Commit 72999150 authored by Chen Bill's avatar Chen Bill

update S:Pリトルナイト

parent 600e4db6
...@@ -88,28 +88,31 @@ function s.drmop(e,tp,eg,ep,ev,re,r,rp) ...@@ -88,28 +88,31 @@ function s.drmop(e,tp,eg,ep,ev,re,r,rp)
if #g~=2 or Duel.Remove(g,0,REASON_EFFECT+REASON_TEMPORARY)==0 if #g~=2 or Duel.Remove(g,0,REASON_EFFECT+REASON_TEMPORARY)==0
or not g:IsExists(Card.IsLocation,1,nil,LOCATION_REMOVED) then return end or not g:IsExists(Card.IsLocation,1,nil,LOCATION_REMOVED) then return end
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED) local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED)
local c=e:GetHandler()
local fid=c:GetFieldID()
for tc in aux.Next(og) do for tc in aux.Next(og) do
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1) tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
end end
og:KeepAlive() og:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabel(fid)
e1:SetLabelObject(og) e1:SetLabelObject(og)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetCondition(s.retcon) e1:SetCondition(s.retcon)
e1:SetOperation(s.retop) e1:SetOperation(s.retop)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function s.retfilter(c) function s.retfilter(c,fid)
return c:GetFlagEffect(id)~=0 return c:GetFlagEffectLabel(id)==fid
end end
function s.retfilter1(c,tp) function s.retfilter1(c,tp,fid)
return c:GetFlagEffect(id)~=0 and c:IsControler(tp) return c:GetFlagEffectLabel(id)==fid and c:IsControler(tp)
end end
function s.retcon(e,tp,eg,ep,ev,re,r,rp) function s.retcon(e,tp,eg,ep,ev,re,r,rp)
if not e:GetLabelObject():IsExists(s.retfilter,1,nil) then if not e:GetLabelObject():IsExists(s.retfilter,1,nil,e:GetLabel()) then
e:GetLabelObject():DeleteGroup() e:GetLabelObject():DeleteGroup()
e:Reset() e:Reset()
return false return false
...@@ -117,8 +120,9 @@ function s.retcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -117,8 +120,9 @@ function s.retcon(e,tp,eg,ep,ev,re,r,rp)
return true return true
end end
function s.retop(e,tp,eg,ep,ev,re,r,rp) function s.retop(e,tp,eg,ep,ev,re,r,rp)
local g1=e:GetLabelObject():Filter(s.retfilter1,nil,tp) local fid=e:GetLabel()
local g2=e:GetLabelObject():Filter(s.retfilter1,nil,1-tp) local g1=e:GetLabelObject():Filter(s.retfilter1,nil,tp,fid)
local g2=e:GetLabelObject():Filter(s.retfilter1,nil,1-tp,fid)
local turnp=Duel.GetTurnPlayer() local turnp=Duel.GetTurnPlayer()
if #g2==0 then if #g2==0 then
if #g1==1 then if #g1==1 then
...@@ -126,7 +130,7 @@ function s.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -126,7 +130,7 @@ function s.retop(e,tp,eg,ep,ev,re,r,rp)
else else
local tc=g1:Select(tp,1,1,nil):GetFirst() local tc=g1:Select(tp,1,1,nil):GetFirst()
Duel.ReturnToField(tc) Duel.ReturnToField(tc)
g1=g1-tc g1:RemoveCard(tc)
Duel.ReturnToField(g1:GetFirst()) Duel.ReturnToField(g1:GetFirst())
end end
else else
...@@ -142,4 +146,5 @@ function s.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -142,4 +146,5 @@ function s.retop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
e:GetLabelObject():DeleteGroup()
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