Skip to content

Commit 1c5d4f5

Browse files
authored
fix lovely patches, slow and steady (SpectralPack#698)
1 parent eb892a5 commit 1c5d4f5

File tree

5 files changed

+26
-19
lines changed

5 files changed

+26
-19
lines changed

lib/forcetrigger.lua

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -897,10 +897,16 @@ function Cryptid.forcetrigger(card, context)
897897
end
898898
end
899899
if card.ability.name == "Perkeo" then
900-
if G.consumeables.cards[1] then
900+
local eligibleJokers = {}
901+
for i = 1, #G.consumeables.cards do
902+
if G.consumeables.cards[i].ability.consumeable then
903+
eligibleJokers[#eligibleJokers + 1] = G.consumeables.cards[i]
904+
end
905+
end
906+
if #eligibleJokers > 0 then
901907
G.E_MANAGER:add_event(Event({
902908
func = function()
903-
local card = copy_card(pseudorandom_element(G.consumeables.cards, pseudoseed("perkeo")), nil)
909+
local card = copy_card(pseudorandom_element(eligibleJokers, pseudoseed('perkeo')), nil)
904910
card:set_edition({ negative = true }, true)
905911
card:add_to_deck()
906912
G.consumeables:emplace(card)

lovely/lib_misc.toml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,6 @@ end
4242
'''
4343
match_indent = true
4444

45-
# Patch related crash
46-
[[patches]]
47-
[patches.pattern]
48-
target = "card.lua"
49-
pattern = "if not initial then G.GAME.blind:debuff_card(self) end"
50-
position = "at"
51-
payload = "if not initial and G.GAME and G.GAME.blind then G.GAME.blind:debuff_card(self) end"
52-
match_indent = true
53-
5445
# Draw midground layer
5546
[[patches]]
5647
[patches.pattern]

lovely/misc.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ if to_big(self.ability.x_mult) > to_big(1) then
5858
'''
5959
match_indent = true
6060

61+
[[patches]]
62+
[patches.pattern]
63+
target = "card.lua"
64+
pattern = "if self.ability.x_mult - self.ability.extra <= 1 then"
65+
position = "at"
66+
payload = '''
67+
if to_big(self.ability.x_mult) - to_big(self.ability.extra) <= to_big(1) then
68+
'''
69+
match_indent = true
70+
6171
[[patches]]
6272
[patches.pattern]
6373
target = "card.lua"

lovely/none.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,14 @@ end
121121
'''
122122
position = "at"
123123
payload = '''
124-
if self.ability.consumeable.max_highlighted then
125-
if G.GAME.hands["cry_None"].visible then
126-
Cryptid.reset_to_none()
127-
128-
else
129-
update_hand_text({delay = 0}, {mult = 0, chips = 0, handname = '', level = ''})
130-
end
124+
if self.ability.consumeable.max_highlighted then
125+
if G.GAME.hands["cry_None"].visible then
126+
Cryptid.reset_to_none()
127+
128+
else
129+
update_hand_text({delay = 0}, {mult = 0, chips = 0, handname = '', level = ''})
131130
end
131+
end
132132
'''
133133
match_indent = true
134134

lovely/sticker.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ match_indent = true
121121
[[patches]]
122122
[patches.pattern]
123123
target = "card.lua"
124-
pattern = "if self.ability.queue_negative_removal then"
124+
pattern = "if self.joker_added_to_deck_but_debuffed then"
125125
position = "before"
126126
payload = '''
127127
if self.ability.consumeable and self.pinned and (G.GAME.cry_pinned_consumeables > 0) then

0 commit comments

Comments
 (0)