-
Notifications
You must be signed in to change notification settings - Fork 192
SMODS.Edition
Class prefix: e
-
Required parameters:
key-
shader: the key for your shader (reference)-
shader = falseis allowed. This will create an edition with no shader.
-
-
loc_txtor localization entry (reference)-
loc_txtshould contain an additionallabelstring. It is used on badges, whilenameis displayed at the top of info boxes. For use with localization files, this label should be placed inmisc.labels(without thee_prefix).
-
-
Optional parameters (defaults):
-
atlas = 'Joker', pos = { x = 0, y = 0 }, soul_pos, soul_atlas(reference)- This defines the card to draw the edition on in the collection.
-
config = {}, unlocked = true, discovered = false, no_collection, prefix_config, dependencies, badge_colour, text_colour(reference)- The following base values for
configare supported and will be applied/scored automatically:
{ chips = 10, mult = 10, x_mult = 2, p_dollars = 3, card_limit = 2, } - The following base values for
-
pools: List of keys to ObjectTypes this center should be injected into- Expects a list of keys like this:
{ ["Foo"] = true, ["Bar"] = true, } -
in_shop = false: Whether the edition can spawn naturally in the shop/booster packs. Ignored ifin_poolon this edition returnstrue. -
weight = 0: The weighting of the edition, see below for more details. -
extra_cost: The extra cost applied to cards in the shop with the edition. -
apply_to_float = false: Whether the shader should be applied to floating sprites or not. -
badge_colour = G.C.DARK_EDITION: Used to set a custom badge colour. -
sound = { sound = "foil1", per = 1.2, vol = 0.4 }: Used to set a custom sound when the edition is applied. -
disable_shadow: Disables shadow drawn under the card. -
disable_base_shader = false: Whether the base shader should be applied (boosterfor Booster packs and Spectral cards,voucherfor Vouchers and Invisible Joker,dissolveotherwise). Enable this if your shader modifies card transparency or shape in any way. Example:
-
always_scores: Iftrue, editioned card always counts in scoring. -
never_scores: Iftrue, editioned card never counts in scoring (supersedesalways_scores).
-
-
loc_vars(reference)- Only
vars,keyandsetreturn values are currently supported for editions.
- Only
-
get_weight(self) -> number- Returns weight. Use for finer control over the edition's weight.
-
on_apply(card) -> void- Used to modify Card when edition is applied
-
on_remove(card) -> void- Used to modify Card when edition is removed
-
calc_scaling(self, card, other_card, initial_value, scalar_value, args) -> table(reference)- (Added in 1531zeebee)
- Called by
SMODS.scale_card. Allows detection and modification of cards when scaling values. - This only affects the card with the Edition
-
on_load(card) -> void- Used to modify Card with edition when it is loaded from save file.
-
draw(self, card, layer)- Draws the edition's shader.
self.shaderis drawn by default when this is absent.
- Draws the edition's shader.
-
in_pool(self, args) -> bool- Define custom logic for when an edition is allowed to spawn. A card with this edition can spawn if
in_poolreturns true and all other checks are met. -
argstable containssource, which is the seed key used when callingpoll_edition.
- Define custom logic for when an edition is allowed to spawn. A card with this edition can spawn if
The default game editions have the following weights
negative = 3
polychrome = 3 (takes negative's weight in some circumstances)
holographic = 14
foil = 20
The base chance for an edition to appear in the shop is 4%, thus there is a 2% chance for a foil joker to appear. Adding custom editions to the shop maintains this 4% chance. Therefore, if you add an edition with a weight of 40, it will have a 2% chance to spawn, and foil will be reduced to 1% chance.
When the Hone and Glow Up vouchers are purchased, the weights of the base editions are adjusted. Custom editions do not have this bonus applied by default. This means that the vouchers do not increase the edition chances to 8%/16%, but rather increase the chances of the default editions by 2X and 4X respectively. To add your edition to the Hone and Glow Up functionality, add this to your edition definition.
get_weight = function(self)
return G.GAME.edition_rate * self.weight
end-
Card:set_edition(edition, immediate, silent, delay)- Use this function to set the edition of a card
-
edition,nilremoves edition,keyof edition as a string -
immediate, boolean -
silent, boolean -
delay, boolean delays the visuals of the edition, useful for applying editions during calculations
-
Example
If you have created a new edition called MyEdition, and your mod prefix key is defined as MyFirstMod, you would use this syntax to apply your edition to a card.
card:set_edition("e_MyFirstMod_MyEdition", true)
- Use this function to set the edition of a card
-
SMODS.poll_edition(args)- The arguments is always a table that can contain the following parameters. (defaults)
-
key = edition_generic, string - key value for a random seed -
mod = 1, number - scale of chance against base card -
no_negative = false, boolean - disables negative edition chance (chance is added to polychrome) -
guaranteed = false, boolean - disables base card -
options = all editions marked in_shop, table - List of editions to poll. Two variations. Option 1 - list of keys for included editions. This method respects defined weights,
Option 2 - table of keys and weights. Used to override default weights,{"e_foil", "e_holo","e_negative"}{ {name = 'e_foil', weight = 1,}, {name = 'e_holo', weight = 1,}, {name = 'e_polychrome', weight = 1,} } -
- The arguments is always a table that can contain the following parameters. (defaults)
Game Objects
- API Documentation
- SMODS.Achievement
- SMODS.Atlas
- SMODS.Attribute
- SMODS.Blind
- SMODS.CanvasSprite
- SMODS.Center
- SMODS.Challenge
- SMODS.DeckSkin
- SMODS.DrawStep
- SMODS.DynaTextEffect
- SMODS.Font
- SMODS.Gradient
- SMODS.https
- SMODS.JimboQuip
- SMODS.Keybind
- SMODS.Language
- SMODS.ObjectType and SMODS.ConsumableType
- SMODS.PokerHand
- SMODS.Rank and SMODS.Suit
- SMODS.Rarity
- SMODS.Scoring_Parameter and SMODS.Scoring_Calculation
- SMODS.Seal
- SMODS.Shader and SMODS.ScreenShader
- SMODS.Sound
- SMODS.Stake
- SMODS.Sticker
- SMODS.Tag
Guides
- Your First Mod
- Mod Metadata
- The Mod Object
- Calculate Functions
- Perma-bonuses
- Object Weights
- Logging
- Event Manager
- Localization
- Text Styling
- UI Structure
- Utility Functions
- All About
G - Internal Documentation
Release Notes
Found an issue, or want to add something? Submit a PR to the Wiki repo.