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:
1 parent
6e59b5e4dd
commit
2723a3daea
9 files changed
+74
-3
No files matched your search
@@ -0,0 +1,17 @@
|
||||
// Enemy-card ability lines (detailPanel EnemyDetail). A line whose data format is SILENCE
|
||||
// (折射: `<$ba.refraction>折射</>`, format "SILENCE") is off while the enemy is silenced: the card greys it.
|
||||
// The sim already drops the RES bonus; this is only the line.
|
||||
|
||||
/**
|
||||
* @param {any[]|null} abilities enemies.json abilities
|
||||
* @param {boolean} silenced live unit (`unitStatsEntry.silenced`)
|
||||
* @returns {Array<{ text: string, off: boolean }>}
|
||||
*/
|
||||
export function abilityRows(abilities, silenced) {
|
||||
const list = Array.isArray(abilities) ? abilities : [];
|
||||
return list.map((a) => {
|
||||
const text = typeof a === 'string' ? a : (a && (a.textRaw || a.text)) || '';
|
||||
const off = !!(silenced && a && typeof a === 'object' && a.format === 'SILENCE');
|
||||
return { text, off };
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user