Skip to content

Commit 2c04448

Browse files
committed
Fix #979
This will do for now
1 parent 953404e commit 2c04448

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

lovely/fixes.toml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -638,13 +638,13 @@ if success then st = _st else sendWarnMessage(_st, "LuaSteam"); st = {} end"""
638638
overwrite = true
639639
match_indent = true
640640

641-
# copy_card edition config
641+
# copy_card: Subtract from .ability.card_limit
642642
[[patches]]
643643
[patches.pattern]
644644
target = 'functions/common_events.lua'
645-
position = 'at'
645+
position = 'before'
646646
match_indent = true
647-
pattern = 'new_card:set_edition(other.edition or {}, nil, true)'
647+
pattern = 'if not strip_edition then'
648648
payload = '''
649649
if other.edition then
650650
new_card.ability.card_limit = new_card.ability.card_limit - (other.edition.card_limit or 0)
@@ -653,8 +653,16 @@ end
653653
if other.seal then
654654
new_card.ability.card_limit = new_card.ability.card_limit - (other.ability.seal.card_limit or 0)
655655
new_card.ability.extra_slots_used = new_card.ability.extra_slots_used - (other.ability.seal.extra_slots_used or 0)
656-
end
657-
new_card:set_edition(other.edition or {}, nil, true)
656+
end'''
657+
658+
# copy_card edition config
659+
[[patches]]
660+
[patches.pattern]
661+
target = 'functions/common_events.lua'
662+
position = 'after'
663+
match_indent = true
664+
pattern = 'new_card:set_edition(other.edition or {}, nil, true)'
665+
payload = '''
658666
for k,v in pairs(other.edition or {}) do
659667
if type(v) == 'table' then
660668
new_card.edition[k] = copy_table(v)

0 commit comments

Comments
 (0)