-
Notifications
You must be signed in to change notification settings - Fork 78
SMODS.Rarity
Casimir Eisenach edited this page Jan 22, 2025
·
4 revisions
-
Required parameters:
key
-
loc_txt
or localization entry (reference)- The only supported field is
name
. In localization files, it must be set as bothmisc.labels['k_'..key:lower()]
andmisc.dictionary['k_'..key:lower()]
.
- The only supported field is
-
Optional parameters (defaults):
-
pools
: Table with a list of ObjectType keys to add this rarity to. Skeleton:
{ ["Joker"] = true, --uses self.default_rate when polled ["Joker"] = { rate = 0.7 }, }
-
badge_colour
: Colour of the rarity's badge. -
default_weight
: Setting a numerical value fordefault_weight
enables cards with this rarity to appear in the shop at the specified weight.- This sets a default weight, which can be modified by accessing
G.GAME[key:lower() .. '_mod']
during a run.
- This sets a default weight, which can be modified by accessing
-
-
get_weight(self, weight, object_type) -> number
- Returns weight. Use for finer control over the rarity's weight.
-
gradient(self, dt)
- Used to control the badge colour gradient.
-
SMODS.poll_rarity(_pool_key, _rand_key) -> key
- Polls all rarities tied to
_pool_key
and returns rarity key.
- Polls all rarities tied to
Game Objects
- API Documentation
- SMODS.Achievement
- SMODS.Atlas
- SMODS.Blind
- SMODS.Center
- SMODS.Challenge
- SMODS.DeckSkin
- SMODS.Keybind
- SMODS.Language
- SMODS.ObjectType
- SMODS.PokerHand
- SMODS.Rarity
- SMODS.Seal
- SMODS.Sound
- SMODS.Stake
- SMODS.Sticker
- SMODS.Suit and SMODS.Rank
- SMODS.Tag
Guides
- Your First Mod
- Mod Metadata
- Joker Calculation
- Calculate Functions
- Logging
- Event Manager
- Localization
- Mod functions
- UI Structure
- Utility Functions
Found an issue, or want to add something? Submit a PR to the Wiki repo.