Skip to content

Commit

Permalink
patch whiff and discard context
Browse files Browse the repository at this point in the history
  • Loading branch information
Eremel committed Jan 11, 2025
1 parent c8380cf commit 1328bec
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 11 additions & 9 deletions lovely/better_calc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -887,12 +887,12 @@ for i=1, #G.hand.cards do
-- TARGET: card held destroyed when hand played
if destroyed then --
if SMODS.shatters(G.play.cards[i]) then
G.play.cards[i].shattered = true
if SMODS.shatters(G.hand.cards[i]) then
G.hand.cards[i].shattered = true
else
G.play.cards[i].destroyed = true
G.hand.cards[i].destroyed = true
end
cards_destroyed[#cards_destroyed+1] = G.play.cards[i]
cards_destroyed[#cards_destroyed+1] = G.hand.cards[i]
end
end
Expand All @@ -907,15 +907,17 @@ SMODS.calculate_context({scoring_hand = scoring_hand, remove_playing_cards = tru

# context.remove_playing_cards from discard
[[patches]]
[patches.regex]
[patches.pattern]
target = "functions/state_events.lua"
pattern = '''
(?<indent>[\t ]*)for i = 1, #G\.jokers\.cards do
[/t ]* G\.jokers\.cards\[i\]:calculate_joker\(\{remove_playing_cards = true, removed = destroyed_cards\}\)
[/t ]*end
if destroyed_cards[1] then
for j=1, #G.jokers.cards do
eval_card(G.jokers.cards[j], {cardarea = G.jokers, remove_playing_cards = true, removed = destroyed_cards})
end
end
'''
position = "at"
line_prepend = '$indent'
match_indent = true
payload = '''
-- context.remove_playing_cards from discard
SMODS.calculate_context({remove_playing_cards = true, removed = destroyed_cards})
Expand Down
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-1311f-STEAMODDED"
return "1.0.0~ALPHA-1311g-STEAMODDED"

0 comments on commit 1328bec

Please sign in to comment.