From 3d3c2c96c0c3d02739d15f9a20e06cef32cd0dd1 Mon Sep 17 00:00:00 2001 From: Eremel Date: Wed, 8 Jan 2025 21:33:29 +0000 Subject: [PATCH] Negative message and consumables in other_joker context --- lovely/better_calc.toml | 48 +++++++++++++++++++++++++++++++++++++---- version.lua | 2 +- 2 files changed, 45 insertions(+), 5 deletions(-) diff --git a/lovely/better_calc.toml b/lovely/better_calc.toml index 14b2302a..6543486f 100644 --- a/lovely/better_calc.toml +++ b/lovely/better_calc.toml @@ -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 @@ -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 @@ -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' \ No newline at end of file +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)}} +''' diff --git a/version.lua b/version.lua index 077deaf2..c96805ee 100644 --- a/version.lua +++ b/version.lua @@ -1 +1 @@ -return "1.0.0~ALPHA-1308a-STEAMODDED" +return "1.0.0~ALPHA-1308b-STEAMODDED"