Skip to content
Eremel_ edited this page Jan 12, 2026 · 1 revision

SMODS~1.0.0-BETA-1221

There are a whole load of bug fixes that are included in this release that will not be covered here. If you wish to know what they are, please check the commit history and the closed issues for reference.

card_limit and extra_slots_used functionality rewrite

The internal methods for these properties have been rewritten to be more robust. There are some important things that you may need to pay attention to.

  • Use area.config.card_limit when checking for space in a card area

  • Use #area.cards to see how many cards are in the area

  • Use area.config.card_count to see how many slots are being used in the area

  • Use area.config.card_limits.total_slots to see how many total slots are in an area

  • Use #area.cards < area.config.card_limit to check if an area has space

  • Use SMODS.draw_cards(number) to force draw a number of cards (using G.FUNCS.draw_from_deck_to_hand will no longer work)

  • Add modifies_draw = true to any instances of SMODS.Blind that modify the number of cards drawn

  • New util function CardArea:count_property(property) takes a string value and returns the total value of card.ability.property for cards in that area

blueprint_compat changes

Adding blueprint_compat = false to your SMODS.Joker objects will now block any calls of SMODS.blueprint_effect on your Joker. In addition, vanilla Blueprint and Brainstorm now use this util function too. This means you no longer need to add and not context.blueprint to your calculation if you don't want effects to be copied.

ModObject.custom_card_areas helper function

You can now create a new function on your Mod Object to create a custom CardArea at the correct point of the run start sequence. This means that any loading will be done correctly. Here is an example of the function in use, which creates a new CardArea below the Jokers area. There will be more improvements to custom CardAreas in a future update.

SMODS.current_mod.custom_card_areas = function(game)
	game.my_area = CardArea(
		game.jokers.T.x, game.jokers.T.y + 3,
        game.jokers.T.w, game.jokers.T.h / 2,
        { card_limit = 1, type = 'joker', highlight_limit = 1 }
	)
end

Some further CardArea improvements lie in the config when creating a CardArea. You can define use bg_colour and no_card_count to change the colour of your area and toggle the card count respectively.

Animated Sprites Everywhere

Support for animated sprites appearing on any object has now been added, and should work straight out of the box. Simply create an animated atlas object as normal, and SMODS will handle the rest for you.

Here is an example animated atlas definition.

SMODS.Atlas({
	key = 'example_atlas',
	path = 'example_atlas.png' -- contained in assets folders
	px = 71, py = 95,
	atlas_table = 'ANIMATION_ATLAS' -- this line tells SMODS that this is an animated atlas
	frames = 5, -- the number of frames in your animation
	fps = 10 -- the fps to play your animation in (defaults to 10 if not included)
})

Note

Each animation should exist entirely on one row of your atlas.

Alongside this, there is a new util function SMODS.create_sprite(x, y, width, height, atlas_key, pos) that will create a sprite of the correct type based on the atlas you provide.

Level up hands with SMODS.upgrade_poker_hands

A new way to level up or upgrade poker hands has been added. This allows permanent modifications to the chips and mult (and other parameters if defined) for each poker hand that will not be removed when a standard level up happens.

This new function, SMODS.upgrade_poker_hands, can be used to achieve this behaviour, but may also be used to target multiple hands to improve at once.

SMODS.upgrade_poker_hands(args) - hands : table of strings or a single string of hand names to level up (if left blank defaults to all Poker Hands) - parameters : table of strings of keys of Scoring_Parameters to upgrade (if left blank defaults to all Scoring Parameters) - level_up : increases the level of the hand by amount passed (NOTE: this can be used to level up a hand by more than one level) - func : pass a custom function function(current, base, parameter) for custom modifications to the parameters in a Poker Hand (if left blank defaults to normal level up method) - from : the Object that is doing the upgrading, will juice_up during animations - instant : boolean that disables animations

New Tracking

Some new variables have been added to be tracked throughout a run, and a new helper function to check if the current blind is a specific one.

  • G.GAME.hands[handname].played_this_ante - similar to played_this_round but tracks across an entire ante (resets when the boss blind is defeated)
  • G.GAME.consumeable_usage_total - this table now automatically contains information for custom consumables too
  • SMODS.is_active_blind(key, ignore_disabled) - returns true when the current blind matches the inputted key

Custom Easing Types

This update adds an array of custom easing types that you can use in various ease functions provided by the game, as well as within ease events. They can be found in SMODS.ease_types in utils.lua, and your own easing functions can be added to this dictionary to be used.

Calculation Updates

There are a couple of new contexts in this update, as well as a functionality improvement to an existing context, as detailed below. In addition to this, you can now return a UI element as the message in a calculation return to be displayed as attention text. This is particularly useful if you want to display an image popup. There will be helper functions created for this in a future update.


context.create_shop_card

This context is used when a card is created for the main shop area. You can return a table as shop_create_flags that will be passed into SMODS.create_card to change which card will be created.

if context.create_shop_card then
context.set -- The selected set of the card that is to be created

context.modify_shop_card

This context is used when a card is added to the main shop area. You can call other functions on this card, such as Card:set_cost, to alter the card within the shop. This context could also be used to respond to certain things appearing in the shop.

if context.modify_shop_card then
context.card -- The card that has been added to the shop

context.blueprint

This context is used when a calculation is being copied from a different object. It contains all properties of the original context, alongside these extra properties.

context.blueprint -- flag to identify copy effect
context.blueprint_card -- the original object the copy effect came from
context.blueprint_copier -- the current object copying the effect (differs when copy effects are chained)
context.blueprint_copiers_stack -- ordered table of objects copying the effect (used when copy effects are chained)

And more!

  • PokerHands now appear in the collection within the Other category.
  • Stakes now fully support loc_vars
  • SMODS.Rarity has a new parameter, disable_if_empty, that removes the rarity from the pool of available rarities if the pool has no valid objects

Clone this wiki locally