Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion lovely/better_calc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2000,4 +2000,35 @@ if ret then
ret.colour = G.C.RED
return ret
end
'''
'''

# 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
7 changes: 6 additions & 1 deletion src/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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 = {
Expand Down