import type { IntroductionState } from '@/game/introduction'; import { introductionCharity, introductionRevival } from '@/game/introduction-resources'; import { LeaderInspector } from './leader-inspector'; import { LeaderPortrait } from './leader-portrait'; import styles from './introduction.module.css'; type Props = { state: IntroductionState; update: (patch: Partial) => void }; export function CharityLesson({ state, update }: Props) { const charity = introductionCharity(state); return <>

CHOAM Charity comes before Bidding. In this Basic example you are Atreides, with no expansion powers or special charity rules. Choose how much spice you already hold.

update({ charitySpice: Number(e.target.value), charityClaimed: false })} />

Changing the starting spice starts a fresh example. It does not change another lesson or any live game.

{state.charityClaimed ? 'Charity received' : charity.canClaim ? 'You can claim charity' : 'No charity needed'}

You have {charity.spice} spice.

{state.charityClaimed ? 'The Spice Bank paid' : 'The Spice Bank would pay'} {charity.amount} spice.

{charity.reason &&

{charity.reason}

}

With no spice you receive two; with one you receive one. At two or more, ordinary charity gives nothing. It brings an eligible player up to two spice; it does not add two to every player’s balance.

Charity is a once-per-turn claim during its phase. That budget may matter in the following auction. Advanced Bene Gesserit and the CHOAM expansion change the ordinary case; their powers are separate.

; } export function RevivalLesson({ state, update }: Props) { const revival = introductionRevival(state); const selected = revival.leaders[state.revivalLeader]; const reset = (patch: Partial = {}) => update({ revivalActions: [], ...patch }); return <>

At the Revival phase, this separate Basic position has five ordinary forces in the Tanks and fifteen in reserves. Revived forces return to reserves, ready for later shipment. No Tleilaxu, ally funding, elites, cards or other expansion effects apply.

reset({ revivalSpice: Number(e.target.value) })} />

Faction, starting spice and leader position reset this example. Force and leader choices below share the same remaining spice.

Bring forces back

update({ revivalAmount: Number(e.target.value) })} />

Bring one leader back

Your remaining resources

{revival.spice} spice · {revival.tanks} forces in the Tanks · {revival.reserves} in reserves.

{revival.revived} of three ordinary force revivals used this turn. You may still return up to {revival.remaining} {revival.remaining === 1 ? 'force' : 'forces'}.

{revival.factionName} has {revival.freeRate} free force revivals per turn; {revival.freeRemaining} of that allowance remain.

Selected force return

{revival.canReviveForces ?

{state.revivalAmount} forces: {revival.forceFree} free, total cost {revival.forceCost} spice to the Spice Bank.

:

{revival.forceReason}

}

{selected.name}

Strength {selected.strength}} badge={selected.strength} /> {revival.canReviveLeader ?

This leader can return for {revival.leaderCost} spice to the Spice Bank.

:

{revival.leaderReason}

}

{revival.leaderRevived ? 'Your ordinary leader revival is used for this turn.' : 'One ordinary leader may be revived this turn, if eligible and affordable.'}

Revival history

{revival.transcript.length ?
    {revival.transcript.map((entry, i) =>
  1. {entry}
  2. )}
:

No revivals yet. Try returning forces in separate batches: the free allowance is shared across them.

}

The ordinary force limit is three total, including free returns. Extra paid returns cost two spice each. Force and leader allowances are separate, so a leader return does not consume a force revival.

Normally all five leaders must die before the first revival cycle opens. You may then revive one eligible leader per turn for its fighting strength in spice. A returned leader that dies again must wait for the other revivable leaders to return and die again. Reviving a leader does not remove a matching Traitor Card from another player’s hand.

; }