Commit 38aeb169 authored by mercury233's avatar mercury233 Committed by GitHub

fix "then inflict damage" cards (#2092)

parent 858fb01b
...@@ -26,11 +26,12 @@ function c13166204.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -26,11 +26,12 @@ function c13166204.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c13166204.activate(e,tp,eg,ep,ev,re,r,rp) function c13166204.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(re:GetHandler(),REASON_EFFECT)~=0 then if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(re:GetHandler(),REASON_EFFECT)~=0 then
Duel.BreakEffect()
local a=re:GetHandler():GetAttack() local a=re:GetHandler():GetAttack()
local b=re:GetHandler():GetDefense() local b=re:GetHandler():GetDefense()
if b>a then a=b end if b>a then a=b end
if a<0 then a=0 end if a>0 then
if a>0 then Duel.Damage(1-tp,a,REASON_EFFECT) end Duel.BreakEffect()
Duel.Damage(1-tp,a,REASON_EFFECT)
end
end end
end end
...@@ -73,10 +73,11 @@ function c32986898.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -73,10 +73,11 @@ function c32986898.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
if Duel.Destroy(tc,REASON_EFFECT)~=0 and e:GetHandler():GetFlagEffect(32986898)~=0 then if Duel.Destroy(tc,REASON_EFFECT)~=0 and e:GetHandler():GetFlagEffect(32986898)~=0 then
Duel.BreakEffect()
local atk=tc:GetBaseAttack() local atk=tc:GetBaseAttack()
if atk<0 then atk=0 end if atk>0 then
Duel.Damage(1-tp,math.ceil(atk/2),REASON_EFFECT) Duel.BreakEffect()
Duel.Damage(1-tp,math.ceil(atk/2),REASON_EFFECT)
end
end end
end end
end end
......
...@@ -31,9 +31,10 @@ end ...@@ -31,9 +31,10 @@ end
function c33776843.operation(e,tp,eg,ep,ev,re,r,rp) function c33776843.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 and tc:IsPreviousLocation(LOCATION_MZONE) then if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 and tc:IsPreviousLocation(LOCATION_MZONE) then
local atk=tc:GetTextAttack() local atk=tc:GetBaseAttack()
if atk<0 then atk=0 end if atk>0 then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Damage(1-tp,atk,REASON_EFFECT) Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end end
end end
...@@ -51,6 +51,9 @@ function c40522482.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -51,6 +51,9 @@ function c40522482.activate(e,tp,eg,ep,ev,re,r,rp)
else else
g,dam=og:GetMaxGroup(Card.GetBaseAttack) g,dam=og:GetMaxGroup(Card.GetBaseAttack)
end end
Duel.Damage(1-tp,dam,REASON_EFFECT) if dam>0 then
Duel.BreakEffect()
Duel.Damage(1-tp,dam,REASON_EFFECT)
end
end end
end end
...@@ -39,9 +39,11 @@ function c71344451.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -39,9 +39,11 @@ function c71344451.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(sg,REASON_EFFECT) Duel.Destroy(sg,REASON_EFFECT)
local tg=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_GRAVE) local tg=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_GRAVE)
if tg:GetCount()>0 then if tg:GetCount()>0 then
Duel.BreakEffect()
local dam=tg:GetCount()*2000 local dam=tg:GetCount()*2000
Duel.Damage(1-tp,dam,REASON_EFFECT) if dam>0 then
Duel.BreakEffect()
Duel.Damage(1-tp,dam,REASON_EFFECT)
end
end end
end end
else else
......
...@@ -56,8 +56,10 @@ function c86750474.damop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -56,8 +56,10 @@ function c86750474.damop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c86750474.damfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c86750474.damfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 then if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.BreakEffect()
local d=Duel.GetFieldGroupCount(1-tp,LOCATION_ONFIELD,0)*200 local d=Duel.GetFieldGroupCount(1-tp,LOCATION_ONFIELD,0)*200
Duel.Damage(1-tp,d,REASON_EFFECT) if d>0 then
Duel.BreakEffect()
Duel.Damage(1-tp,d,REASON_EFFECT)
end
end end
end end
...@@ -40,11 +40,10 @@ function c88120966.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -40,11 +40,10 @@ function c88120966.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function c88120966.operation(e,tp,eg,ep,ev,re,r,rp) function c88120966.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 and tc:IsType(TYPE_XYZ) then
if Duel.Destroy(tc,REASON_EFFECT)~=0 and tc:IsType(TYPE_XYZ) then local atk=tc:GetBaseAttack()
if atk>0 then
Duel.BreakEffect() Duel.BreakEffect()
local atk=tc:GetBaseAttack()
if atk<0 then atk=0 end
Duel.Damage(1-tp,atk,REASON_EFFECT) Duel.Damage(1-tp,atk,REASON_EFFECT)
end end
end end
......
...@@ -33,7 +33,8 @@ function c96700602.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -33,7 +33,8 @@ function c96700602.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local g=Duel.GetMatchingGroup(c96700602.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(c96700602.filter,tp,0,LOCATION_MZONE,nil)
if Duel.ChangePosition(g,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,0,0)~=0 then if Duel.ChangePosition(g,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,0,0)~=0 then
if tc:IsRelateToEffect(e) and tc:IsFaceup() then if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetDefense()>0 then
Duel.BreakEffect()
Duel.Damage(1-tp,tc:GetDefense(),REASON_EFFECT) Duel.Damage(1-tp,tc:GetDefense(),REASON_EFFECT)
end end
end end
......
...@@ -25,8 +25,10 @@ end ...@@ -25,8 +25,10 @@ end
function c98643358.activate(e,tp,eg,ep,ev,re,r,rp) function c98643358.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c98643358.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(c98643358.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if Duel.Destroy(g,REASON_EFFECT)~=0 then if Duel.Destroy(g,REASON_EFFECT)~=0 then
Duel.BreakEffect()
local ct=Duel.GetOperatedGroup():FilterCount(c98643358.ctfilter,nil) local ct=Duel.GetOperatedGroup():FilterCount(c98643358.ctfilter,nil)
Duel.Damage(1-tp,ct*500,REASON_EFFECT) if ct>0 then
Duel.BreakEffect()
Duel.Damage(1-tp,ct*500,REASON_EFFECT)
end
end end
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