SMODS.Enhancement [wip] - Pheubel/Steamodded GitHub Wiki
API Documentation: SMODS.Enhancement
- Required parameters:
key
- Optional parameters (defaults):
-
atlas = 'centers'
-
pos = {x = 0, y = 0}
-
discovered = false
, UNSUPPORTED -
unlocked = true
, -- UNSUPPORTED -
loc_txt
: Uses the standard skeleton, omit if using localization files -
replace_base_card
: Iftrue
, don't draw base card sprite or give base card chips. -
no_rank
: Iftrue
, enhanced card has no rank. -
no_suit
: Iftrue
, enhanced card has no suit. -
overrides_base_rank
: Iftrue
, enhancement cannot be generated by Grim, Familiar and Incantation (enhancements withno_rank
set to true are automatically assigned this property). -
any_suit
: Iftrue
, enhanced card counts as any suit. -
always_scores
: Iftrue
, enhanced card always counts in scoring. -
weight
: The weighting of the enhancement, follows same rules as other weighted objects (default weight is 5). -
config
, supported values that will be calculated and scored automatically:
{ bonus, bonus_chips, mult, x_mult, p_dollars, h_mult, h_x_mult, }
-
API methods
loc_vars(self, info_queue, card) -> { vars ?= table }
- Used for passing variables to enhancement descriptions.
get_weight(self) -> number
- Used to modify the weight of enhancement on certain conditions.
calculate(self, card, context, effect)
- Calculation for enhancements works slightly differently to other center objects. There is no return location for the method, so the
effect
table needs to be modified directly. An example of this would be,
calculate = function(self, card, context, effect) if context.cardarea == G.play and not context.repetition then effect.x_mult = card.ability.extra.x_mult end end
- Calculation for enhancements works slightly differently to other center objects. There is no return location for the method, so the
draw(self, card, layer)
- Draws the sprite and shader of the card.
Util methods
SMODS.poll_enhancement(args)
(defaults)args.key
, the key used to generate the seedargs.type_key
, an optional key used to generate the specific enhancement seedargs.mod
, multiplying modifier to the base rate (40%)args.guaranteed
, iftrue
, enhancement is guaranteedargs.options
, can be used to provide fixed options to the pool{ keys }
, a table of keys as strings, respects original weight values{ {key = string, weight = number} }
, a table of tables, with key and weight pairs
SMODS.get_enhancements(card, extra_only)
: Returns a table indexed by keys of enhancements that the given card has.Card:calculate_joker
is called for each joker withcontext = { check_enhancement = true, other_card = card }
, expecting return tables in the same format to add extra enhancements. No other ways to give a card multiple enhancements are currently supported.- If
extra_only == true
, the card's base enhancement is excluded.
SMODS.has_enhancement(card, key)
: Returnstrue
if the given card has the specified enhancement, either as its natural enhancement or an extra enhancement from jokers.SMODS.has_no_suit(card)
: Returns true if a card doesn't have any suit due to its enhancements (e.g., Stone Cards).SMODS.has_any_suit(card)
: Returns true if a card can be used as any suit due to its enhancements (e.g., Wild Cards).- Cards with enhancement effects both for having no suit and for having any suit can be used as any suit.
SMODS.has_no_rank(card)
: Returns true if a card doesn't have any rank due to its enhancements (e.g., Stone Cards).SMODS.always_scores(card)
: Returns true if a card always scores due to its enhancements (e.g., Stone Cards).