Skip to content
Closed
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
32 changes: 31 additions & 1 deletion lovely/better_calc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2037,7 +2037,6 @@ if ret then
return ret
end
'''

# Reload SMODS.last_hand
[[patches]]
[patches.pattern]
Expand All @@ -2061,3 +2060,34 @@ if saveTable then
end
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_chips = blind_amt
SMODS.calculate_context({modify_blind_chips = true, blind = blind_choice.config, blind_multiplier = blind_choice.config.mult, blind_chips = blind_amt})
blind_amt = SMODS.blind_chips
SMODS.blind_chips = 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_chips = self.chips
SMODS.calculate_context({modify_blind_chips = true, blind = self, blind_multiplier = self.mult, blind_chips = self.chips})
self.chips = SMODS.blind_chips
SMODS.blind_chips = nil
'''
match_indent = true
6 changes: 6 additions & 0 deletions src/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1337,6 +1337,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 Down Expand Up @@ -1479,6 +1483,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 Expand Up @@ -1835,6 +1840,7 @@ function SMODS.update_context_flags(context, flags)
-- insert general modified value updating here
if context.modify_ante then context.modify_ante = flags.modify end
if context.drawing_cards then context.amount = flags.modify end
if context.modify_blind_chips then context.blind_chips = flags.modify; SMODS.blind_chips = flags.modify end
end
end

Expand Down