// 本局信息 dialog under the top bar (opened by the left 🔍, official btn_check_player / autochess_hud_player_info_dialog, // research 09 §2.1) with two tabs: // 本局信息 — own strategy, stage, disabled bonds with banned-member counts and the banned operator list (default) — // the same bonds, states and banned operators (by tier) as the briefing and the strategy draft's 本局信息 // dialog: ui/matchInfo.js matchInfoModel, drawn here as compact chips and avatars; // 敌方情报 — the secondary enemy list: m.private.nextEnemies (icons, names, counts, tags, 特训 faction tags) + this // match's factions and the enemy leader on boss rounds. The primary enemy preview is the pen on the board // (the right 🔍▶▶ pans the camera there; tapping an enemy in the pen opens its detail card) — research 09 §6.2. import { html, Icon, Tabs, MicroLabel } from './components.js'; import { Img, UnitThumb, BondGlyph, BandIcon, RichText, GIcon } from './gameComponents.js'; import { groupEnemies, factionTypes, briefingBondTip } from './gameLogic.js'; import { matchInfoModel } from './matchInfo.js'; import { factionIconUrl } from './assetUrls.js'; import { data } from '../data.js'; const cx = (...p) => p.flat().filter(Boolean).join(' '); const TAG = { boss: '领袖', bounty: '悬赏', escort: '护卫' }; function FactionChips({ types }) { const f = data.get('factions')?.types || {}; const m = data.get('assets'); return html`
${types.map((t) => html` <${Img} src=${factionIconUrl(m, f[t]?.icon)} class="fchip__icon" />${f[t]?.name || t}`)}
`; } function EnemiesTab({ pub, priv, onEnemy }) { const rows = groupEnemies(priv?.nextEnemies, (k) => data.lookup('enemies', k)); const types = factionTypes(pub?.factions); const f = data.get('factions')?.types || {}; const total = rows.reduce((s, r) => s + r.count, 0); const boss = pub?.bossId ? data.lookup('bosses', pub.bossId) : null; return html`
第 ${pub?.round ?? '-'} 回合 · 即将迎击 ${total} 名敌人 ${types.length ? html`<${FactionChips} types=${types} />` : null}
${rows.length ? html`
${rows.map((r) => html``)}
` : html`

<${GIcon} name="target" />暂无敌方情报

`} ${boss ? html`
<${UnitThumb} kind="enemy" id=${boss.enemyKey} size="md" />
<${MicroLabel} tone="gold">ENEMY LEADER // 敌方领袖${boss.name} 第 ${data.get('config')?.modes?.[pub.modeId]?.bossRound ?? pub.lastRound ?? 14} 回合 · 最终攻势
` : null}
`; } function InfoTab({ pub, priv, onChess }) { const { bonds, banned, perBond, stateOf } = matchInfoModel(pub, { bonds: data.list('bonds'), chess: (id) => data.lookup('chess', id), mode: data.get('config')?.modes?.[pub?.modeId], }); const disabled = new Set(bonds.filter((b) => stateOf(b.bondId)).map((b) => b.bondId)); const band = priv?.bandId ? data.lookup('bands', priv.bandId) : null; const stage = pub?.stageId ? data.lookup('stages', pub.stageId) : null; const withBans = bonds.filter((b) => disabled.has(b.bondId) || (perBond.get(b.bondId) || 0) > 0) .sort((a, b) => (disabled.has(b.bondId) - disabled.has(a.bondId)) || ((perBond.get(b.bondId) || 0) - (perBond.get(a.bondId) || 0))); return html`
${band ? html`
<${BandIcon} bandId=${band.bandId} size="md" />
<${MicroLabel} tone="mint">STRATEGY // 我的策略${band.name} ${band.effectName} <${RichText} text=${band.descRaw || band.desc} class="iband__desc" />
` : null} ${stage ? html`

<${Icon} name="rook" />战场:${stage.name || stage.id}

` : null}

本局禁用干员情况 ${banned.length}

${withBans.length ? withBans.map((b) => html` <${BondGlyph} bondId=${b.bondId} />${b.name} ${perBond.get(b.bondId) ? html`<${Icon} name="user" />${perBond.get(b.bondId)}` : null} `) : html`本局没有禁用盟约`}
${banned.length ? html`
${banned.map((id) => html``)}
` : null}
`; } /** * @param {{ tab:'enemies'|'info', onTab:(t:string)=>void, pub:any, priv:any, onClose:Function, onEnemy:(key:string, count:number)=>void, onChess:(id:string)=>void }} props */ export function EnemyDrawer({ tab, onTab, pub, priv, onClose, onEnemy, onChess }) { return html``; }