From 5871558b156b227434ed2bed79de8f992e0f0afe Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Sat, 28 Sep 2024 17:19:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20disable=E5=9B=BE=E5=9D=97=E7=9A=84?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=20&=20feat:=20=E9=AD=94=E6=B3=95=E9=98=B2?= =?UTF-8?q?=E5=BE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/_server/table/data.comment.js | 10 +++ public/project/data.js | 4 +- public/project/floors/MT50.js | 1 - public/project/floors/MT74.js | 12 +-- public/project/floors/MT89.js | 13 +++- public/project/floors/MT90.js | 10 +-- public/project/floors/MT91.js | 33 ++++---- public/project/floors/MT92.js | 109 +++++++++++++++++---------- public/project/functions.js | 6 ++ public/project/items.js | 4 +- src/core/render/preset/layer.ts | 8 ++ src/game/enemy/damage.ts | 27 ++++--- src/plugin/utils.ts | 1 + src/types/status.d.ts | 3 + 14 files changed, 159 insertions(+), 82 deletions(-) diff --git a/public/_server/table/data.comment.js b/public/_server/table/data.comment.js index 2bd6699..6f18550 100644 --- a/public/_server/table/data.comment.js +++ b/public/_server/table/data.comment.js @@ -276,6 +276,16 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { "_type": "textarea", "_data": "初始护盾" }, + "magicDef": { + "_leaf": true, + "_type": "textarea", + "_data": "初始魔法防御" + }, + "magicRed": { + "_leaf": true, + "_type": "textarea", + "_data": "初始魔法减免" + }, "money": { "_leaf": true, "_type": "textarea", diff --git a/public/project/data.js b/public/project/data.js index 5bdac78..d432f77 100644 --- a/public/project/data.js +++ b/public/project/data.js @@ -383,7 +383,9 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = }, "flags": {}, "followers": [], - "steps": 0 + "steps": 0, + "magicDef": 0, + "magicRed": 0 }, "startCanvas": [ { diff --git a/public/project/floors/MT50.js b/public/project/floors/MT50.js index 767e494..958ee1f 100644 --- a/public/project/floors/MT50.js +++ b/public/project/floors/MT50.js @@ -42,7 +42,6 @@ main.floors.MT50= "此区域建议多多使用定点查看功能,鼠标移动到怪物上按C或E即可打开(如果你没有设置自己的快捷键的话)。手机端暂时无法定点查看", "打完左下角和右下角的boss之后,开四个机关门", "注意不要忘记购买装备,到了下一章之后本章的商店将不能到达,不过快捷商店还会保留。这些装备在下一章都会有向上合成", - "建议优先点出学习技能,对于特定场景将会非常有帮助", "本区域可以使用跳跃技能,不要忘记了。", "注意火炬可通行,而且跳跃时会跳过火炬,不会跳到火炬上。" ] diff --git a/public/project/floors/MT74.js b/public/project/floors/MT74.js index d3b46a2..b779592 100644 --- a/public/project/floors/MT74.js +++ b/public/project/floors/MT74.js @@ -56,19 +56,19 @@ main.floors.MT74= "cannotMoveIn": {}, "map": [ [648,648,648,648,648,648,648, 91,648,648,648,648,648,648,648], - [648,430,472,420,648, 0, 0, 0, 0, 0,648,420,472,430,648], - [648,648, 85,648,648, 0, 0, 0, 0, 0,648,648, 85,648,648], + [648,487,487,487,648, 0, 0, 0, 0, 0,648,487,487,487,648], + [648,648,497,648,648, 0, 0, 0, 0, 0,648,648,497,648,648], [648, 0, 0, 0,648, 0, 0, 0, 0, 0,648, 0, 0, 0,648], [648, 0,487, 0,648, 0, 0, 0, 0, 0,648, 0,487, 0,648], [648, 0, 0, 0,648,103, 0, 0, 0,103,648, 0, 0, 0,648], - [648,648,492,648,648, 0, 0, 0, 0, 0,648,648,492,648,648], + [648,648,494,648,648, 0, 0, 0, 0, 0,648,648,494,648,648], [ 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94], - [648,648,492,648,648, 0, 0, 0, 0, 0,648,648,492,648,648], + [648,648,494,648,648, 0, 0, 0, 0, 0,648,648,494,648,648], [648, 0, 0, 0,648,103, 0, 0, 0,103,648, 0, 0, 0,648], [648, 0,487, 0,648, 0, 0, 0, 0, 0,648, 0,487, 0,648], [648, 0, 0, 0,648, 0, 0, 0, 0, 0,648, 0, 0, 0,648], - [648,648, 85,648,648, 0, 0, 0, 0, 0,648,648, 85,648,648], - [648,430,472,420,648, 0, 0, 0, 0, 0,648,420,472,430,648], + [648,648,497,648,648, 0, 0, 0, 0, 0,648,648,497,648,648], + [648,487,487,487,648, 0, 0, 0, 0, 0,648,487,487,487,648], [648,648,648,648,648,648,648, 93,648,648,648,648,648,648,648] ], "bgmap": [ diff --git a/public/project/floors/MT89.js b/public/project/floors/MT89.js index 20edea3..ea49ac8 100644 --- a/public/project/floors/MT89.js +++ b/public/project/floors/MT89.js @@ -38,6 +38,13 @@ main.floors.MT89= 7, 0 ] + }, + "14,7": { + "floorId": "MT92", + "loc": [ + 0, + 7 + ] } }, "beforeBattle": {}, @@ -51,15 +58,15 @@ main.floors.MT89= [648,648,648,648,648,648,648, 91,648,648,648,648,648,648,648], [648,249, 29, 0,491,578, 27, 0,658, 0,381,648,484,484,648], [648, 29,648,648,648,648, 0,648,648,648,648,648,492,648,648], - [648, 0,648,487,378,648,484,648, 0, 0,676,648,378,484,648], + [648, 0,648,487,378,648,484,492, 0, 0,676,648,378,484,648], [648,491,648,378, 21,618, 0,648, 0,648, 0,679,484, 27,648], [648,578,648,648,648,648,679,648, 0,648,491,648,648,648,648], [648, 0, 0, 0,484, 0, 0,648, 0,648, 0,513, 0, 0,648], [ 92, 0,648,492,648,648, 0,648,494,648,648,648,484, 0, 94], [648, 0,682, 0,491,648, 0,644,420,249,482,648,648,682,648], [648,682,648, 29, 0,648,648,648,578,648,482,648, 0,484,648], - [648, 0,648,648,657,648, 0,648,494,648,492,648,657,648,648], - [648, 0,648,484, 0,538, 0,676, 0,648,487,677,491, 0,648], + [648,482,648,648,657,648, 0,648,494,648,492,648,657,648,648], + [648, 29,492,484, 0,538, 0,676, 0,648,487,677,491, 0,648], [648,648,648,648,677,648,648, 0,648,648,648,648,657,648,648], [648, 27,484, 28, 0,648,491, 0, 0,232, 0,378, 0,484,648], [648,648,648,648,648,648,648, 93,648,648,648,648,648,648,648] diff --git a/public/project/floors/MT90.js b/public/project/floors/MT90.js index 131198b..14e84d0 100644 --- a/public/project/floors/MT90.js +++ b/public/project/floors/MT90.js @@ -43,17 +43,17 @@ main.floors.MT90= "map": [ [648,648,648,648,648,648,648, 91,648,648,648,648,648,648,648], [648,376, 0,648,487,232, 0, 0,484, 0,648, 0,494, 0,648], - [648,491,381,671, 0,648,492,648,648,513,648, 0,648,376,648], - [648,648,648,648,648,648, 27, 0,484, 0,538, 0,648,491,648], - [648,491,381,679, 0,648,492,648,648,648,648,677,648,378,648], + [648,491,381,671, 0,648,492,648,648,513,648, 21,648,376,648], + [648,648,648,648,492,648, 27, 0,484, 0,538, 0,648,491,648], + [648,491,381,679, 0,648,492,648,648,492,648,677,648,378,648], [648,378, 0,648,491,232, 27,491,648, 0,658, 0,648,618,648], [648,648,648,648,648,648,491, 28,648,381,648,484,658, 0,648], [648, 0,578, 0, 28,648,644,648,648, 0,648,648,648, 0,648], [648, 0,648,484, 0,682,103,657, 0,484,648,484,657, 0,648], [648,484,648, 0, 27,648,249,648,648,648,648,492,648,648,648], - [648, 0,648,648,648,648, 0,491, 0,648, 27,484,677, 0,648], + [648, 0,648,648,648,648, 0,491, 0,492, 27,484,677, 0,648], [ 92, 0, 0,484, 0,648,494,648,513,648, 0, 29,648, 0,648], - [648,648,648,648,513,648,491,648, 0,648,648,648,648, 0,648], + [648,492,648,648,513,648,491,648, 0,648,648,648,648, 0,648], [648, 28, 0,484, 0,648,491,648, 28, 0, 29,658, 0,491,648], [648,648,648,648,648,648,648,648,648,648,648,648,648,648,648] ], diff --git a/public/project/floors/MT91.js b/public/project/floors/MT91.js index 2b953c4..2e403e8 100644 --- a/public/project/floors/MT91.js +++ b/public/project/floors/MT91.js @@ -24,6 +24,13 @@ main.floors.MT91= 14, 7 ] + }, + "7,14": { + "floorId": "MT92", + "loc": [ + 7, + 0 + ] } }, "beforeBattle": {}, @@ -35,19 +42,19 @@ main.floors.MT91= "cannotMoveIn": {}, "map": [ [648,648,648,648,648,648,648,648,648,648,648,648,648,648,648], - [648, 0, 0, 0,648, 0, 0, 0, 0, 0, 0, 0,648, 0,648], - [648, 0, 0, 0, 0, 0, 0,648,648,648, 0, 0,648, 0,648], - [648,648,648,648,648,648,648,648, 0,648, 0,648,648, 0,648], - [648, 0,648, 0, 0, 0, 0, 0, 0,648, 0, 0, 0, 0,648], - [648, 0, 0, 0,648, 0,648,648,648,648, 0,648,648,648,648], - [648,648,648,648,648, 0, 0, 0, 0, 0, 0,648, 0, 0,648], - [ 92, 0, 0, 0,648, 0,648,648, 0,648, 0,648, 0, 0, 94], - [648, 0, 0, 0, 0, 0, 0,648, 0,648,648,648, 0,648,648], - [648,648,648,648,648,648, 0,648, 0, 0, 0, 0, 0, 0,648], - [648, 0, 0, 0, 0, 0, 0,648, 0, 0,648, 0,648, 0,648], - [648, 0,648,648, 0,648,648,648,648,648,648, 0,648, 0,648], - [648, 0, 0,648, 0,648, 0, 0, 0,648, 0, 0,648, 0,648], - [648, 0, 0,648, 0,648, 0, 0, 0, 0, 0, 0,648, 0,648], + [648, 27,381, 28,648,376, 0,679, 0,484,381, 0,492, 0,648], + [648, 27, 21, 28,618,491,381,648,492,648, 0,378,648,484,648], + [648,494,648,648,648,648,648,648,484,648,232,648,648, 0,648], + [648, 0,648, 0,599, 0,513, 0, 28,648, 0,677, 0, 28,648], + [648, 28, 0,484,648,491,648,648,492,648, 0,648,648,648,648], + [648,648,648,648,648, 0,232,403, 0,648, 27,648, 0,484,648], + [ 92, 0, 0, 0,648,491,648,648, 0,644, 0,648,381, 0, 94], + [648, 0,484, 0,658, 0, 0,648,658,648,648,648,679,648,648], + [648,492,648,648,648,648,682,648, 0,378,682, 0, 0,676,648], + [648, 0, 0,578, 0,484, 0,648,484, 0,648,491,648,484,648], + [648,658,648,648,682,648,648,648,648,648,648,657,648, 0,648], + [648, 0, 28,648, 0,648,482, 0,482,648, 27, 0,648, 0,648], + [648, 27,491,492,491,492, 0, 0, 0,513, 0, 28,492,376,648], [648,648,648,648,648,648,648, 93,648,648,648,648,648,648,648] ], "bgmap": [ diff --git a/public/project/floors/MT92.js b/public/project/floors/MT92.js index 2160a62..914f9cb 100644 --- a/public/project/floors/MT92.js +++ b/public/project/floors/MT92.js @@ -1,45 +1,72 @@ main.floors.MT92= { -"floorId": "MT92", -"title": "苍蓝之殿-右上", -"name": "92", -"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": "MT92", + "title": "苍蓝之殿-右上", + "name": "92", + "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": { + "7,0": { + "floorId": "MT91", + "loc": [ + 7, + 14 + ] + }, + "0,7": { + "floorId": "MT89", + "loc": [ + 14, + 7 + ] + } + }, + "beforeBattle": {}, + "afterBattle": {}, + "afterGetItem": {}, + "afterOpenDoor": {}, + "autoEvent": {}, + "cannotMove": {}, + "cannotMoveIn": {}, + "map": [ + [648,648,648,648,648,648,648, 91,648,648,648,648,648,648,648], + [648, 0, 0, 0, 0, 0, 0, 0, 0,648, 0, 0,648, 0,648], + [648, 0,648,648,648, 0,648,648,648,648,658,648,648, 0,648], + [648, 0, 0,648, 0, 0,648, 0,494, 0, 0, 0,232, 0,648], + [648, 0, 0,648, 0, 0, 0, 0,648,648,648,648,648, 0,648], + [648,648,648,648, 0,648,648, 0,648, 0,644, 0,648, 0,648], + [648, 0, 0,648, 0,648, 0, 0,648, 0,648, 0,677, 0,648], + [ 92, 0, 0, 0, 0, 0, 0, 0,648, 0,648,648,648,648,648], + [648,513,648,648,648,648,648,492,648, 0,679, 0, 0, 0,648], + [648, 0,648, 0,578, 0, 0, 0,648,648,648,648,648,677,648], + [648, 0,648, 0,648,648,648,682,648, 0,538, 0,648, 0,648], + [648, 0,249, 0,648, 0, 0, 0,648, 0,648, 0,648, 0,648], + [648,648,648,648,648,657,648,648,648, 0,648,658,648,682,648], + [648, 0, 0, 0,618, 0, 0, 0,513, 0,648, 0,682, 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/functions.js b/public/project/functions.js index 84bbf52..3ae9e0e 100644 --- a/public/project/functions.js +++ b/public/project/functions.js @@ -56,6 +56,12 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = { } else { flags.autoSkill ??= true; } + + // 兼容性调整 + const h = core.status.hero; + if (h.magicDef === void 0 || h.magicDef === null) { + h.magicDef = 0; + } }, win: function (reason, norank, noexit) { // 游戏获胜事件 diff --git a/public/project/items.js b/public/project/items.js index b51f06e..e422585 100644 --- a/public/project/items.js +++ b/public/project/items.js @@ -1256,7 +1256,9 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "text": "一个用大地之力制造出的饰品,貌似对魔法攻击有抵抗作用。装备后,对魔攻怪会有500点防御力", "equip": { "type": "首饰", - "value": {}, + "value": { + "magicDef": 500 + }, "percentage": {} } }, diff --git a/src/core/render/preset/layer.ts b/src/core/render/preset/layer.ts index a4cfb54..5f69b14 100644 --- a/src/core/render/preset/layer.ts +++ b/src/core/render/preset/layer.ts @@ -1207,6 +1207,9 @@ export class Layer extends Container { const [a, b, , c, d, , e, f] = transform.mat; ctx.setTransform(a, b, c, d, e, f); + const extend = this.getExtends('floor-binder') as LayerFloorBinder; + const floor = extend ? extend.getFloor() : void 0; + const map = floor ? core.status.mapBlockObjs[floor] : void 0; render.forEach(v => { const x = v % width; const y = Math.floor(v / width); @@ -1238,6 +1241,11 @@ export class Layer extends Container { // 先画到临时画布,用于缓存 for (let nx = sx; nx < ex; nx++) { for (let ny = sy; ny < ey; ny++) { + if (map) { + const indexLoc = `${nx},${ny}`; + const block = map[indexLoc as LocString]; + if (block?.disable) continue; + } const blockIndex = nx + ny * this.mapWidth; const num = this.renderData[blockIndex]; if (num === 0 || num === 17) continue; diff --git a/src/game/enemy/damage.ts b/src/game/enemy/damage.ts index b98eeb4..1afd9b1 100644 --- a/src/game/enemy/damage.ts +++ b/src/game/enemy/damage.ts @@ -964,7 +964,13 @@ export class DamageEnemy { /** * 计算伤害时会用到的勇士属性,攻击防御,其余的不会有buff加成,直接从core.status.hero取 */ -const realStatus: (keyof HeroStatus)[] = ['atk', 'def', 'hpmax', 'mana']; +const realStatus: (keyof HeroStatus)[] = [ + 'atk', + 'def', + 'hpmax', + 'mana', + 'magicDef' +]; /** * 主动技能列表 */ @@ -987,7 +993,7 @@ export function calDamageWith( mdef, special: heroSpec = { num: [], last: [] } } = core.status.hero; - let { atk, def, hpmax, mana } = hero as HeroStatus; + let { atk, def, hpmax, mana, magicDef } = hero as HeroStatus; let { hp: monHp, atk: monAtk, def: monDef, special, enemy } = info; hpmax = Math.min(hpmax, def / 10); @@ -1041,17 +1047,9 @@ export function calDamageWith( // 魔攻 if (special.includes(2) || special.includes(13)) { enemyPerDamage = monAtk; - if (core.hasEquip('I663')) { - enemyPerDamage = Math.max(0, enemyPerDamage - 500); - } + enemyPerDamage -= magicDef; } else { enemyPerDamage = monAtk - def; - if (enemyPerDamage < 0) enemyPerDamage = 0; - } - - // 先攻 - if (special.includes(17)) { - damage += enemyPerDamage; } // 连击 @@ -1069,6 +1067,8 @@ export function calDamageWith( enemyPerDamage *= 1 - heroSpec.paleShield / 100; } + if (enemyPerDamage < 0) enemyPerDamage = 0; + // 苍蓝刻 if (special.includes(28)) { heroPerDamage *= 1 - info.paleShield! / 100; @@ -1119,6 +1119,11 @@ export function calDamageWith( turn += 5; } + // 先攻 + if (special.includes(17)) { + damage += enemyPerDamage; + } + damage += (turn - 1) * enemyPerDamage; // 无上之盾 if (flags.superSheild) { diff --git a/src/plugin/utils.ts b/src/plugin/utils.ts index 379cda0..0b6a38e 100644 --- a/src/plugin/utils.ts +++ b/src/plugin/utils.ts @@ -426,6 +426,7 @@ export function getStatusLabel(name: string) { point: '加点', steps: '步数', up: '升级', + magicDef: '魔法防御', none: '无' }[name] || name ); diff --git a/src/types/status.d.ts b/src/types/status.d.ts index 0558996..76c5849 100644 --- a/src/types/status.d.ts +++ b/src/types/status.d.ts @@ -933,6 +933,9 @@ interface HeroStatus { */ manamax: number; + /** 魔法防御 */ + magicDef: number; + /** * 勇士的名称 */