Commit b4b81ac9 authored by mercury233's avatar mercury233 Committed by GitHub

fix Ancient Gear Engineer, Blue-Eyes Twin Burst Dragon etc. (#1744)

parent 1ddaeadf
......@@ -41,6 +41,7 @@ function c11443677.initial_effect(c)
e5:SetCode(EVENT_DAMAGE_STEP_END)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET)
e5:SetCountLimit(1)
e5:SetCondition(aux.dsercon)
e5:SetTarget(c11443677.settg)
e5:SetOperation(c11443677.setop)
c:RegisterEffect(e5)
......
......@@ -54,7 +54,7 @@ function c14148099.rctop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c14148099.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetCounter(0x1f)==0
return e:GetHandler():GetCounter(0x1f)==0 and e:GetHandler():IsRelateToBattle()
end
function c14148099.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
......
......@@ -63,7 +63,7 @@ function c15317640.rctop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c15317640.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetCounter(0x1f)==0
return e:GetHandler():GetCounter(0x1f)==0 and e:GetHandler():IsRelateToBattle()
end
function c15317640.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -62,7 +62,7 @@ function c1953925.actcon(e)
return Duel.GetAttacker()==e:GetHandler()
end
function c1953925.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler()==Duel.GetAttacker()
return e:GetHandler()==Duel.GetAttacker() and aux.dsercon(e)
end
function c1953925.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
......
......@@ -45,7 +45,8 @@ function c2129638.rmcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
e:SetLabelObject(bc)
return c==Duel.GetAttacker() and bc and c:IsStatus(STATUS_OPPO_BATTLE) and bc:IsOnField() and bc:IsRelateToBattle()
return c==Duel.GetAttacker() and aux.dsercon(e)
and bc and c:IsStatus(STATUS_OPPO_BATTLE) and bc:IsOnField() and bc:IsRelateToBattle()
end
function c2129638.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetLabelObject():IsAbleToRemove() end
......
......@@ -14,7 +14,7 @@ end
function c21887179.descon(e,tp,eg,ep,ev,re,r,rp)
local t=e:GetHandler():GetBattleTarget()
e:SetLabelObject(t)
return t and t:IsRace(RACE_FIEND+RACE_ZOMBIE) and t:IsRelateToBattle()
return aux.dsercon(e) and t and t:IsRace(RACE_FIEND+RACE_ZOMBIE) and t:IsRelateToBattle()
end
function c21887179.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -65,7 +65,7 @@ function c22790789.rctop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c22790789.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetCounter(0x1f)==0
return e:GetHandler():GetCounter(0x1f)==0 and e:GetHandler():IsRelateToBattle()
end
function c22790789.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -41,7 +41,7 @@ function c24550676.initial_effect(c)
c:RegisterEffect(e4)
end
function c24550676.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker()==e:GetHandler() and Duel.GetAttackTarget()
return aux.dsercon(e) and Duel.GetAttacker()==e:GetHandler() and Duel.GetAttackTarget()
end
function c24550676.filter(c)
return c:IsSummonType(SUMMON_TYPE_SPECIAL)
......
......@@ -12,7 +12,8 @@ function c25773409.initial_effect(c)
c:RegisterEffect(e1)
end
function c25773409.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttackTarget()==e:GetHandler() and bit.band(e:GetHandler():GetBattlePosition(),POS_DEFENSE)~=0
return aux.dsercon(e) and Duel.GetAttackTarget()==e:GetHandler()
and bit.band(e:GetHandler():GetBattlePosition(),POS_DEFENSE)~=0
end
function c25773409.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -14,7 +14,7 @@ end
function c2671330.retcon(e,tp,eg,ep,ev,re,r,rp)
local t=e:GetHandler():GetBattleTarget()
e:SetLabelObject(t)
return t and t:IsRelateToBattle()
return aux.dsercon(e) and t and t:IsRelateToBattle()
end
function c2671330.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -24,6 +24,7 @@ function c31764700.initial_effect(c)
e4:SetCategory(CATEGORY_DAMAGE+CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_DAMAGE_STEP_END)
e4:SetCondition(aux.dsercon)
e4:SetTarget(c31764700.damtg)
e4:SetOperation(c31764700.damop)
e4:SetLabelObject(e3)
......
......@@ -29,6 +29,7 @@ function c3204467.regop(e,tp,eg,ep,ev,re,r,rp)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_DAMAGE_STEP_END)
e1:SetCondition(aux.dsercon)
e1:SetTarget(c3204467.destg)
e1:SetOperation(c3204467.desop)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
......
......@@ -12,6 +12,7 @@ function c32391631.initial_effect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_DAMAGE_STEP_END)
e2:SetRange(LOCATION_FZONE)
e2:SetCondition(c32391631.reccon)
e2:SetTarget(c32391631.rectg)
e2:SetOperation(c32391631.recop)
c:RegisterEffect(e2)
......@@ -34,6 +35,9 @@ function c32391631.initial_effect(c)
e5:SetOperation(c32391631.desop)
c:RegisterEffect(e5)
end
function c32391631.reccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsRelateToBattle()
end
function c32391631.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(Duel.GetTurnPlayer())
......@@ -41,7 +45,7 @@ function c32391631.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,Duel.GetTurnPlayer(),300)
end
function c32391631.recop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) or not Duel.GetAttacker():IsRelateToBattle() then return end
if not Duel.GetAttacker():IsRelateToBattle() then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
......
......@@ -42,11 +42,11 @@ function c34536828.disop(e,tp,eg,ep,ev,re,r,rp)
end
function c34536828.descon(e,tp,eg,ep,ev,re,r,rp)
local a,d=Duel.GetBattleMonster(tp)
return a and d and a:IsAttack(0) and d:IsAttack(0)
return a and d and a:IsAttack(0) and d:IsAttack(0) and d:IsRelateToBattle()
end
function c34536828.desop(e,tp,eg,ep,ev,re,r,rp)
local a,d=Duel.GetBattleMonster(tp)
if d then
if d and d:IsRelateToBattle() then
Duel.Destroy(d,REASON_EFFECT)
end
end
......@@ -15,6 +15,7 @@ function c37169670.initial_effect(c)
e2:SetCategory(CATEGORY_DAMAGE+CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_DAMAGE_STEP_END)
e2:SetCondition(c37169670.damcon)
e2:SetTarget(c37169670.damtg)
e2:SetOperation(c37169670.damop)
c:RegisterEffect(e2)
......@@ -31,8 +32,11 @@ function c37169670.initial_effect(c)
c:RegisterEffect(e3)
end
c37169670.assault_name=95526884
function c37169670.damcon(e,tp,eg,ep,ev,re,r,rp)
return aux.dsercon(e) and Duel.GetAttackTarget()~=nil
end
function c37169670.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetAttackTarget()~=nil end
if chk==0 then return true end
local c=e:GetHandler()
local d=Duel.GetAttackTarget()
if d==c then d=Duel.GetAttacker() end
......
......@@ -26,6 +26,7 @@ function c40392714.initial_effect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DAMAGE_STEP_END)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCondition(aux.dsercon)
e4:SetTarget(c40392714.sptg2)
e4:SetOperation(c40392714.spop2)
c:RegisterEffect(e4)
......
......@@ -76,7 +76,7 @@ function c44874522.actcon(e)
return Duel.GetAttacker()==e:GetHandler()
end
function c44874522.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker()==e:GetHandler()
return aux.dsercon(e) and Duel.GetAttacker()==e:GetHandler()
end
function c44874522.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
......
......@@ -66,7 +66,7 @@ function c44954628.rctop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c44954628.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetCounter(0x1f)==0
return e:GetHandler():GetCounter(0x1f)==0 and e:GetHandler():IsRelateToBattle()
end
function c44954628.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
......
......@@ -52,19 +52,11 @@ function c4740489.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c4740489.atcon(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if not d then return end
if d:IsControler(tp) then
e:SetLabelObject(a)
return d:IsRace(RACE_ROCK) and d:IsAttribute(ATTRIBUTE_EARTH)
and a:IsRelateToBattle() and a:IsLocation(LOCATION_ONFIELD)
elseif a:IsControler(tp) then
e:SetLabelObject(d)
return a:IsRace(RACE_ROCK) and a:IsAttribute(ATTRIBUTE_EARTH)
and d:IsRelateToBattle() and d:IsLocation(LOCATION_ONFIELD)
end
return false
local a,d=Duel.GetBattleMonster(tp)
if not d then return false end
e:SetLabelObject(d)
return a:IsRace(RACE_ROCK) and a:IsAttribute(ATTRIBUTE_EARTH)
and d:IsRelateToBattle() and d:IsLocation(LOCATION_ONFIELD)
end
function c4740489.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -23,6 +23,7 @@ function c5126490.initial_effect(c)
e3:SetCategory(CATEGORY_DAMAGE+CATEGORY_RECOVER)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_DAMAGE_STEP_END)
e3:SetCondition(aux.dsercon)
e3:SetTarget(c5126490.damtg)
e3:SetOperation(c5126490.damop)
c:RegisterEffect(e3)
......
......@@ -24,6 +24,7 @@ function c5285665.initial_effect(c)
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_DAMAGE_STEP_END)
e4:SetCondition(aux.dsercon)
e4:SetTarget(c5285665.destg)
e4:SetOperation(c5285665.desop)
c:RegisterEffect(e4)
......
......@@ -12,13 +12,12 @@ function c57281778.initial_effect(c)
c:RegisterEffect(e1)
end
function c57281778.descon(e,tp,eg,ep,ev,re,r,rp)
local t=Duel.GetAttackTarget()
if ev==1 then t=Duel.GetAttacker() end
local t=e:GetHandler():GetBattleTarget()
e:SetLabelObject(t)
return t and t:IsRace(RACE_SPELLCASTER+RACE_WARRIOR)
return aux.dsercon(e) and t and t:IsRace(RACE_SPELLCASTER+RACE_WARRIOR) and t:IsRelateToBattle()
end
function c57281778.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetLabelObject():IsRelateToBattle() end
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetLabelObject(),1,0,0)
end
function c57281778.desop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -6,6 +6,7 @@ function c59797187.initial_effect(c)
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_DAMAGE_STEP_END)
e1:SetCondition(aux.dsercon)
e1:SetTarget(c59797187.target)
e1:SetOperation(c59797187.operation)
c:RegisterEffect(e1)
......
......@@ -25,6 +25,7 @@ function c65305468.initial_effect(c)
e6:SetCategory(CATEGORY_CONTROL)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e6:SetCode(EVENT_DAMAGE_STEP_END)
e6:SetCondition(aux.dsercon)
e6:SetTarget(c65305468.cttg)
e6:SetOperation(c65305468.ctop)
c:RegisterEffect(e6)
......
......@@ -42,7 +42,7 @@ function c67508932.initial_effect(c)
end
function c67508932.rmcond(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonLocation(LOCATION_EXTRA) and c:GetBattledGroupCount()>0
return aux.dsercon(e) and c:IsSummonLocation(LOCATION_EXTRA) and c:GetBattledGroupCount()>0
end
function c67508932.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,nil) end
......
......@@ -18,26 +18,26 @@ function c69031175.initial_effect(c)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(69031175,0))
e3:SetCategory(CATEGORY_COUNTER)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DAMAGE_STEP_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c69031175.condition1)
e3:SetOperation(c69031175.operation1)
e3:SetCondition(c69031175.ctcon)
e3:SetOperation(c69031175.ctop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(69031175,1))
e4:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCost(c69031175.cost2)
e4:SetOperation(c69031175.operation2)
e4:SetCost(c69031175.atkcost)
e4:SetOperation(c69031175.atkop)
c:RegisterEffect(e4)
end
function c69031175.condition1(e,tp,eg,ep,ev,re,r,rp)
function c69031175.ctcon(e,tp,eg,ep,ev,re,r,rp)
local atg=Duel.GetAttackTarget()
return Duel.GetAttacker()==e:GetHandler() and atg and atg:IsRelateToBattle() and atg:GetCounter(0x1002)==0 and atg:IsCanAddCounter(0x1002,1)
return aux.dsercon(e) and Duel.GetAttacker()==e:GetHandler()
and atg and atg:IsRelateToBattle() and atg:GetCounter(0x1002)==0 and atg:IsCanAddCounter(0x1002,1)
end
function c69031175.operation1(e,tp,eg,ep,ev,re,r,rp)
function c69031175.ctop(e,tp,eg,ep,ev,re,r,rp)
local atg=Duel.GetAttackTarget()
if atg:IsRelateToBattle() then
atg:AddCounter(0x1002,1)
......@@ -46,7 +46,7 @@ end
function c69031175.filter(c)
return c:GetCounter(0x1002)>0
end
function c69031175.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
function c69031175.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c69031175.filter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(c69031175.filter,tp,0,LOCATION_MZONE,nil)
local t=g:GetFirst()
......@@ -56,7 +56,7 @@ function c69031175.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
end
Duel.SetTargetCard(g)
end
function c69031175.operation2(e,tp,eg,ep,ev,re,r,rp)
function c69031175.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local t=g:GetFirst()
......
......@@ -12,7 +12,7 @@ function c70194827.initial_effect(c)
c:RegisterEffect(e1)
end
function c70194827.atcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler()==Duel.GetAttacker()
return e:GetHandler()==Duel.GetAttacker() and e:GetHandler():IsRelateToBattle()
and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)~=0
end
function c70194827.atcost(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -3,8 +3,7 @@ function c71971554.initial_effect(c)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71971554,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetRange(LOCATION_MZONE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_DAMAGE_STEP_END)
e1:SetCondition(c71971554.lvcon)
e1:SetOperation(c71971554.lvop)
......@@ -17,10 +16,11 @@ function c71971554.initial_effect(c)
c:RegisterEffect(e2)
end
function c71971554.lvcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker()==e:GetHandler()
return Duel.GetAttacker()==e:GetHandler() and e:GetHandler():IsRelateToBattle()
end
function c71971554.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsFaceup() or not c:IsRelateToEffect(e) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
......
......@@ -62,7 +62,7 @@ function c75937826.rctop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c75937826.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetCounter(0x1f)==0
return e:GetHandler():GetCounter(0x1f)==0 and e:GetHandler():IsRelateToBattle()
end
function c75937826.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
......
......@@ -6,6 +6,7 @@ function c77252217.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_DAMAGE_STEP_END)
e1:SetCondition(aux.dsercon)
e1:SetTarget(c77252217.drtg)
e1:SetOperation(c77252217.drop)
c:RegisterEffect(e1)
......
......@@ -33,7 +33,8 @@ function c78266168.operation(e,tp,eg,ep,ev,re,r,rp)
end
end
function c78266168.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttackTarget()==e:GetHandler() and e:GetHandler():GetBattlePosition()==POS_FACEDOWN_DEFENSE
return aux.dsercon(e) and Duel.GetAttackTarget()==e:GetHandler()
and e:GetHandler():GetBattlePosition()==POS_FACEDOWN_DEFENSE
and Duel.GetAttacker():GetAttack()<e:GetHandler():GetDefense()
end
function c78266168.destg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -12,7 +12,8 @@ function c78613627.initial_effect(c)
c:RegisterEffect(e1)
end
function c78613627.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttackTarget()==e:GetHandler() and bit.band(e:GetHandler():GetBattlePosition(),POS_DEFENSE)~=0
return aux.dsercon(e) and Duel.GetAttackTarget()==e:GetHandler()
and bit.band(e:GetHandler():GetBattlePosition(),POS_DEFENSE)~=0
and Duel.GetAttacker():GetAttack()<e:GetHandler():GetDefense()
end
function c78613627.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -19,9 +19,8 @@ function c80796456.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(80796456,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DAMAGE_STEP_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c80796456.atkcon)
e2:SetOperation(c80796456.atkop)
c:RegisterEffect(e2)
......@@ -60,7 +59,7 @@ function c80796456.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject())
end
function c80796456.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker()==e:GetHandler()
return Duel.GetAttacker()==e:GetHandler() and e:GetHandler():IsRelateToBattle()
end
function c80796456.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -65,11 +65,9 @@ function c81269231.regop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c81269231.rmcon(e,tp,eg,ep,ev,re,r,rp)
local t=nil
if ev==0 then t=Duel.GetAttackTarget()
else t=Duel.GetAttacker() end
local t=Duel.GetBattleMonster(1-tp)
e:SetLabelObject(t)
return t and t:IsRelateToBattle() and e:GetHandler():IsStatus(STATUS_OPPO_BATTLE)
return aux.dsercon(e) and t and t:IsRelateToBattle()
end
function c81269231.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetLabelObject():IsAbleToRemove() end
......
......@@ -18,6 +18,7 @@ function c8198620.initial_effect(c)
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_DAMAGE_STEP_END)
e2:SetCondition(aux.dsercon)
e2:SetTarget(c8198620.attg)
e2:SetOperation(c8198620.atop)
c:RegisterEffect(e2)
......
......@@ -34,6 +34,7 @@ function c82821760.initial_effect(c)
e5:SetCategory(CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e5:SetCode(EVENT_DAMAGE_STEP_END)
e5:SetCondition(aux.dsercon)
e5:SetTarget(c82821760.rcttg)
e5:SetOperation(c82821760.rctop)
c:RegisterEffect(e5)
......
......@@ -34,6 +34,7 @@ function c84257883.initial_effect(c)
e5:SetCategory(CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e5:SetCode(EVENT_DAMAGE_STEP_END)
e5:SetCondition(aux.dsercon)
e5:SetTarget(c84257883.rcttg)
e5:SetOperation(c84257883.rctop)
c:RegisterEffect(e5)
......
......@@ -78,7 +78,8 @@ function c88305705.rmcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
e:SetLabelObject(bc)
return c==Duel.GetAttacker() and bc and c:IsStatus(STATUS_OPPO_BATTLE) and bc:IsOnField() and bc:IsRelateToBattle()
return aux.dsercon(e) and c==Duel.GetAttacker() and c:IsStatus(STATUS_OPPO_BATTLE)
and bc and bc:IsOnField() and bc:IsRelateToBattle()
end
function c88305705.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetLabelObject():IsAbleToRemove() end
......
......@@ -25,7 +25,7 @@ end
function c91559748.cpcon(e,tp,eg,ep,ev,re,r,rp)
local t=e:GetHandler():GetBattleTarget()
e:SetLabelObject(t)
return t and t:IsRelateToBattle()
return aux.dsercon(e) and t and t:IsRelateToBattle()
end
function c91559748.cptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -24,7 +24,7 @@ function c95519486.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x3d) and not c:IsCode(95519486)
end
function c95519486.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler()==Duel.GetAttacker() and Duel.GetAttackTarget()
return aux.dsercon(e) and e:GetHandler()==Duel.GetAttacker() and Duel.GetAttackTarget()
and Duel.IsExistingMatchingCard(c95519486.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c95519486.destg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -27,7 +27,7 @@ function c95526884.reccon(e,tp,eg,ep,ev,re,r,rp)
if not d then return false end
local m=a:GetAttack()-d:GetDefense()
e:SetLabel(m)
return c==a and d:GetDefense()>=0 and m>0 and bit.band(d:GetBattlePosition(),POS_DEFENSE)~=0
return aux.dsercon(e) and c==a and d:GetDefense()>=0 and m>0 and bit.band(d:GetBattlePosition(),POS_DEFENSE)~=0
end
function c95526884.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -14,7 +14,7 @@ end
function c95789089.cpcon(e,tp,eg,ep,ev,re,r,rp)
local t=e:GetHandler():GetBattleTarget()
e:SetLabelObject(t)
return t and t:IsRelateToBattle()
return aux.dsercon(e) and t and t:IsRelateToBattle()
end
function c95789089.cptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -2255,6 +2255,11 @@ function Auxiliary.bdogcon(e,tp,eg,ep,ev,re,r,rp)
local bc=c:GetBattleTarget()
return c:IsRelateToBattle() and c:IsStatus(STATUS_OPPO_BATTLE) and bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)
end
--condition of EVENT_DAMAGE_STEP_END + this monster is releate to battle
function Auxiliary.dsercon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsRelateToBattle() or c:IsStatus(STATUS_BATTLE_DESTROYED)
end
--condition of EVENT_TO_GRAVE + destroyed by opponent
function Auxiliary.dogcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
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