-
Notifications
You must be signed in to change notification settings - Fork 176
0711a
- Added SMODS probability functions
- Poker Hands
visibleproperty 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_bosstocontext.end_of_roundto signify if a boss was defeated
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.
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.
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 thenthen it should be changed to
if SMODS.pseudorandom_probability(card, 'seed', numerator, denominator, 'identifier') thenThis will allow your random chance effect to be based on probability altering effects.
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
This context should be used for any additive or multiplicative modifications to the probability.
if context.mod_probability thencontext.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 updateFor example, Oops All 6s! would use this check:
if context.mod_probability and not context.blueprint then
return {
numerator = context.numerator * 2
}
endThis context should be used for setting either the numerator or the denominator.
if context.fix_probability thencontext.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 updateFor 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
}
endIt 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.
This context should be used for setting either the numerator or the denominator.
if context.pseudorandom_result thencontext.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 rollFor 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!'
}
endThis context is used for scoring effects that happen before playing cards are scored. Note: This happens after context.before
if context.initial_scoring_step thencontext.cardarea, context.full_hand, context.scoring_hand, context.scoring_name, context.poker_hands,
context.initial_scoring_step -- boolean value to flag this context, always TRUEThis context is used when a non-playing card is destroyed.
if context.joker_type_destroyed thencontext.joker_type_destroyed -- boolean value to flag this context, always TRUE
context.card -- the card object that has been destroyedNote
You can return no_destroy = true within this context to block the destruction event.
This context is used to make modifications to the evaluation of poker hands, or to display custom hand names.
if context.evaluate_poker_hand thencontext.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 displayedValid return values to make modifications within this context are:
-
replace_scoring_name = "Hand Type"used to change which poker hand is used to score -
replace_display_name = "String"used to change the displayed text (also accepts a loc_key for a string stored in thepoker_handsloc_table) -
replace_poker_hands = tableused to modify the poker hands table (this is fairly advanced and should only be used if you know what you are doing)
This context is used to apply the eternal effect without the sticker being applied.
if context.check_eternal thencontext.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.
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 checked -
trigger- 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}
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.
This function checks whether a poker hand is visible in the poker hands menu.
-
handname- string of poker hand name
- Fix DeckSkin Credit UI breaking modded languages by @HuyTheKiller in https://github.com/Steamodded/smods/pull/751
- Fix
smart_level_upnot updating level in scoring by @nh6574 in https://github.com/Steamodded/smods/pull/755 - Dedicated functions for listed probabilities by @TamerSoup625 in https://github.com/Steamodded/smods/pull/661
- Better calc individual juice fix (Issue #711) by @Gloompashcy in https://github.com/Steamodded/smods/pull/737
- SMODS.PokerHand function to control visibility by @nh6574 in https://github.com/Steamodded/smods/pull/764
- Blind debuff text can now update if provided a new message by @VivianGiacobbi in https://github.com/Steamodded/smods/pull/769
- Fixed post_trigger effects not working on retrigger jokers by @Git-i in https://github.com/Steamodded/smods/pull/761
- Front Hiding Revamp by @Numbuh214 in https://github.com/Steamodded/smods/pull/773
-
context.evaluate_poker_handby @nh6574 in https://github.com/Steamodded/smods/pull/777 - Fix build achi tab not using hidden_pos by @justamirror in https://github.com/Steamodded/smods/pull/780
- Changes to
SMODS.destroy_cardsby @nh6574 in https://github.com/Steamodded/smods/pull/784 -
SMODS.is_eternalby @Gloompashcy in https://github.com/Steamodded/smods/pull/794 - Fix vanilla playing card rng with
SMODS.create_cardby @nh6574 in https://github.com/Steamodded/smods/pull/793 - Add beat_boss to context.end_of_round by @Gloompashcy in https://github.com/Steamodded/smods/pull/786
- Pseudorandom Updates by @VivianGiacobbi in https://github.com/Steamodded/smods/pull/785
- Type check in
SMODS.merge_effectsby @nh6574 in https://github.com/Steamodded/smods/pull/791 - Added 'manual' delayed sprites to Card:set_ability() and Card:set_base() by @VivianGiacobbi in https://github.com/Steamodded/smods/pull/797
- Made Joker Retrigger Juice optional by @VivianGiacobbi in https://github.com/Steamodded/smods/pull/796
- Remove unnecessary patch from seal.toml by @Gloompashcy in https://github.com/Steamodded/smods/pull/790
- Make blind's tag object accessible outside of skipping by @the-Astra in https://github.com/Steamodded/smods/pull/779
- Include numerator and denominator in context.pseudorandom_result by @JustOsquo in https://github.com/Steamodded/smods/pull/802
- Avoid crashes in SMODS.is_pokerhand_visible and add assert by @larswijn in https://github.com/Steamodded/smods/pull/801
- pseudorandom_result context handling by @the-Astra in https://github.com/Steamodded/smods/pull/803
- @HuyTheKiller made their first contribution in https://github.com/Steamodded/smods/pull/751
- @TamerSoup625 made their first contribution in https://github.com/Steamodded/smods/pull/661
- @Gloompashcy made their first contribution in https://github.com/Steamodded/smods/pull/737
- @Git-i made their first contribution in https://github.com/Steamodded/smods/pull/761
- @Numbuh214 made their first contribution in https://github.com/Steamodded/smods/pull/773
- @justamirror made their first contribution in https://github.com/Steamodded/smods/pull/780
- @the-Astra made their first contribution in https://github.com/Steamodded/smods/pull/779
- @JustOsquo made their first contribution in https://github.com/Steamodded/smods/pull/802
Full Changelog: https://github.com/Steamodded/smods/compare/1.0.0-beta-0614a...1.0.0-beta-0711a
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.