Commit 5bccfb3b authored by wind2009's avatar wind2009

Add Card.IsRelateToBattle before Duel.CalculateDamage

parent 78cb60fb
......@@ -51,7 +51,7 @@ function c13166648.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
Duel.SpecialSummonComplete()
if ss then
if ss and a:IsRelateToBattle() then
Duel.CalculateDamage(a,tc)
end
end
......@@ -28,7 +28,7 @@ function c21924381.activate(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e)
and a:IsAttackable() and a:IsRelateToEffect(e) and not a:IsImmuneToEffect(e)then
and a:IsRelateToBattle() and a:IsAttackable() and a:IsRelateToEffect(e) and not a:IsImmuneToEffect(e)then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
......
......@@ -70,7 +70,7 @@ end
function s.tattack(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and a:IsAttackable() and not a:IsImmuneToEffect(e) then
if tc and tc:IsRelateToEffect(e) and a:IsRelateToBattle() and a:IsAttackable() and not a:IsImmuneToEffect(e) then
Duel.CalculateDamage(a,tc)
end
end
......@@ -43,7 +43,7 @@ function c2434862.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local at=Duel.GetAttacker()
if at:IsAttackable() and not at:IsImmuneToEffect(e) then
if at:IsRelateToBattle() and at:IsAttackable() and not at:IsImmuneToEffect(e) then
Duel.CalculateDamage(at,tc)
end
end
......
......@@ -28,7 +28,7 @@ function c2732323.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.DisableSelfDestroyCheck()
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then
local a=Duel.GetAttacker()
if a:IsAttackable() and not a:IsImmuneToEffect(e) then
if a:IsRelateToBattle() and a:IsAttackable() and not a:IsImmuneToEffect(e) then
Duel.CalculateDamage(a,tc)
end
end
......
......@@ -29,10 +29,9 @@ function c3103067.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c3103067.operation(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
if not a or not a:IsRelateToBattle() then return end
if e:GetLabel()==0 then
if a and a:IsRelateToBattle() then
Duel.Destroy(a,REASON_EFFECT)
end
Duel.Destroy(a,REASON_EFFECT)
end
if e:GetLabel()==1 then
local tc=Duel.GetFirstTarget()
......
......@@ -25,7 +25,7 @@ function c34475451.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local a=Duel.GetAttacker()
if a:IsAttackable() and not a:IsImmuneToEffect(e) then
if a:IsRelateToBattle() and a:IsAttackable() and not a:IsImmuneToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
......
......@@ -35,7 +35,7 @@ function c36708764.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(36708764,0))
local tc=g:Select(tp,1,1,nil):GetFirst()
local at=Duel.GetAttacker()
if at:IsAttackable() and not at:IsImmuneToEffect(e) and not tc:IsImmuneToEffect(e) then
if at:IsRelateToBattle() and at:IsAttackable() and not at:IsImmuneToEffect(e) and not tc:IsImmuneToEffect(e) then
Duel.CalculateDamage(at,tc)
end
end
......@@ -47,7 +47,7 @@ function c36708764.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(36708764,0))
local tc=g:Select(tp,1,1,nil):GetFirst()
local at=Duel.GetAttacker()
if at:IsAttackable() and not at:IsImmuneToEffect(e) and not tc:IsImmuneToEffect(e) then
if at:IsRelateToBattle() and at:IsAttackable() and not at:IsImmuneToEffect(e) and not tc:IsImmuneToEffect(e) then
Duel.CalculateDamage(at,tc)
end
end
......
......@@ -26,7 +26,7 @@ end
function c43452193.activate(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local at=Duel.GetAttackTarget()
if a:IsRelateToEffect(e) and a:IsAttackable() and at:IsRelateToEffect(e) then
if a:IsRelateToBattle() and a:IsRelateToEffect(e) and a:IsAttackable() and at:IsRelateToEffect(e) then
if Duel.SwapControl(a,at,RESET_PHASE+PHASE_END,1) then
Duel.CalculateDamage(a,at)
end
......
......@@ -63,7 +63,7 @@ function c51993760.operation(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
local a=Duel.GetAttacker()
if a:IsAttackable() and not a:IsImmuneToEffect(e) then
if a:IsRelateToBattle() and a:IsAttackable() and not a:IsImmuneToEffect(e) then
Duel.CalculateDamage(a,tc)
end
end
......
......@@ -34,7 +34,7 @@ function c54912977.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local a=Duel.GetAttacker()
if tc and tc:IsRelateToEffect(e)
and a:IsAttackable() and not a:IsImmuneToEffect(e) then
and a:IsRelateToBattle() and a:IsAttackable() and not a:IsImmuneToEffect(e) then
Duel.CalculateDamage(a,tc)
end
end
......
......@@ -68,7 +68,7 @@ function c63767246.cbop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local at=Duel.GetAttacker()
if at:IsAttackable() and not at:IsImmuneToEffect(e) then
if at:IsRelateToBattle() and at:IsAttackable() and not at:IsImmuneToEffect(e) then
Duel.CalculateDamage(at,c)
end
end
......
......@@ -32,7 +32,7 @@ function c64966519.cbop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local at=Duel.GetAttacker()
if at:IsAttackable() and not at:IsImmuneToEffect(e) and not c:IsImmuneToEffect(e) then
if at:IsRelateToBattle() and at:IsAttackable() and not at:IsImmuneToEffect(e) and not c:IsImmuneToEffect(e) then
Duel.CalculateDamage(at,c)
end
end
......
......@@ -49,7 +49,7 @@ function c67385964.hspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local a=Duel.GetAttacker()
if a:IsAttackable() and not a:IsImmuneToEffect(e) then
if a:IsRelateToBattle() and a:IsAttackable() and not a:IsImmuneToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
......
......@@ -56,7 +56,7 @@ function c67630339.operation(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=c67630339[2]
if a:GetFlagEffect(67630339)~=0 and d:GetFlagEffect(67630339)~=0
and a:IsAttackable() and not a:IsImmuneToEffect(e) and not d:IsImmuneToEffect(e) then
and a:IsRelateToBattle() and a:IsAttackable() and not a:IsImmuneToEffect(e) and not d:IsImmuneToEffect(e) then
Duel.CalculateDamage(a,d)
end
end
......@@ -26,7 +26,7 @@ function c69181753.hspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local a=Duel.GetAttacker()
if a:IsAttackable() and not a:IsImmuneToEffect(e) then
if a:IsRelateToBattle() and a:IsAttackable() and not a:IsImmuneToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_REVERSE_DAMAGE)
......
......@@ -47,7 +47,7 @@ function c7864030.operation1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local at=Duel.GetAttacker()
if at:IsAttackable() and not at:IsImmuneToEffect(e) and not tc:IsImmuneToEffect(e) then
if at:IsRelateToBattle() and at:IsAttackable() and not at:IsImmuneToEffect(e) and not tc:IsImmuneToEffect(e) then
Duel.CalculateDamage(at,tc)
end
end
......@@ -59,7 +59,7 @@ function c7864030.operation2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local at=Duel.GetAttacker()
if at:IsAttackable() and not at:IsImmuneToEffect(e) then
if at:IsRelateToBattle() and at:IsAttackable() and not at:IsImmuneToEffect(e) then
Duel.CalculateDamage(at,c)
end
end
......
......@@ -36,8 +36,9 @@ end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local a=Duel.GetAttacker()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0 and a:IsAttackable() and not a:IsImmuneToEffect(e) then
Duel.CalculateDamage(a,c)
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0
and a:IsRelateToBattle() and a:IsAttackable() and not a:IsImmuneToEffect(e) then
Duel.CalculateDamage(a,c)
end
end
function s.atkfilter(c,ac)
......
......@@ -48,7 +48,7 @@ function c86049351.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e1)
if bc==Duel.GetAttackTarget() then bc,sc=sc,bc end
if bc:IsAttackable() and not bc:IsImmuneToEffect(e) and not sc:IsImmuneToEffect(e) then
if bc:IsRelateToBattle() and bc:IsAttackable() and not bc:IsImmuneToEffect(e) and not sc:IsImmuneToEffect(e) then
Duel.CalculateDamage(bc,sc)
Duel.BreakEffect()
Duel.Damage(tp,atk,REASON_EFFECT)
......
......@@ -23,7 +23,7 @@ end
function c8687195.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local a=Duel.GetAttacker()
if tc and tc:IsRelateToEffect(e) and a:IsAttackable() and not a:IsImmuneToEffect(e) then
if a:IsRelateToBattle() and tc and tc:IsRelateToEffect(e) and a:IsAttackable() and not a:IsImmuneToEffect(e) then
Duel.CalculateDamage(a,tc)
end
end
......@@ -61,7 +61,7 @@ function c91499077.cbop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) and Duel.ChangePosition(c,POS_FACEUP_DEFENSE)~=0 then
local at=Duel.GetAttacker()
if at:IsAttackable() and not at:IsImmuneToEffect(e) and not c:IsImmuneToEffect(e) then
if at:IsRelateToBattle() and at:IsAttackable() and not at:IsImmuneToEffect(e) and not c:IsImmuneToEffect(e) then
Duel.CalculateDamage(at,c)
end
end
......
......@@ -30,7 +30,7 @@ function c93504463.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local a=Duel.GetAttacker()
if a:IsAttackable() and not a:IsImmuneToEffect(e) then
if a:IsRelateToBattle() and a:IsAttackable() and not a:IsImmuneToEffect(e) then
Duel.CalculateDamage(a,tc)
end
end
......
......@@ -29,7 +29,7 @@ function c96008713.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local a=Duel.GetAttacker()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.GetControl(tc,tp,PHASE_BATTLE,1)~=0 then
if a:IsAttackable() and not a:IsImmuneToEffect(e) then
if a:IsRelateToBattle() and a:IsAttackable() and not a:IsImmuneToEffect(e) then
Duel.CalculateDamage(a,tc)
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment