Skip to content

Commit

Permalink
Fix keep_on_use in booster packs
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurelius7309 committed Jan 12, 2025
1 parent 96132da commit b4dfc3b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
14 changes: 10 additions & 4 deletions lovely/booster.toml
Original file line number Diff line number Diff line change
Expand Up @@ -127,21 +127,27 @@ position = "at"
payload = "if G.STATE == G.STATES.SELECTING_HAND or G.STATE == G.STATES.TAROT_PACK or G.STATE == G.STATES.SPECTRAL_PACK or G.STATE == G.STATES.PLANET_PACK or G.STATE == G.STATES.SMODS_BOOSTER_OPENED then"
match_indent = true

# G.FUNC.use_card()
# G.FUNCS.use_card()
[[patches]]
[patches.pattern]
target = "functions/button_callbacks.lua"
pattern = "if G.STATE == G.STATES.TAROT_PACK or G.STATE == G.STATES.PLANET_PACK or G.STATE == G.STATES.SPECTRAL_PACK then"
position = "at"
payload = "if G.STATE == G.STATES.TAROT_PACK or G.STATE == G.STATES.PLANET_PACK or G.STATE == G.STATES.SPECTRAL_PACK or G.STATE == G.STATES.SMODS_BOOSTER_OPENED and not nc then"
payload = """
if nc then
area:remove_from_highlighted(card)
play_sound('cardSlide2', nil, 0.3)
dont_dissolve = true
end
if (G.STATE == G.STATES.TAROT_PACK or G.STATE == G.STATES.PLANET_PACK or G.STATE == G.STATES.SPECTRAL_PACK or G.STATE == G.STATES.SMODS_BOOSTER_OPENED) then"""
match_indent = true

# G.FUNC.use_card()
[[patches]]
[patches.pattern]
target = "functions/button_callbacks.lua"
pattern = 'elseif G.GAME.pack_choices and G.GAME.pack_choices > 1 then'
position = 'after'
pattern = 'if area == G.consumeables then'
position = 'before'
match_indent = true
payload = '''
if nc and area == G.pack_cards then G.pack_cards:remove_card(card); G.consumeables:emplace(card) end'''
Expand Down
10 changes: 3 additions & 7 deletions lovely/center.toml
Original file line number Diff line number Diff line change
Expand Up @@ -410,19 +410,15 @@ if card.ability.consumeable then
nc = obj:keep_on_use(card)
end
end
if not nc and card.area then card.area:remove_card(card) end'''
if card.area and (not nc or card.area == G.pack_cards) then card.area:remove_card(card) end'''

[[patches]]
[patches.pattern]
target = 'functions/button_callbacks.lua'
pattern = "else draw_card(G.hand, G.play, 1, 'up', true, card, nil, mute) end"
match_indent = true
position = 'before'
payload = '''
elseif nc then
area:remove_from_highlighted(card)
play_sound('cardSlide2', nil, 0.3)
dont_dissolve = true'''
position = 'at'
payload = '''elseif not nc then draw_card(G.hand, G.play, 1, 'up', true, card, nil, mute) end'''

# Card:set_sprites()
[[patches]]
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-1312c-STEAMODDED"
return "1.0.0~ALPHA-1312d-STEAMODDED"

0 comments on commit b4dfc3b

Please sign in to comment.