Skip to content

Commit 9deb98e

Browse files
authored
Update "Card.UpdateAttack" and "Card.UpdateDefense"
They both can now take an additional parameter to set the effect's reset count.
1 parent fb7a7ab commit 9deb98e

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

utility.lua

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -494,10 +494,11 @@ function Card.IsColumn(c,seq,tp,loc)
494494
end
495495
end
496496

497-
function Card.UpdateAttack(c,amt,reset,rc)
497+
function Card.UpdateAttack(c,amt,reset,rc,reset_count)
498498
rc=rc or c
499499
local r=(c==rc) and RESETS_STANDARD_DISABLE or RESETS_STANDARD
500500
reset=reset or RESET_EVENT+r
501+
reset_count=reset_count or 1
501502
local atk=c:GetAttack()
502503
if atk>=-amt then --If amt is positive, it would become negative and always be lower than or equal to atk, if amt is negative, it would become postive and if it is too much it would be higher than atk
503504
local e1=Effect.CreateEffect(rc)
@@ -507,17 +508,18 @@ function Card.UpdateAttack(c,amt,reset,rc)
507508
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
508509
end
509510
e1:SetValue(amt)
510-
e1:SetReset(reset)
511+
e1:SetReset(reset,reset_count)
511512
c:RegisterEffect(e1)
512513
return c:GetAttack()-atk
513514
end
514515
return 0
515516
end
516517

517-
function Card.UpdateDefense(c,amt,reset,rc)
518+
function Card.UpdateDefense(c,amt,reset,rc,reset_count)
518519
rc=rc or c
519520
local r=(c==rc) and RESETS_STANDARD_DISABLE or RESETS_STANDARD
520521
reset=reset or RESET_EVENT+r
522+
reset_count=reset_count or 1
521523
local def=c:GetDefense()
522524
if def and def>=-amt then --See Card.UpdateAttack
523525
local e1=Effect.CreateEffect(rc)
@@ -527,7 +529,7 @@ function Card.UpdateDefense(c,amt,reset,rc)
527529
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
528530
end
529531
e1:SetValue(amt)
530-
e1:SetReset(reset)
532+
e1:SetReset(reset,reset_count)
531533
c:RegisterEffect(e1)
532534
return c:GetDefense()-def
533535
end

0 commit comments

Comments
 (0)