From 2860dccc010b8cd6c39a1a3912ca37b641dc0422 Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Wed, 12 Jul 2023 12:08:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E9=AB=98=E6=A5=BC=E4=BC=A0=E5=88=86?= =?UTF-8?q?=E5=8C=BA=E7=9A=84=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugin/game/damage.ts | 4 ++-- src/plugin/ui/fly.ts | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/plugin/game/damage.ts b/src/plugin/game/damage.ts index 4fd46da..c8e367c 100644 --- a/src/plugin/game/damage.ts +++ b/src/plugin/game/damage.ts @@ -226,8 +226,8 @@ export class EnemyCollection implements RangeCollection { }); // 然后根据位置依次绘制对应位置的伤害 for (const dam of v.damage) { - const d = (dam.damage - min) / delta; - const color = core.arrayToRGB([d * 255, 255 - d * 255, 0]); + const d = ((dam.damage - min) / delta) * 255; + const color = core.arrayToRGB([d, 255 - d, 0]); if (dam.dir === 'down' || dam.dir === 'up') { const dir = dam.dir === 'down' ? '↑' : '↓'; core.status.damage.extraData.push({ diff --git a/src/plugin/ui/fly.ts b/src/plugin/ui/fly.ts index a5deb41..5bd5d24 100644 --- a/src/plugin/ui/fly.ts +++ b/src/plugin/ui/fly.ts @@ -27,11 +27,11 @@ const bfsCache: Partial> = {}; */ const drawCache: Record = {}; -const arrow: Partial> = { - leftPortal: 'left', - rightPortal: 'right', - upPortal: 'up', - downPortal: 'down' +const arrow: Partial> = { + 92: 'left', + 94: 'right', + 91: 'up', + 93: 'down' }; /** @@ -175,13 +175,13 @@ export function getMapData( while (queue.length > 0) { const now = queue.shift()!; - const change = core.floors[now].changeFloor; - const blocks = core.getMapBlocksObj(now, noCache); + const floor = core.floors[now]; + const change = floor.changeFloor; for (const [loc, ev] of Object.entries(change)) { const target = ev.floorId as FloorIds; if (target.startsWith(':')) continue; - const block = blocks[loc as LocString]; - const id = block.event.id; + const [x, y] = loc.split(',').map(v => parseInt(v)); + const id = floor.map[y][x] as AllNumbers; if (id in arrow) { if (!used[target]) { const from = `${now},${loc},${arrow[id]}` as BFSFromString;