From c142cfca8804eb6baa0c558247ed2c0349ef56d2 Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Sun, 29 Sep 2024 15:43:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=8B=8D=E8=93=9D=E4=B9=8B=E6=AE=BF?= =?UTF-8?q?=E4=B8=8A=E5=8D=8A=E9=83=A8=E5=88=86=E5=AE=8C=E6=88=90=20&=20fi?= =?UTF-8?q?x:=20=E7=BC=A9=E7=95=A5=E5=9B=BE=E6=98=BE=E4=BC=A4=20&=20fix:?= =?UTF-8?q?=20=E5=AD=97=E4=BD=93=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/libs/control.js | 43 ++++++++- public/libs/maps.js | 4 +- public/project/enemys.js | 2 +- public/project/floors/MT59.js | 50 ++++++++++ public/project/floors/MT71.js | 54 ++++++++++- public/project/floors/MT75.js | 14 +-- public/project/floors/MT84.js | 57 +++++++++++- public/project/floors/MT91.js | 7 ++ public/project/floors/MT92.js | 14 +-- public/project/floors/MT93.js | 155 +++++++++++++++++++++++-------- public/project/items.js | 30 ++++-- src/core/render/preset/damage.ts | 13 ++- src/data/desc.json | 2 +- src/game/enemy/damage.ts | 1 + src/plugin/game/fx/itemDetail.ts | 106 ++++++++++++++++++++- src/plugin/game/skill.ts | 9 +- src/plugin/game/skillTree.ts | 2 +- src/source/items.d.ts | 4 +- src/ui/skillTree.vue | 2 +- src/ui/statusBar.vue | 4 +- 20 files changed, 484 insertions(+), 89 deletions(-) diff --git a/public/libs/control.js b/public/libs/control.js index d18d468..eed1fab 100644 --- a/public/libs/control.js +++ b/public/libs/control.js @@ -1457,7 +1457,7 @@ control.prototype._updateDamage_extraDamage = function (floorId, onMap) { ////// 重绘地图显伤 ////// control.prototype.drawDamage = function (ctx, floorId = core.status.floorId) { - return; + // return; if (core.status.gameOver || !core.status.damage || main.mode != 'play') return; var onMap = false; @@ -1482,7 +1482,46 @@ control.prototype.drawDamage = function (ctx, floorId = core.status.floorId) { }; control.prototype._drawDamage_draw = function (ctx, onMap) { - // Deprecated. See src/plugin/game/fx/checkblock.js + if (!core.hasItem('book')) return; + + core.setFont(ctx, '300 9px Verdana'); + core.setTextAlign(ctx, 'left'); + core.status.damage.data.forEach(function (one) { + var px = one.px, + py = one.py; + if (onMap && core.bigmap.v2) { + px -= core.bigmap.posX * 32; + py -= core.bigmap.posY * 32; + if ( + px < -32 * 2 || + px > core._PX_ + 32 || + py < -32 || + py > core._PY_ + 32 + ) + return; + } + core.fillBoldText(ctx, one.text, px, py, one.color); + }); + + core.setTextAlign(ctx, 'center'); + core.status.damage.extraData.forEach(function (one) { + var px = one.px, + py = one.py; + if (onMap && core.bigmap.v2) { + px -= core.bigmap.posX * 32; + py -= core.bigmap.posY * 32; + if ( + px < -32 || + px > core._PX_ + 32 || + py < -32 || + py > core._PY_ + 32 + ) + return; + } + var alpha = core.setAlpha(ctx, one.alpha); + core.fillBoldText(ctx, one.text, px, py, one.color); + core.setAlpha(ctx, alpha); + }); }; // ------ 录像相关 ------ // diff --git a/public/libs/maps.js b/public/libs/maps.js index 0f3a599..2b47928 100644 --- a/public/libs/maps.js +++ b/public/libs/maps.js @@ -1506,7 +1506,7 @@ maps.prototype.redrawMap = function () { // core.clearMap(one); // }); // this._drawMap_drawAll(null, { redraw: true }); - core.drawDamage(); + // core.drawDamage(); }; maps.prototype._drawMap_drawAll = function (floorId, config) { @@ -2609,7 +2609,7 @@ maps.prototype._drawThumbnail_realDrawTempCanvas = function ( options.ctx.imageSmoothingEnabled = true; // 缩略图:显伤 if (options.damage && core.hasItem('book')) { - core.control.updateDamage(floorId, options.ctx); + core.control.updateDamage(floorId, options.ctx, true); } }; diff --git a/public/project/enemys.js b/public/project/enemys.js index f7c543a..631783c 100644 --- a/public/project/enemys.js +++ b/public/project/enemys.js @@ -203,5 +203,5 @@ var enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 = "E690": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "E691": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "E692": {"name":"苍蓝之灵-圣","hp":150000,"atk":15000,"def":5000,"money":20,"exp":5000,"point":0,"special":[4,28],"paleShield":25}, - "E693": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]} + "E693": {"name":"苍蓝之灵-战","hp":150000,"atk":15000,"def":4000,"money":20,"exp":5000,"point":0,"special":[32],"assimilateRange":6} } \ No newline at end of file diff --git a/public/project/floors/MT59.js b/public/project/floors/MT59.js index 15d099d..e7d3ebd 100644 --- a/public/project/floors/MT59.js +++ b/public/project/floors/MT59.js @@ -53,6 +53,12 @@ main.floors.MT59= "operator": "+=", "value": "1" }, + { + "type": "setValue", + "name": "flag:door_palace", + "operator": "+=", + "value": "1" + }, { "type": "if", "condition": "(flag:door_palaceSouth===2)", @@ -96,6 +102,50 @@ main.floors.MT59= }, "入口处的机关门已开启" ] + }, + { + "type": "if", + "condition": "(flag:door_palace===4)", + "true": [ + { + "type": "openDoor", + "loc": [ + 7, + 4 + ], + "floorId": "MT72" + }, + { + "type": "openDoor", + "loc": [ + 4, + 7 + ], + "floorId": "MT72" + }, + { + "type": "openDoor", + "loc": [ + 7, + 10 + ], + "floorId": "MT72" + }, + { + "type": "openDoor", + "loc": [ + 10, + 7 + ], + "floorId": "MT72" + }, + { + "type": "setValue", + "name": "flag:door_palace", + "value": "null" + }, + "苍蓝之殿中心处的机关门已经开启,进入后会到达本章最后一个小区域" + ] } ] }, diff --git a/public/project/floors/MT71.js b/public/project/floors/MT71.js index bf2a17b..257acfa 100644 --- a/public/project/floors/MT71.js +++ b/public/project/floors/MT71.js @@ -33,14 +33,14 @@ main.floors.MT71= "type": "openDoor", "loc": [ 10, - 1 + 13 ] }, { "type": "openDoor", "loc": [ 10, - 13 + 1 ] }, { @@ -49,6 +49,12 @@ main.floors.MT71= "operator": "+=", "value": "1" }, + { + "type": "setValue", + "name": "flag:door_palace", + "operator": "+=", + "value": "1" + }, { "type": "if", "condition": "(flag:door_palaceSouth===2)", @@ -92,6 +98,50 @@ main.floors.MT71= }, "入口处的机关门已开启" ] + }, + { + "type": "if", + "condition": "(flag:door_palace===4)", + "true": [ + { + "type": "openDoor", + "loc": [ + 7, + 4 + ], + "floorId": "MT72" + }, + { + "type": "openDoor", + "loc": [ + 4, + 7 + ], + "floorId": "MT72" + }, + { + "type": "openDoor", + "loc": [ + 7, + 10 + ], + "floorId": "MT72" + }, + { + "type": "openDoor", + "loc": [ + 10, + 7 + ], + "floorId": "MT72" + }, + { + "type": "setValue", + "name": "flag:door_palace", + "value": "null" + }, + "苍蓝之殿中心处的机关门已经开启,进入后会到达本章最后一个小区域" + ] } ] }, diff --git a/public/project/floors/MT75.js b/public/project/floors/MT75.js index e1392a3..d69035e 100644 --- a/public/project/floors/MT75.js +++ b/public/project/floors/MT75.js @@ -49,18 +49,18 @@ main.floors.MT75= "cannotMoveIn": {}, "map": [ [648,648,648,648,648,648,648,648,648,648,648,648,648,648,648], - [648,491,491,494,491,494,657,676, 0,494,491,494,491,491,648], - [648,648,648,648,648,648,644,682,659,648,648,648,648,648,648], - [648,484,484,492,484,492,578,677,679,492,484,492,484,484,648], - [648,648,648,648,648,648,618,249,513,648,648,648,648,648,648], - [648, 0, 0, 0, 0,103,232,658,671,103, 0, 0, 0, 0,648], + [648,491,491,494,491,494, 0, 0, 0,494,491,494,491,491,648], + [648,648,648,648,648,648, 0, 0, 0,648,648,648,648,648,648], + [648,484,484,492,484,492, 0, 0, 0,492,484,492,484,484,648], + [648,648,648,648,648,648, 0, 0, 0,648,648,648,648,648,648], + [648, 0, 0, 0, 0,103, 0, 0, 0,103, 0, 0, 0, 0,648], [648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,648], - [ 92, 0, 0,672, 0, 0, 0, 0, 0, 0, 0,599, 0, 0, 94], + [ 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94], [648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,648], [648, 0, 0, 0, 0,103, 0, 0, 0,103, 0, 0, 0, 0,648], [648,648,648,648,648,648, 0, 0, 0,648,648,648,648,648,648], [648,484,484,492,484,492, 0, 0, 0,492,484,492,484,484,648], - [648,648,648,648,648,648, 0,538, 0,648,648,648,648,648,648], + [648,648,648,648,648,648, 0, 0, 0,648,648,648,648,648,648], [648,491,491,494,491,494, 0, 0, 0,494,491,494,491,491,648], [648,648,648,648,648,648,648, 93,648,648,648,648,648,648,648] ], diff --git a/public/project/floors/MT84.js b/public/project/floors/MT84.js index 97ad4ff..1f04de9 100644 --- a/public/project/floors/MT84.js +++ b/public/project/floors/MT84.js @@ -27,7 +27,60 @@ main.floors.MT84= } }, "beforeBattle": {}, - "afterBattle": {}, + "afterBattle": { + "6,7": [ + { + "type": "setValue", + "name": "flag:door_palace", + "operator": "+=", + "value": "1" + }, + { + "type": "if", + "condition": "(flag:door_palace===4)", + "true": [ + { + "type": "openDoor", + "loc": [ + 7, + 4 + ], + "floorId": "MT72" + }, + { + "type": "openDoor", + "loc": [ + 4, + 7 + ], + "floorId": "MT72" + }, + { + "type": "openDoor", + "loc": [ + 7, + 10 + ], + "floorId": "MT72" + }, + { + "type": "openDoor", + "loc": [ + 10, + 7 + ], + "floorId": "MT72" + }, + { + "type": "setValue", + "name": "flag:door_palace", + "value": "null" + }, + "苍蓝之殿中心处的机关门已经开启,进入后会到达本章最后一个小区域" + ] + } + ] + }, "afterGetItem": {}, "afterOpenDoor": {}, "autoEvent": {}, @@ -41,7 +94,7 @@ main.floors.MT84= [648,232,648,648,538,648,378,648, 28,648,513,648,648, 0,648], [648, 0,491,381, 0,648, 0,648, 0,648, 0, 29,484,677,648], [648,648,648,648,648,648,618,648,682,648,648,648,648,648,648], - [648,466,467,468,695,692,487,648, 0, 0,484, 0,484, 0, 94], + [648,466,467,468,695,664,692,648, 0, 0,484, 0,484, 0, 94], [648,648,648,648,648,648,618,648,682,648,648,648,648,648,648], [648, 0,491,381, 0,648, 0,648, 0,648, 0, 29,484,677,648], [648,232,648,648,538,648,376,648, 27,648,513,648,648, 0,648], diff --git a/public/project/floors/MT91.js b/public/project/floors/MT91.js index 2e403e8..48e09d0 100644 --- a/public/project/floors/MT91.js +++ b/public/project/floors/MT91.js @@ -31,6 +31,13 @@ main.floors.MT91= 7, 0 ] + }, + "14,7": { + "floorId": "MT93", + "loc": [ + 0, + 7 + ] } }, "beforeBattle": {}, diff --git a/public/project/floors/MT92.js b/public/project/floors/MT92.js index 742cc96..ac76216 100644 --- a/public/project/floors/MT92.js +++ b/public/project/floors/MT92.js @@ -42,19 +42,19 @@ main.floors.MT92= "cannotMoveIn": {}, "map": [ [648,648,648,648,648,648,648, 91,648,648,648,648,648,648,648], - [648,376, 0,491,679, 0,484, 0, 0,648, 0,381,648, 0,648], + [648,376, 0,491,679, 0,484, 0, 0,648, 0,381,648, 27,648], [648,671,648,648,648,682,648,648,648,648,658,648,648, 0,648], - [648,381,484,648,484, 0,648,482,494, 0, 0, 0,232, 0,648], - [648,484,378,648, 0, 28,657, 0,648,648,648,648,648, 0,648], - [648,648,648,648,658,648,648,492,648, 0,644, 0,648, 0,648], + [648,381,484,648,484, 0,648,482,494,376, 0,491,232, 28,648], + [648,484,378,492, 0, 28,657, 0,648,648,648,648,648, 0,648], + [648,648,648,648,658,648,648,492,648, 0,644, 0,648,484,648], [648, 0,482,648,491,648, 28, 0,648,491,648,484,677, 0,648], - [ 92, 0, 0,682, 0,658, 0,484,648,378,648,648,648,648,648], + [ 92, 0, 0,682, 0,658, 0,484,648,378,648,648,648,494,648], [648,513,648,648,648,648,648,492,648, 0,679,491, 0, 27,648], [648, 27,648,484,578,484, 0,381,648,648,648,648,648,677,648], - [648, 0,648, 0,648,648,648,682,648, 27,538,376,648,378,648], + [648, 0,648, 0,648,648,648,682,648, 27,538,376,492,378,648], [648,484,249, 28,648, 28, 0,482,648, 0,648,484,648,484,648], [648,648,648,648,648,657,648,648,648,484,648,658,648,682,648], - [648,487,376,378,618, 0,491, 0,513, 0,648, 0,682, 0,648], + [648,487,376,378,618, 0,491, 0,513, 0,492, 0,682, 0,648], [648,648,648,648,648,648,648,648,648,648,648,648,648,648,648] ], "bgmap": [ diff --git a/public/project/floors/MT93.js b/public/project/floors/MT93.js index f1c0f14..02b91b2 100644 --- a/public/project/floors/MT93.js +++ b/public/project/floors/MT93.js @@ -1,45 +1,118 @@ main.floors.MT93= { -"floorId": "MT93", -"title": "苍蓝之殿-右上", -"name": "93", -"width": 15, -"height": 15, -"canFlyTo": true, -"canFlyFrom": true, -"canUseQuickShop": true, -"cannotViewMap": false, -"images": [], -"ratio": 8, -"defaultGround": "T650", -"bgm": "palaceNorth.mp3", -"firstArrive": [], -"eachArrive": [], -"parallelDo": "", -"events": {}, -"changeFloor": {}, -"beforeBattle": {}, -"afterBattle": {}, -"afterGetItem": {}, -"afterOpenDoor": {}, -"autoEvent": {}, -"cannotMove": {}, -"cannotMoveIn": {}, -"map": [ - [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + "floorId": "MT93", + "title": "苍蓝之殿-右上", + "name": "93", + "width": 15, + "height": 15, + "canFlyTo": true, + "canFlyFrom": true, + "canUseQuickShop": true, + "cannotViewMap": false, + "images": [], + "ratio": 8, + "defaultGround": "T650", + "bgm": "palaceNorth.mp3", + "firstArrive": [], + "eachArrive": [], + "parallelDo": "", + "events": {}, + "changeFloor": { + "0,7": { + "floorId": "MT91", + "loc": [ + 14, + 7 + ] + } + }, + "beforeBattle": {}, + "afterBattle": { + "10,7": [ + { + "type": "setValue", + "name": "flag:door_palace", + "operator": "+=", + "value": "1" + }, + { + "type": "if", + "condition": "(flag:door_palace===4)", + "true": [ + { + "type": "openDoor", + "loc": [ + 7, + 4 + ], + "floorId": "MT72" + }, + { + "type": "openDoor", + "loc": [ + 4, + 7 + ], + "floorId": "MT72" + }, + { + "type": "openDoor", + "loc": [ + 7, + 10 + ], + "floorId": "MT72" + }, + { + "type": "openDoor", + "loc": [ + 10, + 7 + ], + "floorId": "MT72" + }, + { + "type": "setValue", + "name": "flag:door_palace", + "value": "null" + }, + "苍蓝之殿中心处的机关门已经开启,进入后会到达本章最后一个小区域" + ] + } + ] + }, + "afterGetItem": {}, + "afterOpenDoor": {}, + "autoEvent": {}, + "cannotMove": {}, + "cannotMoveIn": {}, + "map": [ + [648,648,648,648,648,648,648,648,648,648,648,648,648,648,648], + [648, 0,491, 0,648, 0,648, 0,491, 0,648, 0,491, 0,648], + [648, 28, 0, 29,578,491,648,378, 0,381,648,381, 0,376,648], + [648,648,648,648,648, 0,648,648,648,232,648,648,648,671,648], + [648, 27, 0, 29,249,491,648, 27, 0, 28, 0, 0, 0, 0,648], + [648, 0,491, 0,648, 0,648, 0,491, 0,648,648,648,648,648], + [648,648,648,648,648,682,648,648,648,677,648,466, 0,467,648], + [ 92, 0, 0, 0, 0, 0,513, 0,487, 0,693, 0,665, 0,648], + [648,648,648,648,648,682,648,648,648,677,648,468, 0,695,648], + [648, 0,491, 0,648, 0,648, 0,491, 0,648,648,648,648,648], + [648, 28, 0, 29,249,491,648, 28, 0, 27, 0, 0, 0, 0,648], + [648,648,648,648,648, 0,648,648,648,232,648,648,648,671,648], + [648, 27, 0, 29,578,491,648,376, 0,381,648,381, 0,378,648], + [648, 0,491, 0,648, 0,648, 0,491, 0,648, 0,491, 0,648], + [648,648,648,648,648,648,648,648,648,648,648,648,648,648,648] ], + "bgmap": [ + +], + "fgmap": [ + +], + "bg2map": [ + +], + "fg2map": [ + +] } \ No newline at end of file diff --git a/public/project/items.js b/public/project/items.js index e422585..7c2ed3a 100644 --- a/public/project/items.js +++ b/public/project/items.js @@ -1263,14 +1263,32 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = } }, "I664": { - "cls": "items", - "name": "新物品", - "canUseItemEffect": "true" + "cls": "equips", + "name": "极昼剑", + "canUseItemEffect": "true", + "text": "吸收白日之精华锻造而成。攻击+500,额外攻击+50", + "equip": { + "type": "武器", + "value": { + "mana": 50, + "atk": 500 + }, + "percentage": {} + } }, "I665": { - "cls": "items", - "name": "新物品", - "canUseItemEffect": "true" + "cls": "equips", + "name": "永夜盾", + "canUseItemEffect": "true", + "text": "集月光之精华锻造而成。防御+400,生命回复+25。", + "equip": { + "type": "盾牌", + "value": { + "def": 400, + "hpmax": 25 + }, + "percentage": {} + } }, "I694": { "cls": "items", diff --git a/src/core/render/preset/damage.ts b/src/core/render/preset/damage.ts index f001c6b..e94cc10 100644 --- a/src/core/render/preset/damage.ts +++ b/src/core/render/preset/damage.ts @@ -150,7 +150,7 @@ export class Damage extends Sprite { /** 伤害渲染层 */ damageMap: MotaOffscreenCanvas2D = new MotaOffscreenCanvas2D(); /** 默认伤害字体 */ - font: string = "14px 'normal'"; + font: string = '300 9px Verdana'; /** 默认描边样式,当伤害文字不存在描边属性时会使用此属性 */ strokeStyle: CanvasStyle = '#000'; /** 默认描边宽度 */ @@ -347,7 +347,7 @@ export class Damage extends Sprite { text: real.togetherNum.toString(), color: '#09FF5B', x: x * this.cellSize + this.cellSize - 1, - y: y * this.cellSize - 2, + y: y * this.cellSize + 2, strokeWidth: 3 }; block.add(dam3); @@ -359,8 +359,9 @@ export class Damage extends Sprite { text: '乾', color: '#FDCD0B', x: x * this.cellSize + 1, - y: y * this.cellSize - 2, - strokeWidth: 2 + y: y * this.cellSize + 2, + strokeWidth: 2, + font: '500 10px Verdana' }; block.add(dam4); } @@ -408,6 +409,7 @@ export class Damage extends Sprite { // todo: 这个应当可以自定义,通过地图伤害注册实现 let text = ''; let color = '#fa3'; + let font = '300 9px Verdana'; if (dam.damage > 0) { text = core.formatBigNumber(dam.damage, true); } else if (dam.mockery) { @@ -418,9 +420,11 @@ export class Damage extends Sprite { const dir = x > tx ? '←' : x < tx ? '→' : y > ty ? '↑' : '↓'; text = '嘲' + dir; color = '#fd4'; + font = '500 11px Verdana'; } else if (dam.hunt) { text = '猎'; color = '#fd4'; + font = '500 11px Verdana'; } else { return; } @@ -430,6 +434,7 @@ export class Damage extends Sprite { baseline: 'middle', text, color, + font, x: x * this.cellSize + this.cellSize / 2, y: y * this.cellSize + this.cellSize / 2 }; diff --git a/src/data/desc.json b/src/data/desc.json index 0d58486..aad7217 100644 --- a/src/data/desc.json +++ b/src/data/desc.json @@ -284,7 +284,7 @@ "
", "5. 当前勇士的攻击,右方偏下为勇士的额外攻击", "
", - "6. 当前勇士的防御", + "6. 当前勇士的防御,当有魔法防御时,右方偏下为勇士的魔法防御", "
", "7. 当前勇士的智慧,可以用于智慧加点等", "
", diff --git a/src/game/enemy/damage.ts b/src/game/enemy/damage.ts index 1afd9b1..26b3c32 100644 --- a/src/game/enemy/damage.ts +++ b/src/game/enemy/damage.ts @@ -139,6 +139,7 @@ export class EnemyCollection this.list = []; core.extractBlocks(this.floorId); core.status.maps[this.floorId].blocks.forEach(v => { + if (v.disable) return; if (v.event.cls !== 'enemy48' && v.event.cls !== 'enemys') return; const enemy = core.material.enemys[v.event.id as EnemyIds]; this.list.push( diff --git a/src/plugin/game/fx/itemDetail.ts b/src/plugin/game/fx/itemDetail.ts index ba3812d..e19effd 100644 --- a/src/plugin/game/fx/itemDetail.ts +++ b/src/plugin/game/fx/itemDetail.ts @@ -1,7 +1,12 @@ -import { ensureFloorDamage } from '@/game/enemy/damage'; +import { EnemyCollection, ensureFloorDamage } from '@/game/enemy/damage'; +import { checkV2, formatDamage } from '../utils'; export function init() { - core.control.updateDamage = function (floorId = core.status.floorId, ctx) { + core.control.updateDamage = function ( + floorId = core.status.floorId, + ctx, + thumbnail: boolean = false + ) { if (!floorId || core.status.gameOver || main.mode !== 'play') return; const onMap = ctx == null; const floor = core.status.maps[floorId]; @@ -28,6 +33,101 @@ export function init() { // floor.enemy.render(true); // getItemDetail(floorId, onMap); // 宝石血瓶详细信息 - // this.drawDamage(ctx, floorId); + if (thumbnail) { + renderThumbnailDamage(floor.enemy); + this.drawDamage(ctx, floorId); + } }; } + +function renderThumbnailDamage(col: EnemyCollection) { + core.status.damage.data = []; + core.status.damage.extraData = []; + core.status.damage.dir = []; + + // 怪物伤害 + col.list.forEach(v => { + const { damage } = v.calDamage(); + + // 伤害全部相等,绘制在怪物本身所在位置 + const { damage: dam, color } = formatDamage(damage); + const critical = v.calCritical(1)[0]; + core.status.damage.data.push({ + text: dam, + px: 32 * v.x! + 1, + py: 32 * (v.y! + 1) - 1, + color: color + }); + const setting = Mota.require('var', 'mainSetting'); + const criGem = setting.getValue('screen.criticalGem', false); + const n = critical?.atkDelta ?? Infinity; + const ratio = core.status.maps[col.floorId].ratio; + const cri = criGem ? Math.ceil(n / ratio) : n; + + core.status.damage.data.push({ + text: isFinite(cri) ? cri.toString() : '?', + px: 32 * v.x! + 1, + py: 32 * (v.y! + 1) - 11, + color: '#fff' + }); + }); + + // 地图伤害 + const floor = core.status.maps[col.floorId]; + const width = floor.width; + const height = floor.height; + const objs = core.getMapBlocksObj(col.floorId); + + const startX = 0; + const endX = width; + const startY = 0; + const endY = height; + + for (let x = startX; x < endX; x++) { + for (let y = startY; y < endY; y++) { + const id = `${x},${y}` as LocString; + const dam = col.mapDamage[id]; + if (!dam || objs[id]?.event.noPass) continue; + + // 地图伤害 + if (dam.damage !== 0) { + const damage = core.formatBigNumber(dam.damage, true); + const color = dam.damage < 0 ? '#6eff6a' : '#fa3'; + core.status.damage.extraData.push({ + text: damage, + px: 32 * x + 16, + py: 32 * y + 16, + color, + alpha: 1 + }); + } + + // 电摇嘲讽 + if (dam.mockery) { + dam.mockery.sort((a, b) => + a[0] === b[0] ? a[1] - b[1] : a[0] - b[0] + ); + const [tx, ty] = dam.mockery[0]; + const dir = x > tx ? '←' : x < tx ? '→' : y > ty ? '↑' : '↓'; + core.status.damage.extraData.push({ + text: '嘲' + dir, + px: 32 * x + 16, + py: 32 * (y + 1) - 14, + color: '#fd4', + alpha: 1 + }); + } + + // 追猎 + if (dam.hunt) { + core.status.damage.extraData.push({ + text: '猎', + px: 32 * x + 16, + py: 32 * (y + 1) - 14, + color: '#fd4', + alpha: 1 + }); + } + } + } +} diff --git a/src/plugin/game/skill.ts b/src/plugin/game/skill.ts index 1ed97c4..29d89a1 100644 --- a/src/plugin/game/skill.ts +++ b/src/plugin/game/skill.ts @@ -19,7 +19,7 @@ var ignoreInJump = { ] }; -export const jumpIgnoreFloor: FloorIds[] = [ +export const jumpIgnoreFloor: Set = new Set([ 'MT31', 'snowTown', 'MT36', @@ -45,14 +45,15 @@ export const jumpIgnoreFloor: FloorIds[] = [ 'MT73', 'MT74', 'MT75', - 'MT84' -]; + 'MT84', + 'MT93' +]); // 跳跃 export function jumpSkill() { if (core.status.floorId.startsWith('tower')) { return core.drawTip('当前无法使用该技能'); } - if (jumpIgnoreFloor.includes(core.status.floorId) || flags.onChase) { + if (jumpIgnoreFloor.has(core.status.floorId) || flags.onChase) { return core.drawTip('当前楼层无法使用该技能'); } if (!flags.skill2) return; diff --git a/src/plugin/game/skillTree.ts b/src/plugin/game/skillTree.ts index a590a68..af5775a 100644 --- a/src/plugin/game/skillTree.ts +++ b/src/plugin/game/skillTree.ts @@ -157,7 +157,7 @@ export const skills: Record = { ], loc: [4, 1], max: 10, - effect: level => [`学习怪物技能,持续${level * 3 + 2}场战斗`] + effect: level => [`魔法防御 + ${level * 100}`] }, { index: 12, diff --git a/src/source/items.d.ts b/src/source/items.d.ts index f1dea7f..a52d2d5 100644 --- a/src/source/items.d.ts +++ b/src/source/items.d.ts @@ -189,8 +189,8 @@ interface ItemDeclaration { I642: 'constants'; I662: 'equips'; I663: 'equips'; - I664: 'items'; - I665: 'items'; + I664: 'equips'; + I665: 'equips'; I694: 'items'; I695: 'items'; I696: 'items'; diff --git a/src/ui/skillTree.vue b/src/ui/skillTree.vue index 7f9c5d1..9976d9b 100644 --- a/src/ui/skillTree.vue +++ b/src/ui/skillTree.vue @@ -146,7 +146,7 @@ const effect = computed(() => { return [0, 1].map(v => { const prefix = v === 0 ? '当前效果:' : '下一级效果:'; const level = skillTree.getSkillLevel(skill.value.index); - const content = skill.value.effect(level); + const content = skill.value.effect(level + v); return prefix + content.join(''); }) as [string, string]; }); diff --git a/src/ui/statusBar.vue b/src/ui/statusBar.vue index 4b68123..ba0e019 100644 --- a/src/ui/statusBar.vue +++ b/src/ui/statusBar.vue @@ -212,9 +212,7 @@ function update() { studyOpened.value = skillTree.getSkillLevel(11) > 0; jumpCnt.value = flags.skill2 && - !Mota.Plugin.require('skill_g').jumpIgnoreFloor.includes( - core.status.floorId - ) + !Mota.Plugin.require('skill_g').jumpIgnoreFloor.has(core.status.floorId) ? 3 - (flags[`jump_${core.status.floorId}`] ?? 0) : void 0; }