Commit 51860c27 authored by Grajade's avatar Grajade

Update c86379654.lua

parent e0938fbb
......@@ -111,46 +111,57 @@ function c86379654.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c86379654.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 then
local rc=g:GetFirst()
local rc=Duel.GetOperatedGroup():GetFirst()
local tg=rc:GetColumnGroup()
tg:AddCard(rc)
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT+REASON_TEMPORARY)
if Duel.Remove(tg,POS_FACEUP,REASON_EFFECT+REASON_TEMPORARY)<1 then return end
local fid=c:GetFieldID()
local rg=Duel.GetOperatedGroup()
if rg:GetCount()>0 then
rg:KeepAlive()
for tc in aux.Next(rg) do
tc:RegisterFlagEffect(86379654,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
tc:RegisterFlagEffect(86379655,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2,fid)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(rg)
e1:SetCondition(c86379654.con1_2)
e1:SetOperation(c86379654.op1_2)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
for tc in aux.Next(rg) do
tc:RegisterFlagEffect(86379655,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2,fid)
end
rg:KeepAlive()
local ct=Duel.GetTurnCount()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabel(fid,ct)
e1:SetLabelObject(rg)
e1:SetCondition(c86379654.con1_2)
e1:SetOperation(c86379654.op1_2)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
end
end
end
function c86379654.refilter(c)
return c:GetFlagEffect(86379654)>0
end
function c86379654.con1_2(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local sg=g:Filter(c86379654.refilter,nil)
return sg:GetCount()<=0
local fid,ct=e:GetLabel()
return Duel.GetTurnCount()~=ct
end
function c86379654.refilter2(c,fid)
return c:GetFlagEffect(86379655)>0
and c:GetFlagEffectLabel(86379655)==fid
end
function c86379654.op1_2(e,tp,eg,ep,ev,re,r,rp)
local fid,oil=e:GetLabel()
local g=e:GetLabelObject()
local sg=g:Filter(c86379654.refilter2,nil,e:GetLabel())
local sg=g:Filter(c86379654.refilter2,nil,fid)
for i=1,2 do
local p=tp
if i==2 then p=1-tp end
if sg:GetCount()<1 then return end
local lg=sg:Filter(Card.IsPreviousControler,nil,p)
local ft=Duel.GetLocationCount(p,LOCATION_MZONE)
if lg and ft>0 and ft<lg:GetCount() then
Duel.Hint(HINT_SELECTMSG,p,aux.Stringid(86379654,4))
local rg=lg:Select(p,ft,ft,nil)
for tc in aux.Next(rg) do
Duel.ReturnToField(tc)
sg:RemoveCard(tc)
end
end
end
if sg:GetCount()<1 then return end
for tc in aux.Next(sg) do
Duel.ReturnToField(tc)
......
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