Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
slot_effects.c
Go to the documentation of this file.
1/* CARDGAME's card effects on the slots: shaking cards away, sending them
2 off or back, their stats, and marking them by colour. */
3
5
6/* Counts a card of the colour it has on a side's panel (at most 99); 1 if it has one */
7s32 CARDGAME_addColorCount(CardBattle *battle, CardScreen *screen, s32 side, s32 card) {
8 CardDrawer drawer;
9 CardPile *pile = &battle->sides[side].pile;
10 s32 color;
11 s32 done = 0;
12
13 initCardDrawer(&drawer);
14 drawer.setCard(battle->cards[card] + 1);
15 color = drawer.card->color - 1;
16 if (color < 5) {
17 if (pile->points[color] < 99) {
18 pile->points[color]++;
19 }
20 screen->setPanelValue(screen, side, color, pile->points[color]);
21 done = 1;
22 }
23 return done;
24}
25
26/* Shakes sprite index, then shrinks it to nothing; 1 once done */
28 s32 done = 0;
29
30 switch (battle->effectStep.time) {
31 case 0:
32 default:
33 screen->startShake(screen, index);
34 battle->effectStep.time = 1;
35 break;
36 case 1:
37 if (screen->sprites[index].state == 1) {
38 battle->effectStep.time = 2;
39 screen->scaleSprite(screen, index, 5, 0, 0x1000);
40 }
41 break;
42 case 2:
43 if (screen->sprites[index].state == 1) {
44 done = 1;
45 }
46 break;
47 }
48 return done;
49}
50
51/* Puts the card of side's slot index on its owner's discards, on
52 the panel */
53void CARDGAME_discardSlotCard(CardBattle *battle, CardScreen *screen, s32 side, s32 index) {
54 switch (battle->players[side].slots[index].side) {
55 case 0:
56 battle->sides[0].pile.discards[battle->sides[0].pile.discardCount] = battle->players[side].slots[index].card;
57 battle->sides[0].pile.discardCount++;
58 screen->setPanelValue(screen, 0, CARD_PANEL_DISCARDS, battle->sides[0].pile.discardCount);
59 break;
60 case 1:
61 battle->sides[1].pile.discards[battle->sides[1].pile.discardCount] = battle->players[side].slots[index].card;
62 battle->sides[1].pile.discardCount++;
63 screen->setPanelValue(screen, 1, CARD_PANEL_DISCARDS, battle->sides[1].pile.discardCount);
64 break;
65 }
66}
67
68/* Shakes side's slot index away, then CARDGAME_discardSlotCard; 1 once done */
70 s32 ok = 0;
71
72 if (CARDGAME_stepShakeAway(battle, screen, side != 0 ? index + 6 : index)) {
73 CARDGAME_discardSlotCard(battle, screen, side, index);
74 ok = 1;
75 }
76 return ok;
77}
78
79/* Moves sprite index off the left of the screen; 1 once it is there */
81 s32 done = 0;
82
83 switch (battle->effectStep.time) {
84 case 0:
85 default:
86 battle->effectStep.time = 1;
87 screen->sprites[index].moving = 1;
88 screen->startMove(screen, index, 15, -0x5000, 0x6100);
89 screen->setSpriteScale(screen, index, 0x1200, 0x1200);
90 break;
91 case 1:
92 if (screen->sprites[index].state == 1) {
93 screen->sprites[index].moving = 0;
94 screen->sprites[index].scaleX = 0;
95 done = 1;
96 }
97 break;
98 }
99 return done;
100}
101
102/* Puts the card of side's slot index back in its owner's hand, on the panel */
103void CARDGAME_returnSlotCard(CardBattle *battle, CardScreen *screen, s32 side, s32 index) {
104 switch (battle->players[side].slots[index].side) {
105 case 0:
106 battle->sides[0].pile.hand[battle->sides[0].pile.handCount] = battle->players[side].slots[index].card;
107 battle->sides[0].pile.handCount++;
108 screen->setPanelValue(screen, 0, CARD_PANEL_HAND, battle->sides[0].pile.handCount);
109 break;
110 case 1:
111 battle->sides[1].pile.hand[battle->sides[1].pile.handCount] = battle->players[side].slots[index].card;
112 battle->sides[1].pile.handCount++;
113 screen->setPanelValue(screen, 1, CARD_PANEL_HAND, battle->sides[1].pile.handCount);
114 break;
115 }
116}
117
118/* Sends side's slot index off, then CARDGAME_returnSlotCard; 1 once done */
120 s32 ok = 0;
121
122 if (CARDGAME_stepSendOff(battle, screen, side != 0 ? index + 6 : index)) {
123 CARDGAME_returnSlotCard(battle, screen, side, index);
124 ok = 1;
125 }
126 return ok;
127}
128
129/* Starts effect 3 (which 0) or 4 on the flagged cards in play, and plays a
130 sound if there were any */
131void CARDGAME_startSlotEffects(CardBattle *battle, CardScreen *screen, s32 which) {
132 s32 found = 0;
133 s32 i;
134
135 for (i = 0; i < 12; i++) {
136 if (battle->effectStep.marked[i] != 0) {
137 if (i < 6) {
138 if (i < battle->players[0].slotCount) {
139 screen->startEffect(screen, i, which);
140 found = 1;
141 }
142 } else if (i - 6 < battle->players[1].slotCount) {
143 screen->startEffect(screen, i, which);
144 found = 1;
145 }
146 }
147 }
148 if (found) {
149 switch (which) {
150 case 0:
151 default:
152 SOUND.playSound(0x9C0001);
153 break;
154 case 1:
155 SOUND.playSound(0x9C0000);
156 break;
157 }
158 }
159 battle->effectStep.time = 0;
160}
161
162/* Counts effectStep.time up by the frame time; whether it passed duration */
163s32 CARDGAME_waitFor(CardBattle *battle, CardScreen *screen, s32 duration) {
164 battle->effectStep.time += GFX.funcs.getFrameTime();
165 return duration < battle->effectStep.time;
166}
167
168/* Starts moving the marked slots (effectStep.marked) by an offset packed as x << 16 | y */
169void CARDGAME_moveMarkedSlots(CardBattle *battle, CardScreen *screen, s32 offset, s32 mode) {
170 s16 dx = offset >> 16;
171 s16 dy = offset;
172 s32 i;
173
174 battle->effectStep.time = 0;
175 battle->effectStep.vars[0] = dx;
176 battle->effectStep.vars[1] = dy;
177 battle->effectStep.vars[2] = dx;
178 if (dx < 0) {
179 battle->effectStep.vars[2] = -dx;
180 }
181 battle->effectStep.vars[3] = dy;
182 if (dy < 0) {
183 battle->effectStep.vars[3] = -dy;
184 }
185 for (i = 0; i < 12; i++) {
186 if (battle->effectStep.marked[i] != 0) {
187 if (i < 6) {
188 if (i >= battle->players[0].slotCount) {
189 continue;
190 }
191 battle->players[0].slots[i].apBonus += dx;
192 battle->players[0].slots[i].hpBonus += dy;
193 if (mode == 2) {
194 battle->players[0].slots[i].apBonus = battle->players[0].slots[i].ap * -1;
195 }
196 } else {
197 if (i - 6 >= battle->players[1].slotCount) {
198 continue;
199 }
200 battle->players[1].slots[i - 6].apBonus += dx;
201 battle->players[1].slots[i - 6].hpBonus += dy;
202 if (mode == 2) {
203 battle->players[1].slots[i - 6].apBonus = battle->players[1].slots[i - 6].ap * -1;
204 }
205 }
206 if (mode == 0) {
207 screen->startShake(screen, i);
208 } else {
209 screen->startRecovery(screen, i);
210 }
211 }
212 }
213}
214
215/* 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 */
217 s32 done = 1;
218 s32 i;
219
220 if (battle->effectStep.time < battle->effectStep.vars[2]) {
221 for (i = 0; i < 12; i++) {
222 if (battle->effectStep.marked[i] != 0) {
223 if (i < 6) {
224 if (i < battle->players[0].slotCount) {
225 if (battle->effectStep.vars[0] > 0) {
226 if (battle->players[0].slots[i].ap < 99) {
227 battle->players[0].slots[i].ap++;
228 screen->sprites[i].ap++;
229 }
230 } else if (battle->players[0].slots[i].ap > 0) {
231 battle->players[0].slots[i].ap--;
232 screen->sprites[i].ap--;
233 }
234 }
235 } else if (i - 6 < battle->players[1].slotCount) {
236 if (battle->effectStep.vars[0] > 0) {
237 if (battle->players[1].slots[i - 6].ap < 99) {
238 battle->players[1].slots[i - 6].ap++;
239 screen->sprites[i].ap++;
240 }
241 } else if (battle->players[1].slots[i - 6].ap > 0) {
242 battle->players[1].slots[i - 6].ap--;
243 screen->sprites[i].ap--;
244 }
245 }
246 }
247 }
248 done = 0;
249 }
250 if (battle->effectStep.time < battle->effectStep.vars[3]) {
251 for (i = 0; i < 12; i++) {
252 if (battle->effectStep.marked[i] != 0) {
253 if (i < 6) {
254 if (i < battle->players[0].slotCount) {
255 if (battle->effectStep.vars[1] > 0) {
256 if (battle->players[0].slots[i].hp < 99) {
257 battle->players[0].slots[i].hp++;
258 screen->sprites[i].hp++;
259 }
260 } else if (battle->players[0].slots[i].hp > 0) {
261 battle->players[0].slots[i].hp--;
262 screen->sprites[i].hp--;
263 }
264 }
265 } else if (i - 6 < battle->players[1].slotCount) {
266 if (battle->effectStep.vars[1] > 0) {
267 if (battle->players[1].slots[i - 6].hp < 99) {
268 battle->players[1].slots[i - 6].hp++;
269 screen->sprites[i].hp++;
270 }
271 } else if (battle->players[1].slots[i - 6].hp > 0) {
272 battle->players[1].slots[i - 6].hp--;
273 screen->sprites[i].hp--;
274 }
275 }
276 }
277 }
278 done = 0;
279 }
280 battle->effectStep.time++;
281 if (done != 0) {
282 for (i = 0; i < 12; i++) {
283 battle->effectStep.marked[i] = 0;
284 if (i < 6) {
285 if (i < battle->players[0].slotCount && battle->players[0].slots[i].hp <= 0) {
286 battle->effectStep.marked[i] = 1;
287 }
288 } else if (i - 6 < battle->players[1].slotCount && battle->players[1].slots[i - 6].hp <= 0) {
289 battle->effectStep.marked[i] = 1;
290 }
291 }
292 }
293 return done;
294}
295
296/* 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 */
298 s32 i;
299 s32 n;
300 s32 owner;
301 s32 card;
302
303 n = battle->record.playCount - 1;
304 owner = battle->record.plays[n].side;
305 for (i = 0; i < 12; i++) {
306 battle->effectStep.marked[i] = 0;
307 if (i < 6) {
308 if (i >= battle->players[0].slotCount) {
309 continue;
310 }
311 card = battle->players[0].slots[i].card;
312 } else {
313 if (i - 6 >= battle->players[1].slotCount) {
314 continue;
315 }
316 card = battle->players[1].slots[i - 6].card;
317 }
318 switch (battle->record.plays[n].targetKind) {
319 case 1:
320 if (owner == 0) {
321 if (i < 6) {
322 battle->effectStep.marked[i] = 1;
323 }
324 } else if (i >= 6) {
325 battle->effectStep.marked[i] = 1;
326 }
327 break;
328 case 2:
329 if (owner == 0) {
330 if (i >= 6) {
331 battle->effectStep.marked[i] = 1;
332 }
333 } else if (i < 6) {
334 battle->effectStep.marked[i] = 1;
335 }
336 break;
337 case 3:
338 battle->effectStep.marked[i] = 1;
339 break;
340 case 4:
341 if (screen->getCardColor(screen, card) != 1) {
342 battle->effectStep.marked[i] = 1;
343 }
344 break;
345 case 5:
346 if (screen->getCardColor(screen, card) != 2) {
347 battle->effectStep.marked[i] = 1;
348 }
349 break;
350 case 6:
351 if (screen->getCardColor(screen, card) == 3) {
352 battle->effectStep.marked[i] = 1;
353 }
354 break;
355 case 7:
356 if (screen->getCardColor(screen, card) != 4) {
357 battle->effectStep.marked[i] = 1;
358 }
359 break;
360 case 8:
361 if (screen->getCardColor(screen, card) == 6) {
362 battle->effectStep.marked[i] = 1;
363 }
364 break;
365 }
366 }
367}
368
369/* Starts a step's first state */
371 battle->effectStep.state = 1;
372}
373
374/* 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 */
376 s32 result = 0;
377 s32 side, i, j, count;
378 /* the match depends on case 3 having variables of its own */
379 s32 player, k;
380 s32 from, to;
381 s8 *marks;
382 s8 mark;
383 CardSprite sprite;
384
385 switch (battle->effectStep.state) {
386 case 1:
389 for (side = 0; side < 2; side++) {
390 marks = &battle->effectStep.marked[side * 6];
391 for (i = 0; i < battle->players[side].slotCount; i++) {
392 if (marks[i] == 1) {
393 CARDGAME_markedCounts[side]++;
394 }
395 }
396 count = 0;
397 for (i = 0; i < battle->players[side].slotCount - 1; i++) {
398 if (marks[i] == 1) {
399 for (j = i + 1; j < battle->players[side].slotCount; j++) {
400 if (marks[j] == 0) {
401 mark = marks[i];
402 marks[i] = marks[j];
403 marks[j] = mark;
404 CARDGAME_slotMoves[side][count][0] = i;
405 CARDGAME_slotMoves[side][count][1] = j;
406 count++;
407 break;
408 }
409 }
410 }
411 }
412 CARDGAME_slotMoveCounts[side] = count;
413 if (side == 0) {
414 for (i = 0; i < count; i++) {
415#if PAL_VIDEO
416 screen->startMove(screen, CARDGAME_slotMoves[0][i][1], 10,
419#else
420 screen->startMove(screen, CARDGAME_slotMoves[0][i][1], 10, CARDGAME_slotMoves[0][i][0] * 0x2900 + 0x1800, 0x9000);
421#endif
422 }
423 } else {
424 for (i = 0; i < count; i++) {
425#if PAL_VIDEO
426 screen->startMove(screen, CARDGAME_slotMoves[1][i][1] + 6, 10,
429#else
430 screen->startMove(screen, CARDGAME_slotMoves[1][i][1] + 6, 10, CARDGAME_slotMoves[1][i][0] * 0x2900 + 0x1800, 0x3200);
431#endif
432 }
433 }
434 }
436 battle->effectStep.state = 2;
437 battle->effectStep.time = 20;
438 } else {
439 battle->effectStep.state = 4;
440 }
441 break;
442 case 2:
443 battle->effectStep.time -= GFX.funcs.getFrameTime();
444 if (battle->effectStep.time <= 0) {
445 battle->effectStep.state = 3;
446 }
447 break;
448 case 3:
449 for (player = 0; player < 2; player++) {
450 for (k = 0; k < CARDGAME_slotMoveCounts[player]; k++) {
451 from = CARDGAME_slotMoves[player][k][0];
452 to = CARDGAME_slotMoves[player][k][1];
453 battle->players[player].slots[from] = battle->players[player].slots[to];
454 from += player * 6;
455 to += player * 6;
456 sprite = screen->sprites[from];
457 screen->sprites[from] = screen->sprites[to];
458 screen->sprites[to] = sprite;
459 }
460 battle->players[player].slotCount -= CARDGAME_markedCounts[player];
461 for (k = 0; k < 6; k++) {
462 if (k >= battle->players[player].slotCount) {
463 screen->removeSprite(screen, player * 6 + k);
464 screen->sprites[player * 6 + k].scaleX = 0;
465 }
466 }
467 }
468 battle->effectStep.state = 4;
469 break;
470 case 4:
471 result = 1;
472 break;
473 }
474 return result;
475}
476
477/* 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 */
478s32 CARDGAME_markPileCardsByColor(CardBattle *battle, CardScreen *screen, s32 side, s32 kind, s32 flags) {
479 CardDrawer drawer;
480 s32 found;
481 s32 count = 0;
482 s32 card;
483 s32 i;
484 s32 ok;
485 s32 j;
486 s32 id;
487
488 found = 0;
489 switch (kind) {
490 case 2:
491 count = battle->sides[side].pile.handCount;
492 break;
493 case 3:
494 count = battle->sides[side].pile.deckCount;
495 break;
496 case 4:
497 count = battle->sides[side].pile.discardCount;
498 break;
499 }
500 card = 0;
501 for (i = 0; i < count; i++) {
502 battle->effectStep.eligible[i] = 0;
503 switch (kind) {
504 case 2:
505 card = battle->sides[side].pile.hand[i];
506 break;
507 case 3:
508 card = battle->sides[side].pile.deck[i + battle->sides[side].pile.deckTop];
509 break;
510 case 4:
511 card = battle->sides[side].pile.discards[i];
512 break;
513 }
514 id = battle->cards[card];
515 ok = 0;
516 initCardDrawer(&drawer);
517 drawer.setCard(id + 1);
518 if (drawer.card->kind == 0x10) {
519 ok = flags & 1;
520 } else if (flags & 2) {
521 ok = 1;
522 }
523 if (ok) {
524 for (j = 0; j < 6; j++) {
525 if ((flags & CARDGAME_colorFlags[j]) && drawer.card->color == j + 1) {
526 battle->effectStep.eligible[i] = 1;
527 found = 1;
528 break;
529 }
530 }
531 }
532 }
533 return found;
534}
535
536/* 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 */
538 CardDrawer drawer;
539 s32 found = 0;
540 s32 card = 0;
541 s32 i;
542 s32 skip;
543 s32 j;
544
545 initCardDrawer(&drawer);
546 battle->effectStep.flags = 0;
547 for (i = 0, skip = 0; i < 15; i++, skip = 0) {
548 battle->effectStep.eligible[i] = 0;
549 if (i < 6) {
550 if ((side == 0 && (flags & 0x100)) || (side != 0 && (flags & 0x200))) {
551 battle->effectStep.flags |= 1;
552 if (i < battle->players[0].slotCount) {
553 card = battle->players[0].slots[i].card;
554 } else {
555 skip = 1;
556 }
557 } else {
558 skip = 1;
559 }
560 } else if (i < 12) {
561 if ((side == 0 && (flags & 0x200)) || (side != 0 && (flags & 0x100))) {
562 battle->effectStep.flags |= 2;
563 if (i - 6 < battle->players[1].slotCount) {
564 card = battle->players[1].slots[i - 6].card;
565 } else {
566 skip = 1;
567 }
568 } else {
569 skip = 1;
570 }
571 } else {
572 skip = 1;
573 }
574 if (!skip) {
575 drawer.setCard(battle->cards[card] + 1);
576 for (j = 0; j < 6; j++) {
577 if ((flags & CARDGAME_colorFlags[j]) && drawer.card->color == j + 1) {
578 battle->effectStep.eligible[i] = 1;
579 found = 1;
580 break;
581 }
582 }
583 }
584 }
585 return found;
586}
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
Definition cardgame_2.c:28
u8 CARDGAME_slotMoveCounts[8]
per side, the entries of CARDGAME_slotMoves; bytes 2 and 3 are CARDGAME_markedCounts,...
Definition cardgame_3.c:192
u8 CARDGAME_slotMoves[2][6][2]
per side, the slot moves (from, to) of CARDGAME_removeMarkedSlots
Definition cardgame_3.c:182
s32 CARDGAME_slotRowPositions[2][4]
sprite positions, by SHIFT_PAL_SCREEN
Definition cardgame_3.c:14
signed int s32
Definition common.h:11
signed char s8
Definition common.h:7
signed short s16
Definition common.h:9
GfxState GFX
GFX: the graphics state and its methods.
Definition display.c:209
s32 SHIFT_PAL_SCREEN
moves both display areas 0x18 lines down
Definition eu_settings.c:15
@ CARD_PANEL_HAND
Definition screen.h:200
@ CARD_PANEL_DISCARDS
Definition screen.h:201
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.
Definition slot_effects.c:7
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...
Definition sound.c:180
The card battle (CARDGAME_createBattle).
Definition battle.h:226
CardPlayer players[2]
Definition battle.h:275
CardRecord record
Definition battle.h:273
s16 cards[250]
card ids, minus one (CARDGAME_loadCardImages)
Definition battle.h:228
CardStep effectStep
Definition battle.h:262
CardSide sides[2]
Definition battle.h:274
Draws the cards' images (CardImage), from files 0x7E7-0x7EB.
Definition gfx.h:193
void(* setCard)()
(id)
Definition gfx.h:205
CardImage * card
Definition gfx.h:194
u8 color
from 1
Definition gfx.h:173
u8 kind
an index in CARD_KINDS
Definition gfx.h:176
A player's cards in a card battle (CardSide.pile)
Definition battle.h:108
s16 deckCount
the cards left in the deck
Definition battle.h:113
s16 discardCount
Definition battle.h:112
s16 deck[40]
deckTop on are left
Definition battle.h:118
s16 handCount
Definition battle.h:114
s16 deckTop
the index of the deck's top card
Definition battle.h:111
u8 points[5]
one per card colour
Definition battle.h:115
s16 discards[10]
the cards played and lost from the slots, discardCount in use
Definition battle.h:120
s16 hand[10]
handCount in use
Definition battle.h:119
u8 targetKind
its effect's (CardEffect.target)
Definition battle.h:47
u8 side
who played it
Definition battle.h:46
CardSlot slots[8]
Definition battle.h:39
u8 slotCount
Definition battle.h:38
s8 playCount
the plays in use
Definition battle.h:130
CardPlay plays[3]
the cards played this turn, up to three
Definition battle.h:137
The battle screen (created by CARDGAME_createScreen): the two panels, the cards on the table and the ...
Definition screen.h:263
void(* setPanelValue)(struct CardScreen *screen, s32 side, u32 which, s32 value)
Definition screen.h:285
void(* scaleSprite)(struct CardScreen *screen, s32 index, s32 duration, s32 scaleX, s32 scaleY)
Definition screen.h:318
s32(* getCardColor)(struct CardScreen *screen, s32 index)
Definition screen.h:325
void(* startMove)(struct CardScreen *screen, s32 index, s32 duration, s32 x, s32 y)
Definition screen.h:311
s32(* startShake)(struct CardScreen *screen, s32 index)
Definition screen.h:321
CardSprite sprites[40]
Definition screen.h:271
s32(* removeSprite)(struct CardScreen *screen, s32 index)
Definition screen.h:315
s32(* startEffect)(struct CardScreen *screen, s32 index, s32 which)
Definition screen.h:323
void(* setSpriteScale)(struct CardScreen *screen, s32 index, s32 scaleX, s32 scaleY)
Definition screen.h:317
s32(* startRecovery)(struct CardScreen *screen, s32 index)
Definition screen.h:322
CardPile pile
Definition battle.h:160
s16 hp
its hit points, 0 to 99: at 0 it is lost
Definition battle.h:24
s16 hpBonus
and to its hp
Definition battle.h:22
u8 side
Definition battle.h:25
s16 apBonus
what the effects added to its ap
Definition battle.h:21
s16 ap
its attack points, 0 to 99
Definition battle.h:23
s16 card
the index in the battle's card list
Definition battle.h:20
A card on the battle screen (CardScreen.sprites)
Definition screen.h:163
s16 moving
Definition screen.h:177
u8 ap
the values shown, which count towards the slot's
Definition screen.h:188
s16 scaleX
Definition screen.h:170
s32 time
a frame count, or the step's own sub-state
Definition battle.h:148
s8 eligible[0x29]
the cards or slots that can be picked
Definition battle.h:154
u8 state
the step's own state
Definition battle.h:146
s32 vars[5]
values each step uses its own way
Definition battle.h:149
u8 flags
the step's own: the rows to pick from, the deck run out...
Definition battle.h:153
s8 marked[40]
the cards or slots picked
Definition battle.h:155
s32(* getFrameTime)(void)
Definition gfx.h:32
GfxFuncs funcs
Definition gfx.h:77
short(* playSound)(s32 id)
returns the voice of a key-on
Definition sound.h:187