add blue joker

This commit is contained in:
theturtlemafia
2025-08-02 13:25:04 -04:00
parent dcaf025e63
commit ee0591562f
3 changed files with 16 additions and 0 deletions
+2
View File
@@ -82,6 +82,8 @@ int get_played_top(void);
JokerObject** get_jokers(void); JokerObject** get_jokers(void);
int get_jokers_top(void); int get_jokers_top(void);
int get_deck_top(void);
int get_num_discards_remaining(void); int get_num_discards_remaining(void);
#endif // GAME_H #endif // GAME_H
+4
View File
@@ -264,6 +264,10 @@ int get_jokers_top(void) {
return jokers_top; return jokers_top;
} }
int get_deck_top(void) {
return deck_top;
}
int get_num_discards_remaining(void) { int get_num_discards_remaining(void) {
return discards; return discards;
} }
+10
View File
@@ -287,6 +287,15 @@ static JokerEffect blackboard_joker_effect(Joker *joker, Card *scored_card) {
return effect; return effect;
} }
static JokerEffect blue_joker_effect(Joker *joker, Card *scored_card) {
JokerEffect effect = {0};
if (scored_card != NULL)
return effect; // if card != null, we are not at the end-phase of scoring yet
effect.chips = (get_deck_top() + 1) * 2;
return effect;
}
const JokerInfo joker_registry[] = { const JokerInfo joker_registry[] = {
{ COMMON_JOKER, 2, default_joker_effect }, // DEFAULT_JOKER_ID = 0 { COMMON_JOKER, 2, default_joker_effect }, // DEFAULT_JOKER_ID = 0
{ COMMON_JOKER, 5, greedy_joker_effect }, // GREEDY_JOKER_ID = 1 { COMMON_JOKER, 5, greedy_joker_effect }, // GREEDY_JOKER_ID = 1
@@ -311,6 +320,7 @@ const JokerInfo joker_registry[] = {
{ COMMON_JOKER, 5, banner_joker_effect }, { COMMON_JOKER, 5, banner_joker_effect },
{ COMMON_JOKER, 5, mystic_summit_joker_effect }, { COMMON_JOKER, 5, mystic_summit_joker_effect },
{ UNCOMMON_JOKER, 6, blackboard_joker_effect }, { UNCOMMON_JOKER, 6, blackboard_joker_effect },
{ COMMON_JOKER, 5, blue_joker_effect },
}; };
static const size_t joker_registry_size = NUM_ELEM_IN_ARR(joker_registry); static const size_t joker_registry_size = NUM_ELEM_IN_ARR(joker_registry);