From faf5a5c0c30703e501ca497c97a458230044b228 Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Thu, 13 Jul 2023 16:49:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E7=95=8C=E7=BB=98=E5=88=B6=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugin/game/damage.ts | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/plugin/game/damage.ts b/src/plugin/game/damage.ts index da94c5f..3a04311 100644 --- a/src/plugin/game/damage.ts +++ b/src/plugin/game/damage.ts @@ -232,7 +232,19 @@ export class EnemyCollection implements RangeCollection { color: '#fff' }); } else { - const [min, max] = boundary(v.damage, 'damage'); + let min = v.damage[0].damage; + let max = min; + let minI = 0; + for (let i = 1; i < v.damage.length; i++) { + const dam = v.damage[i].damage; + if (dam < min) { + min = dam; + minI = i; + } + if (dam > max) { + max = dam; + } + } const delta = max - min; const { damage, color } = formatDamage(min); // 在怪物位置绘制最低的伤害 @@ -242,6 +254,14 @@ export class EnemyCollection implements RangeCollection { py: 32 * (v.y! + 1) - 1, color: color }); + // 绘制临界 + const critical = v.calCritical(1, v.damage[minI].dir)[0]?.[0]; + core.status.damage.data.push({ + text: critical?.atkDelta.toString() ?? '?', + px: 32 * v.x! + 1, + py: 32 * (v.y! + 1) - 11, + color: '#fff' + }); // 然后根据位置依次绘制对应位置的伤害 for (const dam of v.damage) { if (dam.dir === 'none') continue;