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.
18 lines
789 B
JavaScript
18 lines
789 B
JavaScript
// 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 };
|
|
});
|
|
}
|