From 26f74f94150ab38e2cdbeb146f816c902835e50b Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Fri, 28 Jul 2023 12:02:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=9E=8D=E5=8C=96=E6=80=AA=E7=9A=84=E5=85=89?= =?UTF-8?q?=E7=8E=AF=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugin/game/damage.ts | 8 +++----- src/plugin/game/halo.ts | 16 +++++++++++++++- src/plugin/game/popup.ts | 9 ++++----- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/plugin/game/damage.ts b/src/plugin/game/damage.ts index 98d1b6c..d81bcee 100644 --- a/src/plugin/game/damage.ts +++ b/src/plugin/game/damage.ts @@ -1,4 +1,4 @@ -import { boundary, equal } from './utils'; +import { equal } from './utils'; import { getHeroStatusOf, getHeroStatusOn } from './hero'; import { Range, RangeCollection } from './range'; import { @@ -53,8 +53,8 @@ interface MapDamage { interface HaloData { type: T; data: HaloType[T]; - from: DamageEnemy; special: number; + from?: DamageEnemy; } interface DamageDelta { @@ -1110,7 +1110,6 @@ declare global { damage: { Enemy: typeof DamageEnemy; Collection: typeof EnemyCollection; - ensureFloorDamage: typeof ensureFloorDamage; }; } @@ -1121,6 +1120,5 @@ declare global { core.plugin.damage = { Enemy: DamageEnemy, - Collection: EnemyCollection, - ensureFloorDamage + Collection: EnemyCollection }; diff --git a/src/plugin/game/halo.ts b/src/plugin/game/halo.ts index ce6b1da..7507b1f 100644 --- a/src/plugin/game/halo.ts +++ b/src/plugin/game/halo.ts @@ -1,5 +1,6 @@ const haloColor: Record = { 21: ['cyan'], + 25: ['purple'], 26: ['blue'], 27: ['red'] }; @@ -11,7 +12,20 @@ export function drawHalo( ) { if (main.replayChecking) return; if (!core.getLocalStorage('showHalo', true)) return; - const list = core.status.maps[floorId].enemy.haloList; + const list = core.status.maps[floorId].enemy.haloList.concat( + Object.keys(flags[`melt_${floorId}`] ?? {}).map(v => { + const [x, y] = v.split(',').map(v => parseInt(v)); + return { + type: 'square', + data: { + x, + y, + d: 3 + }, + special: 25 + }; + }) + ); ctx.save(); for (const halo of list) { if (halo.type === 'square') { diff --git a/src/plugin/game/popup.ts b/src/plugin/game/popup.ts index f929789..8bc3f0a 100644 --- a/src/plugin/game/popup.ts +++ b/src/plugin/game/popup.ts @@ -4,12 +4,11 @@ import { drawHalo } from './halo'; // 伤害弹出 // 复写阻激夹域检测 control.prototype.checkBlock = function (forceMockery: boolean = false) { - var x = core.getHeroLoc('x'), + const x = core.getHeroLoc('x'), y = core.getHeroLoc('y'), loc = x + ',' + y; - const floor = core.status.floorId; - const info = core.status.maps[floor].enemy.mapDamage[loc]; - var damage = info.damage; + const info = core.status.thisMap.enemy.mapDamage[loc]; + const damage = info?.damage; if (damage) { if (!main.replayChecking) { core.addPop( @@ -20,7 +19,7 @@ control.prototype.checkBlock = function (forceMockery: boolean = false) { } core.status.hero.hp -= damage; const type = Array.from(info.type.keys()); - var text = type.join(',') || '伤害'; + const text = type.join(',') || '伤害'; core.drawTip('受到' + text + damage + '点'); core.drawHeroAnimate('zone'); this._checkBlock_disableQuickShop();