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 an existing pile in the territory. One pile resolves automatically; with several, provisionally choose its sector. No existing spice means no addition.

} {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 the territory’s positive piles when both plans reveal. Provisional strength policy: the cap includes the copied or printed disc value, declared leader bonuses and Kwisatz. A surviving leader collects even if you lose or have no forces left, unless an actual zero-strength weapon effect resolves. A partial collection across several piles asks you for sector amounts; single-pile and all/none collections stay automatic. Pending spice cannot fund this plan. This modifier policy is not a publisher ruling; other 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.

}
; }