Weight jokers by rarity in the shop (#152)
* Added weight for the rarity of jokers in the shop * Includes manual conflict resolution --------- Co-authored-by: JustinL-12 <jlong30@uic.edu> Co-authored-by: MeirGavish <meir.gavish@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -332,3 +332,27 @@ Sprite* joker_object_get_sprite(JokerObject* joker_object)
|
||||
return NULL;
|
||||
return sprite_object_get_sprite(joker_object->sprite_object);
|
||||
}
|
||||
|
||||
int joker_get_random_rarity()
|
||||
{
|
||||
int joker_rarity = 0;
|
||||
int rarity_roll = random() % 100;
|
||||
if (rarity_roll < COMMON_JOKER_CHANCE)
|
||||
{
|
||||
joker_rarity = COMMON_JOKER;
|
||||
}
|
||||
else if (rarity_roll < COMMON_JOKER_CHANCE + UNCOMMON_JOKER_CHANCE)
|
||||
{
|
||||
joker_rarity = UNCOMMON_JOKER;
|
||||
}
|
||||
else if (rarity_roll < COMMON_JOKER_CHANCE + UNCOMMON_JOKER_CHANCE + RARE_JOKER_CHANCE)
|
||||
{
|
||||
joker_rarity = RARE_JOKER;
|
||||
}
|
||||
else if (rarity_roll < COMMON_JOKER_CHANCE + UNCOMMON_JOKER_CHANCE + RARE_JOKER_CHANCE + LEGENDARY_JOKER_CHANCE)
|
||||
{
|
||||
joker_rarity = LEGENDARY_JOKER;
|
||||
}
|
||||
|
||||
return joker_rarity;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user