Skip to content

Commit 64e6281

Browse files
committed
Add functionality to change which area a card moves to
1 parent 8be0d2d commit 64e6281

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lovely/blind.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,18 @@ target = 'cardarea.lua'
149149
pattern = "local stay_flipped = G.GAME and G.GAME.blind and G.GAME.blind:stay_flipped(self, card)"
150150
position = 'at'
151151
match_indent = true
152-
payload = '''local stay_flipped = G.GAME and G.GAME.blind and G.GAME.blind:stay_flipped(self, card, area)'''
152+
payload = '''local stay_flipped = G.GAME and G.GAME.blind and G.GAME.blind:stay_flipped(self, card, area)
153+
if SMODS.to_area then to = SMODS.to_area; SMODS.to_area = nil end'''
153154

154155
[[patches]]
155156
[patches.pattern]
156157
target = 'functions/common_events.lua'
157158
pattern = "local stay_flipped = G.GAME and G.GAME.blind and G.GAME.blind:stay_flipped(to, card)"
158159
position = 'at'
159160
match_indent = true
160-
payload = '''local stay_flipped = G.GAME and G.GAME.blind and G.GAME.blind:stay_flipped(to, card, from)'''
161+
payload = '''local stay_flipped = G.GAME and G.GAME.blind and G.GAME.blind:stay_flipped(to, card, from)
162+
if SMODS.to_area then to = SMODS.to_area; SMODS.to_area = nil end
163+
'''
161164

162165
# Blind:drawn_to_hand()
163166
[[patches]]

src/overrides.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2520,6 +2520,9 @@ function Blind:stay_flipped(to_area, card, from_area)
25202520
local self_eval, self_post = eval_card(card, { to_area = to_area, from_area = from_area, other_card = card, stay_flipped = true })
25212521
local self_flags = SMODS.trigger_effects({ self_eval, self_post })
25222522
for k,v in pairs(self_flags) do flags[k] = flags[k] or v end
2523+
if flags.modify and flags.modify.to_area then
2524+
SMODS.to_area = flags.modify.to_area
2525+
end
25232526
if flags.prevent_stay_flipped then return false end
25242527
if flags.stay_flipped then return true end
25252528
return ret

0 commit comments

Comments
 (0)