Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
hand_pick.c File Reference

CARDGAME's picks of cards from a hand or a pile, by the player or the computer's flags, then the tally, the step messages and the coin toss that picks the first player (one module: cut between them, the tally's jump table would lose its alignment). More...

Include dependency graph for hand_pick.c:

Go to the source code of this file.

Functions

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, and opens the player's panel.
 
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_moveSelection (CardBattle *battle, CardScreen *screen, s32 count, s32 step)
 Moves the selection by STEP among COUNT cards: the selected card is raised.
 
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.
 
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.marked), and dims the others.
 
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_addCardPoints (CardBattle *battle, CardScreen *screen, CardPile *pile, s32 add, 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_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_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, Triangle cancels.
 
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, Square and Circle end.
 
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.
 
s32 CARDGAME_stepPulseCard (CardBattle *battle, CardScreen *screen)
 Scales the highlighted sprite up to 1.25 and back, 5 frames each; 1 once done.
 
static void hideHandForMenu (CardBattle *battle, CardScreen *screen, CardPile *pile)
 Hides the hand and the choice's windows for the battle menu.
 
static void showHandAfterMenu (CardBattle *battle, CardScreen *screen, CardPile *pile)
 Back from the battle menu: shows the hand again, the cards that can't be played dimmed, and reopens the choice's windows.
 
static void startChooseState (CardBattle *battle, CardScreen *screen, CardPile *pile)
 Starts the state of the card choice effectStep.nextState asks for: its prompt, windows and dimmed cards.
 
static void askToConfirm (CardBattle *battle, CardScreen *screen, CardPile *pile)
 Puts the highlighted card back in the hand and opens the confirm message.
 
static void backToChoosing (CardBattle *battle, CardScreen *screen, CardPile *pile)
 After a no to the confirm message: reopens the choice's windows, then lifts the highlighted card again and choosing goes on (state 3)
 
static void readConfirmInput (CardBattle *battle, CardScreen *screen)
 The answer to the confirm message: yes (effectStep.choice 0) ends the choice (state 8), no or triangle goes back to choosing (state 9)
 
static void showChosenCards (CardBattle *battle, CardScreen *screen, CardPile *pile)
 The chosen cards pulse with a sound, then the hand and its windows close.
 
static void resumeChoosing (CardBattle *battle, CardScreen *screen, CardPile *pile)
 Back from the battle menu: once the hand is shown again, choosing goes on with the picked cards highlighted.
 
s32 CARDGAME_stepChooseCards (CardBattle *battle, CardScreen *screen, CardPile *pile)
 Choosing cards of PILE's hand to play: effectStep.nextState queues the next step (startChooseState).
 
void CARDGAME_startPanelsStep (CardBattle *battle, CardScreen *screen)
 Opens the panels for a step.
 
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 apTotal and hpTotal; 1 when done.
 
void CARDGAME_startStepMessage (CardBattle *battle, CardScreen *screen, s32 index)
 Shows CARDGAME_stepMessages[index]: its message and window 5.
 
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.
 
void CARDGAME_switchCoinCard (CardBattle *battle, CardScreen *screen)
 Moves the selection to the other one of the two cards that CARDGAME_startFirstPick lays out.
 
void CARDGAME_startFirstPick (CardBattle *battle, CardScreen *screen)
 Who goes first: cards 0x57 and 0x58 face down, in a random order.
 
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 cross and both turn over; 1 once it is over, with effectStep.choice 1 if the player won the draw.
 

Detailed Description

CARDGAME's picks of cards from a hand or a pile, by the player or the computer's flags, then the tally, the step messages and the coin toss that picks the first player (one module: cut between them, the tally's jump table would lose its alignment).

Definition in file hand_pick.c.

Function Documentation

◆ CARDGAME_startHandPick()

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, and opens the player's panel.

Definition at line 10 of file hand_pick.c.

Referenced by startEffectStep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_startPick()

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)

Definition at line 43 of file hand_pick.c.

Referenced by startEffectStep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_moveSelection()

void CARDGAME_moveSelection ( CardBattle *  battle,
CardScreen *  screen,
s32  count,
s32  step 
)

Moves the selection by STEP among COUNT cards: the selected card is raised.

< SYSTEM06

Definition at line 61 of file hand_pick.c.

Referenced by CARDGAME_readCountInput().

Here is the caller graph for this function:

◆ CARDGAME_movePileSelection()

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.

< SYSTEM06

Definition at line 73 of file hand_pick.c.

Referenced by CARDGAME_readChooseInput(), and CARDGAME_readPickInput().

Here is the caller graph for this function:

◆ CARDGAME_flagPlayableCards()

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.marked), and dims the others.

Definition at line 86 of file hand_pick.c.

Referenced by CARDGAME_stepChooseCards().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_isHandPickDone()

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.

Definition at line 106 of file hand_pick.c.

Referenced by CARDGAME_stepChooseCards().

Here is the caller graph for this function:

◆ CARDGAME_addCardPoints()

void CARDGAME_addCardPoints ( CardBattle *  battle,
CardScreen *  screen,
CardPile *  pile,
s32  add,
s32  card 
)

Adds a card's points to pile's points of its colour (takes them when add is 0), on the panel.

Definition at line 123 of file hand_pick.c.

Referenced by CARDGAME_pickComputerCards(), and CARDGAME_togglePick().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_togglePick()

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.

Definition at line 139 of file hand_pick.c.

Referenced by CARDGAME_readPickInput().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_readChooseInput()

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, Triangle cancels.

< SYSTEM01

Definition at line 162 of file hand_pick.c.

Referenced by CARDGAME_stepChooseCards().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_readPickInput()

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, Square and Circle end.

Definition at line 193 of file hand_pick.c.

Referenced by CARDGAME_stepChooseCards().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_readCountInput()

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.

< SYSTEM01

Definition at line 220 of file hand_pick.c.

Referenced by CARDGAME_stepChooseCards().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_stepPulseCard()

s32 CARDGAME_stepPulseCard ( CardBattle *  battle,
CardScreen *  screen 
)

Scales the highlighted sprite up to 1.25 and back, 5 frames each; 1 once done.

Definition at line 244 of file hand_pick.c.

Referenced by CARDGAME_chooseCard(), CARDGAME_drawFirstPlayer(), and CARDGAME_stepChooseCards().

Here is the caller graph for this function:

◆ hideHandForMenu()

static void hideHandForMenu ( CardBattle *  battle,
CardScreen *  screen,
CardPile *  pile 
)
inlinestatic

Hides the hand and the choice's windows for the battle menu.

Definition at line 276 of file hand_pick.c.

Referenced by startChooseState().

Here is the caller graph for this function:

◆ showHandAfterMenu()

static void showHandAfterMenu ( CardBattle *  battle,
CardScreen *  screen,
CardPile *  pile 
)
inlinestatic

Back from the battle menu: shows the hand again, the cards that can't be played dimmed, and reopens the choice's windows.

Definition at line 295 of file hand_pick.c.

Referenced by startChooseState().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ startChooseState()

static void startChooseState ( CardBattle *  battle,
CardScreen *  screen,
CardPile *  pile 
)
inlinestatic

Starts the state of the card choice effectStep.nextState asks for: its prompt, windows and dimmed cards.

< SYSTEM07

< SYSTEM07

Definition at line 329 of file hand_pick.c.

Referenced by CARDGAME_stepChooseCards().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ askToConfirm()

static void askToConfirm ( CardBattle *  battle,
CardScreen *  screen,
CardPile *  pile 
)
inlinestatic

Puts the highlighted card back in the hand and opens the confirm message.

Definition at line 441 of file hand_pick.c.

Referenced by CARDGAME_stepChooseCards().

Here is the caller graph for this function:

◆ backToChoosing()

static void backToChoosing ( CardBattle *  battle,
CardScreen *  screen,
CardPile *  pile 
)
inlinestatic

After a no to the confirm message: reopens the choice's windows, then lifts the highlighted card again and choosing goes on (state 3)

Definition at line 459 of file hand_pick.c.

Referenced by CARDGAME_stepChooseCards().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readConfirmInput()

static void readConfirmInput ( CardBattle *  battle,
CardScreen *  screen 
)
inlinestatic

The answer to the confirm message: yes (effectStep.choice 0) ends the choice (state 8), no or triangle goes back to choosing (state 9)

< SYSTEM02: a cursor moves

< SYSTEM01

Definition at line 480 of file hand_pick.c.

Referenced by CARDGAME_stepChooseCards().

Here is the caller graph for this function:

◆ showChosenCards()

static void showChosenCards ( CardBattle *  battle,
CardScreen *  screen,
CardPile *  pile 
)
inlinestatic

The chosen cards pulse with a sound, then the hand and its windows close.

< SYSTEM07

Definition at line 502 of file hand_pick.c.

Referenced by CARDGAME_stepChooseCards().

Here is the caller graph for this function:

◆ resumeChoosing()

static void resumeChoosing ( CardBattle *  battle,
CardScreen *  screen,
CardPile *  pile 
)
inlinestatic

Back from the battle menu: once the hand is shown again, choosing goes on with the picked cards highlighted.

Definition at line 545 of file hand_pick.c.

Referenced by CARDGAME_stepChooseCards().

Here is the caller graph for this function:

◆ CARDGAME_stepChooseCards()

s32 CARDGAME_stepChooseCards ( CardBattle *  battle,
CardScreen *  screen,
CardPile *  pile 
)

Choosing cards of PILE's hand to play: effectStep.nextState queues the next step (startChooseState).

The steps CARDGAME_runEffectStep starts (CardBattle.effectStep.next) and runs (effectStep.id)

-1 while it runs, then 0 or 1

Definition at line 564 of file hand_pick.c.

Referenced by CARDGAME_runEffectStep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_startPanelsStep()

void CARDGAME_startPanelsStep ( CardBattle *  battle,
CardScreen *  screen 
)

Opens the panels for a step.

Definition at line 685 of file hand_pick.c.

Referenced by startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_stepTally()

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 apTotal and hpTotal; 1 when done.

< SYSTEM10: a number counts up or down

Definition at line 696 of file hand_pick.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_startStepMessage()

void CARDGAME_startStepMessage ( CardBattle *  battle,
CardScreen *  screen,
s32  index 
)

Shows CARDGAME_stepMessages[index]: its message and window 5.

Definition at line 808 of file hand_pick.c.

Referenced by startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_stepMessage()

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.

Definition at line 817 of file hand_pick.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_switchCoinCard()

void CARDGAME_switchCoinCard ( CardBattle *  battle,
CardScreen *  screen 
)

Moves the selection to the other one of the two cards that CARDGAME_startFirstPick lays out.

< SYSTEM06

Definition at line 846 of file hand_pick.c.

Referenced by CARDGAME_drawFirstPlayer().

Here is the caller graph for this function:

◆ CARDGAME_startFirstPick()

void CARDGAME_startFirstPick ( CardBattle *  battle,
CardScreen *  screen 
)

Who goes first: cards 0x57 and 0x58 face down, in a random order.

Definition at line 858 of file hand_pick.c.

Referenced by startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_drawFirstPlayer()

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 cross and both turn over; 1 once it is over, with effectStep.choice 1 if the player won the draw.

< SYSTEM07

< SYSTEM03

Definition at line 891 of file hand_pick.c.

Referenced by CARDGAME_runEffectStep().

Here is the call graph for this function:
Here is the caller graph for this function: