Commit 19516650 authored by salix5's avatar salix5

fix

parent fd6be139
...@@ -14,27 +14,48 @@ function c73567374.filter(c) ...@@ -14,27 +14,48 @@ function c73567374.filter(c)
end end
function c73567374.target(e,tp,eg,ep,ev,re,r,rp,chk) function c73567374.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c73567374.filter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c73567374.filter,tp,LOCATION_MZONE,0,1,nil) end
local g=Duel.GetMatchingGroup(c73567374.filter,tp,LOCATION_MZONE,0,nil)
Duel.SetTargetCard(g)
end
function c73567374.filter2(c)
return c:IsFaceup() and c:IsType(TYPE_DUAL) and not c:IsDualState() and c:IsRelateToEffect(e) and not c:IsImmuneToEffect(e)
end end
function c73567374.operation(e,tp,eg,ep,ev,re,r,rp) function c73567374.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c73567374.filter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(c73567374.filter2,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
local fid=e:GetHandler():GetFieldID()
while tc do while tc do
tc:EnableDualState() tc:EnableDualState()
local e1=Effect.CreateEffect(e:GetHandler()) tc:RegisterFlagEffect(73567374,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1,fid)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c73567374.flipcon)
e1:SetOperation(c73567374.flipop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1,true)
tc=g:GetNext() tc=g:GetNext()
end end
g:KeepAlive()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetLabel(fid)
e2:SetLabelObject(g)
e2:SetCondition(c73567374.flipcon)
e2:SetOperation(c73567374.flipop)
Duel.RegisterEffect(e2,tp)
end
function c73567374.flipfilter(c,fid)
return c:GetFlagEffectLabel(73567374)==fid
end end
function c73567374.flipcon(e,tp,eg,ep,ev,re,r,rp) function c73567374.flipcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsCanTurnSet() local g=e:GetLabelObject()
if not g:IsExists(c73567374.flipfilter,1,nil,e:GetLabel()) then
g:DeleteGroup()
e:Reset()
return false
else return true end
end end
function c73567374.flipop(e,tp,eg,ep,ev,re,r,rp) function c73567374.flipop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangePosition(e:GetHandler(),POS_FACEDOWN_DEFENSE) local g=e:GetLabelObject()
local dg=g:Filter(c73567374.flipfilter,nil,e:GetLabel())
g:DeleteGroup()
Duel.ChangePosition(dg,POS_FACEDOWN_DEFENSE)
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