Skip to content

Commit

Permalink
Negative message and consumables in other_joker context
Browse files Browse the repository at this point in the history
  • Loading branch information
Eremel committed Jan 8, 2025
1 parent 107ab14 commit 3d3c2c9
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 5 deletions.
48 changes: 44 additions & 4 deletions lovely/better_calc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -706,8 +706,9 @@ match_indent = true
position = "at"
payload = '''
-- Calculate context.other_joker effects
for _, _joker in ipairs(G.jokers.cards) do
local joker_eval,post = eval_card(_joker, {full_hand = G.play.cards, scoring_hand = scoring_hand, scoring_name = text, poker_hands = poker_hands, other_joker = _card})
for k=1, #G.jokers.cards + #G.consumeables.cards do
local _joker = G.jokers.cards[k] or G.consumeables.cards[k - #G.jokers.cards]
local joker_eval,post = eval_card(_joker, {full_hand = G.play.cards, scoring_hand = scoring_hand, scoring_name = text, poker_hands = poker_hands, other_joker = _card.ability.set == 'Joker' and _card or false, other_consumeable = _card.ability.set ~= 'Joker' and _card or false})
if next(joker_eval) then
if joker_eval.edition then joker_eval.edition = {} end
joker_eval.jokers.juice_card = _joker
Expand All @@ -719,7 +720,7 @@ for _, _joker in ipairs(G.jokers.cards) do
end
if joker_eval.retriggers then
for rt = 1, #joker_eval.retriggers do
local rt_eval, rt_post = eval_card(_card, {full_hand = G.play.cards, scoring_hand = scoring_hand, scoring_name = text, poker_hands = poker_hands, other_joker = _card, retrigger_joker = true})
local rt_eval, rt_post = eval_card(_card, {full_hand = G.play.cards, scoring_hand = scoring_hand, scoring_name = text, poker_hands = poker_hands, other_joker = _card.ability.set == 'Joker' and _card or false, other_consumeable = _card.ability.set ~= 'Joker' and _card or false, retrigger_joker = true})
table.insert(effects, {joker_eval.retriggers[rt]})
table.insert(effects, rt_eval)
if next(rt_post) then table.insert(effects, rt_post) end
Expand Down Expand Up @@ -1352,4 +1353,43 @@ target = 'card.lua'
match_indent = true
position = 'after'
pattern = 'local other_joker_ret = other_joker:calculate_joker(context)'
payload = 'context.blueprint = nil'
payload = 'context.blueprint = nil'

# Auto deal with negative chips card_eval_status_text()
[[patches]]
[patches.pattern]
target = 'functions/common_events.lua'
match_indent = true
position = 'at'
pattern = '''
text = localize{type='variable',key='a_chips',vars={amt}}
'''
payload = '''
text = localize{type='variable',key='a_chips'..(amt<0 and '_minus' or ''),vars={math.abs(amt)}}
'''

# Auto deal with negative mult card_eval_status_text()
[[patches]]
[patches.pattern]
target = 'functions/common_events.lua'
match_indent = true
position = 'at'
pattern = '''
text = localize{type='variable',key='a_mult',vars={amt}}
'''
payload = '''
text = localize{type='variable',key='a_mult'..(amt<0 and '_minus' or ''),vars={math.abs(amt)}}
'''

# Auto deal with negative xmult card_eval_status_text()
[[patches]]
[patches.pattern]
target = 'functions/common_events.lua'
match_indent = true
position = 'at'
pattern = '''
text = localize{type='variable',key='a_xmult',vars={amt}}
'''
payload = '''
text = localize{type='variable',key='a_xmult'..(amt<0 and '_minus' or ''),vars={math.abs(amt)}}
'''
2 changes: 1 addition & 1 deletion version.lua
Original file line number Diff line number Diff line change
@@ -1 +1 @@
return "1.0.0~ALPHA-1308a-STEAMODDED"
return "1.0.0~ALPHA-1308b-STEAMODDED"

0 comments on commit 3d3c2c9

Please sign in to comment.