add blue joker
This commit is contained in:
@@ -82,6 +82,8 @@ int get_played_top(void);
|
||||
JokerObject** get_jokers(void);
|
||||
int get_jokers_top(void);
|
||||
|
||||
int get_deck_top(void);
|
||||
|
||||
int get_num_discards_remaining(void);
|
||||
|
||||
#endif // GAME_H
|
||||
@@ -264,6 +264,10 @@ int get_jokers_top(void) {
|
||||
return jokers_top;
|
||||
}
|
||||
|
||||
int get_deck_top(void) {
|
||||
return deck_top;
|
||||
}
|
||||
|
||||
int get_num_discards_remaining(void) {
|
||||
return discards;
|
||||
}
|
||||
|
||||
@@ -287,6 +287,15 @@ static JokerEffect blackboard_joker_effect(Joker *joker, Card *scored_card) {
|
||||
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[] = {
|
||||
{ COMMON_JOKER, 2, default_joker_effect }, // DEFAULT_JOKER_ID = 0
|
||||
{ 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, mystic_summit_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);
|
||||
|
||||
Reference in New Issue
Block a user