Commit 1b83a10a authored by woodee's avatar woodee

aux.dogcon

parent 303f5784
......@@ -13,7 +13,7 @@ function c18426196.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CVAL_CHECK)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c18426196.thcon)
e1:SetCondition(aux.dogcon)
e1:SetCost(c18426196.thcost)
e1:SetTarget(c18426196.thtg)
e1:SetOperation(c18426196.thop)
......@@ -25,9 +25,6 @@ function c18426196.condtion(e)
return (ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL)
and Duel.GetAttacker()==e:GetHandler()
end
function c18426196.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY) and e:GetHandler():GetReasonPlayer()==1-tp
end
function c18426196.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if Duel.GetFlagEffect(tp,18426196)==0 then
......
......@@ -7,15 +7,11 @@ function c68535320.initial_effect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c68535320.condition)
e1:SetCondition(aux.dogcon)
e1:SetTarget(c68535320.target)
e1:SetOperation(c68535320.operation)
c:RegisterEffect(e1)
end
function c68535320.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and rp~=tp
end
function c68535320.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsDestructable() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,0,LOCATION_MZONE,1,nil) end
......
......@@ -7,15 +7,11 @@ function c95929069.initial_effect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c95929069.condition)
e1:SetCondition(aux.dogcon)
e1:SetTarget(c95929069.target)
e1:SetOperation(c95929069.operation)
c:RegisterEffect(e1)
end
function c95929069.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and rp~=tp
end
function c95929069.dfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end
......
......@@ -1455,6 +1455,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_TO_GRAVE + destroyed_by_opponent_from_field
function Auxiliary.dogcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetPreviousControler()==tp and c:IsReason(REASON_DESTROY) and rp~=tp
end
--condition of "cannot be negated"
function Auxiliary.nfbdncon(e)
return not e:GetHandler():IsForbidden()
......
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