Jokers appear in the shop but don't do anything yet

This commit is contained in:
cellos51
2025-07-18 19:29:17 -04:00
parent 4a5644eddb
commit 176910c483
9 changed files with 197 additions and 21 deletions
+2
View File
@@ -2,6 +2,7 @@
#define CARD_H
#include <tonc.h>
#include <maxmod.h>
#include "sprite.h"
@@ -65,5 +66,6 @@ CardObject *card_object_new(Card *card);
void card_object_destroy(CardObject **card_object);
void card_object_update(CardObject *card_object); // Update the card object position and scale
void card_object_set_sprite(CardObject *card_object, int layer);
void card_object_score(CardObject *card_object, mm_word sound_id); // This doesn't actually score anything, it just performs an animation and plays a sound effect
#endif // CARD_H
+2
View File
@@ -3,6 +3,8 @@
#define MAX_HAND_SIZE 16
#define MAX_DECK_SIZE 52
#define MAX_JOKERS_SIZE 5
#define MAX_SHOP_JOKERS 2 // TODO: Make this dynamic and allow for other items besides jokers
#define MAX_SELECTION_SIZE 5
#define FRAMES(x) (((x) + game_speed - 1) / game_speed)
+10 -1
View File
@@ -2,7 +2,11 @@
#define JOKER_H
#define JOKER_TID 880 // Tile ID for the starting index in the tile memory
#define JOKER_SPRITE_OFFSET 16 // Offset for the joker sprites
#define JOKER_PB 4 // Palette bank for the default jokers
#define JOKER_STARTING_LAYER 27
#include <maxmod.h>
#include "sprite.h"
#include "card.h"
@@ -19,6 +23,7 @@
#define LEGENDARY_JOKER 3
#define MAX_JOKERS 2 // The current maximum jokers added
#define MAX_JOKER_OBJECTS 32 // The maximum number of joker objects that can be created at once
#define DEFAULT_JOKER_ID 0
#define GREEDY_JOKER_ID 1 // This is just an example to show the patern of making joker IDs
@@ -44,6 +49,7 @@ typedef struct // copy of CardObject in card.h
FIXED trotation;
FIXED rotation;
FIXED vrotation;
bool selected;
} JokerObject;
typedef struct // These jokers are triggered after the played hand has finished scoring.
@@ -74,6 +80,9 @@ void joker_destroy(Joker **joker);
IndependentEffect joker_independent_effect(Joker *joker);
OnScoredEffect joker_on_scored(Joker *joker, Card *scored_card);
void joker_object_score(JokerObject *joker_object); // This doesn't actually score anything, it just performs an animation and plays a sound effect
JokerObject *joker_object_new(Joker *joker);
void joker_object_destroy(JokerObject **joker_object);
void joker_object_update(JokerObject *joker_object);
void joker_object_score(JokerObject *joker_object, mm_word sound_id); // This doesn't actually score anything, it just performs an animation and plays a sound effect
#endif // JOKER_H
+1
View File
@@ -15,6 +15,7 @@ typedef struct
Sprite *sprite_new(u16 a0, u16 a1, u32 tid, u32 pb, int sprite_index);
Sprite *affine_sprite_new(u16 a0, u16 a1, u32 tid, u32 pb);
void sprite_destroy(Sprite **sprite);
int sprite_get_layer(Sprite *sprite);
INLINE void sprite_position(Sprite *sprite, int x, int y)
{
sprite->pos.x = x;