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

+17
View File
@@ -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 };
});
}
+2 -1
View File
@@ -35,6 +35,7 @@ import { html, Icon, TierChip, MicroLabel, Button, confirmDialog, useTicker } fr
import { Img, RichText, UnitThumb, BondGlyph, GIcon } from './gameComponents.js';
import { attackInterval, rangeGridBox, fmtNum, tileKey, chessLoadout, nextThreshold, bondTier, briefingBondTip, pieceBondIds, grantedBonds, morphPairings } from './gameLogic.js';
import { chessPortraitUrl, skillIconUrl, skillRecordIconUrl, profIconUrl, subProfIconUrl, itemIconUrl, enemyIconUrl, tokenAvatarUrl, factionIconUrl, uiUrl, moduleTypeIconUrl } from './assetUrls.js';
import { abilityRows } from './abilityLines.js';
import { data } from '../data.js';
import { attackRangeGrid } from '../../../shared/loadoutRecord.js';
import { SKILL_SUMMON_START_DEPLOY } from '../../../shared/constants.js';
@@ -522,7 +523,7 @@ function EnemyDetail({ enemy, snapHp, count, live = null }) {
</div>
${imm.length ? html`<p class="dhint"><${Icon} name="shield" />免疫:${imm.join('、')}</p>` : null}
${Array.isArray(enemy.abilities) && enemy.abilities.length ? html`<${Section} title="能力" micro="ABILITIES">
<ul class="dabil">${enemy.abilities.map((a, i) => html`<li key=${i}><${RichText} text=${typeof a === 'string' ? a : a.textRaw || a.text} /></li>`)}</ul>
<ul class="dabil">${abilityRows(enemy.abilities, !!live?.silenced).map((a, i) => html`<li key=${i} class=${a.off ? 'is-off' : null}><${RichText} text=${a.text} /></li>`)}</ul>
<//>` : enemy.descRaw || enemy.desc ? html`<${Section} title="说明"><${RichText} as="p" text=${enemy.descRaw || enemy.desc} class="dtext" /><//>` : null}`;
}