RarityLib

v1.3.0·Updated 2025-07-08

A utility library for adding custom rarities to the game.

About this mod Author’s original text

RarityLib

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.

Functions

AddRarity()

int AddRarity(string name, float relativeRarity, Color color, Color colorOff)

Description

Adds a new rarity for cards to utilize and returns the curent number of raritys regestered.

Parameters

  • string name the name of the rarity to add.
  • float relativeRarity how rare should it be (Common is 1, Rare is 0.1).
  • Color color what color should the rarity be when the card is selected.
  • Color colorOff what color should the rarity be when the card is not selected.

Example Usage

RarityUtils.AddRarity("Legendary", 0.025f, new Color(1, 1, 0), new Color(0.7f, 0.7f, 0));

Notes

AddRarity should be utilized in your mod's Awake function, that way the rarities are present before building the cards that need them.

GetRarity()

CardInfo.Rarity GetRarity(string rarityName)

Description

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.

Parameters

  • string rarityName the rarity to fetch.

Example Usage

RarityUtils.GetRarity("Legendary");

GetRarityData()

Rarity GetRarityData(CardInfo.Rarity rarity)

Description

Returns the data for a rarity.

Parameters

  • CardInfo.Rarity rarity the rarity data to fetch.

Example Usage

RarityUtils.GetRarityData(CardInfo.Rarity.Common);

GetCardRarityModifier()

float GetCardRarityModifier(CardInfo card)

Description

Returns the rarity modifier for a card.

Parameters

  • CardInfo card the rarity data to fetch.

Example Usage

float rarityMod = RarityUtils.GetCardRarityModifier(card);

UnityEngine.Debug.Log(rarityMod);

SetCardRarityModifier()

void SetCardRarityModifier(CardInfo card, float modifier)

Description

Sets the default rarity modifier for a card.

Parameters

  • CardInfo card the rarity data to fetch.
  • float modifier the new default rarity modifier for the card.

Example Usage

RarityUtils.SetCardRarityModifier(card, 5);

AjustCardRarityModifier()

void AjustCardRarityModifier(CardInfo card, float add = 0, float mul = 0)

Description

Adjusts the rarity modifier for a card.

Parameters

  • CardInfo card the rarity data to fetch.
  • float add the amount the default rarity modifier is adjusted by additively.
  • float mul the amount the default rarity modifier is adjusted by multiplicatively. Applies after the additive modifier.

Example Usage

RarityUtils.AjustCardRarityModifier(CardInfo card, 5, 100)

Classes

Rarity

Description

The information about a given card rarity.

Fields

  • string name
  • The name of a rarity.
  • float relativeRarity
  • How common the rarity is compared to commons.
  • float calculatedRarity
  • No idea.
  • Color color
  • The color of the rarity when a card is selected.
  • Color colorOff
  • The color of the rarity when a card is not selected.
  • CardInfo.Rarity value
  • The CardInfo rarity of a card rarity.

Install & use Install: BepInEx plugin

  1. The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
  2. Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
  3. Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
  4. Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.

Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.

Dependencies

Install these first, or the mod will not work:

BepInEx-BepInExPack_ROUNDSPykess-ModdingUtilsPykess-CardChoiceSpawnUniqueCardPatchwillis81808-UnboundLib

File & checksum

Filename
RarityLib-1.3.0.zip
File size
25.7 KiB
SHA-256
feec620aa0efebc41f83f3a07c33b7eac34a806609b58e7ca16732c89da44455
Stored at
2026-10-06 19:07