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

CARDGAME's card battle: the slots, piles, plays, effects and steps, the opponent and the rounds (effect_script.c, battle.c, battle_steps.c, round.c, play_checks.c, pile_effects.c, slot_effects.c and computer.c). More...

Include dependency graph for battle.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  CardSlot
 A card a player has out (CARDGAME_setSlot) More...
 
struct  CardSortEntry
 A slot's card, sorted by id (CARDGAME_findCardSet) More...
 
struct  CardPlayer
 One of the two players of a card battle. More...
 
struct  CardPlay
 A card played in a round (CardRecord.plays), whose effect then runs. More...
 
struct  CardEffect
 A card's effect (CARDGAME_cardEffects), read through CARDGAME_getEffectField. More...
 
struct  CardPlan
 How the computer plays a card of its deck (CardBattle.opponentPlans): kind first, then priority (CARDGAME_sortOpponentHand) More...
 
struct  CardBattleMessage
 What a phase does once it is over (CARDGAME_battleMessages): the step that shows its message, and the phase after it. More...
 
struct  CardDraw
 Where a card of the opponent's deck is drawn (CardBattle.opponentDraws): the computer draws the cards of group round * 2 + 2 (CardBattle.round), and holds the cards of group 7 back. More...
 
struct  CardPile
 A player's cards in a card battle (CardSide.pile) More...
 
struct  CardRecord
 The turns of a round, in which the sides play cards one after the other (CARDGAME_playRounds), and the battle menu (CardBattle.record) More...
 
struct  CardStep
 The effect step that runs (CARDGAME_runEffectStep) and its values, which CARDGAME_runBattleMenu keeps a copy of while the menu is open. More...
 
struct  CardSide
 Each player's side of a card battle (CardBattle.sides) More...
 
struct  CardAnim
 The running animation of the cards on the table (CARDGAME_updateCardAnims) More...
 
struct  CardDeckCard
 A card of an opponent's deck (CardOpponent.cards) More...
 
struct  CardOpponent
 An opponent of the card battle: an entry of file FILE_CARDGAME_OPPONENTS, picked by CardBattle.arg (CARDGAME_loadOpponent) More...
 
struct  CardBattle
 The card battle (CARDGAME_createBattle). More...
 
struct  CardBattleItems
 The card battle's task items. More...
 

Macros

#define FILE_CARDGAME_OPPONENTS   0x7A4
 The opponents of the card battles (CardOpponent)
 
#define CARD_ANIM_UNDIM_ALL   1
 CardAnim.dimAll.
 
#define CARD_ANIM_DIM_ALL   2
 
#define CARD_INFO_STEPS   2
 The steps CARDGAME_stepPlayCard has before its card goes off: the European and Japanese versions show the card's information first, and wait for a button.
 

Enumerations

enum  CardRun { CARD_RUN_PHASE , CARD_RUN_STEP , CARD_RUN_RESOLVE , CARD_RUN_MENU }
 What CARDGAME_runBattle runs this frame (CardBattle.run) More...
 
enum  CardPhase {
  CARD_PHASE_NONE , CARD_PHASE_FADE_IN , CARD_PHASE_CHOOSE_DECK , CARD_PHASE_FIRST_PICK ,
  CARD_PHASE_DEAL , CARD_PHASE_PLAYS_BEFORE , CARD_PHASE_PUT_OUT , CARD_PHASE_PLAYS_AFTER ,
  CARD_PHASE_END_ROUND , CARD_PHASE_NEXT_ROUND , CARD_PHASE_MESSAGE
}
 The phases of a card battle (CardBattle.phase, CARDGAME_runPhase) More...
 
enum  CardAnimId {
  CARD_ANIM_NONE , CARD_ANIM_SHOW_SLOTS , CARD_ANIM_HIDE_SLOTS , CARD_ANIM_SHOW_PLAYS ,
  CARD_ANIM_HIDE_PLAYS , CARD_ANIM_SHOW_HAND , CARD_ANIM_HIDE_HAND , CARD_ANIM_SHOW_DECK ,
  CARD_ANIM_HIDE_DECK , CARD_ANIM_SHOW_DISCARDS , CARD_ANIM_HIDE_DISCARDS , CARD_ANIM_SHOW_OPPONENT_HAND ,
  CARD_ANIM_HIDE_OPPONENT_HAND , CARD_ANIM_SHOW_OPPONENT_DECK , CARD_ANIM_HIDE_OPPONENT_DECK , CARD_ANIM_SHOW_OPPONENT_DISCARDS ,
  CARD_ANIM_HIDE_OPPONENT_DISCARDS , CARD_ANIM_LAY_OUT_HAND , CARD_ANIM_LAY_OUT_OPPONENT_HAND
}
 The animations of the cards on the table (CardBattle.anim): the slots, the plays or a pile laid out as sprites that scale in, then out. More...
 

Functions

CardBattle * CARDGAME_createBattle (s32 arg)
 Creates the card battle against opponent arg (CARDGAME_loadOpponent), with its functions, and loads its sound bank.
 
void CARDGAME_showPanelValues (CardBattle *battle, CardBattleItems *items)
 Shows both sides' values on their panels: the points of each colour, the deck, hand and discards, AP and HP.
 
void CARDGAME_startColorChange (CardBattle *battle, CardScreen *screen, s32 amount, s32 interval)
 Starts CARDGAME_stepColorValue: amount (effectStep.vars[3], below 0 to take) one at a time, one each interval frames (effectStep.vars[2])
 
void CARDGAME_returnOpponentHand (CardBattle *battle, CardBattleItems *items)
 Puts side 1's hand back on its pile and renumbers the pile's cards.
 
s32 CARDGAME_canPlayCard (CardBattle *battle, u8 *points, s32 card)
 Whether a card can be played: in CARD_PHASE_PUT_OUT a kind 0x10 card needs as many points of its colour (points), otherwise CARDGAME_canPlayCardKind.
 
s32 CARDGAME_stepColorValue (CardBattle *battle, CardScreen *screen, s32 side, s32 color)
 Moves a side's colour value (pile.points[color]) one step each effectStep.vars[2] frames towards using up effectStep.vars[3] (up to 99, down to 0), on its panel; 1 when done.
 
s32 CARDGAME_stepShakeAway (CardBattle *battle, CardScreen *screen, s32 index)
 Shakes sprite index, then shrinks it to nothing; 1 once done.
 
void CARDGAME_discardSlotCard (CardBattle *battle, CardScreen *screen, s32 side, s32 index)
 Puts the card of side's slot index on its owner's discards, on the panel.
 
s32 CARDGAME_stepDiscardSlotCard (CardBattle *battle, CardScreen *screen, s32 side, s32 index)
 Shakes side's slot index away, then CARDGAME_discardSlotCard; 1 once done.
 
s32 CARDGAME_stepSendOff (CardBattle *battle, CardScreen *screen, s32 index)
 Moves sprite index off the left of the screen; 1 once it is there.
 
void CARDGAME_returnSlotCard (CardBattle *battle, CardScreen *screen, s32 side, s32 index)
 Puts the card of side's slot index back in its owner's hand, on the panel.
 
void CARDGAME_sortCards (CardBattle *battle, s16 *list, s32 range, s32 flags)
 Sorts the cards list[from..to) (range: to << 16 | from) by their values, moving opponentDraws (flags bit 0) and effectStep.eligible (bit 1) with them.
 
void CARDGAME_shufflePile (CardBattle *battle, s32 base, s32 n)
 Shuffles the player's pile's deck[base..base + n) with 40 random swaps.
 
void CARDGAME_setCountingCardValues (CardBattle *battle, CardSlot *slot, s32 side, s32 pass)
 Sets the values of a slot that holds the pass-th card of CARDGAME_countingCards from the battle's counts (0 to 99)
 
void CARDGAME_setSlot (CardBattle *battle, s32 side, s32 card, s32 index)
 Puts the battle's card card in side's slot index, with its AP and HP and the order it came out in.
 
void CARDGAME_addCard (CardBattle *battle, s32 side, s32 card)
 CardBattle.addCard: puts card in side's next slot.
 
void CARDGAME_putOutCards (CardBattle *battle, s32 side)
 Puts side's flagged cards of its pile into its slots, up to effectStep.count of them.
 
void CARDGAME_updateCardAnims (CardBattle *battle, CardBattleItems *items)
 Starts (anim.next) and runs (anim.current) the screen's card animations: the hands', the record's and a pile's sprites scaling in or out.
 
void CARDGAME_runEffectStep (CardBattle *battle, CardScreen *screen)
 Starts the effect step battle->effectStep.next asks for (startEffectStep), then runs the current one (battle->effectStep.id)
 
s32 CARDGAME_runPhase (CardBattle *battle, CardBattleItems *items)
 Runs the battle's current phase (phase), after switching to the one asked for in nextPhase; 1 once the battle is over.
 
u8 CARDGAME_resolveCard (CardBattle *battle, CardBattleItems *items)
 Plays out the last card played (record.plays): its effect and its messages, then puts it in its side's discards (pile.discards); 1 once done.
 
s32 CARDGAME_runBattleMenu (CardBattle *battle, CardBattleItems *items)
 The battle menu (record.menuState its state): three help messages, back, and quitting after a yes/no question; 1 when closed, 2 to quit.
 
void CARDGAME_updateBattle (CardBattle *battle, CardBattleItems *items)
 The card battle task: sets up the battle and fades in, runs it (CARDGAME_runBattle), then fades out and gives the player the prize item for a win; result 2 once over.
 
s32 CARDGAME_scoreHand (CardBattle *battle, s32 side, s32 mask)
 Scores the cards in a side's slots, counting runs of the same card.
 
s32 CARDGAME_unflagSlotsOver (CardBattle *battle, s32 side, s32 value, s32 keep)
 Unflags side's slots whose hp is over value; when none is left, 1 (and the last one flagged again, unless keep)
 
s32 CARDGAME_pickLowestOpponentCard (CardBattle *battle)
 Picks the opponent's flagged card with the lowest CardImage.rank, the strongest; 1 if there is one.
 
s32 CARDGAME_getEffectField (s32 index, u32 field, s32 offset)
 One field of card effect index (CardEffect): 0 its condition, 1 its play condition, 2 its message, 3 its target, 4 its script's step at offset.
 
void CARDGAME_jumpIfLastSide (CardBattle *battle, CardScreen *screen, s32 value, s32 offset)
 The effect script jumps offset steps (effectPos) when the last card played was side value's.
 
void CARDGAME_jumpIfFewInHand (CardBattle *battle, s32 side, s32 value, s32 offset)
 The effect script jumps offset steps (effectPos) when side holds at most value cards.
 
void CARDGAME_jumpIfManyInHand (CardBattle *battle, s32 side, s32 value, s32 offset)
 The effect script jumps offset steps (effectPos) when side holds more than value cards.
 
void CARDGAME_jumpIfDeckLeft (CardBattle *battle, s32 side, s32 offset)
 The effect script jumps offset steps (effectPos) when side's deck has cards left.
 
void CARDGAME_jumpIfSlotFree (CardBattle *battle, s32 side, s32 offset)
 The effect script jumps offset steps (effectPos) when side has fewer than six cards out.
 
s32 CARDGAME_countDown (CardBattle *battle, CardScreen *screen)
 Counts effectStep.time down by the frame time; whether it ran out.
 
void CARDGAME_chooseNextDraw (CardBattle *battle, CardScreen *screen, s32 which)
 effectStep.choice becomes the card side which draws next: the player's deck top, or the opponent's first card held back (reserveStart)
 
void CARDGAME_markSlotsOfOrder (CardBattle *battle, CardScreen *screen)
 Marks (effectStep.marked) the slots whose order is the last card played's target.
 
void CARDGAME_markBestOpponentSlot (CardBattle *battle)
 Marks the opponent's slot that scoreHand rates highest, and keeps it in effectStep.choice.
 
s32 CARDGAME_stepEffectColorValue (CardBattle *battle, CardScreen *screen)
 Effect steps 30-40: CARDGAME_stepColorValue on a colour of the last card's side (30-35) or of the other side (36-40)
 
void CARDGAME_sortOpponentCards (CardBattle *battle)
 Sorts the opponent's cards by opponentDraws[].order, then swaps card effectStep.choice to reserveStart.
 
s32 CARDGAME_canPlayCardKind (CardBattle *battle, s32 index)
 Whether card index can be played in this phase by its kind: any kind but 0 in CARD_PHASE_PLAYS_AFTER, kind 2 in CARD_PHASE_PLAYS_BEFORE.
 
s32 CARDGAME_addColorCount (CardBattle *battle, CardScreen *screen, s32 side, s32 card)
 Counts a card of the colour it has on a side's panel (at most 99); 1 if it has one.
 
s32 CARDGAME_stepReturnSlotCard (CardBattle *battle, CardScreen *screen, s32 side, s32 index)
 Sends side's slot index off, then CARDGAME_returnSlotCard; 1 once done.
 
s32 CARDGAME_waitFor (CardBattle *battle, CardScreen *screen, s32 duration)
 Counts effectStep.time up by the frame time; whether it passed duration.
 
void CARDGAME_beginStep (CardBattle *battle, CardScreen *screen)
 Starts a step's first state.
 
void CARDGAME_startHandCount (CardBattle *battle, CardScreen *screen, s32 side)
 Starts a count of side's hand and discards (effectStep.vars[0] and effectStep.vars[1])
 
void CARDGAME_startColorDrain (CardBattle *battle, CardScreen *screen)
 Starts CARDGAME_drainColorValues.
 
void CARDGAME_startCloseGauge (CardBattle *battle, CardScreen *screen)
 Closes the gauge of the card before the last one.
 
s32 CARDGAME_keepLastCard (CardBattle *battle, CardScreen *screen)
 Keeps the last card played in keptCard (as card + 1) and counts it (keptCount); 1.
 
void CARDGAME_showPileCard (CardBattle *battle, CardScreen *screen, s32 side, s32 which)
 Shows side's card at effectStep.choice as sprite 17: of its hand (which 0) or its deck (1)
 
s32 CARDGAME_drawFromDeck (CardBattle *battle, CardScreen *screen, s32 side, s32 which)
 Moves the card just put in the hand into place, then takes card effectStep.choice out of the deck (takeChosenCard), or out of the used pile when which is 4 (takeChosenDiscard)
 
void CARDGAME_startDiscardCount (CardBattle *battle, CardScreen *screen, s32 side)
 Starts a count of side's discards and deck (effectStep.vars[0] and effectStep.vars[1])
 
s32 CARDGAME_returnUsedCards (CardBattle *battle, CardScreen *screen, s32 side)
 Counts the panel's discards down into its deck, then puts the side's discards back into its deck; 1 once done.
 
void CARDGAME_startDraw (CardBattle *battle, CardScreen *screen, s32 count)
 Starts drawing count cards (effectStep.count)
 
s32 CARDGAME_markDrawnCards (CardBattle *battle, CardScreen *screen, s32 side)
 Marks (effectStep.marked) the cards side draws from its deck: from its top for the player, by the round's level (round) for the computer; effectStep.flags when the deck runs out; 1.
 
void CARDGAME_drawMarkedCards (CardBattle *battle, CardScreen *screen, s32 side)
 Moves side's marked deck cards to its hand and opens its panel.
 
s32 CARDGAME_drawNewCards (CardBattle *battle, CardScreen *screen, s32 side)
 Moves the cards drawn into the hand (from effectStep.vars[4] on) into place one at a time (goToNextCard), counting their colours and taking each flagged card (effectStep.marked) out of the deck (takeMarkedCard)
 
void CARDGAME_startSlotSweep (CardBattle *battle, CardScreen *screen)
 Starts CARDGAME_stepSlotSweep.
 
s32 CARDGAME_stepSlotSweep (CardBattle *battle, CardScreen *screen, s32 which)
 Goes over the marked slots one by one, discarding their cards (which 0) or returning them to the hand (1); 1 once done.
 
void CARDGAME_markRecordHits (CardBattle *battle, CardScreen *screen, s32 side, s32 index)
 Marks (marks) the plays whose effect reaches sprite index, by their target (targetKind): a side, both, or a colour; side is not used.
 
void CARDGAME_putSlotCard (CardBattle *battle, CardScreen *screen, s32 side, s32 card)
 Puts a card in the side's next slot (owned by side 2) and shows it.
 
void CARDGAME_takeHandCard (CardBattle *battle, CardScreen *screen, s32 side)
 Takes the card the last record names out of the side's hand into its next slot and shows it.
 
s32 CARDGAME_moveSlotCard (CardBattle *battle, CardScreen *screen, s32 side)
 Moves the side's next slot card into place; 1 once it is there.
 
void CARDGAME_copySlotCard (CardBattle *battle, CardScreen *screen, s32 side)
 Copies the first marked slot card (effectStep.marked) into the side's next slot.
 
s32 CARDGAME_flipSlotCard (CardBattle *battle, CardScreen *screen, s32 side)
 Waits effectStep.time frames, then flips the side's next slot card over and moves it into place; 1 once it is there.
 
void CARDGAME_startPlayCard (CardBattle *battle, CardScreen *screen, s32 side)
 Shows the card being played as sprite 15 (opening the panels for side 0) and starts moving it to its place in the record.
 
s32 CARDGAME_stepPlayCard (CardBattle *battle, CardScreen *screen)
 Card 15 goes off and the marked slot cards turn over; it then lands in sprite 12 + CardRecord.playCount.
 
void CARDGAME_clearHands (CardBattle *battle, CardScreen *screen)
 Empties both hands, on the panels with the decks.
 
void CARDGAME_dealHands (CardBattle *battle, CardScreen *screen)
 Deals six cards from each side's deck into its hand and puts them on the table, face down.
 
s32 CARDGAME_stepStart (CardBattle *battle, CardScreen *screen)
 The start of a card battle: deals six cards to each side (dealNextCards), turns them over and counts their colours (countNextColors) (a deck with fewer than six cards shows a message instead); 1 when it ends.
 
void CARDGAME_startAttack (CardBattle *battle, CardScreen *screen, s32 side)
 Starts CARDGAME_stepAttack: side's apTotal comes off the other side's hpTotal (down to 0), counted down over its cards out.
 
s32 CARDGAME_stepAttack (CardBattle *battle, CardScreen *screen, s32 side)
 The side's slot cards go over one by one (every 27 frames) while the panels count its attack (CARD_PANEL_AP) and the other side's HP (CARD_PANEL_HP) down; 1 once done.
 
void CARDGAME_startDiscardAllSlots (CardBattle *battle, CardScreen *screen, s32 side)
 Starts CARDGAME_stepDiscardAllSlots from side's last slot.
 
s32 CARDGAME_stepDiscardAllSlots (CardBattle *battle, CardScreen *screen, s32 side)
 Discards side's slot cards from the last to the first; 1 once done.
 
s32 CARDGAME_interpolate (s32 to, s32 from, s32 duration, s32 time)
 The value going from FROM to TO in DURATION, at TIME, never past TO.
 
void CARDGAME_startSwap (CardBattle *battle, CardScreen *screen)
 Shows the kept card (keptCard) as sprite 17 for CARDGAME_stepSwap.
 
void CARDGAME_startTotals (CardBattle *battle, CardScreen *screen)
 Starts CARDGAME_stepTotals.
 
void CARDGAME_startRoundEnd (CardBattle *battle, CardScreen *screen)
 Starts CARDGAME_stepRoundEnd.
 
void CARDGAME_startMessage (CardBattle *battle, CardScreen *screen, s32 text)
 Opens message text for a step.
 
void CARDGAME_startClosePanels (CardBattle *battle, CardScreen *screen, s32 force)
 When the last card was the player's (or force): takes its play off for a while and closes the panels.
 
s32 CARDGAME_stepClosePanels (CardBattle *battle, CardScreen *screen)
 Waits for the panels to close and puts the play back; 1 once done.
 
void CARDGAME_startOpenPanels (CardBattle *battle, CardScreen *screen, s32 force)
 When the last card was the player's (or force): takes its play off for a while and opens the panels.
 
s32 CARDGAME_stepOpenPanels (CardBattle *battle, CardScreen *screen)
 Waits for the panels to open and puts the play back; 1 once done.
 
s32 CARDGAME_checkPlayCondition (CardBattle *battle, CardScreen *screen, s32 kind)
 Whether the condition kind (1-11) of the card being played holds for its side: 1 if it does.
 
void CARDGAME_startSlotEffects (CardBattle *battle, CardScreen *screen, s32 which)
 The steps CARDGAME_runEffectStep starts (CardBattle.effectStep.next) and runs (effectStep.id)
 
void CARDGAME_moveMarkedSlots (CardBattle *battle, CardScreen *screen, s32 arg2, s32 arg3)
 Starts moving the marked slots (effectStep.marked) by an offset packed as x << 16 | y.
 
s32 CARDGAME_stepSlotStats (CardBattle *battle, CardScreen *screen)
 Counts the marked slots' ap and hp up or down by one a frame (sign of effectStep.vars[0]/effectStep.vars[1], for effectStep.vars[2]/effectStep.vars[3] frames, clamped to 0..99) with their sprites; when both are over, marks the slots whose hp reached 0.
 
void CARDGAME_markTargetSlots (CardBattle *battle, CardScreen *screen)
 Marks in effectStep.marked the slots out that the last card played applies to, by its target (record.plays[].targetKind): a side, both, or a card colour.
 
s32 CARDGAME_removeMarkedSlots (CardBattle *battle, CardScreen *screen)
 Removes the slots marked in effectStep.marked: slides the cards after them left on screen, then moves their slots and sprites down and shrinks slotCount; 1 when over.
 
s32 CARDGAME_markPileCardsByColor (CardBattle *battle, CardScreen *screen, s32 side, s32 kind, s32 flags)
 Marks in effectStep.eligible the cards of a side's hand (kind 2), deck (3) or discards (4) whose colour has its bit (CARDGAME_colorFlags) in flags (kind 16 cards only with flags bit 0, the others with bit 1); 1 if any.
 
s32 CARDGAME_markSlotsByColor (CardBattle *battle, CardScreen *screen, s32 side, s32 flags)
 Marks in effectStep.eligible the slots of the sides flags picks (0x100 side's own, 0x200 the other) whose card colour has its bit (CARDGAME_colorFlags) in flags; 1 if any.
 
s32 CARDGAME_discardHand (CardBattle *battle, CardScreen *screen, s32 side)
 Counts a side's hand cards over to its discards on its panel, one every 7 frames, then moves them; 1 when done.
 
s32 CARDGAME_drainColorValues (CardBattle *battle, CardScreen *screen)
 Counts both sides' colour values (pile.points) down by one each effectStep.vars[2] frames, on the panels, until they are all 0; 1 when done.
 
s32 CARDGAME_discardPrevCard (CardBattle *battle, CardScreen *screen)
 Puts the card played before the last one (record.plays[playCount - 2]) on its side's discards once its sprite has turned; 1 when done.
 
s32 CARDGAME_discardPickedCard (CardBattle *battle, CardScreen *screen, s32 side, s32 arg3)
 Moves sprite 17 to the side's spot, then puts card effectStep.vars[4] on the side's discards and takes entry effectStep.choice out of the pile it came from (from 0: the hand, from 1: the deck after deckTop); 1 when over.
 
void CARDGAME_takeCardToHand (CardBattle *battle, CardScreen *screen, s32 side, s32 arg3)
 Adds card effectStep.choice of a side's discards (which 4) or deck to its hand.
 
s32 CARDGAME_stepSwap (CardBattle *battle, CardScreen *screen)
 Swaps the two sides' pile apTotal and hpTotal, counting the panels' ap and hp over to each other, then shows message 0x2D until cross or triangle; 1 once done.
 
void CARDGAME_showSlotTotal (CardBattle *battle, CardScreen *screen, s32 side)
 Adds up the marked slots' ap and hp (at most 99, 20 more for four or more slots) and shows them on sprite 0x11 with card effectStep.vars[4], looked for among the card list's last 100 cards.
 
s32 CARDGAME_stepSlotTotal (CardBattle *battle, CardScreen *screen, s32 side)
 Takes the marked slots' sprites away, shows card effectStep.vars[4] in window 2 for 90 frames (or until cross or triangle), then adds effectStep.vars[1] and effectStep.vars[2] to the side's pile apTotal and hpTotal, counting the panel values up; 1 once done.
 
s32 CARDGAME_stepTotals (CardBattle *battle, CardScreen *screen)
 Adds up both players' slots' ap and hp and counts the panels' ap and hp over to the totals, which become the sides' pile apTotal and hpTotal; 1 once done.
 
s32 CARDGAME_stepRoundEnd (CardBattle *battle, CardScreen *screen, s32 side)
 Takes the side's slots away one by one, then moves both sides' hands back into their decks one at a time (the panels' hand and deck) and shows window 5 until cross or triangle; 1 once done.
 
s32 CARDGAME_waitMessage (CardBattle *battle, CardScreen *screen)
 Waits for the message window to open, for cross or triangle, then for the window to close; 1 once it has.
 
s32 CARDGAME_countSlotValues (CardBattle *battle, CardScreen *screen)
 Steps each slot's shown values (its sprite's ap and hp) one unit toward the slot's ap and hp, with a sound; 1 once all are there, 2 if a slot's hp reached 0 (marked in effectStep.marked)
 
void CARDGAME_loadOpponent (CardBattle *battle, CardBattleItems *items)
 Loads the opponent's data (FILE_CARDGAME_OPPONENTS, entry arg - 1): its deck and its card order.
 
void CARDGAME_sortOpponentHand (CardBattle *battle)
 Sorts the opponent's hand by its cards' opponentPlans kind, then value.
 
void CARDGAME_findOpponentDeckLimits (CardBattle *battle, CardBattleItems *items)
 drawEnd: the first card of the opponent's deck above the round's level (round); reserveStart: the end of its deck before the cards of kind 7
 
s32 CARDGAME_stepHidePanels (CardBattle *battle, CardBattleItems *items)
 Closes the panels once; 1 once they are closed.
 
void CARDGAME_startPileCount (CardBattle *battle, CardBattleItems *items, s32 side, s32 which)
 Starts the count of side's hand, discards or deck (which 0-2)
 
void CARDGAME_layOutPile (CardBattle *battle, CardBattleItems *items, s32 side, s32 which)
 Lays out the cards of one of a side's piles (which: 0 the hand; 1 the discards; 2 the deck from deckTop) as sprites in a row.
 
void CARDGAME_layOutSlots (CardBattle *battle, CardBattleItems *items)
 Lays out the slots as sprites (0-5 player 0's, 6-11 player 1's) and each play of record.plays (12 on), marking in marks[play] the slot sprites it applies to (markPlayTargets)
 
void CARDGAME_startStepFade (CardBattle *battle, CardBattleItems *items)
 Starts the fade that fade asks for (CARDGAME_fadeColors)
 
void CARDGAME_resetSpriteFlags (CardBattle *battle)
 Sets the 15 sprites' anim.dimmed to whether anim.dimAll is 2, once it is set.
 
s32 CARDGAME_runFirstPick (CardBattle *battle, CardBattleItems *items)
 Runs step 0xA7 (CARDGAME_startFirstPick) and then keeps who goes first (firstStarter); 1 once done.
 
s32 CARDGAME_runStartStep (CardBattle *battle, CardBattleItems *items)
 Runs step 20 (CARDGAME_stepStart) and then returns its choice + 1: 1 dealt, 2 the player's deck was short, 3 the opponent's.
 
void CARDGAME_prepareTurn (CardBattle *battle, CardBattleItems *items)
 Clears record.turnState, shows the panel values and sorts the player's hand.
 
s32 CARDGAME_chooseDeck (CardBattle *battle, CardBattleItems *items)
 Chooses the player's deck: opens the three deck windows and a marker, Up/Down/Cross pick one, then loads both decks' cards; 1 once done.
 
s32 CARDGAME_playRounds (CardBattle *battle, CardBattleItems *items)
 Runs the rounds of plays (state record.turnState): each side in turn plays a card, the computer through CARDGAME_pickComputerCard; 1 once over.
 
s32 CARDGAME_runPutOut (CardBattle *battle, CardBattleItems *items)
 A battle step: each side puts out its flagged cards (putOutCards) between messages 0x9A, 0x9D and 0x9E; 1 once done.
 
s32 CARDGAME_endRound (CardBattle *battle, CardBattleItems *items)
 The end of a round: shows both sides' cards, gives the round to the higher total (pile.hpTotal) and the battle to the first side with two rounds; 1 for the next round, 2 once the battle is over.
 
void CARDGAME_removeMarkedHandCards (CardBattle *battle, CardPile *pile)
 Takes the marked cards (effectStep.marked) out of pile's hand.
 
s32 CARDGAME_setAllCountingValues (CardBattle *battle)
 Sets the values of the counting cards out, pass by pass (CARDGAME_setCountingCardValues); whether any card is out.
 
void CARDGAME_sumSlotValues (CardBattle *battle, s32 side)
 Side's apTotal and hpTotal become the sums of its slot cards' ap and hp.
 
s32 CARDGAME_findCardSet (CardBattle *battle, s32 side, s32 index)
 Finds three or more of one card (with a CardImage.comboCard) among a side's slots, by id from start: flags them in effectStep.eligible; the index after them or -1.
 
void CARDGAME_openPanelsPhase (CardBattle *battle, CardBattleItems *items)
 Opens the panels for a phase.
 
void CARDGAME_returnHandToDeck (CardPile *pile)
 Puts pile's hand back on top of its deck.
 
void CARDGAME_startNextRound (CardBattle *battle, CardBattleItems *items)
 Puts both hands back in the decks, shuffles the player's, clears the round's values and moves on to the next round (round)
 
void CARDGAME_startBattleMessage (CardBattle *battle, CardBattleItems *items)
 Starts the step of battle message prevPhase (CARDGAME_battleMessages)
 
void CARDGAME_initBattle (CardBattle *battle, CardBattleItems *items)
 Sets up a card battle: the sides' panels, no result, CARD_PHASE_FADE_IN.
 
s32 CARDGAME_stepShowPanels (CardBattle *battle, CardBattleItems *items)
 Opens the panels once; 1 once they are open.
 
s32 CARDGAME_showPlayedCard (CardBattle *battle, CardBattleItems *items)
 Shows the last card played (record.plays) in window 2 for 35 frames (Cross cuts it short), then scales its sprite away; 1 once done.
 
s32 CARDGAME_runBattle (CardBattle *battle, CardBattleItems *items)
 A frame of the card battle: the sprites' flags, the card animations, the fades, then the phase, the effect step, the card's resolution or the battle menu; 1 once it is over.
 
void CARDGAME_keepLowestSlot (CardBattle *battle, s32 side)
 Keeps the flag (effectStep.eligible) only on side's flagged slot that CARDGAME_scoreHand rates lowest.
 
s32 CARDGAME_targetFlaggedSlot (CardBattle *battle, s32 side)
 The next play targets (target) side's first flagged slot; whether there is one.
 
s32 CARDGAME_targetColor3Slot (CardBattle *battle, s32 side)
 CARDGAME_targetFlaggedSlot among side's flagged slots of colour 3.
 
s32 CARDGAME_targetColor4Slot (CardBattle *battle, s32 side)
 CARDGAME_targetFlaggedSlot among side's flagged slots of colour 4.
 
s32 CARDGAME_isSlotWithin (CardBattle *battle, s32 side, s32 index, s32 value)
 Whether side's slot index is flagged and its hp is at most value.
 
s32 CARDGAME_getCardLimit (CardBattle *battle, s32 id)
 The limit card id sets for CARDGAME_compareCards (0 for most)
 
s32 CARDGAME_getCardBonus (CardBattle *battle, s32 id)
 The bonus card id gives in CARDGAME_compareCards (0 for most)
 
s32 CARDGAME_pickComputerTarget (CardBattle *battle, CardScreen *screen, s32 id)
 The computer's target for card id: a slot picked by the card's rule; 1 once there is one.
 
s32 CARDGAME_findOpponentHandKind (CardBattle *battle, s32 kind)
 The index of the first card of the opponent's hand of opponentPlans kind (its count when none)
 
s32 CARDGAME_checkComputerCondition (CardBattle *battle, CardScreen *screen, s32 id)
 Checks the condition id (0x70 to 0x96) of a card for the computer; returns 1 if it holds.
 
s32 CARDGAME_compareCards (CardBattle *battle, s32 id1, s32 id2, s32 flip)
 Compares two cards by the rule of the current play; returns 1 if the second one wins.
 
s32 CARDGAME_pickComputerCard (CardBattle *battle, CardScreen *screen)
 Picks the computer's next card, flagging it in effectStep.marked; returns 1 if one was found.
 
s32 CARDGAME_takeFlaggedCard (CardBattle *battle, CardBattleItems *items)
 Takes the first flagged card out of the hand of side record.turnSide into the play record.plays[playCount]; returns its condition id.
 
void CARDGAME_flagTargetSlots (CardBattle *battle, CardScreen *screen)
 Flags (effectStep.marked) the slots that the current play's target kind (record.plays[playCount].targetKind) picks.
 

Variables

CardEffect CARDGAME_cardEffects []
 The functions and data the overlay's files share.
 
s16 CARDGAME_animPiles [7][2]
 the side and pile CARDGAME_updateCardAnims passes to CARDGAME_layOutPile
 
u16 CARDGAME_defaultDeck []
 the deck used when the chosen one is empty: its first 40 cards, as card ids - 1 (CardBattle.playerDeck); nothing reads the 40 after them
 
CardOffset CARDGAME_deckWindowPos [3]
 the three deck windows
 
u8 CARDGAME_turnStates []
 the next record.turnState state, by step and side
 
CardBattleMessage CARDGAME_battleMessages []
 the step and nextPhase of CARDGAME_startBattleMessage, by prevPhase
 
s32 CARDGAME_slotRowPositions [2][4]
 sprite positions, by SHIFT_PAL_SCREEN
 
CardOffset CARDGAME_panelIconPositions [2][2][2]
 CARDGAME_drawPanelIcon's icon and label positions, by SHIFT_PAL_SCREEN and side (EU)
 
s16 CARDGAME_cardWindowPositions [2][2][2]
 two positions, then the same moved for SHIFT_PAL_SCREEN
 
s16 CARDGAME_colorFlags []
 a flag bit per card colour
 
s32 CARDGAME_discardPositions [][2]
 x, y per side
 
u8 CARDGAME_slotMoves [2][6][2]
 per side, the slot moves (from, to) of CARDGAME_removeMarkedSlots
 
u8 CARDGAME_slotMoveCounts []
 per side, the entries of CARDGAME_slotMoves
 
u8 CARDGAME_markedCounts [2]
 per side, the marked slots
 
CardFadeColor CARDGAME_fadeColors []
 CARDGAME_startStepFade's fade colours and blends, by fade - 1.
 
s32 CARDGAME_recordCardPositions [][2]
 where card 15 goes, by CardRecord.playCount
 
s16 CARDGAME_countingCards []
 five card ids, minus one
 
CardOffset CARDGAME_playedCardPos [2][2]
 then the same moved for SHIFT_PAL_SCREEN
 
CardMessageWindow CARDGAME_savedScreenState
 
s16 CARDGAME_prizeItems []
 the item an opponent gives for a win (CardBattle.prize), by its CardOpponent.prize
 

Detailed Description

CARDGAME's card battle: the slots, piles, plays, effects and steps, the opponent and the rounds (effect_script.c, battle.c, battle_steps.c, round.c, play_checks.c, pile_effects.c, slot_effects.c and computer.c).

Definition in file battle.h.

Macro Definition Documentation

◆ FILE_CARDGAME_OPPONENTS

#define FILE_CARDGAME_OPPONENTS   0x7A4

The opponents of the card battles (CardOpponent)

Definition at line 15 of file battle.h.

◆ CARD_ANIM_UNDIM_ALL

#define CARD_ANIM_UNDIM_ALL   1

CardAnim.dimAll.

Definition at line 189 of file battle.h.

◆ CARD_ANIM_DIM_ALL

#define CARD_ANIM_DIM_ALL   2

Definition at line 190 of file battle.h.

◆ CARD_INFO_STEPS

#define CARD_INFO_STEPS   2

The steps CARDGAME_stepPlayCard has before its card goes off: the European and Japanese versions show the card's information first, and wait for a button.

Definition at line 297 of file battle.h.

Enumeration Type Documentation

◆ CardRun

enum CardRun

What CARDGAME_runBattle runs this frame (CardBattle.run)

Enumerator
CARD_RUN_PHASE 

the battle's phase (CARDGAME_runPhase)

CARD_RUN_STEP 

an effect step (CARDGAME_runEffectStep)

CARD_RUN_RESOLVE 

the card just played (CARDGAME_resolveCard)

CARD_RUN_MENU 

Definition at line 70 of file battle.h.

◆ CardPhase

enum CardPhase

The phases of a card battle (CardBattle.phase, CARDGAME_runPhase)

Enumerator
CARD_PHASE_NONE 

for nextPhase: no switch

CARD_PHASE_FADE_IN 
CARD_PHASE_CHOOSE_DECK 
CARD_PHASE_FIRST_PICK 

who starts

CARD_PHASE_DEAL 

six cards to each side

CARD_PHASE_PLAYS_BEFORE 

plays before the cards are put out: kind 2 cards only

CARD_PHASE_PUT_OUT 
CARD_PHASE_PLAYS_AFTER 

plays after: any kind but 0

CARD_PHASE_END_ROUND 
CARD_PHASE_NEXT_ROUND 
CARD_PHASE_MESSAGE 

Definition at line 78 of file battle.h.

◆ CardAnimId

enum CardAnimId

The animations of the cards on the table (CardBattle.anim): the slots, the plays or a pile laid out as sprites that scale in, then out.

Enumerator
CARD_ANIM_NONE 
CARD_ANIM_SHOW_SLOTS 
CARD_ANIM_HIDE_SLOTS 
CARD_ANIM_SHOW_PLAYS 
CARD_ANIM_HIDE_PLAYS 
CARD_ANIM_SHOW_HAND 

the player's piles...

CARD_ANIM_HIDE_HAND 
CARD_ANIM_SHOW_DECK 
CARD_ANIM_HIDE_DECK 
CARD_ANIM_SHOW_DISCARDS 
CARD_ANIM_HIDE_DISCARDS 
CARD_ANIM_SHOW_OPPONENT_HAND 

...and the opponent's

CARD_ANIM_HIDE_OPPONENT_HAND 
CARD_ANIM_SHOW_OPPONENT_DECK 
CARD_ANIM_HIDE_OPPONENT_DECK 
CARD_ANIM_SHOW_OPPONENT_DISCARDS 
CARD_ANIM_HIDE_OPPONENT_DISCARDS 
CARD_ANIM_LAY_OUT_HAND 

the hand laid out at once

CARD_ANIM_LAY_OUT_OPPONENT_HAND 

Definition at line 166 of file battle.h.

Function Documentation

◆ CARDGAME_createBattle()

CardBattle * CARDGAME_createBattle ( s32  arg)

Creates the card battle against opponent arg (CARDGAME_loadOpponent), with its functions, and loads its sound bank.

Definition at line 2554 of file battle.c.

Referenced by CARDGAME_updateScene().

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

◆ CARDGAME_showPanelValues()

void CARDGAME_showPanelValues ( CardBattle *  battle,
CardBattleItems *  items 
)

Shows both sides' values on their panels: the points of each colour, the deck, hand and discards, AP and HP.

Definition at line 675 of file battle.c.

Referenced by CARDGAME_prepareTurn(), CARDGAME_resolveCard(), CARDGAME_startNextRound(), and loadChosenDeck().

Here is the caller graph for this function:

◆ CARDGAME_startColorChange()

void CARDGAME_startColorChange ( CardBattle *  battle,
CardScreen *  screen,
s32  amount,
s32  interval 
)

Starts CARDGAME_stepColorValue: amount (effectStep.vars[3], below 0 to take) one at a time, one each interval frames (effectStep.vars[2])

Definition at line 54 of file pile_effects.c.

Referenced by CARDGAME_startColorDrain(), and startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_returnOpponentHand()

void CARDGAME_returnOpponentHand ( CardBattle *  battle,
CardBattleItems *  items 
)

Puts side 1's hand back on its pile and renumbers the pile's cards.

Definition at line 120 of file battle.c.

Referenced by CARDGAME_startNextRound().

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

◆ CARDGAME_canPlayCard()

s32 CARDGAME_canPlayCard ( CardBattle *  battle,
u8 *  points,
s32  card 
)

Whether a card can be played: in CARD_PHASE_PUT_OUT a kind 0x10 card needs as many points of its colour (points), otherwise CARDGAME_canPlayCardKind.

Definition at line 57 of file play_checks.c.

Referenced by CARDGAME_flagPlayableCards(), CARDGAME_pickComputerCards(), CARDGAME_startHandPick(), CARDGAME_startQuestion(), showHandAfterMenu(), and startChooseState().

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

◆ CARDGAME_stepColorValue()

s32 CARDGAME_stepColorValue ( CardBattle *  battle,
CardScreen *  screen,
s32  side,
s32  color 
)

Moves a side's colour value (pile.points[color]) one step each effectStep.vars[2] frames towards using up effectStep.vars[3] (up to 99, down to 0), on its panel; 1 when done.

< SYSTEM10: a number counts up or down

< SYSTEM10: a number counts up or down

Definition at line 61 of file pile_effects.c.

Referenced by CARDGAME_stepEffectColorValue().

Here is the caller graph for this function:

◆ CARDGAME_stepShakeAway()

s32 CARDGAME_stepShakeAway ( CardBattle *  battle,
CardScreen *  screen,
s32  index 
)

Shakes sprite index, then shrinks it to nothing; 1 once done.

Definition at line 27 of file slot_effects.c.

Referenced by CARDGAME_discardPrevCard(), and CARDGAME_stepDiscardSlotCard().

Here is the caller graph for this function:

◆ CARDGAME_discardSlotCard()

void CARDGAME_discardSlotCard ( CardBattle *  battle,
CardScreen *  screen,
s32  side,
s32  index 
)

Puts the card of side's slot index on its owner's discards, on the panel.

Definition at line 53 of file slot_effects.c.

Referenced by CARDGAME_stepDiscardSlotCard(), and CARDGAME_stepRoundEnd().

Here is the caller graph for this function:

◆ CARDGAME_stepDiscardSlotCard()

s32 CARDGAME_stepDiscardSlotCard ( CardBattle *  battle,
CardScreen *  screen,
s32  side,
s32  index 
)

Shakes side's slot index away, then CARDGAME_discardSlotCard; 1 once done.

Definition at line 69 of file slot_effects.c.

Referenced by CARDGAME_stepDiscardAllSlots(), and CARDGAME_stepSlotSweep().

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

◆ CARDGAME_stepSendOff()

s32 CARDGAME_stepSendOff ( CardBattle *  battle,
CardScreen *  screen,
s32  index 
)

Moves sprite index off the left of the screen; 1 once it is there.

Definition at line 80 of file slot_effects.c.

Referenced by CARDGAME_stepReturnSlotCard().

Here is the caller graph for this function:

◆ CARDGAME_returnSlotCard()

void CARDGAME_returnSlotCard ( CardBattle *  battle,
CardScreen *  screen,
s32  side,
s32  index 
)

Puts the card of side's slot index back in its owner's hand, on the panel.

Definition at line 103 of file slot_effects.c.

Referenced by CARDGAME_stepReturnSlotCard().

Here is the caller graph for this function:

◆ CARDGAME_sortCards()

void CARDGAME_sortCards ( CardBattle *  battle,
s16 *  list,
s32  range,
s32  flags 
)

Sorts the cards list[from..to) (range: to << 16 | from) by their values, moving opponentDraws (flags bit 0) and effectStep.eligible (bit 1) with them.

Definition at line 693 of file battle.c.

Referenced by CARDGAME_createBattle().

Here is the caller graph for this function:

◆ CARDGAME_shufflePile()

void CARDGAME_shufflePile ( CardBattle *  battle,
s32  base,
s32  n 
)

Shuffles the player's pile's deck[base..base + n) with 40 random swaps.

Definition at line 730 of file battle.c.

Referenced by CARDGAME_createBattle().

Here is the caller graph for this function:

◆ CARDGAME_setCountingCardValues()

void CARDGAME_setCountingCardValues ( CardBattle *  battle,
CardSlot *  slot,
s32  side,
s32  pass 
)

Sets the values of a slot that holds the pass-th card of CARDGAME_countingCards from the battle's counts (0 to 99)

Definition at line 1398 of file battle.c.

Referenced by CARDGAME_setAllCountingValues(), and CARDGAME_takeHandCard().

Here is the caller graph for this function:

◆ CARDGAME_setSlot()

void CARDGAME_setSlot ( CardBattle *  battle,
s32  side,
s32  card,
s32  index 
)

Puts the battle's card card in side's slot index, with its AP and HP and the order it came out in.

Definition at line 1359 of file battle.c.

Referenced by CARDGAME_addCard().

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

◆ CARDGAME_addCard()

void CARDGAME_addCard ( CardBattle *  battle,
s32  side,
s32  card 
)

CardBattle.addCard: puts card in side's next slot.

Definition at line 1376 of file battle.c.

Referenced by CARDGAME_createBattle(), and CARDGAME_putOutCards().

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

◆ CARDGAME_putOutCards()

void CARDGAME_putOutCards ( CardBattle *  battle,
s32  side 
)

Puts side's flagged cards of its pile into its slots, up to effectStep.count of them.

Definition at line 1383 of file battle.c.

Referenced by CARDGAME_createBattle().

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

◆ CARDGAME_updateCardAnims()

void CARDGAME_updateCardAnims ( CardBattle *  battle,
CardBattleItems *  items 
)

Starts (anim.next) and runs (anim.current) the screen's card animations: the hands', the record's and a pile's sprites scaling in or out.

Definition at line 553 of file battle.c.

Referenced by CARDGAME_runBattle().

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

◆ CARDGAME_runEffectStep()

void CARDGAME_runEffectStep ( CardBattle *  battle,
CardScreen *  screen 
)

Starts the effect step battle->effectStep.next asks for (startEffectStep), then runs the current one (battle->effectStep.id)

Definition at line 676 of file effect_script.c.

Referenced by CARDGAME_runBattle().

Here is the caller graph for this function:

◆ CARDGAME_runPhase()

s32 CARDGAME_runPhase ( CardBattle *  battle,
CardBattleItems *  items 
)

Runs the battle's current phase (phase), after switching to the one asked for in nextPhase; 1 once the battle is over.

Definition at line 1941 of file battle.c.

Referenced by CARDGAME_runBattle().

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

◆ CARDGAME_resolveCard()

u8 CARDGAME_resolveCard ( CardBattle *  battle,
CardBattleItems *  items 
)

Plays out the last card played (record.plays): its effect and its messages, then puts it in its side's discards (pile.discards); 1 once done.

Definition at line 2182 of file battle.c.

Referenced by CARDGAME_runBattle().

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

◆ CARDGAME_runBattleMenu()

s32 CARDGAME_runBattleMenu ( CardBattle *  battle,
CardBattleItems *  items 
)

The battle menu (record.menuState its state): three help messages, back, and quitting after a yes/no question; 1 when closed, 2 to quit.

Definition at line 2372 of file battle.c.

Referenced by CARDGAME_runBattle().

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

◆ CARDGAME_updateBattle()

void CARDGAME_updateBattle ( CardBattle *  battle,
CardBattleItems *  items 
)

The card battle task: sets up the battle and fades in, runs it (CARDGAME_runBattle), then fades out and gives the player the prize item for a win; result 2 once over.

< CBTLMAIN: the card battles

< W_JINGLE: a battle won

< CBTLMAIN: the card battles

Definition at line 2484 of file battle.c.

Referenced by CARDGAME_createBattle().

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

◆ CARDGAME_scoreHand()

s32 CARDGAME_scoreHand ( CardBattle *  battle,
s32  side,
s32  mask 
)

Scores the cards in a side's slots, counting runs of the same card.

Definition at line 143 of file computer.c.

Referenced by CARDGAME_createBattle(), CARDGAME_keepLowestSlot(), and CARDGAME_pickComputerCard().

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

◆ CARDGAME_unflagSlotsOver()

s32 CARDGAME_unflagSlotsOver ( CardBattle *  battle,
s32  side,
s32  value,
s32  keep 
)

Unflags side's slots whose hp is over value; when none is left, 1 (and the last one flagged again, unless keep)

Definition at line 348 of file computer.c.

Referenced by CARDGAME_compareCards(), and CARDGAME_pickComputerTarget().

Here is the caller graph for this function:

◆ CARDGAME_pickLowestOpponentCard()

s32 CARDGAME_pickLowestOpponentCard ( CardBattle *  battle)

Picks the opponent's flagged card with the lowest CardImage.rank, the strongest; 1 if there is one.

Definition at line 386 of file computer.c.

Referenced by CARDGAME_pickComputerTarget().

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

◆ CARDGAME_getEffectField()

s32 CARDGAME_getEffectField ( s32  index,
u32  field,
s32  offset 
)

One field of card effect index (CardEffect): 0 its condition, 1 its play condition, 2 its message, 3 its target, 4 its script's step at offset.

Definition at line 19 of file effect_script.c.

Referenced by CARDGAME_pickComputerCard(), CARDGAME_takeFlaggedCard(), checkPlayedCard(), and runCardEffects().

Here is the caller graph for this function:

◆ CARDGAME_jumpIfLastSide()

void CARDGAME_jumpIfLastSide ( CardBattle *  battle,
CardScreen *  screen,
s32  value,
s32  offset 
)

The effect script jumps offset steps (effectPos) when the last card played was side value's.

Definition at line 43 of file effect_script.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_jumpIfFewInHand()

void CARDGAME_jumpIfFewInHand ( CardBattle *  battle,
s32  side,
s32  value,
s32  offset 
)

The effect script jumps offset steps (effectPos) when side holds at most value cards.

Definition at line 50 of file effect_script.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_jumpIfManyInHand()

void CARDGAME_jumpIfManyInHand ( CardBattle *  battle,
s32  side,
s32  value,
s32  offset 
)

The effect script jumps offset steps (effectPos) when side holds more than value cards.

Definition at line 57 of file effect_script.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_jumpIfDeckLeft()

void CARDGAME_jumpIfDeckLeft ( CardBattle *  battle,
s32  side,
s32  offset 
)

The effect script jumps offset steps (effectPos) when side's deck has cards left.

Definition at line 64 of file effect_script.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_jumpIfSlotFree()

void CARDGAME_jumpIfSlotFree ( CardBattle *  battle,
s32  side,
s32  offset 
)

The effect script jumps offset steps (effectPos) when side has fewer than six cards out.

Definition at line 71 of file effect_script.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_countDown()

s32 CARDGAME_countDown ( CardBattle *  battle,
CardScreen *  screen 
)

Counts effectStep.time down by the frame time; whether it ran out.

Definition at line 78 of file effect_script.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_chooseNextDraw()

void CARDGAME_chooseNextDraw ( CardBattle *  battle,
CardScreen *  screen,
s32  which 
)

effectStep.choice becomes the card side which draws next: the player's deck top, or the opponent's first card held back (reserveStart)

Definition at line 85 of file effect_script.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_markSlotsOfOrder()

void CARDGAME_markSlotsOfOrder ( CardBattle *  battle,
CardScreen *  screen 
)

Marks (effectStep.marked) the slots whose order is the last card played's target.

Definition at line 94 of file effect_script.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_markBestOpponentSlot()

void CARDGAME_markBestOpponentSlot ( CardBattle *  battle)

Marks the opponent's slot that scoreHand rates highest, and keeps it in effectStep.choice.

Definition at line 119 of file effect_script.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_stepEffectColorValue()

s32 CARDGAME_stepEffectColorValue ( CardBattle *  battle,
CardScreen *  screen 
)

Effect steps 30-40: CARDGAME_stepColorValue on a colour of the last card's side (30-35) or of the other side (36-40)

Definition at line 142 of file effect_script.c.

Referenced by CARDGAME_runEffectStep().

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

◆ CARDGAME_sortOpponentCards()

void CARDGAME_sortOpponentCards ( CardBattle *  battle)

Sorts the opponent's cards by opponentDraws[].order, then swaps card effectStep.choice to reserveStart.

Definition at line 7 of file play_checks.c.

Referenced by takePickedCard().

Here is the caller graph for this function:

◆ CARDGAME_canPlayCardKind()

s32 CARDGAME_canPlayCardKind ( CardBattle *  battle,
s32  index 
)

Whether card index can be played in this phase by its kind: any kind but 0 in CARD_PHASE_PLAYS_AFTER, kind 2 in CARD_PHASE_PLAYS_BEFORE.

Definition at line 39 of file play_checks.c.

Referenced by CARDGAME_canPlayCard(), and CARDGAME_pickComputerCard().

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

◆ CARDGAME_addColorCount()

s32 CARDGAME_addColorCount ( CardBattle *  battle,
CardScreen *  screen,
s32  side,
s32  card 
)

Counts a card of the colour it has on a side's panel (at most 99); 1 if it has one.

Definition at line 7 of file slot_effects.c.

Referenced by countNextColors().

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

◆ CARDGAME_stepReturnSlotCard()

s32 CARDGAME_stepReturnSlotCard ( CardBattle *  battle,
CardScreen *  screen,
s32  side,
s32  index 
)

Sends side's slot index off, then CARDGAME_returnSlotCard; 1 once done.

Definition at line 119 of file slot_effects.c.

Referenced by CARDGAME_stepSlotSweep().

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

◆ CARDGAME_waitFor()

s32 CARDGAME_waitFor ( CardBattle *  battle,
CardScreen *  screen,
s32  duration 
)

Counts effectStep.time up by the frame time; whether it passed duration.

Definition at line 163 of file slot_effects.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_beginStep()

void CARDGAME_beginStep ( CardBattle *  battle,
CardScreen *  screen 
)

Starts a step's first state.

Definition at line 370 of file slot_effects.c.

Referenced by startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_startHandCount()

void CARDGAME_startHandCount ( CardBattle *  battle,
CardScreen *  screen,
s32  side 
)

Starts a count of side's hand and discards (effectStep.vars[0] and effectStep.vars[1])

Definition at line 7 of file pile_effects.c.

Referenced by startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_startColorDrain()

void CARDGAME_startColorDrain ( CardBattle *  battle,
CardScreen *  screen 
)

Starts CARDGAME_drainColorValues.

Definition at line 113 of file pile_effects.c.

Referenced by startEffectStep().

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

◆ CARDGAME_startCloseGauge()

void CARDGAME_startCloseGauge ( CardBattle *  battle,
CardScreen *  screen 
)

Closes the gauge of the card before the last one.

Definition at line 178 of file pile_effects.c.

Referenced by startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_keepLastCard()

s32 CARDGAME_keepLastCard ( CardBattle *  battle,
CardScreen *  screen 
)

Keeps the last card played in keptCard (as card + 1) and counts it (keptCount); 1.

Definition at line 225 of file pile_effects.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_showPileCard()

void CARDGAME_showPileCard ( CardBattle *  battle,
CardScreen *  screen,
s32  side,
s32  which 
)

Shows side's card at effectStep.choice as sprite 17: of its hand (which 0) or its deck (1)

Definition at line 235 of file pile_effects.c.

Referenced by startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_drawFromDeck()

s32 CARDGAME_drawFromDeck ( CardBattle *  battle,
CardScreen *  screen,
s32  side,
s32  which 
)

Moves the card just put in the hand into place, then takes card effectStep.choice out of the deck (takeChosenCard), or out of the used pile when which is 4 (takeChosenDiscard)

Definition at line 432 of file pile_effects.c.

Referenced by CARDGAME_runEffectStep().

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

◆ CARDGAME_startDiscardCount()

void CARDGAME_startDiscardCount ( CardBattle *  battle,
CardScreen *  screen,
s32  side 
)

Starts a count of side's discards and deck (effectStep.vars[0] and effectStep.vars[1])

Definition at line 528 of file pile_effects.c.

Referenced by startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_returnUsedCards()

s32 CARDGAME_returnUsedCards ( CardBattle *  battle,
CardScreen *  screen,
s32  side 
)

Counts the panel's discards down into its deck, then puts the side's discards back into its deck; 1 once done.

Definition at line 538 of file pile_effects.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_startDraw()

void CARDGAME_startDraw ( CardBattle *  battle,
CardScreen *  screen,
s32  count 
)

Starts drawing count cards (effectStep.count)

Definition at line 604 of file pile_effects.c.

Referenced by startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_markDrawnCards()

s32 CARDGAME_markDrawnCards ( CardBattle *  battle,
CardScreen *  screen,
s32  side 
)

Marks (effectStep.marked) the cards side draws from its deck: from its top for the player, by the round's level (round) for the computer; effectStep.flags when the deck runs out; 1.

Definition at line 617 of file pile_effects.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_drawMarkedCards()

void CARDGAME_drawMarkedCards ( CardBattle *  battle,
CardScreen *  screen,
s32  side 
)

Moves side's marked deck cards to its hand and opens its panel.

Definition at line 657 of file pile_effects.c.

Referenced by startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_drawNewCards()

s32 CARDGAME_drawNewCards ( CardBattle *  battle,
CardScreen *  screen,
s32  side 
)

Moves the cards drawn into the hand (from effectStep.vars[4] on) into place one at a time (goToNextCard), counting their colours and taking each flagged card (effectStep.marked) out of the deck (takeMarkedCard)

Definition at line 778 of file pile_effects.c.

Referenced by CARDGAME_runEffectStep().

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

◆ CARDGAME_startSlotSweep()

void CARDGAME_startSlotSweep ( CardBattle *  battle,
CardScreen *  screen 
)

Starts CARDGAME_stepSlotSweep.

Definition at line 9 of file round.c.

Referenced by startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_stepSlotSweep()

s32 CARDGAME_stepSlotSweep ( CardBattle *  battle,
CardScreen *  screen,
s32  which 
)

Goes over the marked slots one by one, discarding their cards (which 0) or returning them to the hand (1); 1 once done.

Definition at line 16 of file round.c.

Referenced by CARDGAME_runEffectStep().

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

◆ CARDGAME_markRecordHits()

void CARDGAME_markRecordHits ( CardBattle *  battle,
CardScreen *  screen,
s32  side,
s32  index 
)

Marks (marks) the plays whose effect reaches sprite index, by their target (targetKind): a side, both, or a colour; side is not used.

Definition at line 60 of file round.c.

Referenced by CARDGAME_copySlotCard(), CARDGAME_putSlotCard(), and CARDGAME_takeHandCard().

Here is the caller graph for this function:

◆ CARDGAME_putSlotCard()

void CARDGAME_putSlotCard ( CardBattle *  battle,
CardScreen *  screen,
s32  side,
s32  card 
)

Puts a card in the side's next slot (owned by side 2) and shows it.

Definition at line 120 of file round.c.

Referenced by startEffectStep().

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

◆ CARDGAME_takeHandCard()

void CARDGAME_takeHandCard ( CardBattle *  battle,
CardScreen *  screen,
s32  side 
)

Takes the card the last record names out of the side's hand into its next slot and shows it.

Definition at line 151 of file round.c.

Referenced by startEffectStep().

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

◆ CARDGAME_moveSlotCard()

s32 CARDGAME_moveSlotCard ( CardBattle *  battle,
CardScreen *  screen,
s32  side 
)

Moves the side's next slot card into place; 1 once it is there.

Definition at line 188 of file round.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_copySlotCard()

void CARDGAME_copySlotCard ( CardBattle *  battle,
CardScreen *  screen,
s32  side 
)

Copies the first marked slot card (effectStep.marked) into the side's next slot.

Definition at line 245 of file round.c.

Referenced by startEffectStep().

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

◆ CARDGAME_flipSlotCard()

s32 CARDGAME_flipSlotCard ( CardBattle *  battle,
CardScreen *  screen,
s32  side 
)

Waits effectStep.time frames, then flips the side's next slot card over and moves it into place; 1 once it is there.

Definition at line 293 of file round.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_startPlayCard()

void CARDGAME_startPlayCard ( CardBattle *  battle,
CardScreen *  screen,
s32  side 
)

Shows the card being played as sprite 15 (opening the panels for side 0) and starts moving it to its place in the record.

Definition at line 358 of file round.c.

Referenced by startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_stepPlayCard()

s32 CARDGAME_stepPlayCard ( CardBattle *  battle,
CardScreen *  screen 
)

Card 15 goes off and the marked slot cards turn over; it then lands in sprite 12 + CardRecord.playCount.

1 once done

Definition at line 408 of file round.c.

Referenced by CARDGAME_runEffectStep().

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

◆ CARDGAME_clearHands()

void CARDGAME_clearHands ( CardBattle *  battle,
CardScreen *  screen 
)

Empties both hands, on the panels with the decks.

Definition at line 524 of file round.c.

Referenced by startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_dealHands()

void CARDGAME_dealHands ( CardBattle *  battle,
CardScreen *  screen 
)

Deals six cards from each side's deck into its hand and puts them on the table, face down.

Definition at line 537 of file round.c.

Referenced by startDealState().

Here is the caller graph for this function:

◆ CARDGAME_stepStart()

s32 CARDGAME_stepStart ( CardBattle *  battle,
CardScreen *  screen 
)

The start of a card battle: deals six cards to each side (dealNextCards), turns them over and counts their colours (countNextColors) (a deck with fewer than six cards shows a message instead); 1 when it ends.

Definition at line 670 of file round.c.

Referenced by CARDGAME_runEffectStep().

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

◆ CARDGAME_startAttack()

void CARDGAME_startAttack ( CardBattle *  battle,
CardScreen *  screen,
s32  side 
)

Starts CARDGAME_stepAttack: side's apTotal comes off the other side's hpTotal (down to 0), counted down over its cards out.

Definition at line 781 of file round.c.

Referenced by startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_stepAttack()

s32 CARDGAME_stepAttack ( CardBattle *  battle,
CardScreen *  screen,
s32  side 
)

The side's slot cards go over one by one (every 27 frames) while the panels count its attack (CARD_PANEL_AP) and the other side's HP (CARD_PANEL_HP) down; 1 once done.

Definition at line 804 of file round.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_startDiscardAllSlots()

void CARDGAME_startDiscardAllSlots ( CardBattle *  battle,
CardScreen *  screen,
s32  side 
)

Starts CARDGAME_stepDiscardAllSlots from side's last slot.

Definition at line 871 of file round.c.

Referenced by startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_stepDiscardAllSlots()

s32 CARDGAME_stepDiscardAllSlots ( CardBattle *  battle,
CardScreen *  screen,
s32  side 
)

Discards side's slot cards from the last to the first; 1 once done.

Definition at line 878 of file round.c.

Referenced by CARDGAME_runEffectStep().

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

◆ CARDGAME_interpolate()

s32 CARDGAME_interpolate ( s32  to,
s32  from,
s32  duration,
s32  time 
)

The value going from FROM to TO in DURATION, at TIME, never past TO.

Definition at line 899 of file round.c.

Referenced by CARDGAME_stepSlotTotal(), CARDGAME_stepSwap(), and CARDGAME_stepTotals().

Here is the caller graph for this function:

◆ CARDGAME_startSwap()

void CARDGAME_startSwap ( CardBattle *  battle,
CardScreen *  screen 
)

Shows the kept card (keptCard) as sprite 17 for CARDGAME_stepSwap.

Definition at line 919 of file round.c.

Referenced by startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_startTotals()

void CARDGAME_startTotals ( CardBattle *  battle,
CardScreen *  screen 
)

Starts CARDGAME_stepTotals.

Definition at line 1163 of file round.c.

Referenced by startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_startRoundEnd()

void CARDGAME_startRoundEnd ( CardBattle *  battle,
CardScreen *  screen 
)

Starts CARDGAME_stepRoundEnd.

Definition at line 1226 of file round.c.

Referenced by startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_startMessage()

void CARDGAME_startMessage ( CardBattle *  battle,
CardScreen *  screen,
s32  text 
)

Opens message text for a step.

Definition at line 8 of file battle_steps.c.

Referenced by startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_startClosePanels()

void CARDGAME_startClosePanels ( CardBattle *  battle,
CardScreen *  screen,
s32  force 
)

When the last card was the player's (or force): takes its play off for a while and closes the panels.

Definition at line 44 of file battle_steps.c.

Referenced by startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_stepClosePanels()

s32 CARDGAME_stepClosePanels ( CardBattle *  battle,
CardScreen *  screen 
)

Waits for the panels to close and puts the play back; 1 once done.

Definition at line 56 of file battle_steps.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_startOpenPanels()

void CARDGAME_startOpenPanels ( CardBattle *  battle,
CardScreen *  screen,
s32  force 
)

When the last card was the player's (or force): takes its play off for a while and opens the panels.

Definition at line 75 of file battle_steps.c.

Referenced by startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_stepOpenPanels()

s32 CARDGAME_stepOpenPanels ( CardBattle *  battle,
CardScreen *  screen 
)

Waits for the panels to open and puts the play back; 1 once done.

Definition at line 88 of file battle_steps.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_checkPlayCondition()

s32 CARDGAME_checkPlayCondition ( CardBattle *  battle,
CardScreen *  screen,
s32  kind 
)

Whether the condition kind (1-11) of the card being played holds for its side: 1 if it does.

Definition at line 167 of file battle_steps.c.

Referenced by checkPlayedCard().

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

◆ CARDGAME_startSlotEffects()

void CARDGAME_startSlotEffects ( CardBattle *  battle,
CardScreen *  screen,
s32  which 
)

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

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

Definition at line 131 of file slot_effects.c.

Referenced by startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_moveMarkedSlots()

void CARDGAME_moveMarkedSlots ( CardBattle *  battle,
CardScreen *  screen,
s32  arg2,
s32  arg3 
)

Starts moving the marked slots (effectStep.marked) by an offset packed as x << 16 | y.

Definition at line 169 of file slot_effects.c.

Referenced by startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_stepSlotStats()

s32 CARDGAME_stepSlotStats ( CardBattle *  battle,
CardScreen *  screen 
)

Counts the marked slots' ap and hp up or down by one a frame (sign of effectStep.vars[0]/effectStep.vars[1], for effectStep.vars[2]/effectStep.vars[3] frames, clamped to 0..99) with their sprites; when both are over, marks the slots whose hp reached 0.

Definition at line 216 of file slot_effects.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_markTargetSlots()

void CARDGAME_markTargetSlots ( CardBattle *  battle,
CardScreen *  screen 
)

Marks in effectStep.marked the slots out that the last card played applies to, by its target (record.plays[].targetKind): a side, both, or a card colour.

Definition at line 297 of file slot_effects.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_removeMarkedSlots()

s32 CARDGAME_removeMarkedSlots ( CardBattle *  battle,
CardScreen *  screen 
)

Removes the slots marked in effectStep.marked: slides the cards after them left on screen, then moves their slots and sprites down and shrinks slotCount; 1 when over.

Definition at line 375 of file slot_effects.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_markPileCardsByColor()

s32 CARDGAME_markPileCardsByColor ( CardBattle *  battle,
CardScreen *  screen,
s32  side,
s32  kind,
s32  flags 
)

Marks in effectStep.eligible the cards of a side's hand (kind 2), deck (3) or discards (4) whose colour has its bit (CARDGAME_colorFlags) in flags (kind 16 cards only with flags bit 0, the others with bit 1); 1 if any.

Definition at line 478 of file slot_effects.c.

Referenced by CARDGAME_checkComputerCondition(), and CARDGAME_runEffectStep().

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

◆ CARDGAME_markSlotsByColor()

s32 CARDGAME_markSlotsByColor ( CardBattle *  battle,
CardScreen *  screen,
s32  side,
s32  flags 
)

Marks in effectStep.eligible the slots of the sides flags picks (0x100 side's own, 0x200 the other) whose card colour has its bit (CARDGAME_colorFlags) in flags; 1 if any.

Definition at line 537 of file slot_effects.c.

Referenced by CARDGAME_checkComputerCondition(), and CARDGAME_runEffectStep().

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

◆ CARDGAME_discardHand()

s32 CARDGAME_discardHand ( CardBattle *  battle,
CardScreen *  screen,
s32  side 
)

Counts a side's hand cards over to its discards on its panel, one every 7 frames, then moves them; 1 when done.

Definition at line 16 of file pile_effects.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_drainColorValues()

s32 CARDGAME_drainColorValues ( CardBattle *  battle,
CardScreen *  screen 
)

Counts both sides' colour values (pile.points) down by one each effectStep.vars[2] frames, on the panels, until they are all 0; 1 when done.

Definition at line 119 of file pile_effects.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_discardPrevCard()

s32 CARDGAME_discardPrevCard ( CardBattle *  battle,
CardScreen *  screen 
)

Puts the card played before the last one (record.plays[playCount - 2]) on its side's discards once its sprite has turned; 1 when done.

Definition at line 185 of file pile_effects.c.

Referenced by CARDGAME_runEffectStep().

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

◆ CARDGAME_discardPickedCard()

s32 CARDGAME_discardPickedCard ( CardBattle *  battle,
CardScreen *  screen,
s32  side,
s32  arg3 
)

Moves sprite 17 to the side's spot, then puts card effectStep.vars[4] on the side's discards and takes entry effectStep.choice out of the pile it came from (from 0: the hand, from 1: the deck after deckTop); 1 when over.

Definition at line 258 of file pile_effects.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_takeCardToHand()

void CARDGAME_takeCardToHand ( CardBattle *  battle,
CardScreen *  screen,
s32  side,
s32  arg3 
)

Adds card effectStep.choice of a side's discards (which 4) or deck to its hand.

Definition at line 329 of file pile_effects.c.

Referenced by startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_stepSwap()

s32 CARDGAME_stepSwap ( CardBattle *  battle,
CardScreen *  screen 
)

Swaps the two sides' pile apTotal and hpTotal, counting the panels' ap and hp over to each other, then shows message 0x2D until cross or triangle; 1 once done.

Definition at line 928 of file round.c.

Referenced by CARDGAME_runEffectStep().

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

◆ CARDGAME_showSlotTotal()

void CARDGAME_showSlotTotal ( CardBattle *  battle,
CardScreen *  screen,
s32  side 
)

Adds up the marked slots' ap and hp (at most 99, 20 more for four or more slots) and shows them on sprite 0x11 with card effectStep.vars[4], looked for among the card list's last 100 cards.

Definition at line 998 of file round.c.

Referenced by startEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_stepSlotTotal()

s32 CARDGAME_stepSlotTotal ( CardBattle *  battle,
CardScreen *  screen,
s32  side 
)

Takes the marked slots' sprites away, shows card effectStep.vars[4] in window 2 for 90 frames (or until cross or triangle), then adds effectStep.vars[1] and effectStep.vars[2] to the side's pile apTotal and hpTotal, counting the panel values up; 1 once done.

Definition at line 1062 of file round.c.

Referenced by CARDGAME_runEffectStep().

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

◆ CARDGAME_stepTotals()

s32 CARDGAME_stepTotals ( CardBattle *  battle,
CardScreen *  screen 
)

Adds up both players' slots' ap and hp and counts the panels' ap and hp over to the totals, which become the sides' pile apTotal and hpTotal; 1 once done.

< SYSTEM10: a number counts up or down

Definition at line 1173 of file round.c.

Referenced by CARDGAME_runEffectStep().

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

◆ CARDGAME_stepRoundEnd()

s32 CARDGAME_stepRoundEnd ( CardBattle *  battle,
CardScreen *  screen,
s32  side 
)

Takes the side's slots away one by one, then moves both sides' hands back into their decks one at a time (the panels' hand and deck) and shows window 5 until cross or triangle; 1 once done.

< SYSTEM10: a number counts up or down

Definition at line 1237 of file round.c.

Referenced by CARDGAME_runEffectStep().

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

◆ CARDGAME_waitMessage()

s32 CARDGAME_waitMessage ( CardBattle *  battle,
CardScreen *  screen 
)

Waits for the message window to open, for cross or triangle, then for the window to close; 1 once it has.

Definition at line 15 of file battle_steps.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_countSlotValues()

s32 CARDGAME_countSlotValues ( CardBattle *  battle,
CardScreen *  screen 
)

Steps each slot's shown values (its sprite's ap and hp) one unit toward the slot's ap and hp, with a sound; 1 once all are there, 2 if a slot's hp reached 0 (marked in effectStep.marked)

< SYSTEM10: a number counts up or down

Definition at line 106 of file battle_steps.c.

Referenced by CARDGAME_runEffectStep().

Here is the caller graph for this function:

◆ CARDGAME_loadOpponent()

void CARDGAME_loadOpponent ( CardBattle *  battle,
CardBattleItems *  items 
)

Loads the opponent's data (FILE_CARDGAME_OPPONENTS, entry arg - 1): its deck and its card order.

Definition at line 7 of file battle.c.

Referenced by CARDGAME_updateBattle().

Here is the caller graph for this function:

◆ CARDGAME_sortOpponentHand()

void CARDGAME_sortOpponentHand ( CardBattle *  battle)

Sorts the opponent's hand by its cards' opponentPlans kind, then value.

Definition at line 71 of file battle.c.

Referenced by CARDGAME_runPutOut(), and playComputerTurn().

Here is the caller graph for this function:

◆ CARDGAME_findOpponentDeckLimits()

void CARDGAME_findOpponentDeckLimits ( CardBattle *  battle,
CardBattleItems *  items 
)

drawEnd: the first card of the opponent's deck above the round's level (round); reserveStart: the end of its deck before the cards of kind 7

Definition at line 102 of file battle.c.

Referenced by CARDGAME_startNextRound(), and loadChosenDeck().

Here is the caller graph for this function:

◆ CARDGAME_stepHidePanels()

s32 CARDGAME_stepHidePanels ( CardBattle *  battle,
CardBattleItems *  items 
)

Closes the panels once; 1 once they are closed.

Definition at line 213 of file battle.c.

Referenced by CARDGAME_endRound(), and CARDGAME_playRounds().

Here is the caller graph for this function:

◆ CARDGAME_startPileCount()

void CARDGAME_startPileCount ( CardBattle *  battle,
CardBattleItems *  items,
s32  side,
s32  which 
)

Starts the count of side's hand, discards or deck (which 0-2)

Definition at line 228 of file battle.c.

Referenced by CARDGAME_updateCardAnims().

Here is the caller graph for this function:

◆ CARDGAME_layOutPile()

void CARDGAME_layOutPile ( CardBattle *  battle,
CardBattleItems *  items,
s32  side,
s32  which 
)

Lays out the cards of one of a side's piles (which: 0 the hand; 1 the discards; 2 the deck from deckTop) as sprites in a row.

Definition at line 156 of file battle.c.

Referenced by CARDGAME_updateCardAnims().

Here is the caller graph for this function:

◆ CARDGAME_layOutSlots()

void CARDGAME_layOutSlots ( CardBattle *  battle,
CardBattleItems *  items 
)

Lays out the slots as sprites (0-5 player 0's, 6-11 player 1's) and each play of record.plays (12 on), marking in marks[play] the slot sprites it applies to (markPlayTargets)

Definition at line 351 of file battle.c.

Referenced by CARDGAME_updateCardAnims().

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

◆ CARDGAME_startStepFade()

void CARDGAME_startStepFade ( CardBattle *  battle,
CardBattleItems *  items 
)

Starts the fade that fade asks for (CARDGAME_fadeColors)

Definition at line 404 of file battle.c.

Referenced by CARDGAME_runBattle().

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

◆ CARDGAME_resetSpriteFlags()

void CARDGAME_resetSpriteFlags ( CardBattle *  battle)

Sets the 15 sprites' anim.dimmed to whether anim.dimAll is 2, once it is set.

Definition at line 425 of file battle.c.

Referenced by CARDGAME_runBattle().

Here is the caller graph for this function:

◆ CARDGAME_runFirstPick()

s32 CARDGAME_runFirstPick ( CardBattle *  battle,
CardBattleItems *  items 
)

Runs step 0xA7 (CARDGAME_startFirstPick) and then keeps who goes first (firstStarter); 1 once done.

Definition at line 927 of file battle.c.

Referenced by CARDGAME_runPhase().

Here is the caller graph for this function:

◆ CARDGAME_runStartStep()

s32 CARDGAME_runStartStep ( CardBattle *  battle,
CardBattleItems *  items 
)

Runs step 20 (CARDGAME_stepStart) and then returns its choice + 1: 1 dealt, 2 the player's deck was short, 3 the opponent's.

Definition at line 947 of file battle.c.

Referenced by CARDGAME_runPhase().

Here is the caller graph for this function:

◆ CARDGAME_prepareTurn()

void CARDGAME_prepareTurn ( CardBattle *  battle,
CardBattleItems *  items 
)

Clears record.turnState, shows the panel values and sorts the player's hand.

Definition at line 1336 of file battle.c.

Referenced by CARDGAME_runPhase().

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

◆ CARDGAME_chooseDeck()

s32 CARDGAME_chooseDeck ( CardBattle *  battle,
CardBattleItems *  items 
)

Chooses the player's deck: opens the three deck windows and a marker, Up/Down/Cross pick one, then loads both decks' cards; 1 once done.

< SYSTEM03

Definition at line 830 of file battle.c.

Referenced by CARDGAME_runPhase().

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

◆ CARDGAME_playRounds()

s32 CARDGAME_playRounds ( CardBattle *  battle,
CardBattleItems *  items 
)

Runs the rounds of plays (state record.turnState): each side in turn plays a card, the computer through CARDGAME_pickComputerCard; 1 once over.

Definition at line 1230 of file battle.c.

Referenced by CARDGAME_runPhase().

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

◆ CARDGAME_runPutOut()

s32 CARDGAME_runPutOut ( CardBattle *  battle,
CardBattleItems *  items 
)

A battle step: each side puts out its flagged cards (putOutCards) between messages 0x9A, 0x9D and 0x9E; 1 once done.

Definition at line 1475 of file battle.c.

Referenced by CARDGAME_runPhase().

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

◆ CARDGAME_endRound()

s32 CARDGAME_endRound ( CardBattle *  battle,
CardBattleItems *  items 
)

The end of a round: shows both sides' cards, gives the round to the higher total (pile.hpTotal) and the battle to the first side with two rounds; 1 for the next round, 2 once the battle is over.

Definition at line 1774 of file battle.c.

Referenced by CARDGAME_runPhase().

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

◆ CARDGAME_removeMarkedHandCards()

void CARDGAME_removeMarkedHandCards ( CardBattle *  battle,
CardPile *  pile 
)

Takes the marked cards (effectStep.marked) out of pile's hand.

Definition at line 1343 of file battle.c.

Referenced by CARDGAME_putOutCards().

Here is the caller graph for this function:

◆ CARDGAME_setAllCountingValues()

s32 CARDGAME_setAllCountingValues ( CardBattle *  battle)

Sets the values of the counting cards out, pass by pass (CARDGAME_setCountingCardValues); whether any card is out.

Definition at line 1443 of file battle.c.

Referenced by CARDGAME_resolveCard(), and CARDGAME_runPutOut().

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

◆ CARDGAME_sumSlotValues()

void CARDGAME_sumSlotValues ( CardBattle *  battle,
s32  side 
)

Side's apTotal and hpTotal become the sums of its slot cards' ap and hp.

Definition at line 1463 of file battle.c.

Referenced by CARDGAME_runPutOut().

Here is the caller graph for this function:

◆ CARDGAME_findCardSet()

s32 CARDGAME_findCardSet ( CardBattle *  battle,
s32  side,
s32  index 
)

Finds three or more of one card (with a CardImage.comboCard) among a side's slots, by id from start: flags them in effectStep.eligible; the index after them or -1.

Definition at line 1516 of file battle.c.

Referenced by runOpponentCardSets(), and runPlayerCardSets().

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

◆ CARDGAME_openPanelsPhase()

void CARDGAME_openPanelsPhase ( CardBattle *  battle,
CardBattleItems *  items 
)

Opens the panels for a phase.

Definition at line 1570 of file battle.c.

Referenced by CARDGAME_runPhase().

Here is the caller graph for this function:

◆ CARDGAME_returnHandToDeck()

void CARDGAME_returnHandToDeck ( CardPile *  pile)

Puts pile's hand back on top of its deck.

Definition at line 1891 of file battle.c.

Referenced by CARDGAME_startNextRound().

Here is the caller graph for this function:

◆ CARDGAME_startNextRound()

void CARDGAME_startNextRound ( CardBattle *  battle,
CardBattleItems *  items 
)

Puts both hands back in the decks, shuffles the player's, clears the round's values and moves on to the next round (round)

Definition at line 1900 of file battle.c.

Referenced by CARDGAME_runPhase().

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

◆ CARDGAME_startBattleMessage()

void CARDGAME_startBattleMessage ( CardBattle *  battle,
CardBattleItems *  items 
)

Starts the step of battle message prevPhase (CARDGAME_battleMessages)

Definition at line 1923 of file battle.c.

Referenced by CARDGAME_runPhase().

Here is the caller graph for this function:

◆ CARDGAME_initBattle()

void CARDGAME_initBattle ( CardBattle *  battle,
CardBattleItems *  items 
)

Sets up a card battle: the sides' panels, no result, CARD_PHASE_FADE_IN.

Definition at line 1932 of file battle.c.

Referenced by CARDGAME_updateBattle().

Here is the caller graph for this function:

◆ CARDGAME_stepShowPanels()

s32 CARDGAME_stepShowPanels ( CardBattle *  battle,
CardBattleItems *  items 
)

Opens the panels once; 1 once they are open.

Definition at line 2043 of file battle.c.

Referenced by CARDGAME_resolveCard().

Here is the caller graph for this function:

◆ CARDGAME_showPlayedCard()

s32 CARDGAME_showPlayedCard ( CardBattle *  battle,
CardBattleItems *  items 
)

Shows the last card played (record.plays) in window 2 for 35 frames (Cross cuts it short), then scales its sprite away; 1 once done.

Definition at line 2059 of file battle.c.

Referenced by CARDGAME_resolveCard().

Here is the caller graph for this function:

◆ CARDGAME_runBattle()

s32 CARDGAME_runBattle ( CardBattle *  battle,
CardBattleItems *  items 
)

A frame of the card battle: the sprites' flags, the card animations, the fades, then the phase, the effect step, the card's resolution or the battle menu; 1 once it is over.

Definition at line 2448 of file battle.c.

Referenced by CARDGAME_updateBattle().

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

◆ CARDGAME_keepLowestSlot()

void CARDGAME_keepLowestSlot ( CardBattle *  battle,
s32  side 
)

Keeps the flag (effectStep.eligible) only on side's flagged slot that CARDGAME_scoreHand rates lowest.

Definition at line 243 of file computer.c.

Referenced by CARDGAME_compareCards(), and CARDGAME_pickComputerTarget().

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

◆ CARDGAME_targetFlaggedSlot()

s32 CARDGAME_targetFlaggedSlot ( CardBattle *  battle,
s32  side 
)

The next play targets (target) side's first flagged slot; whether there is one.

Definition at line 272 of file computer.c.

Referenced by CARDGAME_compareCards(), CARDGAME_pickComputerTarget(), CARDGAME_targetColor3Slot(), and CARDGAME_targetColor4Slot().

Here is the caller graph for this function:

◆ CARDGAME_targetColor3Slot()

s32 CARDGAME_targetColor3Slot ( CardBattle *  battle,
s32  side 
)

CARDGAME_targetFlaggedSlot among side's flagged slots of colour 3.

Definition at line 293 of file computer.c.

Referenced by CARDGAME_compareCards().

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

◆ CARDGAME_targetColor4Slot()

s32 CARDGAME_targetColor4Slot ( CardBattle *  battle,
s32  side 
)

CARDGAME_targetFlaggedSlot among side's flagged slots of colour 4.

Definition at line 315 of file computer.c.

Referenced by CARDGAME_compareCards().

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

◆ CARDGAME_isSlotWithin()

s32 CARDGAME_isSlotWithin ( CardBattle *  battle,
s32  side,
s32  index,
s32  value 
)

Whether side's slot index is flagged and its hp is at most value.

Definition at line 337 of file computer.c.

Referenced by CARDGAME_compareCards().

Here is the caller graph for this function:

◆ CARDGAME_getCardLimit()

s32 CARDGAME_getCardLimit ( CardBattle *  battle,
s32  id 
)

The limit card id sets for CARDGAME_compareCards (0 for most)

Definition at line 413 of file computer.c.

Referenced by CARDGAME_compareCards().

Here is the caller graph for this function:

◆ CARDGAME_getCardBonus()

s32 CARDGAME_getCardBonus ( CardBattle *  battle,
s32  id 
)

The bonus card id gives in CARDGAME_compareCards (0 for most)

Definition at line 435 of file computer.c.

Referenced by CARDGAME_compareCards().

Here is the caller graph for this function:

◆ CARDGAME_pickComputerTarget()

s32 CARDGAME_pickComputerTarget ( CardBattle *  battle,
CardScreen *  screen,
s32  id 
)

The computer's target for card id: a slot picked by the card's rule; 1 once there is one.

Definition at line 461 of file computer.c.

Referenced by CARDGAME_pickComputerCard().

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

◆ CARDGAME_findOpponentHandKind()

s32 CARDGAME_findOpponentHandKind ( CardBattle *  battle,
s32  kind 
)

The index of the first card of the opponent's hand of opponentPlans kind (its count when none)

Definition at line 603 of file computer.c.

Referenced by CARDGAME_pickComputerCard().

Here is the caller graph for this function:

◆ CARDGAME_checkComputerCondition()

s32 CARDGAME_checkComputerCondition ( CardBattle *  battle,
CardScreen *  screen,
s32  id 
)

Checks the condition id (0x70 to 0x96) of a card for the computer; returns 1 if it holds.

Definition at line 17 of file computer.c.

Referenced by CARDGAME_pickComputerCard().

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

◆ CARDGAME_compareCards()

s32 CARDGAME_compareCards ( CardBattle *  battle,
s32  id1,
s32  id2,
s32  flip 
)

Compares two cards by the rule of the current play; returns 1 if the second one wins.

Definition at line 517 of file computer.c.

Referenced by CARDGAME_pickComputerCard().

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

◆ CARDGAME_pickComputerCard()

s32 CARDGAME_pickComputerCard ( CardBattle *  battle,
CardScreen *  screen 
)

Picks the computer's next card, flagging it in effectStep.marked; returns 1 if one was found.

Definition at line 615 of file computer.c.

Referenced by playComputerTurn().

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

◆ CARDGAME_takeFlaggedCard()

s32 CARDGAME_takeFlaggedCard ( CardBattle *  battle,
CardBattleItems *  items 
)

Takes the first flagged card out of the hand of side record.turnSide into the play record.plays[playCount]; returns its condition id.

Definition at line 971 of file battle.c.

Referenced by playComputerTurn(), and takePickedCard().

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

◆ CARDGAME_flagTargetSlots()

void CARDGAME_flagTargetSlots ( CardBattle *  battle,
CardScreen *  screen 
)

Flags (effectStep.marked) the slots that the current play's target kind (record.plays[playCount].targetKind) picks.

Definition at line 997 of file battle.c.

Referenced by playComputerTurn().

Here is the caller graph for this function:

Variable Documentation

◆ CARDGAME_cardEffects

CardEffect CARDGAME_cardEffects[]
extern

The functions and data the overlay's files share.

the effects of the first 60 cards, by card id minus one: conditions, target and messages

The functions and data the overlay's files share.

Definition at line 1269 of file effect_script.c.

Referenced by CARDGAME_getEffectField().

◆ CARDGAME_animPiles

s16 CARDGAME_animPiles[7][2]
extern

the side and pile CARDGAME_updateCardAnims passes to CARDGAME_layOutPile

Definition at line 160 of file cardgame_3.c.

Referenced by CARDGAME_updateCardAnims().

◆ CARDGAME_defaultDeck

u16 CARDGAME_defaultDeck[]
extern

the deck used when the chosen one is empty: its first 40 cards, as card ids - 1 (CardBattle.playerDeck); nothing reads the 40 after them

Definition at line 144 of file cardgame_3.c.

Referenced by loadChosenDeck().

◆ CARDGAME_deckWindowPos

CardOffset CARDGAME_deckWindowPos[3]
extern

the three deck windows

Definition at line 161 of file cardgame_3.c.

Referenced by CARDGAME_chooseDeck(), moveDeckMarker(), and openDeckWindow().

◆ CARDGAME_turnStates

u8 CARDGAME_turnStates[]
extern

the next record.turnState state, by step and side

Definition at line 162 of file cardgame_3.c.

Referenced by CARDGAME_playRounds(), playPlayerTurn(), and takePickedCard().

◆ CARDGAME_battleMessages

CardBattleMessage CARDGAME_battleMessages[]
extern

the step and nextPhase of CARDGAME_startBattleMessage, by prevPhase

Definition at line 165 of file cardgame_3.c.

Referenced by CARDGAME_startBattleMessage().

◆ CARDGAME_slotRowPositions

s32 CARDGAME_slotRowPositions[2][4]
extern

◆ CARDGAME_panelIconPositions

CardOffset CARDGAME_panelIconPositions[2][2][2]
extern

CARDGAME_drawPanelIcon's icon and label positions, by SHIFT_PAL_SCREEN and side (EU)

Definition at line 60 of file cardgame_3.c.

Referenced by CARDGAME_drawPanelIcon().

◆ CARDGAME_cardWindowPositions

s16 CARDGAME_cardWindowPositions[2][2][2]
extern

two positions, then the same moved for SHIFT_PAL_SCREEN

Definition at line 33 of file cardgame_2.c.

Referenced by CARDGAME_stepSlotTotal().

◆ CARDGAME_colorFlags

s16 CARDGAME_colorFlags[]
extern

a flag bit per card colour

Definition at line 28 of file cardgame_2.c.

Referenced by CARDGAME_markPileCardsByColor(), and CARDGAME_markSlotsByColor().

◆ CARDGAME_discardPositions

s32 CARDGAME_discardPositions[][2]
extern

x, y per side

Definition at line 31 of file cardgame_2.c.

Referenced by CARDGAME_discardPickedCard().

◆ CARDGAME_slotMoves

u8 CARDGAME_slotMoves[2][6][2]
extern

per side, the slot moves (from, to) of CARDGAME_removeMarkedSlots

Definition at line 182 of file cardgame_3.c.

Referenced by CARDGAME_removeMarkedSlots().

◆ CARDGAME_slotMoveCounts

u8 CARDGAME_slotMoveCounts[]
extern

per side, the entries of CARDGAME_slotMoves

per side, the entries of CARDGAME_slotMoves

Two symbols, not a struct or an array: CARDGAME_removeMarkedSlots loads each address with its own lui and addiu, and GCC 2.8.1 folds the members of one object into one base (CARDGAME_removeMarkedSlots no longer matches as either). The zero variables from CARDGAME_promptText on end the file, as an overlay's .bss would: two 2-byte variables 2 bytes apart fit commons that the linker laid out, not word-aligned C definitions.

Definition at line 192 of file cardgame_3.c.

Referenced by CARDGAME_removeMarkedSlots().

◆ CARDGAME_markedCounts

u8 CARDGAME_markedCounts[2]
extern

per side, the marked slots

Referenced by CARDGAME_removeMarkedSlots().

◆ CARDGAME_fadeColors

CardFadeColor CARDGAME_fadeColors[]
extern

CARDGAME_startStepFade's fade colours and blends, by fade - 1.

Definition at line 156 of file cardgame_3.c.

Referenced by CARDGAME_startStepFade().

◆ CARDGAME_recordCardPositions

s32 CARDGAME_recordCardPositions[][2]
extern

where card 15 goes, by CardRecord.playCount

Definition at line 32 of file cardgame_2.c.

Referenced by CARDGAME_startPlayCard(), and CARDGAME_stepPlayCard().

◆ CARDGAME_countingCards

s16 CARDGAME_countingCards[]
extern

five card ids, minus one

Definition at line 134 of file cardgame_3.c.

Referenced by CARDGAME_setCountingCardValues(), and CARDGAME_showCardInfo().

◆ CARDGAME_playedCardPos

CardOffset CARDGAME_playedCardPos[2][2]
extern

then the same moved for SHIFT_PAL_SCREEN

Definition at line 177 of file cardgame_3.c.

Referenced by CARDGAME_showPlayedCard().

◆ CARDGAME_savedScreenState

CardMessageWindow CARDGAME_savedScreenState
extern

Definition at line 193 of file cardgame_3.c.

Referenced by CARDGAME_runBattleMenu().

◆ CARDGAME_prizeItems

s16 CARDGAME_prizeItems[]
extern

the item an opponent gives for a win (CardBattle.prize), by its CardOpponent.prize

Definition at line 137 of file cardgame_3.c.

Referenced by CARDGAME_loadOpponent().