import { introductionBidding, INTRODUCTION_BIDDERS, } from '@/game/introduction-bidding'; import type { IntroductionState } from '@/game/introduction'; import { CardInspector, CardRules } from './card-inspector'; import styles from './introduction.module.css'; export function BiddingLesson({ state, update, }: { state: IntroductionState; update: (patch: Partial) => void; }) { const auction = introductionBidding(state); const reset = (patch: Partial = {}) => update({ auctionActions: [], auctionBid: 1, ...patch }); const act = (amount: number | null) => { const next = { ...state, auctionActions: [...state.auctionActions, amount], }; const result = introductionBidding(next); update({ auctionActions: next.auctionActions, auctionBid: result.status === 'bidding' ? Math.min(7, result.minimum) : next.auctionBid, }); }; return ( <>

In this separate example you are Fremen with 6 spice. One face-down Treachery Card is being auctioned in the order Fremen, Emperor, Spacing Guild. There are no allies, Karama cards or other reacting powers here.

These are fixed teaching responses. At a real table, opponents choose their own bids and their spice remains private. Changing either option starts a new example.

update({ auctionBid: Number(event.target.value) }) } />

{auction.status === 'bidding' ? 'Your bidding turn' : auction.status === 'unbid' ? 'No one bought the card' : auction.won ? 'You bought the card' : 'Your opponent bought the card'}

{state.auctionHandFull && (

Your four-card hand is full, so you cannot bid. The auction continues with the eligible players.

)} {auction.status === 'bidding' ? ( <>

{auction.bidder ? `${INTRODUCTION_BIDDERS[auction.bidder]} holds the high bid of ${auction.bid} spice.` : 'No bid has been made yet.'}{' '} Your next bid must be at least {auction.minimum} spice.

You still hold all 6 spice. The winning bid is paid when the auction closes.

{auction.bidError &&

{auction.bidError}

} {state.auctionActions.includes(null) && (

You passed earlier, but the card is still up for sale. You may re-enter on this turn.

)} ) : auction.status === 'unbid' ? ( <>

Everyone passed without a bid. No spice changes hands. This card and any remaining unauctioned cards return to the top of the deck, and normal bidding ends.

) : ( <>

{INTRODUCTION_BIDDERS[auction.bidder!]} pays {auction.bid} spice{' '} {auction.bankIncome ? 'to the Spice Bank' : 'to the Emperor'}. Losing bidders pay nothing.

You have {auction.remaining} spice and{' '} {auction.handCount} cards in your hand.

{auction.received ? ( <>

Your new card is private. Buying it did not reveal its face to the other players.

) : (

The purchased card remains concealed from you.

)} )}

Auction history

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

You open the bidding. Bid at least 1 spice or pass.

)}

A higher bid gives the other eligible players another opportunity. Passing does not permanently remove you: you can bid again if the card is still available when your turn returns. Once everyone else passes on the standing bid, its owner buys the card automatically.

Ordinary hands hold at most four Treachery Cards; Harkonnen has a larger limit. Atreides can inspect auction cards through its faction power. Allies, Karama and expansion auctions add further choices in the live game.

); }