Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
62 changes: 62 additions & 0 deletions lovely/better_calc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1971,3 +1971,65 @@ position = 'at'
payload = '''
delay(0.4); ease_ante(1, true); delay(0.4); check_for_unlock({type = 'ante_up', ante = G.GAME.round_resets.ante + 1})
'''

# Make draw_card and draw_card_from actually use stay_flipped
[[patches]]
[patches.pattern]
target = "cardarea.lua"
match_indent = true
pattern = '''
local stay_flipped = G.GAME and G.GAME.blind and G.GAME.blind:stay_flipped(self, card, area)
'''
position = "at"
payload = '''
local stay_flipped = G.GAME and G.GAME.blind and G.GAME.blind:stay_flipped(self, card, area) or stay_flipped
'''

[[patches]]
[patches.pattern]
target = "cardarea.lua"
match_indent = true
pattern = '''
local stay_flipped = G.GAME and G.GAME.blind and G.GAME.blind:stay_flipped(to, card, from)
'''
position = "at"
payload = '''
local stay_flipped = G.GAME and G.GAME.blind and G.GAME.blind:stay_flipped(to, card, from) or stay_flipped
'''

# Discard From Play context
[[patches]]
[patches.pattern]
target = 'functions/state_events.lua'
match_indent = true
pattern = '''
draw_card(G.play,G.discard, it*100/play_count,'down', false, v)
'''
position = 'at'
payload = '''
local flags = SMODS.calculate_context({discard_from_play = true, card = v, num_discarded = k})
local discard_to = G[flags.cardarea] or G.discard
draw_card(G.play,discard_to, it*100/play_count,'down', false, v, nil, nil, flags.stay_flipped)
'''

# Draw Individual context
[[patches]]
[patches.pattern]
target = 'functions/state_events.lua'
match_indent = true
pattern = '''
draw_card(G.deck,G.hand, i*100/hand_space,'up', true, cards_to_draw[i])
else
draw_card(G.deck,G.hand, i*100/hand_space,'up', true, cards_to_draw[i])
end
'''
position = 'at'
payload = '''
local flags = SMODS.calculate_context({draw_individual = true, card = cards_to_draw[i], num_drawn = i, to_booster = true})
draw_card(G.deck,G.hand, i*100/hand_space,'up', true, cards_to_draw[i], nil, nil, flags.stay_flipped)
else
local flags = SMODS.calculate_context({draw_individual = true, card = cards_to_draw[i], num_drawn = i, to_booster = false})
local draw_to = G[flags.cardarea] or G.hand
draw_card(G.deck,draw_to, i*100/hand_space,'up', true, cards_to_draw[i], nil, nil, flags.stay_flipped)
end
'''
5 changes: 3 additions & 2 deletions src/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,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' then
key == 'replace_scoring_name' or key == 'replace_display_name' or key == 'replace_poker_hands' or key == 'modify' or key == 'cardarea' then
return { [key] = amount }
end

Expand Down Expand Up @@ -1448,7 +1448,8 @@ SMODS.other_calculation_keys = {
'numerator', 'denominator',
'modify',
'no_destroy', 'prevent_trigger',
'replace_scoring_name', 'replace_display_name', 'replace_poker_hands'
'replace_scoring_name', 'replace_display_name', 'replace_poker_hands',
'cardarea'
}
SMODS.silent_calculation = {
saved = true, effect = true, remove = true,
Expand Down