Skip to content

Commit 7b7540d

Browse files
authored
Updated some utility functions
- Cost.SelfReveal: name fix. - Card.IsPreviousCodeOnField: Added handling for checking multiple codes at once.
1 parent 64e29f1 commit 7b7540d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

utility.lua

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,15 @@ end
344344
function Card.IsPreviousTypeOnField(c,card_type)
345345
return c:GetPreviousTypeOnField()&card_type>0
346346
end
347-
function Card.IsPreviousCodeOnField(c,code)
347+
function Card.IsPreviousCodeOnField(c,...)
348348
local code1,code2=c:GetPreviousCodeOnField()
349-
return code1==code or code2==code
349+
local codes={...}
350+
for _,code in ipairs(codes) do
351+
if code1==code or code2==code then
352+
return true
353+
end
354+
end
355+
return false
350356
end
351357
function Card.IsPreviousSequence(c,seq)
352358
return c:GetPreviousSequence()==seq
@@ -1585,7 +1591,7 @@ Cost.SelfToDeck=aux.SelfToDeckCost
15851591
Cost.SelfToExtra=aux.SelfToExtraCost
15861592
Cost.SelfDiscard=aux.SelfDiscardCost
15871593
Cost.SelfDiscardToGrave=aux.SelfDiscardToGraveCost
1588-
Cost.SelfRevealCost=aux.SelfRevealCost
1594+
Cost.SelfReveal=aux.SelfRevealCost
15891595

15901596
Cost.Detach=aux.dxmcostgen
15911597
Cost.Discard=aux.DiscardCost

0 commit comments

Comments
 (0)