Commit ed69c089 authored by POLYMER's avatar POLYMER

fix

parent fcd0201b
......@@ -73,7 +73,7 @@ function cm.reop1(e,tp,eg,ep,ev,re,r,rp)
Duel.HintSelection(tg)
if tc:IsLocation(LOCATION_MZONE) then
Duel.Hint(HINT_CARD,0,m)
if Duel.Remove(tc,0,REASON_RULE+REASON_TEMPORARY)>0 then
if Duel.Remove(tc,0,REASON_RULE+REASON_TEMPORARY)>0 and not tc:IsReason(REASON_REDIRECT) then
n1=n1-1
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(m,0))
......@@ -114,7 +114,7 @@ function cm.reop1(e,tp,eg,ep,ev,re,r,rp)
Duel.HintSelection(tg)
if tc:IsLocation(LOCATION_MZONE) then
Duel.Hint(HINT_CARD,0,m)
if Duel.Remove(tc,0,REASON_RULE+REASON_TEMPORARY)>0 then
if Duel.Remove(tc,0,REASON_RULE+REASON_TEMPORARY)>0 and not tc:IsReason(REASON_REDIRECT) then
n2=n2-1
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(m,0))
......
......@@ -94,7 +94,7 @@ function cm.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoDeck(g,tp,2,REASON_EFFECT)
else
Duel.BreakEffect()
if Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT+REASON_TEMPORARY)~=0 then
if Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT+REASON_TEMPORARY)~=0 and not c:IsReason(REASON_REDIRECT) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
......
......@@ -156,7 +156,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local og1=Duel.GetOperatedGroup()
if og1:IsExists(cm.retfilter2,1,nil,tp,LOCATION_HAND) then Duel.ShuffleHand(tp) end
if og1:IsExists(cm.retfilter2,1,nil,1-tp,LOCATION_HAND) then Duel.ShuffleHand(1-tp) end
local og=Group.__band(og1,tg):Filter(Card.IsLocation,nil,LOCATION_REMOVED)
local og=Group.__band(og1,tg):Filter(cm.rffilter,nil)
if og and #og>0 then
for oc in aux.Next(og) do
oc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
......@@ -179,6 +179,9 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function cm.rffilter(c)
return c:IsLocation(LOCATION_REMOVED) and not c:IsReason(REASON_REDIRECT)
end
function cm.retfilter2(c,p,loc)
if (c:IsPreviousLocation(LOCATION_SZONE) and c:GetPreviousTypeOnField()&TYPE_EQUIP>0) or c:IsPreviousLocation(LOCATION_FZONE) then return false end
return c:IsPreviousControler(p) and c:IsPreviousLocation(loc)
......
......@@ -139,7 +139,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local og1=Duel.GetOperatedGroup()
if og1:IsExists(cm.retfilter2,1,nil,tp,LOCATION_HAND) then Duel.ShuffleHand(tp) end
if og1:IsExists(cm.retfilter2,1,nil,1-tp,LOCATION_HAND) then Duel.ShuffleHand(1-tp) end
local og=Group.__band(og1,tg):Filter(Card.IsLocation,nil,LOCATION_REMOVED)
local og=Group.__band(og1,tg):Filter(cm.rffilter,nil)
if og and #og>0 then
for oc in aux.Next(og) do
oc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
......@@ -162,6 +162,9 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function cm.rffilter(c)
return c:IsLocation(LOCATION_REMOVED) and not c:IsReason(REASON_REDIRECT)
end
function cm.retfilter2(c,p,loc)
if (c:IsPreviousLocation(LOCATION_SZONE) and c:GetPreviousTypeOnField()&TYPE_EQUIP>0) or c:IsPreviousLocation(LOCATION_FZONE) then return false end
return c:IsPreviousControler(p) and c:IsPreviousLocation(loc)
......
......@@ -195,7 +195,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local og1=Duel.GetOperatedGroup()
if og1:IsExists(cm.retfilter2,1,nil,tp,LOCATION_HAND) then Duel.ShuffleHand(tp) end
if og1:IsExists(cm.retfilter2,1,nil,1-tp,LOCATION_HAND) then Duel.ShuffleHand(1-tp) end
local og=Group.__band(og1,tg):Filter(Card.IsLocation,nil,LOCATION_REMOVED)
local og=Group.__band(og1,tg):Filter(cm.rffilter,nil)
if og and #og>0 then
for oc in aux.Next(og) do
oc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
......@@ -218,6 +218,9 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function cm.rffilter(c)
return c:IsLocation(LOCATION_REMOVED) and not c:IsReason(REASON_REDIRECT)
end
function cm.retfilter2(c,p,loc)
if (c:IsPreviousLocation(LOCATION_SZONE) and c:GetPreviousTypeOnField()&TYPE_EQUIP>0) or c:IsPreviousLocation(LOCATION_FZONE) then return false end
return c:IsPreviousControler(p) and c:IsPreviousLocation(loc)
......
......@@ -173,7 +173,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local og1=Duel.GetOperatedGroup()
if og1:IsExists(cm.retfilter2,1,nil,tp,LOCATION_HAND) then Duel.ShuffleHand(tp) end
if og1:IsExists(cm.retfilter2,1,nil,1-tp,LOCATION_HAND) then Duel.ShuffleHand(1-tp) end
local og=Group.__band(og1,tg):Filter(Card.IsLocation,nil,LOCATION_REMOVED)
local og=Group.__band(og1,tg):Filter(cm.rffilter,nil)
if og and #og>0 then
for oc in aux.Next(og) do
oc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
......@@ -196,6 +196,9 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function cm.rffilter(c)
return c:IsLocation(LOCATION_REMOVED) and not c:IsReason(REASON_REDIRECT)
end
function cm.retfilter2(c,p,loc)
if (c:IsPreviousLocation(LOCATION_SZONE) and c:GetPreviousTypeOnField()&TYPE_EQUIP>0) or c:IsPreviousLocation(LOCATION_FZONE) then return false end
return c:IsPreviousControler(p) and c:IsPreviousLocation(loc)
......
......@@ -190,7 +190,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local og1=Duel.GetOperatedGroup()
if og1:IsExists(cm.retfilter2,1,nil,tp,LOCATION_HAND) then Duel.ShuffleHand(tp) end
if og1:IsExists(cm.retfilter2,1,nil,1-tp,LOCATION_HAND) then Duel.ShuffleHand(1-tp) end
local og=Group.__band(og1,tg):Filter(Card.IsLocation,nil,LOCATION_REMOVED)
local og=Group.__band(og1,tg):Filter(cm.rffilter,nil)
if og and #og>0 then
for oc in aux.Next(og) do
oc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
......@@ -213,6 +213,9 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function cm.rffilter(c)
return c:IsLocation(LOCATION_REMOVED) and not c:IsReason(REASON_REDIRECT)
end
function cm.retfilter2(c,p,loc)
if (c:IsPreviousLocation(LOCATION_SZONE) and c:GetPreviousTypeOnField()&TYPE_EQUIP>0) or c:IsPreviousLocation(LOCATION_FZONE) then return false end
return c:IsPreviousControler(p) and c:IsPreviousLocation(loc)
......
......@@ -230,7 +230,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local og1=Duel.GetOperatedGroup()
if og1:IsExists(cm.retfilter2,1,nil,tp,LOCATION_HAND) then Duel.ShuffleHand(tp) end
if og1:IsExists(cm.retfilter2,1,nil,1-tp,LOCATION_HAND) then Duel.ShuffleHand(1-tp) end
local og=Group.__band(og1,tg):Filter(Card.IsLocation,nil,LOCATION_REMOVED)
local og=Group.__band(og1,tg):Filter(cm.rffilter,nil)
if og and #og>0 then
for oc in aux.Next(og) do
oc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
......@@ -253,6 +253,9 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function cm.rffilter(c)
return c:IsLocation(LOCATION_REMOVED) and not c:IsReason(REASON_REDIRECT)
end
function cm.retfilter2(c,p,loc)
if (c:IsPreviousLocation(LOCATION_SZONE) and c:GetPreviousTypeOnField()&TYPE_EQUIP>0) or c:IsPreviousLocation(LOCATION_FZONE) then return false end
return c:IsPreviousControler(p) and c:IsPreviousLocation(loc)
......
......@@ -88,7 +88,7 @@ function cm.initial_effect(c)
end
end
if #og>=mi and Duel.GetMZoneCount(top)>0 then return true end
return _CheckTribute(c,mi-#og,ma,mg,top,...)
return cm.CheckTribute(c,mi-#og,ma,mg,top,...)
end
function Duel.SelectTribute(tp,c,mi,ma,mg,...)
local g=mg or Duel.GetTributeGroup(c)
......
......@@ -29,8 +29,8 @@ function cm.initial_effect(c)
e2:SetTarget(cm.sctg)
e2:SetOperation(cm.scop)
c:RegisterEffect(e2)
if not cm.global_check then
cm.global_check=true
if not PNFL_ETARGET_CHECK then
PNFL_ETARGET_CHECK=true
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_BECOME_TARGET)
......@@ -44,23 +44,27 @@ function cm.initial_effect(c)
end
end
function cm.checkop3(e,tp,eg,ep,ev,re,r,rp)
local tg=eg:Filter(Card.IsLocation,nil,LOCATION_MZONE)
local tg=eg
if #tg>0 then
for tc in aux.Next(tg) do
tc:RegisterFlagEffect(m+1,RESET_EVENT+0x1fc0000,0,1)
for tc in aux.Next(eg) do
local prop=EFFECT_FLAG_SET_AVAILABLE
if PNFL_ETARGET_HINT or PNFL_DEBUG then prop=prop|EFFECT_FLAG_CLIENT_HINT end
tc:RegisterFlagEffect(11451541,RESET_EVENT+0x1fc0000,prop,1,0,aux.Stringid(11451541,5))
end
end
end
function cm.checkop6(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetMatchingGroup(cm.ctgfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil)
local tg=Duel.GetMatchingGroup(cm.ctgfilter,0,0x3c,0x3c,nil)
if #tg>0 then
for tc in aux.Next(tg) do
tc:RegisterFlagEffect(m+1,RESET_EVENT+0x1fc0000,0,1)
local prop=EFFECT_FLAG_SET_AVAILABLE
if PNFL_ETARGET_HINT or PNFL_DEBUG then prop=prop|EFFECT_FLAG_CLIENT_HINT end
tc:RegisterFlagEffect(11451541,RESET_EVENT+0x1fc0000,prop,1,0,aux.Stringid(11451541,5))
end
end
end
function cm.ctgfilter(c)
return c:GetOwnerTargetCount()>0 and c:GetFlagEffect(m+1)==0
return c:GetOwnerTargetCount()>0 and c:GetFlagEffect(11451541)==0
end
function cm.filter(c,tp)
return c:IsControler(tp)
......@@ -120,11 +124,23 @@ function cm.sccost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(e:GetHandler(),REASON_COST)
end
function cm.cfilter(c)
return c:IsFaceup() and c:GetFlagEffect(m+1)==0
return c:IsFaceup() and c:GetFlagEffect(11451541)==0
end
function cm.shfilter(c)
return c:GetFlagEffect(11451541)>0
end
function cm.sctg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(cm.cfilter,tp,0,LOCATION_MZONE,2,nil) end
if chk==0 then
if not PNFL_ETARGET_HINT then
PNFL_ETARGET_HINT=true
local shg=Duel.GetMatchingGroup(cm.shfilter,tp,0x3c,0x3c,nil)
for tc in aux.Next(shg) do
tc:RegisterFlagEffect(11451541,RESET_EVENT+0x1fc0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451541,5))
end
end
return Duel.IsExistingTarget(cm.cfilter,tp,0,LOCATION_MZONE,2,nil)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,cm.cfilter,tp,0,LOCATION_MZONE,2,2,nil)
end
......@@ -145,18 +161,18 @@ function cm.scop(e,tp,eg,ep,ev,re,r,rp)
e1:SetLabel(eid)
e1:SetCondition(cm.con)
if ac:IsAttribute(bc:GetAttribute()) and (ac:GetAttribute()==bc:GetAttribute() or Duel.SelectOption(tp,aux.Stringid(m,2),aux.Stringid(m,3))==0) then
ac:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,eid,aux.Stringid(m,2))
bc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,eid,aux.Stringid(m,2))
ac:RegisterFlagEffect(m+1,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,eid,aux.Stringid(m,2))
bc:RegisterFlagEffect(m+1,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,eid,aux.Stringid(m,2))
e1:SetTarget(cm.sumlimit)
else
ac:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,eid,aux.Stringid(m,3))
bc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,eid,aux.Stringid(m,3))
ac:RegisterFlagEffect(m+1,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,eid,aux.Stringid(m,3))
bc:RegisterFlagEffect(m+1,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,eid,aux.Stringid(m,3))
e1:SetTarget(cm.sumlimit2)
end
Duel.RegisterEffect(e1,tp)
end
function cm.cfilter2(c,eid)
return c:IsFaceup() and c:GetFlagEffect(m)~=0 and c:GetFlagEffectLabel(m)==eid
return c:IsFaceup() and c:GetFlagEffect(m+1)~=0 and c:GetFlagEffectLabel(m+1)==eid
end
function cm.con(e)
return Duel.IsExistingMatchingCard(cm.cfilter2,0,LOCATION_MZONE,LOCATION_MZONE,1,nil,e:GetLabel())
......
--电脑网断了
--21.06.18
local m=11451575
local cm=_G["c"..m]
local cm,m=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
......@@ -41,15 +40,14 @@ function cm.xylabel(c,tp)
return x,y
end
function cm.gradient(y,x)
if y>0 and x==0 then return 100 end
if y<0 and x==0 then return 110 end
if y>0 and x~=0 then return y/x end
if y<0 and x~=0 then return y/x+10 end
if y==0 and x>0 then return 0 end
if y==0 and x<0 then return 10 end
if y>0 and x==0 then return math.pi/2 end
if y<0 and x==0 then return math.pi*3/2 end
if y>=0 and x>0 then return math.atan(y/x) end
if x<0 then return math.pi+math.atan(y/x) end
if y<0 and x>0 then return 2*math.pi+math.atan(y/x) end
return 1000
end
function cm.fieldline(x1,y1,x2,y2,tp,...)
function cm.fieldline(x1,y1,x2,y2,...)
for _,k in pairs({...}) do
if cm.gradient(y2-y1,x2-x1)==k then return true end
end
......@@ -58,18 +56,19 @@ end
function cm.willbelinkdir(c,lc,x0,y0,tp,tgp)
if tp~=tgp then x0,y0=4-x0,4-y0 end
local x,y=cm.xylabel(c,tgp)
local list={11,110,9,10,1000,0,-1,100,1}
local list={5/4,3/2,7/4,1,1000,0,3/4,1/2,1/4}
for i=0,8 do
if lc:IsLinkMarker(1<<i) and cm.fieldline(x0,y0,x,y,tgp,list[i+1]) then return true end
if lc:IsLinkMarker(1<<i) and cm.fieldline(x0,y0,x,y,list[i+1]*math.pi) then return true end
end
return false
end
function cm.islinkdir(lc,x,y,tp)
if lc:IsControler(1-tp) then x,y=4-x,4-y end
local x0,y0=cm.xylabel(lc,lc:GetControler())
local list={11,110,9,10,1000,0,-1,100,1}
local list={5/4,3/2,7/4,1,1000,0,3/4,1/2,1/4}
--local list={11,110,9,10,1000,0,-1,100,1}
for i=0,8 do
if lc:IsLinkMarker(1<<i) and cm.fieldline(x0,y0,x,y,lc:GetControler(),list[i+1]) then return true end
if lc:IsLinkMarker(1<<i) and cm.fieldline(x0,y0,x,y,list[i+1]*math.pi) then return true end
end
return false
end
......@@ -107,6 +106,9 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=lg:Filter(cm.islinkdir,nil,x,y,tp)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0)
end
function cm.rffilter(c)
return c:IsLocation(LOCATION_REMOVED) and not c:IsReason(REASON_REDIRECT)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or not c:IsLocation(LOCATION_SZONE) or not c:IsFaceup() then return end
......@@ -114,7 +116,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local x,y=cm.xylabel(c,tp)
local g=lg:Filter(cm.islinkdir,nil,x,y,tp)
if Duel.Remove(g,POS_FACEUP,REASON_EFFECT+REASON_TEMPORARY)>0 then
local og=Duel.GetOperatedGroup()
local og=Duel.GetOperatedGroup():Filter(cm.rffilter,nil)
og:KeepAlive()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
......
......@@ -2,6 +2,7 @@
--21.06.20
local cm,m=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x971)
--act in hand
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
......@@ -53,15 +54,15 @@ function cm.ctcon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.ctop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
e:GetHandler():AddCounter(0x1970,1)
e:GetHandler():AddCounter(0x971,1)
if e:GetHandler():IsStatus(STATUS_ACT_FROM_HAND) then Duel.SetLP(tp,Duel.GetLP(tp)-300) end
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function cm.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x1970,3,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x1970,3,REASON_COST)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x971,3,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x971,3,REASON_COST)
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and aux.disfilter1(chkc) end
......
......@@ -265,7 +265,7 @@ function cm.syop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave=function(g,r)
if r==REASON_MATERIAL+REASON_SYNCHRO and #g>0 and Duel.Remove(g,POS_FACEUP,REASON_MATERIAL+REASON_SYNCHRO+REASON_TEMPORARY)>0 then
local fid=sc:GetFieldID()
local og=Duel.GetOperatedGroup()
local og=Duel.GetOperatedGroup():Filter(cm.rffilter,nil)
for oc in aux.Next(og) do
oc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
end
......@@ -290,6 +290,9 @@ function cm.syop(e,tp,eg,ep,ev,re,r,rp)
Duel.SynchroSummon(tp,sg:GetFirst(),nil)
end
end
function cm.rffilter(c)
return c:IsLocation(LOCATION_REMOVED) and not c:IsReason(REASON_REDIRECT)
end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if te and aux.GetValueType(te)=="Effect" then te:Reset() end
......
......@@ -35,13 +35,8 @@ function cm.initial_effect(c)
e2:SetTarget(cm.destg2)
e2:SetOperation(cm.desop2)
c:RegisterEffect(e2)
if not NTR_CHECK then
NTR_CHECK=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_BE_BATTLE_TARGET)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
if not PNFL_ETARGET_CHECK then
PNFL_ETARGET_CHECK=true
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_BECOME_TARGET)
......@@ -53,6 +48,14 @@ function cm.initial_effect(c)
ge6:SetOperation(cm.checkop6)
Duel.RegisterEffect(ge6,0)
end
if not PNFL_BTARGET_CHECK then
PNFL_BTARGET_CHECK=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_BE_BATTLE_TARGET)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
end
if not Duel.GetMustMaterial then
function Duel.GetMustMaterial(tp,code)
......@@ -67,29 +70,36 @@ if not Duel.GetMustMaterial then
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttackTarget()
tc:RegisterFlagEffect(m,RESET_EVENT+0x1fc0000,0,1)
tc:RegisterFlagEffect(11451682,RESET_EVENT+0x1fc0000,0,1)
end
function cm.checkop3(e,tp,eg,ep,ev,re,r,rp)
local tg=eg:Filter(Card.IsOnField,nil)
local tg=eg
if #tg>0 then
for tc in aux.Next(tg) do
tc:RegisterFlagEffect(m,RESET_EVENT+0x1fc0000,0,1)
for tc in aux.Next(eg) do
local prop=EFFECT_FLAG_SET_AVAILABLE
if PNFL_ETARGET_HINT or PNFL_DEBUG then prop=prop|EFFECT_FLAG_CLIENT_HINT end
tc:RegisterFlagEffect(11451541,RESET_EVENT+0x1fc0000,prop,1,0,aux.Stringid(11451541,5))
end
end
end
function cm.checkop6(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetMatchingGroup(cm.ctgfilter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local tg=Duel.GetMatchingGroup(cm.ctgfilter,0,0x3c,0x3c,nil)
if #tg>0 then
for tc in aux.Next(tg) do
tc:RegisterFlagEffect(m,RESET_EVENT+0x1fc0000,0,1)
local prop=EFFECT_FLAG_SET_AVAILABLE
if PNFL_ETARGET_HINT or PNFL_DEBUG then prop=prop|EFFECT_FLAG_CLIENT_HINT end
tc:RegisterFlagEffect(11451541,RESET_EVENT+0x1fc0000,prop,1,0,aux.Stringid(11451541,5))
end
end
end
function cm.ctgfilter(c)
return c:GetOwnerTargetCount()>0 and c:GetFlagEffect(m)==0
return c:GetOwnerTargetCount()>0 and c:GetFlagEffect(11451541)==0
end
function cm.shfilter(c)
return c:GetFlagEffect(11451541)>0
end
function cm.GetLinkCount(c)
if c:GetFlagEffect(m)>0 then
if c:GetFlagEffect(11451541)>0 then
return 1+0x10000*2
elseif c:IsType(TYPE_LINK) and c:GetLink()>1 then
return 1+0x10000*c:GetLink()
......@@ -131,6 +141,13 @@ function cm.LinkCondition(f,minc,maxc,gf)
end
function cm.LinkTarget(f,minc,maxc,gf)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,og,lmat,min,max)
if not PNFL_ETARGET_HINT then
PNFL_ETARGET_HINT=true
local shg=Duel.GetMatchingGroup(cm.shfilter,tp,0x3c,0x3c,nil)
for tc in aux.Next(shg) do
tc:RegisterFlagEffect(11451541,RESET_EVENT+0x1fc0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451541,5))
end
end
local minc=minc
local maxc=maxc
if min then
......
......@@ -56,13 +56,34 @@ function cm.initial_effect(c)
e4:SetTarget(cm.reptg)
e4:SetValue(cm.repval)
c:RegisterEffect(e4)
if not PNFL_ETARGET_CHECK then
PNFL_ETARGET_CHECK=true
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_BECOME_TARGET)
ge3:SetOperation(cm.checkop3)
Duel.RegisterEffect(ge3,0)
local ge6=Effect.CreateEffect(c)
ge6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge6:SetCode(EVENT_ADJUST)
ge6:SetOperation(cm.checkop6)
Duel.RegisterEffect(ge6,0)
end
if not PNFL_BTARGET_CHECK then
PNFL_BTARGET_CHECK=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_BE_BATTLE_TARGET)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
if not NTR_CHECK then
NTR_CHECK=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_BE_BATTLE_TARGET)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
--Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_CHAINING)
......@@ -73,7 +94,7 @@ function cm.initial_effect(c)
ge3:SetCode(EVENT_BECOME_TARGET)
ge3:SetOperation(cm.checkop3)
--ge3:SetLabelObject(ge2)
Duel.RegisterEffect(ge3,0)
--Duel.RegisterEffect(ge3,0)
local ge4=Effect.CreateEffect(c)
ge4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge4:SetCode(EVENT_CHAIN_END)
......@@ -89,12 +110,12 @@ function cm.initial_effect(c)
ge6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge6:SetCode(EVENT_ADJUST)
ge6:SetOperation(cm.checkop6)
Duel.RegisterEffect(ge6,0)
--Duel.RegisterEffect(ge6,0)
end
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttackTarget()
tc:RegisterFlagEffect(m-1,RESET_EVENT+0x1fc0000,0,1)
tc:RegisterFlagEffect(11451682,RESET_EVENT+0x1fc0000,0,1)
end
function cm.checkop2(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
......@@ -108,16 +129,6 @@ function cm.checkop2(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function cm.checkop3(e,tp,eg,ep,ev,re,r,rp)
--local lab=e:GetLabelObject():GetLabel()
--if lab~=ev-1 then return end
local tg=eg:Filter(Card.IsOnField,nil)
if #tg>0 then
for tc in aux.Next(tg) do
tc:RegisterFlagEffect(m-1,RESET_EVENT+0x1fc0000,0,1)
end
end
end
function cm.checkop4(e,tp,eg,ep,ev,re,r,rp)
e:GetLabelObject():SetLabel(0)
end
......@@ -133,19 +144,34 @@ function cm.checkop5(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function cm.checkop3(e,tp,eg,ep,ev,re,r,rp)
local tg=eg
if #tg>0 then
for tc in aux.Next(eg) do
local prop=EFFECT_FLAG_SET_AVAILABLE
if PNFL_ETARGET_HINT or PNFL_DEBUG then prop=prop|EFFECT_FLAG_CLIENT_HINT end
tc:RegisterFlagEffect(11451541,RESET_EVENT+0x1fc0000,prop,1,0,aux.Stringid(11451541,5))
end
end
end
function cm.checkop6(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetMatchingGroup(cm.ctgfilter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local tg=Duel.GetMatchingGroup(cm.ctgfilter,0,0x3c,0x3c,nil)
if #tg>0 then
for tc in aux.Next(tg) do
tc:RegisterFlagEffect(m-1,RESET_EVENT+0x1fc0000,0,1)
local prop=EFFECT_FLAG_SET_AVAILABLE
if PNFL_ETARGET_HINT or PNFL_DEBUG then prop=prop|EFFECT_FLAG_CLIENT_HINT end
tc:RegisterFlagEffect(11451541,RESET_EVENT+0x1fc0000,prop,1,0,aux.Stringid(11451541,5))
end
end
end
function cm.ctgfilter(c)
return c:GetOwnerTargetCount()>0 and c:GetFlagEffect(m-1)==0
return c:GetOwnerTargetCount()>0 and c:GetFlagEffect(11451541)==0
end
function cm.shfilter(c)
return c:GetFlagEffect(11451541)>0
end
function cm.tgfilter(c,e)
return c:IsCanBeEffectTarget(e) and c:GetFlagEffect(m-1)==0
return c:IsCanBeEffectTarget(e) and c:GetFlagEffect(11451541)==0
end
function cm.hand(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
......@@ -154,6 +180,13 @@ end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
if not PNFL_ETARGET_HINT then
PNFL_ETARGET_HINT=true
local shg=Duel.GetMatchingGroup(cm.shfilter,tp,0x3c,0x3c,nil)
for tc in aux.Next(shg) do
tc:RegisterFlagEffect(11451541,RESET_EVENT+0x1fc0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451541,5))
end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
if e:GetHandler():IsStatus(STATUS_ACT_FROM_HAND) then
local g=Duel.SelectTarget(tp,cm.tgfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler(),e)
......
......@@ -26,6 +26,7 @@ function cm.initial_effect(c)
e3:SetCode(EVENT_REMOVE)
e3:SetRange(LOCATION_HAND)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetTarget(cm.mrtg)
e3:SetOperation(cm.mrop)
c:RegisterEffect(e3)
......@@ -49,7 +50,7 @@ end
function cm.reop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=e:GetLabel()
if c:IsRelateToEffect(e) and Duel.Remove(c,nil,REASON_EFFECT+REASON_TEMPORARY)~=0 and c:IsLocation(LOCATION_REMOVED) then
if c:IsRelateToEffect(e) and Duel.Remove(c,nil,REASON_EFFECT+REASON_TEMPORARY)~=0 and c:IsLocation(LOCATION_REMOVED) and not c:IsReason(REASON_REDIRECT) then
c:RegisterFlagEffect(11451717,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,ct,aux.Stringid(11451717,ct-3))
c:RegisterFlagEffect(11451718,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,9-ct,aux.Stringid(11451718,9-ct))
local e1=Effect.CreateEffect(c)
......@@ -177,7 +178,7 @@ function cm.pfilter(c)
return (seq>0 and Duel.CheckLocation(p,loc,seq-1)) or (seq<4 and Duel.CheckLocation(p,loc,seq+1))
end
function cm.mrtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.pfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and not e:GetHandler():IsStatus(STATUS_CHAINING) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.pfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
end
function cm.mrop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
......
......@@ -27,6 +27,7 @@ function cm.initial_effect(c)
e3:SetCode(EVENT_TO_HAND)
e3:SetRange(LOCATION_HAND)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(cm.mrcon)
e3:SetTarget(cm.mrtg)
e3:SetOperation(cm.mrop)
......@@ -51,7 +52,7 @@ end
function cm.reop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=e:GetLabel()
if c:IsRelateToEffect(e) and Duel.Remove(c,nil,REASON_EFFECT+REASON_TEMPORARY)~=0 and c:IsLocation(LOCATION_REMOVED) then
if c:IsRelateToEffect(e) and Duel.Remove(c,nil,REASON_EFFECT+REASON_TEMPORARY)~=0 and c:IsLocation(LOCATION_REMOVED) and not c:IsReason(REASON_REDIRECT) then
c:RegisterFlagEffect(11451717,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,ct,aux.Stringid(11451717,ct-3))
c:RegisterFlagEffect(11451718,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,9-ct,aux.Stringid(11451718,9-ct))
local e1=Effect.CreateEffect(c)
......@@ -224,7 +225,7 @@ function cm.mrcon(e,tp,eg,ep,ev,re,r,rp)
return r&REASON_EFFECT~=0
end
function cm.mrtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsRace,tp,LOCATION_DECK,0,1,nil,RACE_PSYCHO) and not e:GetHandler():IsStatus(STATUS_CHAINING) end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsRace,tp,LOCATION_DECK,0,1,nil,RACE_PSYCHO) end
end
function cm.mrop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
......
......@@ -27,6 +27,7 @@ function cm.initial_effect(c)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetRange(LOCATION_HAND)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(cm.mrcon)
e3:SetTarget(cm.mrtg)
e3:SetOperation(cm.mrop)
......@@ -51,7 +52,7 @@ end
function cm.reop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=e:GetLabel()
if c:IsRelateToEffect(e) and Duel.Remove(c,nil,REASON_EFFECT+REASON_TEMPORARY)~=0 and c:IsLocation(LOCATION_REMOVED) then
if c:IsRelateToEffect(e) and Duel.Remove(c,nil,REASON_EFFECT+REASON_TEMPORARY)~=0 and c:IsLocation(LOCATION_REMOVED) and not c:IsReason(REASON_REDIRECT) then
c:RegisterFlagEffect(11451717,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,ct,aux.Stringid(11451717,ct-3))
c:RegisterFlagEffect(11451718,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,9-ct,aux.Stringid(11451718,9-ct))
local e1=Effect.CreateEffect(c)
......@@ -182,7 +183,7 @@ function cm.mrcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil) and aux.dscon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.mrtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and not e:GetHandler():IsStatus(STATUS_CHAINING) end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
end
function cm.mrop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
......
......@@ -28,6 +28,7 @@ function cm.initial_effect(c)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_HAND)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(cm.mrcon)
e3:SetTarget(cm.mrtg)
e3:SetOperation(cm.mrop)
......@@ -52,7 +53,7 @@ end
function cm.reop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=e:GetLabel()
if c:IsRelateToEffect(e) and Duel.Remove(c,nil,REASON_EFFECT+REASON_TEMPORARY)~=0 and c:IsLocation(LOCATION_REMOVED) then
if c:IsRelateToEffect(e) and Duel.Remove(c,nil,REASON_EFFECT+REASON_TEMPORARY)~=0 and c:IsLocation(LOCATION_REMOVED) and not c:IsReason(REASON_REDIRECT) then
c:RegisterFlagEffect(11451717,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,ct,aux.Stringid(11451717,ct-3))
c:RegisterFlagEffect(11451718,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,9-ct,aux.Stringid(11451718,9-ct))
local e1=Effect.CreateEffect(c)
......@@ -199,7 +200,7 @@ function cm.thfilter(c)
return c:IsSetCard(0x3977) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function cm.mrtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) and e:GetHandler():IsAbleToDeck() and not e:GetHandler():IsStatus(STATUS_CHAINING) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) and e:GetHandler():IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end
......
......@@ -28,6 +28,7 @@ function cm.initial_effect(c)
e3:SetCode(EVENT_DESTROYED)
e3:SetRange(LOCATION_HAND)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(cm.mrcon)
e3:SetTarget(cm.mrtg)
e3:SetOperation(cm.mrop)
......@@ -52,7 +53,7 @@ end
function cm.reop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=e:GetLabel()
if c:IsRelateToEffect(e) and Duel.Remove(c,nil,REASON_EFFECT+REASON_TEMPORARY)~=0 and c:IsLocation(LOCATION_REMOVED) then
if c:IsRelateToEffect(e) and Duel.Remove(c,nil,REASON_EFFECT+REASON_TEMPORARY)~=0 and c:IsLocation(LOCATION_REMOVED) and not c:IsReason(REASON_REDIRECT) then
c:RegisterFlagEffect(11451717,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,ct,aux.Stringid(11451717,ct-3))
c:RegisterFlagEffect(11451718,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,9-ct,aux.Stringid(11451718,9-ct))
local e1=Effect.CreateEffect(c)
......@@ -298,7 +299,7 @@ function cm.spfilter(c,e,tp)
return c:IsSetCard(0x3977) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.mrtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsAbleToDeck() and not e:GetHandler():IsStatus(STATUS_CHAINING) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end
......
--绛胧烈刃辐散跃迁
local m=11451719
local cm=_G["c"..m]
local cm,m=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_CHAIN_END)
e1:SetTarget(cm.target)
e1:SetOperation(cm.rmop)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
......@@ -15,9 +17,11 @@ function cm.initial_effect(c)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(cm.rmcon)
e2:SetTarget(cm.rmtg)
e2:SetOperation(cm.rmop)
e2:SetLabel(1)
c:RegisterEffect(e2)
--activate cost
local e3=Effect.CreateEffect(c)
......@@ -47,24 +51,52 @@ function cm.initial_effect(c)
return res1,res2
end
end
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
if re:IsActiveType(TYPE_SPELL) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetOperation(cm.regop)
Duel.RegisterEffect(e1,0)
end
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+m,e,0,0,0,0)
end
function cm.rmcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:SetLabel(0)
e:SetCategory(0)
if Duel.CheckEvent(EVENT_CUSTOM+m) and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
e:SetCategory(CATEGORY_REMOVE)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,LOCATION_MZONE)
e:SetLabel(1)
e:GetHandler():RegisterFlagEffect(0,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,3))
end
end
function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and not e:GetHandler():IsStatus(STATUS_CHAINING) end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,LOCATION_MZONE)
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if c:IsRelateToEffect(e) and #g>0 then
if e:GetLabel()==1 and c:IsRelateToEffect(e) and #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
Duel.HintSelection(sg)
local sc=sg:GetFirst()
if Duel.Remove(sc,nil,REASON_EFFECT+REASON_TEMPORARY)~=0 and sc:IsLocation(LOCATION_REMOVED) then
if Duel.Remove(sc,nil,REASON_EFFECT+REASON_TEMPORARY)~=0 and sc:IsLocation(LOCATION_REMOVED) and not sc:IsReason(REASON_REDIRECT) then
sc:RegisterFlagEffect(11451718,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,8,aux.Stringid(11451718,8))
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......
......@@ -139,6 +139,9 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.rffilter(c)
return c:IsFaceup() and c:IsLocation(LOCATION_REMOVED) and not c:IsReason(REASON_REDIRECT)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_ATTACK)>0 then
......@@ -157,7 +160,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=g:Select(tp,1,#g,nil)
if #rg>0 and Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)>0 then
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED)
local og=Duel.GetOperatedGroup():Filter(cm.rffilter,nil)
og:ForEach(Card.RegisterFlagEffect,m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1))
og:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler())
......
......@@ -163,6 +163,9 @@ function cm.spcon2(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil)
return Duel.IsExistingMatchingCard(cm.RitualUltimateFilter,tp,LOCATION_DECK,0,1,nil,nil,e,tp,mg,nil,Card.GetLevel,"Greater")
end
function cm.rffilter(c)
return c:IsFaceup() and c:IsLocation(LOCATION_REMOVED) and not c:IsReason(REASON_REDIRECT)
end
function cm.spop2(e,tp,eg,ep,ev,re,r,rp)
::cancel::
local mg=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil)
......@@ -185,7 +188,7 @@ function cm.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.Remove(mat,0,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL+REASON_TEMPORARY)~=0 then
local fid=e:GetHandler():GetFieldID()
local og1=Duel.GetOperatedGroup()
local og=og1:Filter(Card.IsLocation,nil,LOCATION_REMOVED)
local og=og1:Filter(cm.rffilter,nil)
if og and #og>0 then
for oc in aux.Next(og) do
oc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
......
......@@ -156,7 +156,7 @@ function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
else
ct=Duel.Remove(sc,POS_FACEUP,REASON_EFFECT)
end
if ct~=0 and sc:IsLocation(LOCATION_REMOVED) then
if ct~=0 and sc:IsLocation(LOCATION_REMOVED) and not sc:IsReason(REASON_REDIRECT) then
sc:RegisterFlagEffect(m+4,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,8-flag,aux.Stringid(m+4,math.max(0,8-flag)))
local rc=c
if re and re:GetHandler() then rc=re:GetHandler() end
......
......@@ -71,7 +71,7 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()<=0 then return end
local tc=g:GetFirst()
while tc do
if Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 then
if Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 and not tc:IsReason(REASON_REDIRECT) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE)
......
......@@ -34,7 +34,7 @@ function c9910024.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c9910024.cosfilter),tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil):GetFirst()
local fid=c:GetFieldID()
local lab=tc:GetLocation()
if Duel.Remove(tc,POS_FACEUP,REASON_COST+REASON_TEMPORARY)~=0 then
if Duel.Remove(tc,POS_FACEUP,REASON_COST+REASON_TEMPORARY)~=0 and not tc:IsReason(REASON_REDIRECT) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
......
......@@ -74,7 +74,7 @@ function c9910040.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c9910040.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0
and tc:IsRelateToEffect(e) and Duel.Remove(tc,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then
and tc:IsRelateToEffect(e) and Duel.Remove(tc,0,REASON_EFFECT+REASON_TEMPORARY)~=0 and not tc:IsReason(REASON_REDIRECT) then
tc:RegisterFlagEffect(9910040,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......
......@@ -45,7 +45,7 @@ function c9910154.thoperation(e,tp,eg,ep,ev,re,r,rp)
and c:IsRelateToEffect(e) and c:IsAbleToRemove()
and Duel.SelectYesNo(tp,aux.Stringid(9910154,2)) then
Duel.BreakEffect()
Duel.Remove(c,0,REASON_EFFECT+REASON_TEMPORARY)
if Duel.Remove(c,0,REASON_EFFECT+REASON_TEMPORARY)==0 or c:IsReason(REASON_REDIRECT) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
......
......@@ -36,6 +36,9 @@ end
function c9910197.chlimit(e,ep,tp)
return tp==ep or not e:GetHandler():IsType(TYPE_MONSTER) or not e:GetHandler():IsLinkState()
end
function c9910197.ogfilter(c)
return c:IsLocation(LOCATION_REMOVED) and not c:IsReason(REASON_REDIRECT)
end
function c9910197.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c9910197.rmfilter,tp,0,LOCATION_MZONE,nil)
......@@ -43,7 +46,7 @@ function c9910197.rmop(e,tp,eg,ep,ev,re,r,rp)
local fid=c:GetFieldID()
local rct=1
if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_STANDBY then rct=2 end
local og=Duel.GetOperatedGroup()
local og=Duel.GetOperatedGroup():Filter(c9910197.ogfilter,nil)
local oc=og:GetFirst()
while oc do
oc:RegisterFlagEffect(9910197,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_OPPO_TURN,0,rct,fid)
......
......@@ -48,7 +48,7 @@ end
function c9910202.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemoveAsCost() end
if Duel.Remove(c,POS_FACEUP,REASON_COST+REASON_TEMPORARY)~=0 then
if Duel.Remove(c,POS_FACEUP,REASON_COST+REASON_TEMPORARY)~=0 and not c:IsReason(REASON_REDIRECT) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
......
......@@ -89,7 +89,7 @@ function c9910414.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c9910414.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Remove(tc,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then
if tc:IsRelateToEffect(e) and Duel.Remove(tc,0,REASON_EFFECT+REASON_TEMPORARY)~=0 and not tc:IsReason(REASON_REDIRECT) then
tc:RegisterFlagEffect(9910414,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......
......@@ -74,6 +74,9 @@ function c9910470.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_ONFIELD+LOCATION_HAND+LOCATION_GRAVE)
e:GetHandler():RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(9910470,2))
end
function c9910470.ogfilter(c)
return c:IsLocation(LOCATION_REMOVED) and not c:IsReason(REASON_REDIRECT)
end
function c9910470.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local chkf=tp
......@@ -101,7 +104,7 @@ function c9910470.spop(e,tp,eg,ep,ev,re,r,rp)
tc:SetMaterial(mat1)
Duel.Remove(mat1,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
local fid=e:GetHandler():GetFieldID()
local og=Duel.GetOperatedGroup()
local og=Duel.GetOperatedGroup():Filter(c9910470.ogfilter,nil)
for oc in aux.Next(og) do
oc:RegisterFlagEffect(9910470,RESET_EVENT+RESETS_STANDARD,0,1,fid)
end
......
......@@ -58,7 +58,7 @@ function c9910551.thop(e,tp,eg,ep,ev,re,r,rp)
if Duel.Remove(sg1,POS_FACEUP,REASON_EFFECT)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc2=g2:Select(tp,1,1,nil):GetFirst()
if tc2 and Duel.Remove(tc2,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then
if tc2 and Duel.Remove(tc2,0,REASON_EFFECT+REASON_TEMPORARY)~=0 and not tc2:IsReason(REASON_REDIRECT) then
tc2:RegisterFlagEffect(9910551,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......
......@@ -15,48 +15,32 @@ function c9910607.rmfilter(c)
return c:IsFaceup() and c:IsAbleToRemove()
end
function c9910607.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x6950) and c:IsType(TYPE_FUSION)
return c:IsSetCard(0x6950) and c:IsType(TYPE_FUSION)
end
function c9910607.locfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and Duel.GetMZoneCount(tp,c)>0
function c9910607.fselect(g,tp)
return g:IsExists(c9910607.cfilter,1,nil) and Duel.GetMZoneCount(tp,g)>0
end
function c9910607.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.GetMatchingGroup(c9910607.rmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
if chk==0 then return g:IsExists(c9910607.cfilter,1,nil)
and Duel.IsPlayerCanSpecialSummonMonster(tp,9910606,0,0x4011,1000,1000,11,RACE_MACHINE,ATTRIBUTE_DARK)
and (ft>0 or g:IsExists(c9910607.locfilter,-ft+1,nil,tp)) end
if chk==0 then return g:CheckSubGroup(c9910607.fselect,1,3,tp)
and Duel.IsPlayerCanSpecialSummonMonster(tp,9910606,0,0x4011,1000,1000,11,RACE_MACHINE,ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
end
function c9910607.ogfilter(c)
return c:IsLocation(LOCATION_REMOVED) and not c:IsReason(REASON_REDIRECT)
end
function c9910607.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.GetMatchingGroup(c9910607.rmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
if g:GetCount()==0 or not g:IsExists(c9910607.cfilter,1,nil) then return end
local g1=nil
local g2=nil
local g3=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
g1=g:FilterSelect(tp,c9910607.cfilter,1,1,nil)
g:RemoveCard(g1:GetFirst())
if ft<1 and not c9910607.locfilter(g1:GetFirst()) then
local g=Duel.GetMatchingGroup(c9910607.rmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
if #g==0 or not g:CheckSubGroup(c9910607.fselect,1,3,tp) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
g2=g:FilterSelect(tp,c9910607.locfilter,1,1,nil,tp)
g1:Merge(g2)
g:RemoveCard(g2:GetFirst())
end
local ct=g:GetCount()
if ct>3-g1:GetCount() then ct=3-g1:GetCount() end
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(9910607,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
g3=g:Select(tp,1,ct,nil)
g1:Merge(g3)
end
Duel.HintSelection(g1)
ct=Duel.Remove(g1,POS_FACEUP,REASON_EFFECT)
local atk=ct*1000+1000
if ct>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,9910606,0,0x4011,atk,atk,11,RACE_MACHINE,ATTRIBUTE_DARK) then
local sg=g:SelectSubGroup(tp,c9910607.fselect,false,1,3,tp)
Duel.HintSelection(sg)
if Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)==0 then return end
local ct=Duel.GetOperatedGroup():FilterCount(c9910607.ogfilter,nil)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,9910606,0,0x4011,1000,1000,11,RACE_MACHINE,ATTRIBUTE_DARK) then
Duel.BreakEffect()
local token=Duel.CreateToken(tp,9910606)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
......
......@@ -35,7 +35,7 @@ function c9910645.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local fid=c:GetFieldID()
if tc:IsRelateToEffect(e) and Duel.Remove(tc,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then
if tc:IsRelateToEffect(e) and Duel.Remove(tc,0,REASON_EFFECT+REASON_TEMPORARY)~=0 and not tc:IsReason(REASON_REDIRECT) then
tc:RegisterFlagEffect(9910645,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......
......@@ -52,7 +52,7 @@ function c9910659.spop(e,tp,eg,ep,ev,re,r,rp)
if tc:IsAbleToRemove()
and (not res or Duel.SelectOption(tp,aux.Stringid(9910659,0),aux.Stringid(9910659,1))==0) then
Duel.BreakEffect()
if Duel.Remove(tc,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then
if Duel.Remove(tc,0,REASON_EFFECT+REASON_TEMPORARY)~=0 and not tc:IsReason(REASON_REDIRECT) then
tc:RegisterFlagEffect(9910659,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......
......@@ -68,7 +68,7 @@ function c9910666.spop(e,tp,eg,ep,ev,re,r,rp)
if c:IsRelateToEffect(e) and c:IsAbleToRemove() and Duel.SelectYesNo(tp,aux.Stringid(9910666,1)) then
Duel.BreakEffect()
local fid=c:GetFieldID()
if Duel.Remove(c,0,REASON_EFFECT+REASON_TEMPORARY)==0 then return end
if Duel.Remove(c,0,REASON_EFFECT+REASON_TEMPORARY)==0 or c:IsReason(REASON_REDIRECT) then return end
c:RegisterFlagEffect(9910666,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......
......@@ -45,7 +45,7 @@ function c9910929.activate(e,tp,eg,ep,ev,re,r,rp)
and c:IsRelateToEffect(e) then
c:CancelToGrave()
local b1=c:IsCanTurnSet()
local b2=c:IsAbleToDeck()
local b2=c:IsAbleToDeck() and not rc:IsReason(REASON_REDIRECT)
if b1 and (not b2 or Duel.SelectOption(tp,aux.Stringid(9910929,0),aux.Stringid(9910929,1))==0) then
Duel.BreakEffect()
Duel.ChangePosition(c,POS_FACEDOWN)
......
......@@ -87,7 +87,8 @@ function c9910957.thop(e,tp,eg,ep,ev,re,r,rp)
c:RegisterEffect(e1)
elseif b2 then
local fid=c:GetFieldID()
if Duel.Remove(c,0,REASON_EFFECT+REASON_TEMPORARY)~=0 and c:IsLocation(LOCATION_REMOVED) then
if Duel.Remove(c,0,REASON_EFFECT+REASON_TEMPORARY)~=0 and c:IsLocation(LOCATION_REMOVED)
and not c:IsReason(REASON_REDIRECT) then
res=true
c:RegisterFlagEffect(9910957,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2,fid)
local e2=Effect.CreateEffect(c)
......
......@@ -50,7 +50,7 @@ function c9911355.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sc=g:Select(tp,1,1,nil):GetFirst()
if sc and Duel.Remove(sc,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then
if sc and Duel.Remove(sc,0,REASON_EFFECT+REASON_TEMPORARY)~=0 and not sc:IsReason(REASON_REDIRECT) then
sc:RegisterFlagEffect(9911355,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......
......@@ -52,6 +52,9 @@ end
function c9911365.gselect2(g)
return #g==1 or g:IsExists(Card.IsAbleToGrave,2,nil) or g:IsExists(Card.IsAbleToRemove,2,nil)
end
function c9911365.ogfilter(c)
return c:IsLocation(LOCATION_REMOVED) and not c:IsReason(REASON_REDIRECT)
end
function c9911365.rlop(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(c9911365.rlfilter,tp,LOCATION_HAND+LOCATION_DECK,0,nil)
local g2=Duel.GetMatchingGroup(c9911365.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,0,nil)
......@@ -78,8 +81,9 @@ function c9911365.rlop(e,tp,eg,ep,ev,re,r,rp)
if opt==0 then
Duel.SendtoGrave(tg,REASON_EFFECT)
elseif opt==1 then
if Duel.Remove(tg,0,REASON_EFFECT+REASON_TEMPORARY)>0 and tg:IsExists(Card.IsLocation,1,nil,LOCATION_REMOVED) then
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED)
if Duel.Remove(tg,0,REASON_EFFECT+REASON_TEMPORARY)>0 then
local og=Duel.GetOperatedGroup():Filter(c9911365.ogfilter,nil)
if #og==0 then return end
for tc in aux.Next(og) do
tc:RegisterFlagEffect(9911365,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
......
......@@ -155,7 +155,7 @@ function c9911383.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst()
if tc then
Duel.HintSelection(g)
if Duel.Remove(tc,0,REASON_EFFECT+REASON_TEMPORARY)>0 then
if Duel.Remove(tc,0,REASON_EFFECT+REASON_TEMPORARY)>0 and not tc:IsReason(REASON_REDIRECT) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
......
......@@ -59,7 +59,7 @@ function c9911407.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c9911407.rmfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil)
local tc=g:GetFirst()
if tc and Duel.Remove(tc,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then
if tc and Duel.Remove(tc,0,REASON_EFFECT+REASON_TEMPORARY)~=0 and not tc:IsReason(REASON_REDIRECT) then
tc:RegisterFlagEffect(9911407,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......
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