diff --git a/lovely/better_calc.toml b/lovely/better_calc.toml index 3f0ea3818..e5cd0f6ed 100644 --- a/lovely/better_calc.toml +++ b/lovely/better_calc.toml @@ -2000,4 +2000,35 @@ if ret then ret.colour = G.C.RED return ret end -''' \ No newline at end of file +''' + +# Adds modify_blind_amt context +[[patches]] +[patches.pattern] +target = 'functions/UI_definitions.lua' +pattern = ''' +local blind_amt = get_blind_amount(G.GAME.round_resets.blind_ante)*blind_choice.config.mult*G.GAME.starting_params.ante_scaling +''' +position = "after" +payload = ''' +SMODS.blind_amt = blind_amt +SMODS.calculate_context({modify_blind_amt = true, blind_multiplier = blind_choice.config.mult}) +blind_amt = SMODS.blind_amt +SMODS.blind_amt = nil +''' +match_indent = true + +[[patches]] +[patches.pattern] +target = 'blind.lua' +pattern = ''' +self.chips = get_blind_amount(G.GAME.round_resets.ante)*self.mult*G.GAME.starting_params.ante_scaling +''' +position = "after" +payload = ''' +SMODS.blind_amt = self.chips +SMODS.calculate_context({modify_blind_amt = true, blind_multiplier = self.mult}) +self.chips = SMODS.blind_amt +SMODS.blind_amt = nil +''' +match_indent = true \ No newline at end of file diff --git a/src/utils.lua b/src/utils.lua index 757a99d4b..87555d0cd 100644 --- a/src/utils.lua +++ b/src/utils.lua @@ -1349,6 +1349,10 @@ SMODS.calculate_individual_effect = function(effect, scored_card, key, amount, f return key end + if key == 'blind_amt' then + SMODS.blind_amt = amount + end + if key == 'effect' then return true end @@ -1358,7 +1362,7 @@ SMODS.calculate_individual_effect = function(effect, scored_card, key, amount, f end if key == 'remove' or key == 'debuff_text' or key == 'cards_to_draw' or key == 'numerator' or key == 'denominator' or key == 'no_destroy' or - key == 'replace_scoring_name' or key == 'replace_display_name' or key == 'replace_poker_hands' or key == 'modify' or key == 'shop_create_flags' then + key == 'replace_scoring_name' or key == 'replace_display_name' or key == 'replace_poker_hands' or key == 'modify' or key == 'shop_create_flags' then return { [key] = amount } end @@ -1461,6 +1465,7 @@ SMODS.other_calculation_keys = { 'no_destroy', 'prevent_trigger', 'replace_scoring_name', 'replace_display_name', 'replace_poker_hands', 'shop_create_flags', + 'blind_amt', 'extra', } SMODS.silent_calculation = {