Skip to content

Commit c7108ae

Browse files
committed
Fix copy_card bug with cards that have card_limit modifications
1 parent bbaffde commit c7108ae

File tree

2 files changed

+41
-2
lines changed

2 files changed

+41
-2
lines changed

lovely/fixes.toml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,13 +654,52 @@ if success then st = _st else sendWarnMessage(_st, "LuaSteam"); st = {} end"""
654654
overwrite = true
655655
match_indent = true
656656

657+
# copy_card: Reorder timings
658+
[[patches]]
659+
[patches.pattern]
660+
target = 'functions/common_events.lua'
661+
match_indent = true
662+
position = 'at'
663+
pattern = '''
664+
for k, v in pairs(other.ability) do
665+
if type(v) == 'table' then
666+
new_card.ability[k] = copy_table(v)
667+
else
668+
new_card.ability[k] = v
669+
end
670+
end
671+
'''
672+
payload = '''
673+
'''
674+
675+
# copy_card: Reorder timings
676+
[[patches]]
677+
[patches.pattern]
678+
target = 'functions/common_events.lua'
679+
match_indent = true
680+
position = 'before'
681+
pattern = '''
682+
return new_card
683+
'''
684+
payload = '''
685+
for k, v in pairs(other.ability) do
686+
if type(v) == 'table' then
687+
new_card.ability[k] = copy_table(v)
688+
else
689+
new_card.ability[k] = v
690+
end
691+
end
692+
'''
693+
694+
695+
657696
# copy_card: Subtract from .ability.card_limit
658697
[[patches]]
659698
[patches.pattern]
660699
target = 'functions/common_events.lua'
661700
position = 'before'
662701
match_indent = true
663-
pattern = 'if not strip_edition then'
702+
pattern = 'for k, v in pairs(other.ability) do'
664703
payload = '''
665704
if other.edition then
666705
new_card.ability.card_limit = new_card.ability.card_limit - (other.edition.card_limit or 0)

version.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
return "1.0.0~BETA-1408c-STEAMODDED"
1+
return "1.0.0~BETA-1413a-STEAMODDED"

0 commit comments

Comments
 (0)