feedback3 WJ: grey the 折射 line and drop its icon while silenced

The RES bonus was already off. The enemy card now greys a SILENCE-format line from the live silenced flag, and the status row leaves the 折射 icon out while silence is up.
This commit is contained in:
sganggs committed 2026-10-04 20:38:26 +08:00
1 parent 6e59b5e4dd
commit 2723a3daea
9 files changed
+74 -3

No files matched your search

+1
View File
@@ -51,6 +51,7 @@ test('unitStatsEntry: effective stats next to the base, rounded for display; the
id: 3, uid: 44, defId: 'chess_x', hp: 813, alive: true,
maxHp: 1250, atk: 420, def: 90, res: 12.3, interval: 1.08, blockCnt: 3, moveSpeed: 0,
base: { maxHp: 1000, atk: 300, def: 100, res: 10, interval: 1.2, blockCnt: 2, moveSpeed: 0 },
silenced: false,
});
const plain = unitStatsEntry(u);
assert.equal(plain.atk, 300, 'no aggregated stats: the base');
+26
View File
@@ -0,0 +1,26 @@
// 折射 while silenced: the enemy card greys the SILENCE-format line; the status icon is mapped and not drawn
// under silence. The sim already drops the RES bonus (enemies.js) — not asserted here.
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import { abilityRows } from '../../public/js/ui/abilityLines.js';
import { statusIconKey, statusIconSuppressed } from '../../public/js/render/style.js';
const scout = JSON.parse(readFileSync(new URL('../../data/enemies.json', import.meta.url), 'utf8')).enemy_1166_dusbr;
test('折射: the card line greys only while silenced; the icon key exists and is suppressed under silence', () => {
const on = abilityRows(scout.abilities, false);
assert.equal(on.length, 1);
assert.match(on[0].text, /折射/);
assert.equal(on[0].off, false);
const off = abilityRows(scout.abilities, true);
assert.equal(off[0].off, true, 'grey the 折射 line');
assert.equal(off[0].text, on[0].text, 'the words stay');
assert.equal(abilityRows([{ text: '普通攻击', format: 'NONE' }], true)[0].off, false);
assert.equal(abilityRows(['plain'], true)[0].off, false);
assert.equal(statusIconKey('ab:refraction'), 'refraction');
const both = new Set(['ab:refraction', 'silence']);
assert.equal(statusIconSuppressed('ab:refraction', both), true, 'drop the icon while silenced');
assert.equal(statusIconSuppressed('silence', both), false, 'the silence icon itself stays');
assert.equal(statusIconSuppressed('ab:refraction', new Set(['ab:refraction'])), false, 'the icon shows while 折射 is on');
});