From 591485a5ac80a059a491345557c227ecb78aefa3 Mon Sep 17 00:00:00 2001 From: noctowlhoot Date: Mon, 22 Sep 2025 20:49:35 +0930 Subject: [PATCH] Update joker_effects.c I was unsure of the significance of the number immediately after joker rarity in the joker registry, so I haven't put the joker effects in there. If anyone can tell me what the significance of that number is I can add them in :) --- source/joker_effects.c | 138 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) diff --git a/source/joker_effects.c b/source/joker_effects.c index 1382ea2..a78a137 100644 --- a/source/joker_effects.c +++ b/source/joker_effects.c @@ -464,6 +464,143 @@ static JokerEffect odd_todd_joker_effect(Joker *joker, Card *scored_card) { return effect; } + __attribute__((unused)) + static JokerEffect the_duo_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 + + // This is really inefficient but the only way at the moment to check for whole-hand conditions + u8 suits[NUM_SUITS]; + u8 ranks[NUM_RANKS]; + get_played_distribution(ranks, suits); + + if (hand_contains_n_of_a_kind(ranks) >= 2) + effect.xmult = 2; + return effect; + } + + +// graphics available from @MathisMartin31 + __attribute__((unused)) + static JokerEffect the_trio_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 + + // This is really inefficient but the only way at the moment to check for whole-hand conditions + u8 suits[NUM_SUITS]; + u8 ranks[NUM_RANKS]; + get_played_distribution(ranks, suits); + + if (hand_contains_n_of_a_kind(ranks) >= 3) + effect.xmult = 3; + return effect; + } + +// graphics available from @MathisMartin31 + __attribute__((unused)) + static JokerEffect the_family_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 + + // This is really inefficient but the only way at the moment to check for whole-hand conditions + u8 suits[NUM_SUITS]; + u8 ranks[NUM_RANKS]; + get_played_distribution(ranks, suits); + + if (hand_contains_n_of_a_kind(ranks) >= 4) + effect.xmult = 4; + return effect; + } + +// graphics available from @MathisMartin31 + __attribute__((unused)) + static JokerEffect the_order_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 + + u8 suits[NUM_SUITS]; + u8 ranks[NUM_RANKS]; + get_played_distribution(ranks, suits); + + if (hand_contains_straight(ranks)) + effect.xmult = 3; + return effect; +} + +// graphics available from @MathisMartin31 + __attribute__((unused)) + static JokerEffect the_tribe_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 + + u8 suits[NUM_SUITS]; + u8 ranks[NUM_RANKS]; + get_played_distribution(ranks, suits); + + if (hand_contains_flush(suits)) + effect.xmult = 2; + return effect; +} + + +// graphics available from @MathisMartin31 + __attribute__((unused)) +static JokerEffect joker_bootstraps_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.mult = (get_money() / 5) * 2; + + return effect; +} + +// no graphics available but ready to be used if wanted when graphics available +__attribute__((unused)) +static JokerEffect shoot_the_moon_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 + + CardObject** hand = get_hand_array(); + int hand_size = hand_get_size(); + for (int i = 0; i < hand_size; i++ ) + { + switch (hand[i]->card->rank) { + case QUEEN: + + effect.mult += 13; + default: + break; + } + } + + return effect; +} + +// no graphics available but ready to be used if wanted when graphics available +__attribute__((unused)) +static JokerEffect triboulet_joker_effect(Joker *joker, Card *scored_card) { + JokerEffect effect = {0}; + if (scored_card == NULL) + return effect; + + switch (scored_card->rank) { + case KING: case QUEEN: case JACK: + effect.xmult = 2; + default: + break; + } + + return effect; +} + + /* The index of a joker in the registry matches its ID. * The joker sprites are matched by ID so the position in the registry * determines the joker's sprite. @@ -508,6 +645,7 @@ const JokerInfo joker_registry[] = { // The following jokers don't have sprites yet, // uncomment them when their sprites are added. + #if 0 { COMMON_JOKER, 5, raised_fist_joker_effect }, { COMMON_JOKER, 6, reserved_parking_joker_effect },