Main Notes
- Added SMODS probability functions
- Poker Hands
visible
property adjustments - Animation adjustments
- certificate/marble
- card juicing on conditional upgrades
- level not updating when levelling up a different hand
- Discard effects on debuffed cards fixed
- Blueprint effects no longer copy debuffed jokers
- Blind debuff text can now be updated after it has been created
- Added
context.initial_scoring_step
- Added
context.joker_type_destroyed
- Added
context.evaluate_poker_hand
- Added
context.check_eternal
- Added
SMODS.is_eternal
- Added
Card:should_hide_front
- Added
context.beat_boss
tocontext.end_of_round
to signify if a boss was defeated
Probability Changes
Probability has had it's functionality changed to allow for more granular control of it, and to allow for effects to happen based on probability rolls. Unfortunately, this requires updating older mods to be able to function properly with the new changes. There are two steps to do this.
Updating Probability Chances
Step 1 - Replace your loc_vars
Any item descriptions that contain a chance roll should be updated to use the new functionality. If your code looked like this before,
return {vars = {numerator, denominator, other_value}}
then it should be changed to
local new_numerator, new_denominator = SMODS.get_probability_vars(card, numerator, demoninator, 'identifier') -- it is suggested to use an identifier so that effects that modify probabilities can target specific values
return {vars = {new_numerator, new_denominator, other_value}}
This will allow your item description to dynamically update based on probability altering effects.
Step 2 - Replace your probability checks
The probability check will also need to be adjusted. If your code look like this before,
if pseudorandom('seed') < G.GAME.probabilities.normal * numerator / denominator then
then it should be changed to
if SMODS.pseudorandom_probability(card, 'seed', numerator, denominator, 'identifier') then
This will allow your random chance effect to be based on probability altering effects.
Modifying Probability
It is now possible to modify probability in two ways. By using new calculation contexts, you can modify both the numerator and denominator of a chance based effect, with respect to joker order, or you can set it to a fixed value. Both of these new contexts have context.numerator
and context.denominator
which are the current values of the numerator and denominator, taking into account modifications from previous jokers. They also have context.trigger_obj
and context.identifier
which can be used to identify the source of the chance roll.
fix_probability = true, from_roll = from_roll, trigger_obj = trigger_obj, identifier = identifier, numerator = additive.numerator or base_numerator, denominator = additive.denominator or base_denominator
context.mod_probability
This context should be used for any additive or multiplicative modifications to the probability.
if context.mod_probability then
context.numerator -- current numerator
context.denominator -- current denominator
context.mod_probability -- boolean value to flag this context, always TRUE
context.trigger_obj -- the object that the roll comes from (note: The Wheel blind switches between the blind object and the blind prototype object)
context.identifier -- a string value to identify the source of the roll
context.from_roll -- internal value used to only trigger certain return values when the roll is made rather than a tooltip update
For example, Oops All 6s! would use this check:
if context.mod_probability and not context.blueprint then
return {
numerator = context.numerator * 2
}
end
context.fix_probability
This context should be used for setting either the numerator or the denominator.
if context.fix_probability then
context.numerator -- current numerator
context.denominator -- current denominator
context.fix_probability -- boolean value to flag this context, always TRUE
context.trigger_obj -- the object that the roll comes from (note: The Wheel blind switches between the blind object and the blind prototype object)
context.identifier -- a string value to identify the source of the roll
context.from_roll -- internal value used to only trigger certain return values when the roll is made rather than a tooltip update
For example, a joker that sets every chance based effect to a 1 in 2 would use this check:
if context.fix_probability and not context.blueprint then
return {
numerator = 1,
denominator = 2
}
end
Responding to probability rolls
It is also possible to trigger effects based on the outcomes of probability rolls, using another new context.
Some return values may appear misordered here. Please report any such occurances then we can continue to improve SMODS.
context.pseudorandom_result
This context should be used for setting either the numerator or the denominator.
if context.pseudorandom_result then
context.pseudorandom_result -- boolean value to flag this context, always TRUE
context.result -- the result of the chance roll
context.numerator -- the numerator used for the chance
context.denominator -- the denominator used for the chance
context.trigger_obj -- the object that the roll comes from (note: The Wheel blind switches between the blind object and the blind prototype object)
context.identifier -- a string value to identify the source of the roll
For example, a joker that triggers a message when a chance roll fails would look like this:
if context.pseudorandom_result and not context.result then
return {
message = 'Chance failed!'
}
end
Other Changes
New Contexts
context.initial_scoring_step
This context is used for scoring effects that happen before playing cards are scored.
Note: This happens after context.before
if context.initial_scoring_step then
context.cardarea, context.full_hand, context.scoring_hand, context.scoring_name, context.poker_hands,
context.initial_scoring_step -- boolean value to flag this context, always TRUE
context.joker_type_destroyed
This context is used when a non-playing card is destroyed.
if context.joker_type_destroyed then
context.joker_type_destroyed -- boolean value to flag this context, always TRUE
context.card -- the card object that has been destroyed
Note
You can return no_destroy = true
within this context to block the destruction event.
context.evaluate_poker_hand
This context is used to make modifications to the evaluation of poker hands, or to display custom hand names.
if context.evaluate_poker_hand then
context.evaluate_poker_hand
context.cardarea, context.full_hand, context.scoring_hand, context.scoring_name, context.poker_hands
context.evaluate_poker_hand -- boolean value to flag this context, always TRUE
context.display_name -- the current text that is displayed
Valid return values to make modifications within this context are:
replace_scoring_name = "Hand Type"
used to change which poker hand is used to scorereplace_display_name = "String"
used to change the displayed text (also accepts a loc_key for a string stored in thepoker_hands
loc_table)replace_poker_hands = table
used to modify the poker hands table (this is fairly advanced and should only be used if you know what you are doing)
context.check_eternal
This context is used to apply the eternal effect without the sticker being applied.
if context.check_eternal then
context.check_eternal -- boolean value to flag this context, always TRUE
context.other_card -- the card object that is being checked
context.trigger -- the source of the check (this is an empty table if it has not been provided)
Note
You can return no_destroy = true
within this context to add the eternal effect to a card. Returning no_destroy = {override_compat = true}
will apply the effect to cards that are marked as eternal_compat = false
.
New Functions
SMODS.is_eternal(card, trigger)
This function is used for checking whether a card object has an eternal property, provided either through the Eternal sticker, or other means.
card
- the card that is being checkedtrigger
- generally should be a reference to the object that is doing the check. If the check is being done by a general function, it is recommended to supply an identifying table such as{destroying_cards = true}
Card:should_hide_front()
This function checks whether a card object should display the front sprite or not. Currently only checks for Stone cards and cards with overrides_base_rank = true
defined on the Center, but can be hooked to provide additional functionality as required.
SMODS.is_poker_hand_visible(handname)
This function checks whether a poker hand is visible in the poker hands menu.
handname
- string of poker hand name
What's Changed
- Fix DeckSkin Credit UI breaking modded languages by @HuyTheKiller in #751
- Fix
smart_level_up
not updating level in scoring by @nh6574 in #755 - Dedicated functions for listed probabilities by @TamerSoup625 in #661
- Better calc individual juice fix (Issue #711) by @Gloompashcy in #737
- SMODS.PokerHand function to control visibility by @nh6574 in #764
- Blind debuff text can now update if provided a new message by @VivianGiacobbi in #769
- Fixed post_trigger effects not working on retrigger jokers by @Git-i in #761
- Front Hiding Revamp by @Numbuh214 in #773
context.evaluate_poker_hand
by @nh6574 in #777- Fix build achi tab not using hidden_pos by @justamirror in #780
- Changes to
SMODS.destroy_cards
by @nh6574 in #784 SMODS.is_eternal
by @Gloompashcy in #794- Fix vanilla playing card rng with
SMODS.create_card
by @nh6574 in #793 - Add beat_boss to context.end_of_round by @Gloompashcy in #786
- Pseudorandom Updates by @VivianGiacobbi in #785
- Type check in
SMODS.merge_effects
by @nh6574 in #791 - Added 'manual' delayed sprites to Card:set_ability() and Card:set_base() by @VivianGiacobbi in #797
- Made Joker Retrigger Juice optional by @VivianGiacobbi in #796
- Remove unnecessary patch from seal.toml by @Gloompashcy in #790
- Make blind's tag object accessible outside of skipping by @the-Astra in #779
- Include numerator and denominator in context.pseudorandom_result by @JustOsquo in #802
- Avoid crashes in SMODS.is_pokerhand_visible and add assert by @larswijn in #801
- pseudorandom_result context handling by @the-Astra in #803
New Contributors
- @HuyTheKiller made their first contribution in #751
- @TamerSoup625 made their first contribution in #661
- @Gloompashcy made their first contribution in #737
- @Git-i made their first contribution in #761
- @Numbuh214 made their first contribution in #773
- @justamirror made their first contribution in #780
- @the-Astra made their first contribution in #779
- @JustOsquo made their first contribution in #802
Full Changelog: 1.0.0-beta-0614a...1.0.0-beta-0711a