Commit a6744277 authored by DailyShana's avatar DailyShana

fix "or destroyed by opponents attacking"

parent 12ac5605
......@@ -70,8 +70,8 @@ function c23545031.thop(e,tp,eg,ep,ev,re,r,rp)
end
function c23545031.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:GetPreviousControler()==tp
and (c:IsReason(REASON_EFFECT) or (c:IsReason(REASON_BATTLE) and Duel.GetAttacker():IsControler(1-tp)))
return c:GetPreviousControler()==tp
and (c:IsReason(REASON_EFFECT) and rp==1-tp or c:IsReason(REASON_BATTLE) and Duel.GetAttacker():IsControler(1-tp))
end
function c23545031.spcfilter(c)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToGraveAsCost()
......
......@@ -56,8 +56,8 @@ function c2530830.desop(e,tp,eg,ep,ev,re,r,rp)
end
function c2530830.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsReason(REASON_DESTROY) and (c:IsReason(REASON_EFFECT) or (c:IsReason(REASON_BATTLE) and Duel.GetAttacker():IsControler(1-tp)))
return c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) and c:IsReason(REASON_DESTROY)
and (c:IsReason(REASON_EFFECT) and rp==1-tp or c:IsReason(REASON_BATTLE) and Duel.GetAttacker():IsControler(1-tp))
and c:IsSummonType(SUMMON_TYPE_XYZ)
end
function c2530830.filter(c,e,tp)
......
......@@ -8,7 +8,6 @@ function c53485634.initial_effect(c)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCondition(c53485634.spcon)
e1:SetTarget(c53485634.sptg)
e1:SetOperation(c53485634.spop)
c:RegisterEffect(e1)
......@@ -24,14 +23,11 @@ function c53485634.initial_effect(c)
c:RegisterEffect(e2)
end
function c53485634.spfilter(c,e,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsReason(REASON_DESTROY) and (c:IsReason(REASON_EFFECT) or (c:IsReason(REASON_BATTLE) and Duel.GetAttacker():IsControler(1-tp)))
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) and c:IsReason(REASON_DESTROY)
and (c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp or c:IsReason(REASON_BATTLE) and Duel.GetAttacker():IsControler(1-tp))
and c:IsSetCard(0x3b) and c:IsLevelBelow(7) and c:IsControler(tp)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c53485634.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp
end
function c53485634.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -27,8 +27,8 @@ function c59650656.initial_effect(c)
end
function c59650656.cfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and ((c:IsReason(REASON_DESTROY) and c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
or (c:IsReason(REASON_BATTLE) and Duel.GetTurnPlayer()==1-tp))
and (c:IsReason(REASON_DESTROY) and c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp
or c:IsReason(REASON_BATTLE) and Duel.GetTurnPlayer()==1-tp)
and c:IsSetCard(0x7b) and c:IsType(TYPE_XYZ)
end
function c59650656.descon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -53,8 +53,8 @@ function c65472618.atkop(e,tp,eg,ep,ev,re,r,rp)
end
function c65472618.regcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and (c:IsReason(REASON_EFFECT) or (c:IsReason(REASON_BATTLE) and Duel.GetAttacker():IsControler(1-tp)))
return c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and (c:IsReason(REASON_EFFECT) and rp==1-tp or c:IsReason(REASON_BATTLE) and Duel.GetAttacker():IsControler(1-tp))
end
function c65472618.thfilter(c)
return c:IsAttackBelow(2000) and c:IsRace(RACE_WARRIOR+RACE_SPELLCASTER) and not c:IsCode(65472618)
......
......@@ -22,8 +22,8 @@ function c6903857.initial_effect(c)
end
function c6903857.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetPreviousControler()==tp and c:IsReason(REASON_DESTROY) and rp==1-tp
and (not c:IsReason(REASON_BATTLE) or c==Duel.GetAttackTarget())
return c:GetPreviousControler()==tp and c:IsReason(REASON_DESTROY)
and (c:IsReason(REASON_DESTROY) and rp==1-tp or c:IsReason(REASON_BATTLE) and c==Duel.GetAttackTarget())
end
function c6903857.dfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL+TYPE_TRAP)
......
......@@ -41,7 +41,7 @@ function c73130445.desop(e,tp,eg,ep,ev,re,r,rp)
end
function c73130445.cfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and c:GetReasonPlayer()==1-tp and (c:IsReason(REASON_EFFECT) or (c:IsReason(REASON_BATTLE) and c==Duel.GetAttackTarget()))
and (c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp or c:IsReason(REASON_BATTLE) and c==Duel.GetAttackTarget())
end
function c73130445.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c73130445.cfilter,1,nil,tp)
......
......@@ -12,7 +12,7 @@ function c9298235.initial_effect(c)
c:RegisterEffect(e1)
end
function c9298235.filter(c,tp)
return c:IsReason(REASON_DESTROY) and c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:GetReasonPlayer()==1-tp
return c:IsReason(REASON_DESTROY) and (c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp or c:IsReason(REASON_BATTLE) and Duel.GetAttacker():IsControler(1-tp))
and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP)
and c:GetPreviousControler()==tp and c:IsControler(tp) and c:IsSetCard(0xa9) and c:IsAbleToHand()
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