Skip to content

Commit e858e6b

Browse files
committed
aux.StatChangeDamageStepCondition
1 parent 5aa7a21 commit e858e6b

File tree

233 files changed

+342
-898
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

233 files changed

+342
-898
lines changed

official/c10497636.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp)
116116
end
117117
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
118118
return Duel.IsBattlePhase() and Duel.GetFlagEffect(tp,id)>0
119-
and (Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated())
119+
and aux.StatChangeDamageStepCondition()
120120
end
121121
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
122122
if chk==0 then return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_WAR_ROCK),tp,LOCATION_MZONE,0,1,nil) end
@@ -135,7 +135,7 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp)
135135
c:RegisterEffect(e1,true)
136136
end
137137
local atkg=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsSetCard,SET_WAR_ROCK),tp,LOCATION_MZONE,0,nil)
138-
for tc in aux.Next(atkg) do
138+
for tc in atkg:Iter() do
139139
--Increase ATK
140140
local e2=Effect.CreateEffect(c)
141141
e2:SetType(EFFECT_TYPE_SINGLE)

official/c10793085.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function s.costfilter(c,op1,op2,op3)
3838
end
3939
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
4040
local phase=Duel.GetCurrentPhase()
41-
local op1=Duel.IsExistingTarget(s.cfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and (phase~=PHASE_DAMAGE or not Duel.IsDamageCalculated())
41+
local op1=Duel.IsExistingTarget(s.cfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and aux.StatChangeDamageStepCondition()
4242
local op2=Duel.IsExistingTarget(s.cfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and phase~=PHASE_DAMAGE
4343
local op3=Duel.IsExistingTarget(s.cfilter3,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and phase~=PHASE_DAMAGE
4444
if chk==0 then return (op1 or op2 or op3) and Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_DECK|LOCATION_EXTRA,0,1,nil,op1,op2,op3) end

official/c111280.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function s.cfilter(c)
2020
end
2121
function s.condition(e,tp,eg,ep,ev,re,r,rp)
2222
local ct=Duel.GetMatchingGroupCount(s.cfilter,tp,LOCATION_ONFIELD|LOCATION_GRAVE,LOCATION_ONFIELD|LOCATION_GRAVE,nil)
23-
return ct>0 and (Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated())
23+
return ct>0 and aux.StatChangeDamageStepCondition()
2424
end
2525
function s.filter(c)
2626
return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER) and c:IsAttribute(ATTRIBUTE_DARK)

official/c11224934.lua

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@ function s.initial_effect(c)
99
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
1010
e1:SetCode(EVENT_FREE_CHAIN)
1111
e1:SetHintTiming(TIMING_DAMAGE_STEP)
12-
e1:SetCondition(s.condition)
12+
e1:SetCondition(aux.StatChangeDamageStepCondition)
1313
e1:SetTarget(s.target)
1414
e1:SetOperation(s.activate)
1515
c:RegisterEffect(e1)
1616
end
17-
function s.condition(e,tp,eg,ep,ev,re,r,rp)
18-
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
19-
end
2017
function s.filter(c)
2118
return c:IsFaceup() and c:GetOverlayCount()~=0
2219
end
@@ -25,8 +22,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
2522
end
2623
function s.activate(e,tp,eg,ep,ev,re,r,rp)
2724
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,0,nil)
28-
local tc=g:GetFirst()
29-
for tc in aux.Next(g) do
25+
for tc in g:Iter() do
3026
local e1=Effect.CreateEffect(e:GetHandler())
3127
e1:SetType(EFFECT_TYPE_SINGLE)
3228
e1:SetCode(EFFECT_UPDATE_ATTACK)

official/c11228035.lua

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@ function s.initial_effect(c)
99
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
1010
e1:SetCode(EVENT_FREE_CHAIN)
1111
e1:SetHintTiming(TIMING_DAMAGE_STEP)
12-
e1:SetCondition(s.condition)
12+
e1:SetCondition(aux.StatChangeDamageStepCondition)
1313
e1:SetTarget(s.target)
1414
e1:SetOperation(s.activate)
1515
c:RegisterEffect(e1)
1616
end
17-
function s.condition(e,tp,eg,ep,ev,re,r,rp)
18-
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
19-
end
2017
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
2118
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsType(TYPE_XYZ) end
2219
if chk==0 then return Duel.IsExistingTarget(Card.IsType,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,TYPE_XYZ)
@@ -30,8 +27,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
3027
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
3128
if #g>0 and tc:IsRelateToEffect(e) then
3229
local atk=tc:GetRank()*200
33-
local sc=g:GetFirst()
34-
for sc in aux.Next(g) do
30+
for sc in g:Iter() do
3531
local e1=Effect.CreateEffect(e:GetHandler())
3632
e1:SetType(EFFECT_TYPE_SINGLE)
3733
e1:SetCode(EFFECT_UPDATE_ATTACK)

official/c11264180.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,12 @@ function s.initial_effect(c)
99
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
1010
e1:SetCode(EVENT_FREE_CHAIN)
1111
e1:SetHintTiming(TIMING_DAMAGE_STEP)
12-
e1:SetCondition(s.condition)
12+
e1:SetCondition(aux.StatChangeDamageStepCondition)
1313
e1:SetTarget(s.target)
1414
e1:SetOperation(s.activate)
1515
c:RegisterEffect(e1)
1616
end
1717
s.listed_series={SET_TG}
18-
function s.condition(e,tp,eg,ep,ev,re,r,rp)
19-
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
20-
end
2118
function s.filter(c)
2219
return c:IsFaceup() and c:IsSetCard(SET_TG)
2320
end
@@ -47,5 +44,6 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
4744
tc:RegisterEffect(e2)
4845
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
4946
local dg=Duel.SelectMatchingCard(tp,Card.IsSpellTrap,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
47+
Duel.HintSelection(dg)
5048
Duel.Destroy(dg,REASON_EFFECT)
5149
end

official/c11662742.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function s.dmop(e,tp,eg,ep,ev,re,r,rp)
6060
if c:GetControler()~=ep then return end
6161
if (r&REASON_BATTLE)~=0 then
6262
c:RegisterFlagEffect(id,RESET_PHASE|PHASE_DAMAGE,0,1)
63-
elseif Duel.IsPhase(PHASE_DAMAGE) and not Duel.IsDamageCalculated() then
63+
elseif aux.StatChangeDamageStepCondition() then
6464
c:RegisterFlagEffect(id+1,RESET_PHASE|PHASE_DAMAGE,0,1)
6565
end
6666
end

official/c12219047.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,5 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
7474
end
7575
function s.condition2(e,tp,eg,ep,ev,re,r,rp)
7676
return e:GetHandler():GetOverlayGroup():IsExists(Card.IsSetCard,1,nil,SET_THE_PHANTOM_KNIGHTS)
77-
and (Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated())
77+
and aux.StatChangeDamageStepCondition()
7878
end

official/c12501230.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function s.initial_effect(c)
5050
end
5151
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
5252
return Duel.IsTurnPlayer(1-tp) and Duel.IsBattlePhase()
53-
and (Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated())
53+
and aux.StatChangeDamageStepCondition()
5454
end
5555
function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
5656
local c=e:GetHandler()

official/c12503902.lua

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
local s,id=GetID()
44
function s.initial_effect(c)
55
--Equip procedure
6-
aux.AddPersistentProcedure(c,0,s.filter,CATEGORY_ATKCHANGE,EFFECT_FLAG_DAMAGE_STEP,nil,TIMING_DAMAGE_STEP,s.condition,nil,nil,s.operation)
6+
aux.AddPersistentProcedure(c,0,s.filter,CATEGORY_ATKCHANGE,EFFECT_FLAG_DAMAGE_STEP,nil,TIMING_DAMAGE_STEP,aux.StatChangeDamageStepCondition,nil,nil,s.operation)
77
--Increase ATK
88
local e1=Effect.CreateEffect(c)
99
e1:SetType(EFFECT_TYPE_FIELD)
@@ -22,9 +22,6 @@ function s.initial_effect(c)
2222
e2:SetOperation(s.selfdesop)
2323
c:RegisterEffect(e2)
2424
end
25-
function s.condition(e,tp,eg,ep,ev,re,r,rp)
26-
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
27-
end
2825
function s.filter(c)
2926
return c:IsFaceup() and c:IsRace(RACE_MACHINE)
3027
end

0 commit comments

Comments
 (0)