Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
choice.h
Go to the documentation of this file.
1#ifndef CARDGAME_CHOICE_H
2#define CARDGAME_CHOICE_H
3
4/* CARDGAME's choices: the cards of a hand or a pile, the picks, the deck,
5 the table views and the questions (card_choice.c, hand_pick.c,
6 deck_choice.c, table_view.c and questions.c). */
7
11
12/* A step of CARDGAME_windowSteps: once its time is past, CARDGAME_openStepWindows opens windows */
13typedef struct CardBattleStep {
14 /* 0x0 */ s16 time;
15 /* 0x2 */ s16 kind;
17
18/* A blinking marker that opens and closes by scaling (CARDGAME_createMarker):
19 frame 0x47 of the TIM archive's sprite sheet */
20struct CardMarker {
22 /* 0x50 */ s32 time; /* the blink */
23 /* 0x54 */ s16 x;
24 /* 0x56 */ s16 y;
25 /* 0x58 */ s16 scaleX;
26 /* 0x5A */ s16 scaleY;
27 /* 0x5C */ u8 pad[6]; /* never read or written */
28 /* 0x62 */ u8 phase; /* 0 opening, 1 open, 2 closing */
29 /* 0x63 */ u8 fast; /* the blink's palette cycle */
30 /* 0x64 */ s16 scaleTime;
31 /* 0x66 */ s16 scaleDuration;
32 /* 0x68 */ void (*setPos)(struct CardMarker *marker, s16 x, s16 y);
33 /* 0x6C */ void (*close)(struct CardMarker *marker);
34 /* 0x70 */ void (*setFast)(struct CardMarker *marker);
35};
36
37/* A deck's window (CARDGAME_createDeckWindow): its name and how many cards
38 of each of the six colours it has. It opens and closes by scaling. */
41 /* 0x50 */ s32 deck; /* in GAME.decks */
42 /* 0x54 */ s32 time; /* the blink */
43 /* 0x58 */ s16 x;
44 /* 0x5A */ s16 y;
45 /* 0x5C */ s16 scaleX;
46 /* 0x5E */ s16 scaleY;
47 /* 0x60 */ u8 counts[6];
48 /* 0x66 */ u8 phase; /* 0 opening, 1 open, 2 closing */
49 /* 0x67 */ u8 blink;
50 /* 0x68 */ s16 scaleTime;
51 /* 0x6A */ s16 scaleDuration;
52 /* 0x6C */ void (*setBlink)(struct CardDeckWindow *window);
53 /* 0x70 */ void (*close)(struct CardDeckWindow *window);
54};
55
56/* The functions and data the overlay's files share */
58extern s32 CARDGAME_rowSpriteOffsets[]; /* the sprite offset of each row of CARDGAME_viewTable */
59extern s32 CARDGAME_rowSteps[]; /* the step of each row of CARDGAME_viewTable */
60extern s16 CARDGAME_savedPanelScales[2]; /* the panels' scale states, kept by CARDGAME_viewTable */
61extern s32 CARDGAME_selectionText; /* the message of CARDGAME_chooseCard's selection */
62extern s16 CARDGAME_stepWindowPositions[2][3][4][2]; /* CARDGAME_openStepWindows's window positions, by layout and window, then the same moved for SHIFT_PAL_SCREEN */
65void CARDGAME_moveTableHighlight(CardBattle *battle, CardScreen *screen, s32 kind, s32 delta);
66void CARDGAME_setupCardChoice(CardBattle *battle, CardScreen *screen, s32 side, s32 kind);
67extern u8 CARDGAME_stepMessages[][2]; /* CARDGAME_startStepMessage's text for window 5 and what screen->openMessage shows, by message */
69extern s32 CARDGAME_coinCardPositions[][2]; /* the two cards' x, y (CARDGAME_startFirstPick) */
70extern s32 CARDGAME_promptText; /* the text of window 0 */
71void CARDGAME_showCardInfo(CardBattle *battle, CardScreen *screen, s32 offset);
72void CARDGAME_addCardPoints(CardBattle *battle, CardScreen *screen, CardPile *pile, s32 arg3, s32 card);
74s32 CARDGAME_openStepWindows(CardBattle *battle, CardScreen *screen, s32 layout, s32 text, s32 time, s32 step);
75void CARDGAME_startQuestion(CardBattle *battle, CardScreen *screen, s32 value);
77void CARDGAME_clearCardInfo(CardBattle *battle, CardScreen *screen);
78void CARDGAME_showTableCardInfo(CardBattle *battle, CardScreen *screen, s32 kind);
79void CARDGAME_startHandPick(CardBattle *battle, CardScreen *screen, CardPile *pile);
80void CARDGAME_startPick(CardBattle *battle, CardScreen *screen, s32 all, s32 mode);
81void CARDGAME_moveSelection(CardBattle *battle, CardScreen *screen, s32 count, s32 step);
83void CARDGAME_flagPlayableCards(CardBattle *battle, CardScreen *screen, CardPile *pile);
86void CARDGAME_readChooseInput(CardBattle *battle, CardScreen *screen, CardPile *pile);
87void CARDGAME_readPickInput(CardBattle *battle, CardScreen *screen, CardPile *pile);
88void CARDGAME_readCountInput(CardBattle *battle, CardScreen *screen, s32 count);
92void CARDGAME_startStepMessage(CardBattle *battle, CardScreen *screen, s32 index);
93void CARDGAME_switchCoinCard(CardBattle *battle, CardScreen *screen);
94void CARDGAME_startFirstPick(CardBattle *battle, CardScreen *screen);
96void CARDGAME_startViewTable(CardBattle *battle, CardScreen *screen);
97void CARDGAME_startPickTableCard(CardBattle *battle, CardScreen *screen, s32 cancelable);
99void CARDGAME_movePickHighlight(CardBattle *battle, CardScreen *screen, s32 kind, s32 delta);
101void CARDGAME_setupSideChoice(CardBattle *battle, CardScreen *screen, s32 side);
102void CARDGAME_moveHandHighlight(CardBattle *battle, CardScreen *screen, s32 delta);
103void CARDGAME_browseHand(CardBattle *battle, CardScreen *screen);
104s32 CARDGAME_chooseCard(CardBattle *battle, CardScreen *screen, s32 mode);
107void CARDGAME_startPileChoice(CardBattle *battle, CardScreen *screen, s32 flags);
108
109/* The steps CARDGAME_runEffectStep starts (CardBattle.effectStep.next) and runs (effectStep.id) */
112void CARDGAME_pickBestPileCard(CardBattle *battle, CardScreen *screen, s32 arg2);
115void CARDGAME_startPreviousCardChoice(CardBattle *battle, CardScreen *screen, s32 arg2);
117void CARDGAME_showTargetSlots(CardBattle *battle, CardScreen *screen, s32 side, s32 arg3);
119void CARDGAME_drawMarker(CardMarker *marker);
121void CARDGAME_setMarkerPos(CardMarker *marker, s16 x, s16 y);
123void CARDGAME_closeMarker(CardMarker *marker);
130
131#endif /* 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.
Definition hand_pick.c:73
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 ...
Definition table_view.c:284
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...
Definition hand_pick.c:891
s32 CARDGAME_stepPulseCard(CardBattle *battle, CardScreen *screen)
Scales the highlighted sprite up to 1.25 and back, 5 frames each; 1 once done.
Definition hand_pick.c:244
CardOffset CARDGAME_deckCountOffsets[]
The functions and data the overlay's files share.
Definition cardgame_3.c:10
s32 CARDGAME_coinCardPositions[][2]
the two cards' x, y (CARDGAME_startFirstPick)
Definition cardgame_2.c:26
void CARDGAME_browseHand(CardBattle *battle, CardScreen *screen)
Moves the highlight along the hand with left and right; cross picks a playable card.
Definition card_choice.c:68
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.
Definition table_view.c:27
s16 CARDGAME_stepWindowPositions[2][3][4][2]
CARDGAME_openStepWindows's window positions, by layout and window, then the same moved for SHIFT_PAL_...
Definition cardgame_2.c:6
void CARDGAME_movePickHighlight(CardBattle *battle, CardScreen *screen, s32 kind, s32 delta)
CARDGAME_moveTableHighlight, for CARDGAME_pickTableCard.
Definition table_view.c:367
s32 CARDGAME_selectionText
the message of CARDGAME_chooseCard's selection
Definition cardgame_3.c:181
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...
Definition questions.c:44
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.
Definition deck_choice.c:77
s16 CARDGAME_getStepWindowPos(s32 a, s32 b, s32 c)
A position of CARDGAME_stepWindowPositions.
Definition questions.c:6
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,...
Definition hand_pick.c:193
void CARDGAME_setupSideChoice(CardBattle *battle, CardScreen *screen, s32 side)
CARDGAME_setupCardChoice of side, kind 0.
Definition card_choice.c:51
u8 CARDGAME_stepMessages[][2]
CARDGAME_startStepMessage's text for window 5 and what screen->openMessage shows, by message.
Definition cardgame_2.c:22
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.
Definition table_view.c:12
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...
Definition hand_pick.c:86
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 hand_pick.c:817
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,...
Definition table_view.c:535
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,...
Definition hand_pick.c:162
s32 CARDGAME_rowSteps[]
the step of each row of CARDGAME_viewTable
Definition cardgame_2.c:27
void CARDGAME_showCardInfo(CardBattle *battle, CardScreen *screen, s32 offset)
Fills the information windows with the card of sprite offset + effectStep.cursor (the highlighted one...
Definition questions.c:246
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.
Definition hand_pick.c:61
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.
Definition hand_pick.c:808
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)
Definition deck_choice.c:8
void CARDGAME_startFirstPick(CardBattle *battle, CardScreen *screen)
Who goes first: cards 0x57 and 0x58 face down, in a random order.
Definition hand_pick.c:858
void CARDGAME_setMarkerFast(CardMarker *marker)
CardMarker.setFast: runs its palettes once from the start (the deck was picked)
Definition deck_choice.c:84
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...
Definition hand_pick.c:696
CardMarker * CARDGAME_createMarker(s16 x, s16 y)
Creates the deck marker at x, y, which shows the selected deck window.
Definition deck_choice.c:98
void CARDGAME_switchCoinCard(CardBattle *battle, CardScreen *screen)
Moves the selection to the other one of the two cards that CARDGAME_startFirstPick lays out.
Definition hand_pick.c:846
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 hand_pick.c:106
void CARDGAME_setDeckWindowBlink(CardDeckWindow *window)
CardDeckWindow.setBlink: blinks its icon (the deck was picked)
void CARDGAME_startViewTable(CardBattle *battle, CardScreen *screen)
Starts CARDGAME_viewTable.
Definition table_view.c:6
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
Definition cardgame_3.c:179
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.
Definition questions.c:236
s32 CARDGAME_stepChooseCards(CardBattle *battle, CardScreen *screen, CardPile *pile)
The steps CARDGAME_runEffectStep starts (CardBattle.effectStep.next) and runs (effectStep....
Definition hand_pick.c:564
s32 CARDGAME_rowSpriteOffsets[]
the sprite offset of each row of CARDGAME_viewTable
Definition cardgame_2.c:18
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,...
Definition card_choice.c:8
void CARDGAME_closeMarker(CardMarker *marker)
CardMarker.close: shrinks it over 5 frames.
Definition deck_choice.c:90
void CARDGAME_moveHandHighlight(CardBattle *battle, CardScreen *screen, s32 delta)
Moves the highlight along the hand by delta, raising the highlighted card.
Definition card_choice.c:56
void CARDGAME_closeDeckWindow(CardDeckWindow *window)
CardDeckWindow.close: narrows it over 6 frames.
CardBattleStep CARDGAME_windowSteps[]
Definition cardgame_2.c:21
s32 CARDGAME_stepYesNo(CardBattle *battle, CardScreen *screen)
Runs the yes/no window that CARDGAME_startQuestion sets up: 1 for the first choice,...
Definition questions.c:155
void CARDGAME_updateMarker(CardMarker *marker)
The deck marker's task: opens by growing over 10 frames, stays until closed, then shrinks and is draw...
Definition deck_choice.c:34
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 hand_pick.c:43
void CARDGAME_startPanelsStep(CardBattle *battle, CardScreen *screen)
Opens the panels for a step.
Definition hand_pick.c:685
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,...
Definition hand_pick.c:10
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
Definition cardgame_3.c:180
s32 CARDGAME_getPickTableHeight(CardBattle *battle, CardScreen *screen)
CARDGAME_getTableHeight, for CARDGAME_pickTableCard.
Definition table_view.c:362
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 hand_pick.c:139
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.
Definition hand_pick.c:220
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....
Definition table_view.c:356
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.
Definition hand_pick.c:123
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.
Definition questions.c:15
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...
Definition questions.c:308
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.
signed int s32
Definition common.h:11
signed short s16
Definition common.h:9
unsigned char u8
Definition common.h:8
#define TASK_HEADER(Type)
Definition task.h:39
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.
Definition choice.h:13
The card battle (CARDGAME_createBattle).
Definition battle.h:226
A deck's window (CARDGAME_createDeckWindow): its name and how many cards of each of the six colours i...
Definition choice.h:39
s16 scaleDuration
Definition choice.h:51
s32 deck
in GAME.decks
Definition choice.h:41
s32 time
the blink
Definition choice.h:42
void(* close)(struct CardDeckWindow *window)
Definition choice.h:53
void(* setBlink)(struct CardDeckWindow *window)
Definition choice.h:52
u8 counts[6]
Definition choice.h:47
s16 scaleTime
Definition choice.h:50
u8 phase
0 opening, 1 open, 2 closing
Definition choice.h:48
A blinking marker that opens and closes by scaling (CARDGAME_createMarker): frame 0x47 of the TIM arc...
Definition choice.h:20
s16 scaleX
Definition choice.h:25
s16 y
Definition choice.h:24
u8 pad[6]
never read or written
Definition choice.h:27
u8 phase
0 opening, 1 open, 2 closing
Definition choice.h:28
void(* close)(struct CardMarker *marker)
Definition choice.h:33
u8 fast
the blink's palette cycle
Definition choice.h:29
s32 time
the blink
Definition choice.h:22
void(* setFast)(struct CardMarker *marker)
Definition choice.h:34
void(* setPos)(struct CardMarker *marker, s16 x, s16 y)
Definition choice.h:32
s16 scaleTime
Definition choice.h:30
s16 scaleDuration
Definition choice.h:31
s16 scaleY
Definition choice.h:26
s16 x
Definition choice.h:23
An offset from a window's corner.
Definition screen.h:59
A player's cards in a card battle (CardSide.pile)
Definition battle.h:108
The battle screen (created by CARDGAME_createScreen): the two panels, the cards on the table and the ...
Definition screen.h:263
A text window (createTextWindow): up to six text buffers (0 is shown, 1-5 are "work" buffers that con...
Definition text.h:131