Files
ark-stronghold-protocol/public/js/ui/abilityLines.js
T
sganggs 2723a3daea 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.
2026-10-04 20:38:26 +08:00

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 };
});
}