Commit 43f70886 authored by wyykak's avatar wyykak

fix 28050

Signed-off-by: wyykak's avatarwyykak <wyy_1414@126.com>
parent d9b3253c
......@@ -59,33 +59,22 @@ function c28050.op1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c28050.tfilter1,tp,LOCATION_HAND+LOCATION_ONFIELD,LOCATION_HAND+LOCATION_ONFIELD,c)
if g:GetCount()<=0 then return end
if Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT|REASON_TEMPORARY)>0 and g:IsExists(Card.IsLocation,1,nil,LOCATION_REMOVED) then
local og1=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED):Filter(Card.IsPreviousLocation,nil,LOCATION_ONFIELD)
local og2=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED):Filter(Card.IsPreviousLocation,nil,LOCATION_HAND)
local tc=og1:GetFirst()
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED)
local tc=og:GetFirst()
while tc do
tc:RegisterFlagEffect(28050,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
tc=og1:GetNext()
tc=og:GetNext()
end
tc=og2:GetFirst()
while tc do
tc:RegisterFlagEffect(28050,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
tc=og2:GetNext()
end
og1:KeepAlive()
og2:KeepAlive()
og:KeepAlive()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(og1)
e1:SetLabelObject(og)
e1:SetCountLimit(1)
e1:SetCondition(c28050.retcon)
e1:SetOperation(c28050.retop1)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetLabelObject(og2)
e2:SetOperation(c28050.retop2)
Duel.RegisterEffect(e2,tp)
end
local num=g:FilterCount(c28050.ofilter1,nil)
if num<=0 then return end
......@@ -108,18 +97,45 @@ function c28050.retcon(e,tp,eg,ep,ev,re,r,rp)
end
function c28050.retop1(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local tg=g:Filter(c28050.retfilter,nil,e:GetLabel())
local tc=tg:GetFirst()
while tc do
Duel.ReturnToField(tc)
tc=tg:GetNext()
local tg=g:Filter(c28050.retfilter,nil)
local rc=tg:GetFirst()
while rc do
local cp=rc:GetPreviousControler()
if rc:GetPreviousLocation()==LOCATION_HAND then
Duel.SendtoHand(rc,cp,REASON_RULE)
end
if rc:IsPreviousLocation(LOCATION_ONFIELD) then
if rc:IsType(TYPE_FIELD) and rc:IsPreviousLocation(LOCATION_FZONE) then
local pos=rc:GetPreviousPosition()
if Duel.GetFieldCard(cp,LOCATION_SZONE,5) then
Duel.SendtoGrave(rc,REASON_RULE)
else
Duel.MoveToField(rc,cp,cp,LOCATION_FZONE,pos,true)
end
elseif rc:IsType(TYPE_PENDULUM) and rc:IsPreviousLocation(LOCATION_PZONE) then
local pos=rc:GetPreviousPosition()
if Duel.GetFieldCard(cp,LOCATION_PZONE,0) and Duel.GetFieldCard(cp,LOCATION_PZONE,1) then
Duel.SendtoGrave(rc,REASON_RULE)
else
Duel.MoveToField(rc,cp,cp,LOCATION_PZONE,pos,true)
end
elseif rc:IsType(TYPE_MONSTER) and rc:IsPreviousLocation(LOCATION_SZONE) then
local ty=rc:GetPreviousTypeOnField()
if Duel.ReturnToField(rc) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(ty)
rc:RegisterEffect(e1,true)
end
else
Duel.ReturnToField(rc)
end
end
rc=tg:GetNext()
end
g:DeleteGroup()
end
function c28050.retop2(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local tg=g:Filter(c28050.retfilter,nil,e:GetLabel())
Duel.SendtoHand(tg,nil,REASON_EFFECT)
g:DeleteGroup()
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