1#ifndef CARDGAME_CHOICE_H
2#define CARDGAME_CHOICE_H
CARDGAME's card battle: the slots, piles, plays, effects and steps, the opponent and the rounds (effe...
CARDGAME's shared declarations: the headers it builds on and the types the other headers point to bef...
void CARDGAME_movePileSelection(CardBattle *battle, CardScreen *screen, CardPile *pile, s32 step)
Moves the selection by STEP among the cards of PILE's hand: the selected card is raised.
s32 CARDGAME_viewTable(CardBattle *battle, CardScreen *screen)
Lets the player look over the cards out on the table: the two players' rows and the row of the cards ...
s32 CARDGAME_chooseCard(CardBattle *battle, CardScreen *screen, s32 mode)
Lets a player pick a card of a row (set up by CARDGAME_setupCardChoice): 2 once one is picked,...
void CARDGAME_pickBestPileCard(CardBattle *battle, CardScreen *screen, s32 arg2)
Sets effectStep.choice to the effectStep.eligible-marked card of the pile effectStep....
s32 CARDGAME_drawFirstPlayer(CardBattle *battle, CardScreen *screen)
The draw for who goes first: the two face-down cards open, the player picks one with left/right and c...
s32 CARDGAME_stepPulseCard(CardBattle *battle, CardScreen *screen)
Scales the highlighted sprite up to 1.25 and back, 5 frames each; 1 once done.
CardOffset CARDGAME_deckCountOffsets[]
The functions and data the overlay's files share.
s32 CARDGAME_coinCardPositions[][2]
the two cards' x, y (CARDGAME_startFirstPick)
void CARDGAME_browseHand(CardBattle *battle, CardScreen *screen)
Moves the highlight along the hand with left and right; cross picks a playable card.
void CARDGAME_moveTableHighlight(CardBattle *battle, CardScreen *screen, s32 kind, s32 delta)
Moves the highlight of a row of cards (kind 0, 1 or 2) by delta.
s16 CARDGAME_stepWindowPositions[2][3][4][2]
CARDGAME_openStepWindows's window positions, by layout and window, then the same moved for SHIFT_PAL_...
void CARDGAME_movePickHighlight(CardBattle *battle, CardScreen *screen, s32 kind, s32 delta)
CARDGAME_moveTableHighlight, for CARDGAME_pickTableCard.
s32 CARDGAME_selectionText
the message of CARDGAME_chooseCard's selection
void CARDGAME_startQuestion(CardBattle *battle, CardScreen *screen, s32 value)
Opens the panels and asks message value; the European and Japanese versions start on the second choic...
s32 CARDGAME_stepTargetSlots(CardBattle *battle, CardScreen *screen)
The steps of CARDGAME_showTargetSlots: highlights the marked slots (effectStep.marked); confirming ne...
void CARDGAME_setMarkerPos(CardMarker *marker, s16 x, s16 y)
CardMarker.setPos: moves the marker to x, y.
s16 CARDGAME_getStepWindowPos(s32 a, s32 b, s32 c)
A position of CARDGAME_stepWindowPositions.
void CARDGAME_readPickInput(CardBattle *battle, CardScreen *screen, CardPile *pile)
Reads the pad while cards of PILE's hand are being picked: Left/Right move, Cross picks or puts back,...
void CARDGAME_setupSideChoice(CardBattle *battle, CardScreen *screen, s32 side)
CARDGAME_setupCardChoice of side, kind 0.
u8 CARDGAME_stepMessages[][2]
CARDGAME_startStepMessage's text for window 5 and what screen->openMessage shows, by message.
s32 CARDGAME_getTableHeight(CardBattle *battle, CardScreen *screen)
The table's height: 8 per card of the longer row of slots (at least 3), and 14.
void CARDGAME_flagPlayableCards(CardBattle *battle, CardScreen *screen, CardPile *pile)
Flags (effectStep.eligible) the cards of pile's hand that can be played and aren't picked (effectStep...
s32 CARDGAME_stepMessage(CardBattle *battle, CardScreen *screen)
Waits for window 5 to open, then for Cross or Triangle to close it; 1 once it has closed.
s32 CARDGAME_pickTableCard(CardBattle *battle, CardScreen *screen)
Lets the player pick a card out on the table (effectStep.flags bit 0: in their own row,...
void CARDGAME_readChooseInput(CardBattle *battle, CardScreen *screen, CardPile *pile)
Reads the pad while a card of PILE's hand is being chosen: Left/Right move, Cross picks,...
s32 CARDGAME_rowSteps[]
the step of each row of CARDGAME_viewTable
void CARDGAME_showCardInfo(CardBattle *battle, CardScreen *screen, s32 offset)
Fills the information windows with the card of sprite offset + effectStep.cursor (the highlighted one...
void CARDGAME_updateDeckWindow(CardDeckWindow *window, TextWindow **texts)
A deck window's task: makes its name and colour counts, opens by widening over 12 frames,...
void CARDGAME_moveSelection(CardBattle *battle, CardScreen *screen, s32 count, s32 step)
Moves the selection by STEP among COUNT cards: the selected card is raised.
void CARDGAME_showTargetSlots(CardBattle *battle, CardScreen *screen, s32 side, s32 arg3)
Shows the card being played as sprite 15 and lets the slots out that its target picks (a side of owne...
void CARDGAME_startStepMessage(CardBattle *battle, CardScreen *screen, s32 index)
Shows CARDGAME_stepMessages[index]: its message and window 5.
void CARDGAME_startPreviousCardChoice(CardBattle *battle, CardScreen *screen, s32 arg2)
Shows the last card played as sprite 15; with mode 0, or mode 1 and a colour 6 card before it,...
void CARDGAME_drawMarker(CardMarker *marker)
Draws the deck marker at its size, cycling its palettes (or running through them once when fast)
void CARDGAME_startFirstPick(CardBattle *battle, CardScreen *screen)
Who goes first: cards 0x57 and 0x58 face down, in a random order.
void CARDGAME_setMarkerFast(CardMarker *marker)
CardMarker.setFast: runs its palettes once from the start (the deck was picked)
s32 CARDGAME_stepTally(CardBattle *battle, CardScreen *screen)
Turns the opponent's slot cards over, then counts the panels' ap and hp up to each side's pile apTota...
CardMarker * CARDGAME_createMarker(s16 x, s16 y)
Creates the deck marker at x, y, which shows the selected deck window.
void CARDGAME_switchCoinCard(CardBattle *battle, CardScreen *screen)
Moves the selection to the other one of the two cards that CARDGAME_startFirstPick lays out.
s32 CARDGAME_isHandPickDone(CardBattle *battle, CardScreen *screen, CardPile *pile)
Whether the pick is over: six cards picked (effectStep.count), or none left that can be played.
void CARDGAME_setDeckWindowBlink(CardDeckWindow *window)
CardDeckWindow.setBlink: blinks its icon (the deck was picked)
void CARDGAME_startViewTable(CardBattle *battle, CardScreen *screen)
Starts CARDGAME_viewTable.
void CARDGAME_drawDeckWindow(CardDeckWindow *window)
Draws a deck window's frame and icon at its size, the icon running through its palettes once when it ...
s32 CARDGAME_promptText
the text of window 0
s32 CARDGAME_pickComputerCards(CardBattle *battle, CardScreen *screen)
The computer marks (effectStep.marked) the cards of its hand it plays: up to six that can be played,...
void CARDGAME_clearCardInfo(CardBattle *battle, CardScreen *screen)
Empties the card information windows 1-4.
s32 CARDGAME_stepChooseCards(CardBattle *battle, CardScreen *screen, CardPile *pile)
The steps CARDGAME_runEffectStep starts (CardBattle.effectStep.next) and runs (effectStep....
s32 CARDGAME_rowSpriteOffsets[]
the sprite offset of each row of CARDGAME_viewTable
void CARDGAME_setupCardChoice(CardBattle *battle, CardScreen *screen, s32 side, s32 kind)
Sets up CARDGAME_chooseCard's choice of one of a side's cards: kind 0 among its hand,...
void CARDGAME_closeMarker(CardMarker *marker)
CardMarker.close: shrinks it over 5 frames.
void CARDGAME_moveHandHighlight(CardBattle *battle, CardScreen *screen, s32 delta)
Moves the highlight along the hand by delta, raising the highlighted card.
void CARDGAME_closeDeckWindow(CardDeckWindow *window)
CardDeckWindow.close: narrows it over 6 frames.
CardBattleStep CARDGAME_windowSteps[]
s32 CARDGAME_stepYesNo(CardBattle *battle, CardScreen *screen)
Runs the yes/no window that CARDGAME_startQuestion sets up: 1 for the first choice,...
void CARDGAME_updateMarker(CardMarker *marker)
The deck marker's task: opens by growing over 10 frames, stays until closed, then shrinks and is draw...
void CARDGAME_startPick(CardBattle *battle, CardScreen *screen, s32 all, s32 mode)
Starts a pick of the cards (all when all > 0) in mode (anim.next)
void CARDGAME_startPanelsStep(CardBattle *battle, CardScreen *screen)
Opens the panels for a step.
void CARDGAME_startHandPick(CardBattle *battle, CardScreen *screen, CardPile *pile)
Starts a pick from pile's hand: flags (effectStep.eligible) the cards that can be played,...
s32 CARDGAME_stepPreviousCardChoice(CardBattle *battle, CardScreen *screen)
The steps of CARDGAME_startPreviousCardChoice: confirming takes the card before the last one played,...
CardDeckWindow * CARDGAME_createDeckWindow(s32 deck, s32 x, s32 y)
Creates the window of deck deck at x, y, with how many cards of each colour it has.
s16 CARDGAME_savedPanelScales[2]
the panels' scale states, kept by CARDGAME_viewTable
s32 CARDGAME_getPickTableHeight(CardBattle *battle, CardScreen *screen)
CARDGAME_getTableHeight, for CARDGAME_pickTableCard.
s32 CARDGAME_togglePick(CardBattle *battle, CardScreen *screen, CardPile *pile)
Picks or puts back the selected card of PILE's hand: 1 picked, 2 put back, 0 neither.
void CARDGAME_readCountInput(CardBattle *battle, CardScreen *screen, s32 count)
Reads the pad while one of COUNT cards is being chosen: Left/Right move, Triangle cancels.
void CARDGAME_startPileChoice(CardBattle *battle, CardScreen *screen, s32 flags)
Shows the card being played as sprite 15 and the panels with flags, and starts CARDGAME_stepPileChoic...
s32 CARDGAME_stepPileChoice(CardBattle *battle, CardScreen *screen)
The steps of CARDGAME_startPileChoice: confirming is allowed when the pile the panel flags (effectSte...
void CARDGAME_startPickTableCard(CardBattle *battle, CardScreen *screen, s32 cancelable)
Starts CARDGAME_pickTableCard, which triangle backs out of when cancelable (effectStep....
void CARDGAME_addCardPoints(CardBattle *battle, CardScreen *screen, CardPile *pile, s32 arg3, s32 card)
Adds a card's points to pile's points of its colour (takes them when add is 0), on the panel.
s32 CARDGAME_openStepWindows(CardBattle *battle, CardScreen *screen, s32 layout, s32 text, s32 time, s32 step)
Opens the windows of the step CARDGAME_windowSteps[step] once its time is past; the next step.
void CARDGAME_showTableCardInfo(CardBattle *battle, CardScreen *screen, s32 kind)
CARDGAME_showCardInfo for the highlighted card of a row (kind 0, 1 or 2, as CARDGAME_moveTableHighlig...
void CARDGAME_pickComputerDeckCard(CardBattle *battle, CardScreen *screen)
The computer's pick from its deck: the first card flagged (effectStep.eligible) from its top up to dr...
void CARDGAME_pickLowestPlayerCard(CardBattle *battle, CardScreen *screen)
Picks the player's card with the lowest CardImage.rank, the strongest.
#define TASK_HEADER(Type)
CARDGAME's battle screen: its task, panels, card sprites, blinkers, gauges, numbers and windows,...
A step of CARDGAME_windowSteps: once its time is past, CARDGAME_openStepWindows opens windows.
The card battle (CARDGAME_createBattle).
A deck's window (CARDGAME_createDeckWindow): its name and how many cards of each of the six colours i...
void(* close)(struct CardDeckWindow *window)
void(* setBlink)(struct CardDeckWindow *window)
u8 phase
0 opening, 1 open, 2 closing
A blinking marker that opens and closes by scaling (CARDGAME_createMarker): frame 0x47 of the TIM arc...
u8 pad[6]
never read or written
u8 phase
0 opening, 1 open, 2 closing
void(* close)(struct CardMarker *marker)
u8 fast
the blink's palette cycle
void(* setFast)(struct CardMarker *marker)
void(* setPos)(struct CardMarker *marker, s16 x, s16 y)
An offset from a window's corner.
A player's cards in a card battle (CardSide.pile)
The battle screen (created by CARDGAME_createScreen): the two panels, the cards on the table and the ...
A text window (createTextWindow): up to six text buffers (0 is shown, 1-5 are "work" buffers that con...