Merge branch 'main' into main

This commit is contained in:
Geralt
2025-10-08 23:25:24 +02:00
committed by GitHub
19 changed files with 106 additions and 30 deletions
+51 -22
View File
@@ -304,9 +304,6 @@ static JokerEffect blue_joker_effect(Joker *joker, Card *scored_card) {
return effect;
}
// Using __attribute__((unused)) for jokers with no sprites yet to avoid warning
// Remove the attribute once they have sprites
__attribute__((unused))
static JokerEffect raised_fist_joker_effect(Joker *joker, Card *scored_card)
{
JokerEffect effect = {0};
@@ -331,7 +328,6 @@ static JokerEffect raised_fist_joker_effect(Joker *joker, Card *scored_card)
return effect;
}
__attribute__((unused))
static JokerEffect reserved_parking_joker_effect(Joker *joker, Card *scored_card) {
JokerEffect effect = {0};
if (scored_card != NULL)
@@ -386,7 +382,6 @@ static JokerEffect scary_face_joker_effect(Joker *joker, Card *scored_card) {
return effect;
}
__attribute__((unused))
static JokerEffect abstract_joker_effect(Joker *joker, Card *scored_card) {
JokerEffect effect = {0};
if (scored_card != NULL)
@@ -399,7 +394,6 @@ static JokerEffect abstract_joker_effect(Joker *joker, Card *scored_card) {
return effect;
}
__attribute__((unused))
static JokerEffect bull_joker_effect(Joker *joker, Card *scored_card) {
JokerEffect effect = {0};
if (scored_card != NULL)
@@ -480,7 +474,6 @@ static JokerEffect the_duo_joker_effect(Joker *joker, Card *scored_card) {
return effect;
}
// graphics available from @MathisMartin31
__attribute__((unused))
static JokerEffect the_trio_joker_effect(Joker *joker, Card *scored_card) {
@@ -547,7 +540,8 @@ static JokerEffect the_tribe_joker_effect(Joker *joker, Card *scored_card) {
return effect;
}
// Using __attribute__((unused)) for jokers with no sprites yet to avoid warning
// Remove the attribute once they have sprites
// graphics available from @MathisMartin31
__attribute__((unused))
static JokerEffect bootstraps_joker_effect(Joker *joker, Card *scored_card) {
@@ -597,6 +591,41 @@ static JokerEffect triboulet_joker_effect(Joker *joker, Card *scored_card) {
return effect;
}
static JokerEffect blueprint_joker_effect(Joker *joker, Card *scored_card) {
JokerEffect effect = {0};
List* jokers = get_jokers();
int list_size = list_get_size(jokers);
for (int i = 0; i < list_size - 1; i++ ) {
JokerObject* curr_joker_object = list_get(jokers, i);
if (curr_joker_object->joker == joker) {
JokerObject* next_joker_object = list_get(jokers, i + 1);
effect = joker_get_score_effect(next_joker_object->joker, scored_card);
break;
}
}
return effect;
}
static JokerEffect brainstorm_joker_effect(Joker *joker, Card *scored_card) {
JokerEffect effect = {0};
static bool in_brainstorm = false;
if (in_brainstorm)
return effect;
List* jokers = get_jokers();
JokerObject* first_joker = list_get(jokers, 0);
if (first_joker != NULL && first_joker->joker->id != JOKER_BRAINSTORM_ID) {
// Static var to avoid infinite blueprint + brainstorm loops
in_brainstorm = true;
effect = joker_get_score_effect(first_joker->joker, scored_card);
in_brainstorm = false;
}
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
@@ -639,24 +668,24 @@ const JokerInfo joker_registry[] = {
// Business card should be paired with Shortcut for palette optimization when it's added
{ COMMON_JOKER, 4, scary_face_joker_effect }, // 28
{ COMMON_JOKER, 4, smiley_face_joker_effect }, // 29
{ UNCOMMON_JOKER, 5, NULL /* Pareidolia */ }, // 30
{ COMMON_JOKER, 5, raised_fist_joker_effect }, // 30
{ COMMON_JOKER, 6, reserved_parking_joker_effect }, // 31
{ COMMON_JOKER, 4, abstract_joker_effect }, // 32
{ UNCOMMON_JOKER, 6, bull_joker_effect}, // 33
{ RARE_JOKER, 8, the_duo_joker_effect}, // 34
{ RARE_JOKER, 8, the_trio_joker_effect}, // 35
{ RARE_JOKER, 8, the_family_joker_effect}, // 36
{ RARE_JOKER, 8, the_order_joker_effect}, // 37
{ RARE_JOKER, 8, the_tribe_joker_effect}, // 38
{ RARE_JOKER, 10, blueprint_joker_effect }, // 39
{ RARE_JOKER, 10, brainstorm_joker_effect }, // 40
{ UNCOMMON_JOKER, 5, NULL /* Pareidolia */ }, // 41
// 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 },
{ COMMON_JOKER, 4, abstract_joker_effect },
{ UNCOMMON_JOKER, 6, bull_joker_effect},
{ UNCOMMON_JOKER, 6, acrobat_joker_effect },
{ RARE_JOKER, 8, the_duo_joker_effect},
{ RARE_JOKER, 8, the_trio_joker_effect},
{ RARE_JOKER, 8, the_family_joker_effect},
{ RARE_JOKER, 8, the_order_joker_effect},
{ RARE_JOKER, 8, the_tribe_joker_effect},
{ UNCOMMON_JOKER, 7, bootstraps_joker_effect},
{ UNCOMMON_JOKER, 7, bootstraps_joker_effect},
{ COMMON_JOKER, 5, shoot_the_moon_joker_effect},
#endif
};
@@ -672,4 +701,4 @@ const JokerInfo* get_joker_registry_entry(int joker_id) {
size_t get_joker_registry_size(void) {
return joker_registry_size;
}
}