import type { GameView } from '@/game/engine'; import { usesSurvivingSkilledLeader } from '@/game/leader-skill-combat'; import { leaderSkillStrongholdCount } from '@/game/leader-skill-battle-board'; /** Guidance uses only the viewer's selected disc and public board occupation. */ export function LeaderSkillBattleGuide({ game, leader }: { game: GameView; leader: string }) { const battle = game.battle; if (!battle || ![battle.attacker, battle.defender].includes(game.me)) return null; const assignments = game.leaderSkills?.assignments.filter((a) => a.controller === game.me) ?? []; const opponent = game.players.find((p) => p.id === (battle.attacker === game.me ? battle.defender : battle.attacker))!; const mentat = usesSurvivingSkilledLeader(assignments, 'mentat', leader, true); const bureaucrat = usesSurvivingSkilledLeader(assignments, 'bureaucrat', leader, true); const sandmaster = usesSurvivingSkilledLeader(assignments, 'sandmaster', leader, true); const rihani = usesSurvivingSkilledLeader(assignments, 'rihani-decipherer', leader, true); const smuggler = usesSurvivingSkilledLeader(assignments, 'smuggler', leader, true); if (!mentat && !bureaucrat && !sandmaster && !rihani && !smuggler) return null; return
{mentat &&

Mentat adds 2 to this leader’s battle strength if the leader survives.

} {bureaucrat &&

Bureaucrat subtracts {leaderSkillStrongholdCount(game, opponent)} from your opponent’s battle total if your leader survives. Count each occupied stronghold once, including contested strongholds. Advisors do not count.

} {sandmaster &&

If this Sandmaster survives and wins, add 3 spice to the territory’s existing spice pile automatically. No spice is added when the territory has no spice.

} {rihani &&

If this Rihani Decipherer survives and wins, you may draw two Traitors and exchange an unused old card for one of them. A native Rihani also privately inspects two deck cards first.

} {smuggler &&

{game.battle!.smugglerCollectionEnabled ? 'Smuggler records spice in this territory when both plans reveal, capped by this leader’s unmodified strength. If the leader survives, collect it automatically even if you lose or have no forces left. Pending spice cannot fund this plan. Strength modifiers and combined modules remain under review.' : 'This saved battle predates automatic Smuggler collection. Its original battle behavior is preserved; new battles use the current collection flow.'}

} {(mentat || bureaucrat) &&

These score effects resolve automatically. They do not change the leader’s printed value or spice bounty.

}
; }