

Adds the ability to create and fetch custom rarities for cards, along with functionality for modifying the relative rarity of a card.
If you would like acsess to a pile of existing modded raritys checkout Rarity Bundle.
Those rarities should generally fit any need.
Note: This library is Not the corect way to disable cards from showing up; and it does not suport having a rarity with a weight of 0.
name the name of the rarity to add.relativeRarity how rare should it be (Common is 1, Rare is 0.1).color what color should the rarity be when the card is selected.colorOff what color should the rarity be when the card is not selected.RarityUtils.AddRarity("Legendary", 0.025f, new Color(1, 1, 0), new Color(0.7f, 0.7f, 0));
AddRarity should be utilized in your mod's Awake function, that way the rarities are present before building the cards that need them.
CardInfo.Rarity GetRarity(string rarityName)
Returns the rarity with the given name if it exists, otherwise returns Common. Can not be called untill after the rarities are finalized in RarityLib's start function.
rarityName the rarity to fetch.RarityUtils.GetRarity("Legendary");
Rarity GetRarityData(CardInfo.Rarity rarity)
Returns the data for a rarity.
rarity the rarity data to fetch.RarityUtils.GetRarityData(CardInfo.Rarity.Common);
float GetCardRarityModifier(CardInfo card)
Returns the rarity modifier for a card.
card the rarity data to fetch.float rarityMod = RarityUtils.GetCardRarityModifier(card);
UnityEngine.Debug.Log(rarityMod);
void SetCardRarityModifier(CardInfo card, float modifier)
Sets the default rarity modifier for a card.
card the rarity data to fetch.modifier the new default rarity modifier for the card.RarityUtils.SetCardRarityModifier(card, 5);
void AjustCardRarityModifier(CardInfo card, float add = 0, float mul = 0)
Adjusts the rarity modifier for a card.
card the rarity data to fetch.add the amount the default rarity modifier is adjusted by additively.mul the amount the default rarity modifier is adjusted by multiplicatively. Applies after the additive modifier.RarityUtils.AjustCardRarityModifier(CardInfo card, 5, 100)
The information about a given card rarity.