17 if (pile->
points[color] < 99) {
88 screen->
startMove(screen, index, 15, -0x5000, 0x6100);
135 for (i = 0; i < 12; i++) {
138 if (i < battle->players[0].slotCount) {
170 s16 dx = offset >> 16;
185 for (i = 0; i < 12; i++) {
221 for (i = 0; i < 12; i++) {
224 if (i < battle->players[0].slotCount) {
251 for (i = 0; i < 12; i++) {
254 if (i < battle->players[0].slotCount) {
282 for (i = 0; i < 12; i++) {
285 if (i < battle->players[0].slotCount && battle->
players[0].
slots[i].
hp <= 0) {
305 for (i = 0; i < 12; i++) {
377 s32 side, i, j, count;
389 for (side = 0; side < 2; side++) {
414 for (i = 0; i < count; i++) {
424 for (i = 0; i < count; i++) {
449 for (player = 0; player < 2; player++) {
456 sprite = screen->
sprites[from];
461 for (k = 0; k < 6; k++) {
501 for (i = 0; i < count; i++) {
514 id = battle->
cards[card];
520 }
else if (flags & 2) {
524 for (j = 0; j < 6; j++) {
547 for (i = 0, skip = 0; i < 15; i++, skip = 0) {
550 if ((side == 0 && (flags & 0x100)) || (side != 0 && (flags & 0x200))) {
552 if (i < battle->players[0].slotCount) {
561 if ((side == 0 && (flags & 0x200)) || (side != 0 && (flags & 0x100))) {
576 for (j = 0; j < 6; j++) {
CARDGAME.PRO: the card battle (mode 0x700).
void initCardDrawer(CardDrawer *obj)
Clears a card drawer, gives it its methods and binds it.
u8 CARDGAME_markedCounts[2]
per side, the marked slots
s16 CARDGAME_colorFlags[]
a flag bit per card colour
u8 CARDGAME_slotMoveCounts[8]
per side, the entries of CARDGAME_slotMoves; bytes 2 and 3 are CARDGAME_markedCounts,...
u8 CARDGAME_slotMoves[2][6][2]
per side, the slot moves (from, to) of CARDGAME_removeMarkedSlots
s32 CARDGAME_slotRowPositions[2][4]
sprite positions, by SHIFT_PAL_SCREEN
GfxState GFX
GFX: the graphics state and its methods.
s32 SHIFT_PAL_SCREEN
moves both display areas 0x18 lines down
s32 CARDGAME_removeMarkedSlots(CardBattle *battle, CardScreen *screen)
Removes the slots marked in effectStep.marked: slides the cards after them left on screen,...
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_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_markTargetSlots(CardBattle *battle, CardScreen *screen)
Marks in effectStep.marked the slots out that the last card played applies to, by its target (record....
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,...
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_stepShakeAway(CardBattle *battle, CardScreen *screen, s32 index)
Shakes sprite index, then shrinks it to nothing; 1 once done.
void CARDGAME_beginStep(CardBattle *battle, CardScreen *screen)
Starts a step's first state.
void CARDGAME_startSlotEffects(CardBattle *battle, CardScreen *screen, s32 which)
Starts effect 3 (which 0) or 4 on the flagged cards in play, and plays a sound if there were any.
void CARDGAME_moveMarkedSlots(CardBattle *battle, CardScreen *screen, s32 offset, s32 mode)
Starts moving the marked slots (effectStep.marked) by an offset packed as x << 16 | y.
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.
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....
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.
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 colo...
SoundState SOUND
rsin and rcos (libgte) read rsin_tbl[a - 0x800] and the like: their addresses before the table fall i...
The card battle (CARDGAME_createBattle).
s16 cards[250]
card ids, minus one (CARDGAME_loadCardImages)
Draws the cards' images (CardImage), from files 0x7E7-0x7EB.
u8 kind
an index in CARD_KINDS
A player's cards in a card battle (CardSide.pile)
s16 deckCount
the cards left in the deck
s16 deck[40]
deckTop on are left
s16 deckTop
the index of the deck's top card
u8 points[5]
one per card colour
s16 discards[10]
the cards played and lost from the slots, discardCount in use
s16 hand[10]
handCount in use
u8 targetKind
its effect's (CardEffect.target)
s8 playCount
the plays in use
CardPlay plays[3]
the cards played this turn, up to three
The battle screen (created by CARDGAME_createScreen): the two panels, the cards on the table and the ...
void(* setPanelValue)(struct CardScreen *screen, s32 side, u32 which, s32 value)
void(* scaleSprite)(struct CardScreen *screen, s32 index, s32 duration, s32 scaleX, s32 scaleY)
s32(* getCardColor)(struct CardScreen *screen, s32 index)
void(* startMove)(struct CardScreen *screen, s32 index, s32 duration, s32 x, s32 y)
s32(* startShake)(struct CardScreen *screen, s32 index)
s32(* removeSprite)(struct CardScreen *screen, s32 index)
s32(* startEffect)(struct CardScreen *screen, s32 index, s32 which)
void(* setSpriteScale)(struct CardScreen *screen, s32 index, s32 scaleX, s32 scaleY)
s32(* startRecovery)(struct CardScreen *screen, s32 index)
s16 hp
its hit points, 0 to 99: at 0 it is lost
s16 apBonus
what the effects added to its ap
s16 ap
its attack points, 0 to 99
s16 card
the index in the battle's card list
A card on the battle screen (CardScreen.sprites)
u8 ap
the values shown, which count towards the slot's
s32 time
a frame count, or the step's own sub-state
s8 eligible[0x29]
the cards or slots that can be picked
u8 state
the step's own state
s32 vars[5]
values each step uses its own way
u8 flags
the step's own: the rows to pick from, the deck run out...
s8 marked[40]
the cards or slots picked
s32(* getFrameTime)(void)
short(* playSound)(s32 id)
returns the voice of a key-on