Commit b60fe110 authored by Nemo Ma's avatar Nemo Ma

fix

parent e9bbda34
--幻旅传说·逃亡 --traveler saga outrun
--21.04.10 --21.04.10
local m=11451401 local m=11451401
local cm=_G["c"..m] local cm=_G["c"..m]
...@@ -63,5 +63,7 @@ function cm.thcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -63,5 +63,7 @@ function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.thfilter,1,nil) return eg:IsExists(cm.thfilter,1,nil)
end end
function cm.thop(e,tp,eg,ep,ev,re,r,rp) function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(cm.thfilter,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
end end
\ No newline at end of file
...@@ -43,8 +43,9 @@ function cm.initial_effect(c) ...@@ -43,8 +43,9 @@ function cm.initial_effect(c)
cm[1]=0 cm[1]=0
local ge1=Effect.CreateEffect(c) local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_RELEASE) ge1:SetCode(EFFECT_SEND_REPLACE)
ge1:SetOperation(cm.check) ge1:SetTarget(cm.check)
ge1:SetValue(aux.FALSE)
Duel.RegisterEffect(ge1,0) Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c) local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
...@@ -59,13 +60,15 @@ end ...@@ -59,13 +60,15 @@ end
function cm.filter(c,tp) function cm.filter(c,tp)
return c:IsControler(tp) and c:IsSetCard(0x6978) and c:IsFaceup() return c:IsControler(tp) and c:IsSetCard(0x6978) and c:IsFaceup()
end end
function cm.check(e,tp,eg,ep,ev,re,r,rp) function cm.check(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
for tc in aux.Next(eg) do for tc in aux.Next(eg) do
if (tc:IsPreviousLocation(LOCATION_MZONE) or (tc:GetPreviousLocation()&LOCATION_ONFIELD==0 and tc:GetOriginalType()&0x1>0)) and tc:IsSetCard(0x6978) then if (tc:IsLocation(LOCATION_MZONE) or (not tc:IsOnField() and tc:GetOriginalType()&0x1>0)) and tc:IsSetCard(0x6978) and tc:IsReason(REASON_RELEASE) then
local p=tc:GetReasonPlayer() local p=tc:GetReasonPlayer()
cm[p]=cm[p]+1 cm[p]=cm[p]+1
end end
end end
return false
end end
function cm.clear(e,tp,eg,ep,ev,re,r,rp) function cm.clear(e,tp,eg,ep,ev,re,r,rp)
cm[0]=0 cm[0]=0
......
...@@ -155,6 +155,16 @@ end ...@@ -155,6 +155,16 @@ end
function cm.retfilter2(c,p,loc) function cm.retfilter2(c,p,loc)
return c:IsPreviousControler(p) and c:IsPreviousLocation(loc) return c:IsPreviousControler(p) and c:IsPreviousLocation(loc)
end end
function cm.fselect2(g,pft)
return g:FilterCount(Card.IsPreviousLocation,nil,LOCATION_PZONE)<=pft
end
function cm.returntofield(tc)
if tc:GetPreviousTypeOnField()&TYPE_EQUIP>0 then
Duel.SendtoGrave(tc,REASON_RULE+REASON_RETURN)
else
Duel.ReturnToField(tc)
end
end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp) function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject() local g=e:GetLabelObject()
if not g:IsExists(cm.filter6,1,nil,e) then if not g:IsExists(cm.filter6,1,nil,e) then
...@@ -167,26 +177,51 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -167,26 +177,51 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject() local g=e:GetLabelObject()
local sg=g:Filter(cm.filter6,nil,e) local sg=g:Filter(cm.filter6,nil,e)
g:DeleteGroup() g:DeleteGroup()
local ft,mg={},{} local ft,mg,pft,pmg={},{},{},{}
ft[1]=Duel.GetLocationCount(tp,LOCATION_MZONE) ft[1]=Duel.GetLocationCount(tp,LOCATION_MZONE)
ft[2]=Duel.GetLocationCount(1-tp,LOCATION_MZONE) ft[2]=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
ft[3]=Duel.GetLocationCount(tp,LOCATION_SZONE) ft[3]=Duel.GetLocationCount(tp,LOCATION_SZONE)
ft[4]=Duel.GetLocationCount(1-tp,LOCATION_SZONE) ft[4]=Duel.GetLocationCount(1-tp,LOCATION_SZONE)
pft[3],pft[4]=0,0
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then pft[3]=pft[3]+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then pft[3]=pft[3]+1 end
if Duel.CheckLocation(1-tp,LOCATION_PZONE,0) then pft[4]=pft[4]+1 end
if Duel.CheckLocation(1-tp,LOCATION_PZONE,1) then pft[4]=pft[4]+1 end
mg[1]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_MZONE) mg[1]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_MZONE)
mg[2]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_MZONE) mg[2]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_MZONE)
mg[3]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_SZONE) mg[3]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_SZONE)
mg[4]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_SZONE) mg[4]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_SZONE)
for i=1,4 do pmg[3]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_PZONE)
pmg[4]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_PZONE)
for i=1,2 do
if #mg[i]>ft[i] then if #mg[i]>ft[i] then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,2)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7))
local tg=mg[i]:Select(tp,ft[i],ft[i],nil) local tg=mg[i]:Select(tp,ft[i],ft[i],nil)
for tc in aux.Next(tg) do Duel.ReturnToField(tc) end for tc in aux.Next(tg) do cm.returntofield(tc) end
sg:Sub(tg)
end
end
for i=3,4 do
if #mg[i]>ft[i] then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7))
local ct=math.min(#(mg[i]-pmg[i])+pft[i],ft[i])
local tg=mg[i]:SelectSubGroup(tp,cm.fselect2,false,ct,ct,nil,pft[i])
local ptg=tg:Filter(Card.IsPreviousLocation,nil,LOCATION_PZONE)
for tc in aux.Next(ptg) do cm.returntofield(tc) end
for tc in aux.Next(tg-ptg) do cm.returntofield(tc) end
sg:Sub(tg)
elseif #pmg[i]>pft[i] then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7))
local tg=pmg[i]:Select(tp,pft[i],pft[i],nil)
for tc in aux.Next(tg) do cm.returntofield(tc) end
sg:Sub(tg) sg:Sub(tg)
end end
end end
for tc in aux.Next(sg) do local psg=sg:Filter(Card.IsPreviousLocation,nil,LOCATION_PZONE)
for tc in aux.Next(psg) do cm.returntofield(tc) end
for tc in aux.Next(sg-psg) do
if tc:GetPreviousLocation()&LOCATION_ONFIELD>0 then if tc:GetPreviousLocation()&LOCATION_ONFIELD>0 then
Duel.ReturnToField(tc) cm.returntofield(tc)
elseif tc:IsPreviousLocation(LOCATION_HAND) then elseif tc:IsPreviousLocation(LOCATION_HAND) then
Duel.SendtoHand(tc,tc:GetPreviousControler(),REASON_EFFECT) Duel.SendtoHand(tc,tc:GetPreviousControler(),REASON_EFFECT)
end end
......
...@@ -159,6 +159,16 @@ end ...@@ -159,6 +159,16 @@ end
function cm.retfilter2(c,p,loc) function cm.retfilter2(c,p,loc)
return c:IsPreviousControler(p) and c:IsPreviousLocation(loc) return c:IsPreviousControler(p) and c:IsPreviousLocation(loc)
end end
function cm.fselect2(g,pft)
return g:FilterCount(Card.IsPreviousLocation,nil,LOCATION_PZONE)<=pft
end
function cm.returntofield(tc)
if tc:GetPreviousTypeOnField()&TYPE_EQUIP>0 then
Duel.SendtoGrave(tc,REASON_RULE+REASON_RETURN)
else
Duel.ReturnToField(tc)
end
end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp) function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject() local g=e:GetLabelObject()
if not g:IsExists(cm.filter6,1,nil,e) then if not g:IsExists(cm.filter6,1,nil,e) then
...@@ -171,26 +181,51 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -171,26 +181,51 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject() local g=e:GetLabelObject()
local sg=g:Filter(cm.filter6,nil,e) local sg=g:Filter(cm.filter6,nil,e)
g:DeleteGroup() g:DeleteGroup()
local ft,mg={},{} local ft,mg,pft,pmg={},{},{},{}
ft[1]=Duel.GetLocationCount(tp,LOCATION_MZONE) ft[1]=Duel.GetLocationCount(tp,LOCATION_MZONE)
ft[2]=Duel.GetLocationCount(1-tp,LOCATION_MZONE) ft[2]=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
ft[3]=Duel.GetLocationCount(tp,LOCATION_SZONE) ft[3]=Duel.GetLocationCount(tp,LOCATION_SZONE)
ft[4]=Duel.GetLocationCount(1-tp,LOCATION_SZONE) ft[4]=Duel.GetLocationCount(1-tp,LOCATION_SZONE)
pft[3],pft[4]=0,0
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then pft[3]=pft[3]+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then pft[3]=pft[3]+1 end
if Duel.CheckLocation(1-tp,LOCATION_PZONE,0) then pft[4]=pft[4]+1 end
if Duel.CheckLocation(1-tp,LOCATION_PZONE,1) then pft[4]=pft[4]+1 end
mg[1]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_MZONE) mg[1]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_MZONE)
mg[2]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_MZONE) mg[2]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_MZONE)
mg[3]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_SZONE) mg[3]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_SZONE)
mg[4]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_SZONE) mg[4]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_SZONE)
for i=1,4 do pmg[3]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_PZONE)
pmg[4]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_PZONE)
for i=1,2 do
if #mg[i]>ft[i] then if #mg[i]>ft[i] then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,2)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7))
local tg=mg[i]:Select(tp,ft[i],ft[i],nil) local tg=mg[i]:Select(tp,ft[i],ft[i],nil)
for tc in aux.Next(tg) do Duel.ReturnToField(tc) end for tc in aux.Next(tg) do cm.returntofield(tc) end
sg:Sub(tg)
end
end
for i=3,4 do
if #mg[i]>ft[i] then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7))
local ct=math.min(#(mg[i]-pmg[i])+pft[i],ft[i])
local tg=mg[i]:SelectSubGroup(tp,cm.fselect2,false,ct,ct,nil,pft[i])
local ptg=tg:Filter(Card.IsPreviousLocation,nil,LOCATION_PZONE)
for tc in aux.Next(ptg) do cm.returntofield(tc) end
for tc in aux.Next(tg-ptg) do cm.returntofield(tc) end
sg:Sub(tg)
elseif #pmg[i]>pft[i] then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7))
local tg=pmg[i]:Select(tp,pft[i],pft[i],nil)
for tc in aux.Next(tg) do cm.returntofield(tc) end
sg:Sub(tg) sg:Sub(tg)
end end
end end
for tc in aux.Next(sg) do local psg=sg:Filter(Card.IsPreviousLocation,nil,LOCATION_PZONE)
for tc in aux.Next(psg) do cm.returntofield(tc) end
for tc in aux.Next(sg-psg) do
if tc:GetPreviousLocation()&LOCATION_ONFIELD>0 then if tc:GetPreviousLocation()&LOCATION_ONFIELD>0 then
Duel.ReturnToField(tc) cm.returntofield(tc)
elseif tc:IsPreviousLocation(LOCATION_HAND) then elseif tc:IsPreviousLocation(LOCATION_HAND) then
Duel.SendtoHand(tc,tc:GetPreviousControler(),REASON_EFFECT) Duel.SendtoHand(tc,tc:GetPreviousControler(),REASON_EFFECT)
end end
......
...@@ -215,6 +215,16 @@ end ...@@ -215,6 +215,16 @@ end
function cm.retfilter2(c,p,loc) function cm.retfilter2(c,p,loc)
return c:IsPreviousControler(p) and c:IsPreviousLocation(loc) return c:IsPreviousControler(p) and c:IsPreviousLocation(loc)
end end
function cm.fselect2(g,pft)
return g:FilterCount(Card.IsPreviousLocation,nil,LOCATION_PZONE)<=pft
end
function cm.returntofield(tc)
if tc:GetPreviousTypeOnField()&TYPE_EQUIP>0 then
Duel.SendtoGrave(tc,REASON_RULE+REASON_RETURN)
else
Duel.ReturnToField(tc)
end
end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp) function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject() local g=e:GetLabelObject()
if not g:IsExists(cm.filter6,1,nil,e) then if not g:IsExists(cm.filter6,1,nil,e) then
...@@ -227,26 +237,51 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -227,26 +237,51 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject() local g=e:GetLabelObject()
local sg=g:Filter(cm.filter6,nil,e) local sg=g:Filter(cm.filter6,nil,e)
g:DeleteGroup() g:DeleteGroup()
local ft,mg={},{} local ft,mg,pft,pmg={},{},{},{}
ft[1]=Duel.GetLocationCount(tp,LOCATION_MZONE) ft[1]=Duel.GetLocationCount(tp,LOCATION_MZONE)
ft[2]=Duel.GetLocationCount(1-tp,LOCATION_MZONE) ft[2]=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
ft[3]=Duel.GetLocationCount(tp,LOCATION_SZONE) ft[3]=Duel.GetLocationCount(tp,LOCATION_SZONE)
ft[4]=Duel.GetLocationCount(1-tp,LOCATION_SZONE) ft[4]=Duel.GetLocationCount(1-tp,LOCATION_SZONE)
pft[3],pft[4]=0,0
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then pft[3]=pft[3]+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then pft[3]=pft[3]+1 end
if Duel.CheckLocation(1-tp,LOCATION_PZONE,0) then pft[4]=pft[4]+1 end
if Duel.CheckLocation(1-tp,LOCATION_PZONE,1) then pft[4]=pft[4]+1 end
mg[1]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_MZONE) mg[1]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_MZONE)
mg[2]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_MZONE) mg[2]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_MZONE)
mg[3]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_SZONE) mg[3]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_SZONE)
mg[4]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_SZONE) mg[4]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_SZONE)
for i=1,4 do pmg[3]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_PZONE)
pmg[4]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_PZONE)
for i=1,2 do
if #mg[i]>ft[i] then if #mg[i]>ft[i] then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,2)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7))
local tg=mg[i]:Select(tp,ft[i],ft[i],nil) local tg=mg[i]:Select(tp,ft[i],ft[i],nil)
for tc in aux.Next(tg) do Duel.ReturnToField(tc) end for tc in aux.Next(tg) do cm.returntofield(tc) end
sg:Sub(tg)
end
end
for i=3,4 do
if #mg[i]>ft[i] then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7))
local ct=math.min(#(mg[i]-pmg[i])+pft[i],ft[i])
local tg=mg[i]:SelectSubGroup(tp,cm.fselect2,false,ct,ct,nil,pft[i])
local ptg=tg:Filter(Card.IsPreviousLocation,nil,LOCATION_PZONE)
for tc in aux.Next(ptg) do cm.returntofield(tc) end
for tc in aux.Next(tg-ptg) do cm.returntofield(tc) end
sg:Sub(tg)
elseif #pmg[i]>pft[i] then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7))
local tg=pmg[i]:Select(tp,pft[i],pft[i],nil)
for tc in aux.Next(tg) do cm.returntofield(tc) end
sg:Sub(tg) sg:Sub(tg)
end end
end end
for tc in aux.Next(sg) do local psg=sg:Filter(Card.IsPreviousLocation,nil,LOCATION_PZONE)
for tc in aux.Next(psg) do cm.returntofield(tc) end
for tc in aux.Next(sg-psg) do
if tc:GetPreviousLocation()&LOCATION_ONFIELD>0 then if tc:GetPreviousLocation()&LOCATION_ONFIELD>0 then
Duel.ReturnToField(tc) cm.returntofield(tc)
elseif tc:IsPreviousLocation(LOCATION_HAND) then elseif tc:IsPreviousLocation(LOCATION_HAND) then
Duel.SendtoHand(tc,tc:GetPreviousControler(),REASON_EFFECT) Duel.SendtoHand(tc,tc:GetPreviousControler(),REASON_EFFECT)
end end
......
...@@ -193,6 +193,16 @@ end ...@@ -193,6 +193,16 @@ end
function cm.retfilter2(c,p,loc) function cm.retfilter2(c,p,loc)
return c:IsPreviousControler(p) and c:IsPreviousLocation(loc) return c:IsPreviousControler(p) and c:IsPreviousLocation(loc)
end end
function cm.fselect2(g,pft)
return g:FilterCount(Card.IsPreviousLocation,nil,LOCATION_PZONE)<=pft
end
function cm.returntofield(tc)
if tc:GetPreviousTypeOnField()&TYPE_EQUIP>0 then
Duel.SendtoGrave(tc,REASON_RULE+REASON_RETURN)
else
Duel.ReturnToField(tc)
end
end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp) function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject() local g=e:GetLabelObject()
if not g:IsExists(cm.filter6,1,nil,e) then if not g:IsExists(cm.filter6,1,nil,e) then
...@@ -205,26 +215,51 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -205,26 +215,51 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject() local g=e:GetLabelObject()
local sg=g:Filter(cm.filter6,nil,e) local sg=g:Filter(cm.filter6,nil,e)
g:DeleteGroup() g:DeleteGroup()
local ft,mg={},{} local ft,mg,pft,pmg={},{},{},{}
ft[1]=Duel.GetLocationCount(tp,LOCATION_MZONE) ft[1]=Duel.GetLocationCount(tp,LOCATION_MZONE)
ft[2]=Duel.GetLocationCount(1-tp,LOCATION_MZONE) ft[2]=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
ft[3]=Duel.GetLocationCount(tp,LOCATION_SZONE) ft[3]=Duel.GetLocationCount(tp,LOCATION_SZONE)
ft[4]=Duel.GetLocationCount(1-tp,LOCATION_SZONE) ft[4]=Duel.GetLocationCount(1-tp,LOCATION_SZONE)
pft[3],pft[4]=0,0
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then pft[3]=pft[3]+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then pft[3]=pft[3]+1 end
if Duel.CheckLocation(1-tp,LOCATION_PZONE,0) then pft[4]=pft[4]+1 end
if Duel.CheckLocation(1-tp,LOCATION_PZONE,1) then pft[4]=pft[4]+1 end
mg[1]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_MZONE) mg[1]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_MZONE)
mg[2]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_MZONE) mg[2]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_MZONE)
mg[3]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_SZONE) mg[3]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_SZONE)
mg[4]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_SZONE) mg[4]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_SZONE)
for i=1,4 do pmg[3]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_PZONE)
pmg[4]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_PZONE)
for i=1,2 do
if #mg[i]>ft[i] then if #mg[i]>ft[i] then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,2)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7))
local tg=mg[i]:Select(tp,ft[i],ft[i],nil) local tg=mg[i]:Select(tp,ft[i],ft[i],nil)
for tc in aux.Next(tg) do Duel.ReturnToField(tc) end for tc in aux.Next(tg) do cm.returntofield(tc) end
sg:Sub(tg)
end
end
for i=3,4 do
if #mg[i]>ft[i] then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7))
local ct=math.min(#(mg[i]-pmg[i])+pft[i],ft[i])
local tg=mg[i]:SelectSubGroup(tp,cm.fselect2,false,ct,ct,nil,pft[i])
local ptg=tg:Filter(Card.IsPreviousLocation,nil,LOCATION_PZONE)
for tc in aux.Next(ptg) do cm.returntofield(tc) end
for tc in aux.Next(tg-ptg) do cm.returntofield(tc) end
sg:Sub(tg)
elseif #pmg[i]>pft[i] then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7))
local tg=pmg[i]:Select(tp,pft[i],pft[i],nil)
for tc in aux.Next(tg) do cm.returntofield(tc) end
sg:Sub(tg) sg:Sub(tg)
end end
end end
for tc in aux.Next(sg) do local psg=sg:Filter(Card.IsPreviousLocation,nil,LOCATION_PZONE)
for tc in aux.Next(psg) do cm.returntofield(tc) end
for tc in aux.Next(sg-psg) do
if tc:GetPreviousLocation()&LOCATION_ONFIELD>0 then if tc:GetPreviousLocation()&LOCATION_ONFIELD>0 then
Duel.ReturnToField(tc) cm.returntofield(tc)
elseif tc:IsPreviousLocation(LOCATION_HAND) then elseif tc:IsPreviousLocation(LOCATION_HAND) then
Duel.SendtoHand(tc,tc:GetPreviousControler(),REASON_EFFECT) Duel.SendtoHand(tc,tc:GetPreviousControler(),REASON_EFFECT)
end end
......
...@@ -214,6 +214,16 @@ end ...@@ -214,6 +214,16 @@ end
function cm.retfilter2(c,p,loc) function cm.retfilter2(c,p,loc)
return c:IsPreviousControler(p) and c:IsPreviousLocation(loc) return c:IsPreviousControler(p) and c:IsPreviousLocation(loc)
end end
function cm.fselect2(g,pft)
return g:FilterCount(Card.IsPreviousLocation,nil,LOCATION_PZONE)<=pft
end
function cm.returntofield(tc)
if tc:GetPreviousTypeOnField()&TYPE_EQUIP>0 then
Duel.SendtoGrave(tc,REASON_RULE+REASON_RETURN)
else
Duel.ReturnToField(tc)
end
end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp) function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject() local g=e:GetLabelObject()
if not g:IsExists(cm.filter6,1,nil,e) then if not g:IsExists(cm.filter6,1,nil,e) then
...@@ -226,26 +236,51 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -226,26 +236,51 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject() local g=e:GetLabelObject()
local sg=g:Filter(cm.filter6,nil,e) local sg=g:Filter(cm.filter6,nil,e)
g:DeleteGroup() g:DeleteGroup()
local ft,mg={},{} local ft,mg,pft,pmg={},{},{},{}
ft[1]=Duel.GetLocationCount(tp,LOCATION_MZONE) ft[1]=Duel.GetLocationCount(tp,LOCATION_MZONE)
ft[2]=Duel.GetLocationCount(1-tp,LOCATION_MZONE) ft[2]=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
ft[3]=Duel.GetLocationCount(tp,LOCATION_SZONE) ft[3]=Duel.GetLocationCount(tp,LOCATION_SZONE)
ft[4]=Duel.GetLocationCount(1-tp,LOCATION_SZONE) ft[4]=Duel.GetLocationCount(1-tp,LOCATION_SZONE)
pft[3],pft[4]=0,0
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then pft[3]=pft[3]+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then pft[3]=pft[3]+1 end
if Duel.CheckLocation(1-tp,LOCATION_PZONE,0) then pft[4]=pft[4]+1 end
if Duel.CheckLocation(1-tp,LOCATION_PZONE,1) then pft[4]=pft[4]+1 end
mg[1]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_MZONE) mg[1]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_MZONE)
mg[2]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_MZONE) mg[2]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_MZONE)
mg[3]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_SZONE) mg[3]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_SZONE)
mg[4]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_SZONE) mg[4]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_SZONE)
for i=1,4 do pmg[3]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_PZONE)
pmg[4]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_PZONE)
for i=1,2 do
if #mg[i]>ft[i] then if #mg[i]>ft[i] then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,2)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7))
local tg=mg[i]:Select(tp,ft[i],ft[i],nil) local tg=mg[i]:Select(tp,ft[i],ft[i],nil)
for tc in aux.Next(tg) do Duel.ReturnToField(tc) end for tc in aux.Next(tg) do cm.returntofield(tc) end
sg:Sub(tg)
end
end
for i=3,4 do
if #mg[i]>ft[i] then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7))
local ct=math.min(#(mg[i]-pmg[i])+pft[i],ft[i])
local tg=mg[i]:SelectSubGroup(tp,cm.fselect2,false,ct,ct,nil,pft[i])
local ptg=tg:Filter(Card.IsPreviousLocation,nil,LOCATION_PZONE)
for tc in aux.Next(ptg) do cm.returntofield(tc) end
for tc in aux.Next(tg-ptg) do cm.returntofield(tc) end
sg:Sub(tg)
elseif #pmg[i]>pft[i] then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7))
local tg=pmg[i]:Select(tp,pft[i],pft[i],nil)
for tc in aux.Next(tg) do cm.returntofield(tc) end
sg:Sub(tg) sg:Sub(tg)
end end
end end
for tc in aux.Next(sg) do local psg=sg:Filter(Card.IsPreviousLocation,nil,LOCATION_PZONE)
for tc in aux.Next(psg) do cm.returntofield(tc) end
for tc in aux.Next(sg-psg) do
if tc:GetPreviousLocation()&LOCATION_ONFIELD>0 then if tc:GetPreviousLocation()&LOCATION_ONFIELD>0 then
Duel.ReturnToField(tc) cm.returntofield(tc)
elseif tc:IsPreviousLocation(LOCATION_HAND) then elseif tc:IsPreviousLocation(LOCATION_HAND) then
Duel.SendtoHand(tc,tc:GetPreviousControler(),REASON_EFFECT) Duel.SendtoHand(tc,tc:GetPreviousControler(),REASON_EFFECT)
end end
......
...@@ -243,6 +243,16 @@ end ...@@ -243,6 +243,16 @@ end
function cm.retfilter2(c,p,loc) function cm.retfilter2(c,p,loc)
return c:IsPreviousControler(p) and c:IsPreviousLocation(loc) return c:IsPreviousControler(p) and c:IsPreviousLocation(loc)
end end
function cm.fselect2(g,pft)
return g:FilterCount(Card.IsPreviousLocation,nil,LOCATION_PZONE)<=pft
end
function cm.returntofield(tc)
if tc:GetPreviousTypeOnField()&TYPE_EQUIP>0 then
Duel.SendtoGrave(tc,REASON_RULE+REASON_RETURN)
else
Duel.ReturnToField(tc)
end
end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp) function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject() local g=e:GetLabelObject()
if not g:IsExists(cm.filter6,1,nil,e) then if not g:IsExists(cm.filter6,1,nil,e) then
...@@ -255,26 +265,51 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -255,26 +265,51 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject() local g=e:GetLabelObject()
local sg=g:Filter(cm.filter6,nil,e) local sg=g:Filter(cm.filter6,nil,e)
g:DeleteGroup() g:DeleteGroup()
local ft,mg={},{} local ft,mg,pft,pmg={},{},{},{}
ft[1]=Duel.GetLocationCount(tp,LOCATION_MZONE) ft[1]=Duel.GetLocationCount(tp,LOCATION_MZONE)
ft[2]=Duel.GetLocationCount(1-tp,LOCATION_MZONE) ft[2]=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
ft[3]=Duel.GetLocationCount(tp,LOCATION_SZONE) ft[3]=Duel.GetLocationCount(tp,LOCATION_SZONE)
ft[4]=Duel.GetLocationCount(1-tp,LOCATION_SZONE) ft[4]=Duel.GetLocationCount(1-tp,LOCATION_SZONE)
pft[3],pft[4]=0,0
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then pft[3]=pft[3]+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then pft[3]=pft[3]+1 end
if Duel.CheckLocation(1-tp,LOCATION_PZONE,0) then pft[4]=pft[4]+1 end
if Duel.CheckLocation(1-tp,LOCATION_PZONE,1) then pft[4]=pft[4]+1 end
mg[1]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_MZONE) mg[1]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_MZONE)
mg[2]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_MZONE) mg[2]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_MZONE)
mg[3]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_SZONE) mg[3]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_SZONE)
mg[4]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_SZONE) mg[4]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_SZONE)
for i=1,4 do pmg[3]=sg:Filter(cm.retfilter2,nil,tp,LOCATION_PZONE)
pmg[4]=sg:Filter(cm.retfilter2,nil,1-tp,LOCATION_PZONE)
for i=1,2 do
if #mg[i]>ft[i] then if #mg[i]>ft[i] then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,2)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7))
local tg=mg[i]:Select(tp,ft[i],ft[i],nil) local tg=mg[i]:Select(tp,ft[i],ft[i],nil)
for tc in aux.Next(tg) do Duel.ReturnToField(tc) end for tc in aux.Next(tg) do cm.returntofield(tc) end
sg:Sub(tg)
end
end
for i=3,4 do
if #mg[i]>ft[i] then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7))
local ct=math.min(#(mg[i]-pmg[i])+pft[i],ft[i])
local tg=mg[i]:SelectSubGroup(tp,cm.fselect2,false,ct,ct,nil,pft[i])
local ptg=tg:Filter(Card.IsPreviousLocation,nil,LOCATION_PZONE)
for tc in aux.Next(ptg) do cm.returntofield(tc) end
for tc in aux.Next(tg-ptg) do cm.returntofield(tc) end
sg:Sub(tg)
elseif #pmg[i]>pft[i] then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451461,7))
local tg=pmg[i]:Select(tp,pft[i],pft[i],nil)
for tc in aux.Next(tg) do cm.returntofield(tc) end
sg:Sub(tg) sg:Sub(tg)
end end
end end
for tc in aux.Next(sg) do local psg=sg:Filter(Card.IsPreviousLocation,nil,LOCATION_PZONE)
for tc in aux.Next(psg) do cm.returntofield(tc) end
for tc in aux.Next(sg-psg) do
if tc:GetPreviousLocation()&LOCATION_ONFIELD>0 then if tc:GetPreviousLocation()&LOCATION_ONFIELD>0 then
Duel.ReturnToField(tc) cm.returntofield(tc)
elseif tc:IsPreviousLocation(LOCATION_HAND) then elseif tc:IsPreviousLocation(LOCATION_HAND) then
Duel.SendtoHand(tc,tc:GetPreviousControler(),REASON_EFFECT) Duel.SendtoHand(tc,tc:GetPreviousControler(),REASON_EFFECT)
end end
......
...@@ -48,7 +48,7 @@ function cm.spfilter(c) ...@@ -48,7 +48,7 @@ function cm.spfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGraveAsCost() return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGraveAsCost()
end end
function cm.thfilter(c) function cm.thfilter(c)
return c:IsRace(RACE_INSECT) return c:IsRace(RACE_INSECT) and c:GetOriginalType()&0x1==0x1
end end
function cm.spcon(e,c) function cm.spcon(e,c)
if c==nil then return true end if c==nil then return true end
...@@ -85,7 +85,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp) ...@@ -85,7 +85,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsType(TYPE_MONSTER) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsType(TYPE_MONSTER) end
if chk==0 then return Duel.IsExistingTarget(Card.IsType,tp,0,LOCATION_GRAVE,1,nil,TYPE_MONSTER) end if chk==0 then return Duel.GetMatchingGroupCount(aux.NOT(Card.IsPublic),tp,0,LOCATION_HAND,nil)>0 and Duel.IsExistingTarget(Card.IsType,tp,0,LOCATION_GRAVE,1,nil,TYPE_MONSTER) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,Card.IsType,tp,0,LOCATION_GRAVE,1,1,nil,TYPE_MONSTER) local g=Duel.SelectTarget(tp,Card.IsType,tp,0,LOCATION_GRAVE,1,1,nil,TYPE_MONSTER)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,0)
......
...@@ -17,7 +17,6 @@ function cm.initial_effect(c) ...@@ -17,7 +17,6 @@ function cm.initial_effect(c)
c:RegisterEffect(e0) c:RegisterEffect(e0)
--effect1 --effect1
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
...@@ -128,8 +127,13 @@ function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -128,8 +127,13 @@ function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g1=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,2-op,2-op,e:GetHandler(),e) local g1=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,2-op,2-op,e:GetHandler(),e)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g1,1,0,0) if op==0 then
if op==0 then Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g1,1,0,0) end e:SetCategory(CATEGORY_TOHAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g1,1,0,0)
else
e:SetCategory(0)
end
if g1:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE) then Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g1,1,0,0) end
end end
function cm.thop(e,tp,eg,ep,ev,re,r,rp) function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -105,6 +105,8 @@ function cm.thcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -105,6 +105,8 @@ function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.thfilter,1,nil) return eg:IsExists(cm.thfilter,1,nil)
end end
function cm.thop(e,tp,eg,ep,ev,re,r,rp) function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(cm.thfilter,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
end end
function cm.rscon(e,tp,eg,ep,ev,re,r,rp) function cm.rscon(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -24,14 +24,25 @@ end ...@@ -24,14 +24,25 @@ end
function cm.spfilter(c,e,tp,mg) function cm.spfilter(c,e,tp,mg)
if bit.band(c:GetType(),0x81)~=0x81 or c.mat_filter or c.mat_group_check or not (c:IsAttribute(ATTRIBUTE_WIND) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true)) then return false end if bit.band(c:GetType(),0x81)~=0x81 or c.mat_filter or c.mat_group_check or not (c:IsAttribute(ATTRIBUTE_WIND) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true)) then return false end
local ct=math.max(1,c:GetLevel()//3) local ct=math.max(1,c:GetLevel()//3)
return #mg>0 and mg:CheckSubGroup(cm.fselect,ct,ct,c,tp) if c.mat_filter then
local g=mg:Filter(cm.mfilter2,nil,c)
if c.mat_group_check then return #g>0 and g:CheckSubGroup(cm.fselect2,ct,ct,tp,rc) end
return #g>0 and g:CheckSubGroup(cm.fselect,ct,ct,tp)
end
return #mg>0 and mg:CheckSubGroup(cm.fselect,ct,ct,tp)
end end
function cm.fselect(g,c,tp) function cm.fselect(g,tp)
return Duel.GetMZoneCount(tp,g)>0 return Duel.GetMZoneCount(tp,g)>0
end end
function cm.fselect2(g,tp)
return Duel.GetMZoneCount(tp,g)>0 and rc.mat_group_check(g)
end
function cm.mfilter(c) function cm.mfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGrave() return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGrave()
end end
function cm.mfilter2(c,rc)
return c:IsType(TYPE_MONSTER) and rc.mat_filter(c)
end
function cm.filter1(c,e) function cm.filter1(c,e)
return not c:IsImmuneToEffect(e) return not c:IsImmuneToEffect(e)
end end
...@@ -50,7 +61,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -50,7 +61,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local ct=math.max(1,tc:GetLevel()//3) local ct=math.max(1,tc:GetLevel()//3)
local mat=mg:SelectSubGroup(tp,cm.fselect,false,ct,ct,c,tp) local mat=mg:SelectSubGroup(tp,cm.fselect,false,ct,ct,tp)
if not mat or #mat==0 then return end if not mat or #mat==0 then return end
tc:SetMaterial(mat) tc:SetMaterial(mat)
Duel.SendtoGrave(mat,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL) Duel.SendtoGrave(mat,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL)
......
...@@ -82,10 +82,11 @@ function cm.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -82,10 +82,11 @@ function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_DECK) local g=Duel.GetFieldGroup(tp,0,LOCATION_DECK)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.BreakEffect() Duel.BreakEffect()
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(tp,g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil) local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,tp,REASON_EFFECT) Duel.SendtoHand(sg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleDeck(1-tp) Duel.ShuffleDeck(1-tp)
end end
end end
......
...@@ -59,6 +59,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -59,6 +59,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
e6:SetCode(EFFECT_CANNOT_ACTIVATE) e6:SetCode(EFFECT_CANNOT_ACTIVATE)
e6:SetTargetRange(1,0) e6:SetTargetRange(1,0)
e6:SetValue(cm.aclimit) e6:SetValue(cm.aclimit)
e6:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e6,tp) Duel.RegisterEffect(e6,tp)
end end
function cm.filter(c,sp) function cm.filter(c,sp)
......
...@@ -40,6 +40,9 @@ function c188811.initial_effect(c) ...@@ -40,6 +40,9 @@ function c188811.initial_effect(c)
e4:SetOperation(c188811.xeqop) e4:SetOperation(c188811.xeqop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c188811.eqlimit(e,c)
return (c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT)) or e:GetHandler():GetEquipTarget()==c
end
function c188811.filter(c) function c188811.filter(c)
local ct1,ct2=c:GetUnionCount() local ct1,ct2=c:GetUnionCount()
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_WATER) and ct2==0 return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_WATER) and ct2==0
...@@ -109,7 +112,7 @@ function c188811.xeqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -109,7 +112,7 @@ function c188811.xeqop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then if tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c188811.unfil2,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,tp,tc) local g=Duel.SelectMatchingCard(tp,c188811.unfil2,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,tp,tc)
local ec=g:GetFirst() local ec=g:GetFirst()
if ec and aux.CheckUnionEquip(ec,tc) and Duel.Equip(tp,ec,tc) then if ec and aux.CheckUnionEquip(ec,tc) and Duel.Equip(tp,ec,tc) then
aux.SetUnionState(ec) aux.SetUnionState(ec)
......
...@@ -6,7 +6,7 @@ function c188813.initial_effect(c) ...@@ -6,7 +6,7 @@ function c188813.initial_effect(c)
aux.EnableUnionAttribute(c,c188813.eqlimit) aux.EnableUnionAttribute(c,c188813.eqlimit)
--equip --equip
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(188813,0)) e1:SetDescription(aux.Stringid(188811,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_EQUIP) e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
...@@ -25,7 +25,9 @@ function c188813.initial_effect(c) ...@@ -25,7 +25,9 @@ function c188813.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--ac --ac
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_IGNITION) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_EQUIP)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,188813) e3:SetCountLimit(1,188813)
e3:SetCondition(c188813.accon) e3:SetCondition(c188813.accon)
...@@ -33,6 +35,9 @@ function c188813.initial_effect(c) ...@@ -33,6 +35,9 @@ function c188813.initial_effect(c)
e3:SetOperation(c188813.acop) e3:SetOperation(c188813.acop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c188813.eqlimit(e,c)
return (c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT)) or e:GetHandler():GetEquipTarget()==c
end
function c188813.matfilter(c) function c188813.matfilter(c)
return c:IsType(TYPE_UNION) and not c:IsCode(188813) return c:IsType(TYPE_UNION) and not c:IsCode(188813)
end end
...@@ -80,6 +85,9 @@ end ...@@ -80,6 +85,9 @@ end
function c188813.acfilter(c,tp) function c188813.acfilter(c,tp)
return c:IsCode(188812) and c:GetActivateEffect():IsActivatable(tp) return c:IsCode(188812) and c:GetActivateEffect():IsActivatable(tp)
end end
function c188813.accon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsContains(e:GetHandler())
end
function c188813.actg(e,tp,eg,ep,ev,re,r,rp,chk) function c188813.actg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c188813.acfilter,tp,LOCATION_DECK,0,1,nil,tp) end if chk==0 then return Duel.IsExistingMatchingCard(c188813.acfilter,tp,LOCATION_DECK,0,1,nil,tp) end
end end
......
--超硼素巨神 杰克南瓜
function c188815.initial_effect(c)
c:SetUniqueOnField(1,0,188815)
c:EnableReviveLimit()
--splimit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e0)
--spsummon1
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,188815)
e1:SetCost(c188815.spcost1)
e1:SetTarget(c188815.sptg1)
e1:SetOperation(c188815.spop1)
c:RegisterEffect(e1)
--spsummon2
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(188815,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetCountLimit(1,088815)
e2:SetCondition(c188815.spcon2)
e2:SetTarget(c188815.sptg2)
e2:SetOperation(c188815.spop2)
c:RegisterEffect(e2)
end
function c188815.spfilter1(c)
return c:IsRace(RACE_ZOMBIE) and c:IsAbleToGraveAsCost() and (Duel.GetMZoneCount(tp,c)>0 or c:IsLocation(LOCATION_HAND))
end
function c188815.fcheck(c,g)
return g:IsExists(Card.IsOriginalCodeRule,1,c,c:GetOriginalCodeRule())
end
function c188815.fselect(g)
return not g:IsExists(c188815.fcheck,1,nil,g)
end
function c188815.spcost1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c188815.ctfil,tp,LOCATION_HAND+LOCATION_ONFIELD,0,2,nil)
if chk==0 then return g:CheckSubGroup(c188815.fselect,2,99) end
local sg=g:SelectSubGroup(tp,c188815.fselect,false,2,99,g)
Duel.SendtoGrave(g,REASON_COST)
end
function c188815.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c188815.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c188815.spcon2(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c188815.spfilter2(c,e,tp)
local code=c:GetCode()
return c:IsRace(RACE_ZOMBIE) and c:IsAbleToRemoveAsCost() and Duel.IsExistingMatchingCard(c188815.spfilter3,tp,LOCATION_DECK,0,1,nil,e,tp,code)
end
function c188815.spfilter2(c,e,tp,code)
return c:IsRace(RACE_ZOMBIE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(code)
end
function c188815.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c188815.spfilter2,tp,LOCATION_GRAVE,0,1,nil,e,tp) and c:IsAbleToRemove() end
local tc=Duel.SelectTarget(tp,c188815.spfilter2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,tc,1,0,0)
end
function c188815.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 then
local code=tc:GetCode()
local g=Duel.GetMatchingGroup(c188815.spfilter3,tp,LOCATION_DECK,0,nil,e,tp,code)
if g:GetCount()<=0 then return end
local sc=g:Select(tp,1,1,nil):GetFirst()
if Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
sc:RegisterEffect(e1,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e1)
if c:IsFaceup() and c:IsRelateToEffect(e) and c:IsAbleToRemove() then
Duel.BreakEffect()
if Duel.Remove(c,POS_FACEUP,REASON_EFFECT+REASON_TEMPORARY)~=0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetLabelObject(c)
e2:SetCountLimit(1)
e2:SetOperation(c188815.retop)
Duel.RegisterEffect(e2,tp)
end
end
end
end
end
function c188815.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject())
end
...@@ -153,7 +153,7 @@ end ...@@ -153,7 +153,7 @@ end
-- re:GetHandler():RegisterFlagEffect(m,RESET_CHAIN,0,1) -- re:GetHandler():RegisterFlagEffect(m,RESET_CHAIN,0,1)
--end --end
function cm.chcon2(e,tp,eg,ep,ev,re,r,rp) function cm.chcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(e:GetHandlerPlayer())>=12000 return ep==1-tp and Duel.GetLP(e:GetHandlerPlayer())>=12000
end end
function cm.chop2(e,tp,eg,ep,ev,re,r,rp) function cm.chop2(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup() local g=Group.CreateGroup()
...@@ -162,7 +162,7 @@ function cm.chop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -162,7 +162,7 @@ function cm.chop2(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.repop(e,tp,eg,ep,ev,re,r,rp) function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
Duel.Damage(tp-1,2000,REASON_EFFECT) Duel.Damage(1-tp,2000,REASON_EFFECT)
Duel.Recover(tp,2000,REASON_EFFECT) Duel.Recover(tp,2000,REASON_EFFECT)
end end
function cm.sumlimit(e,c,sump,sumtype,sumpos,targetp) function cm.sumlimit(e,c,sump,sumtype,sumpos,targetp)
......
--守护天使 急诊天马 --守护天使 急诊天马
local m=m local m=40009101
local cm=_G["c"..m] local cm=_G["c"..m]
cm.named_with_ProtectorSpirit=1 cm.named_with_ProtectorSpirit=1
function cm.initial_effect(c) function cm.initial_effect(c)
......
...@@ -16,7 +16,6 @@ function cm.initial_effect(c) ...@@ -16,7 +16,6 @@ function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(cm.effcon)
e1:SetOperation(cm.effop) e1:SetOperation(cm.effop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -51,15 +50,13 @@ end ...@@ -51,15 +50,13 @@ end
-- Duel.Hint(HINT_CARD,0,m) -- Duel.Hint(HINT_CARD,0,m)
-- Duel.Destroy(e:GetHandler(),REASON_EFFECT) -- Duel.Destroy(e:GetHandler(),REASON_EFFECT)
--end --end
function cm.effcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function cm.effop(e,tp,eg,ep,ev,re,r,rp) function cm.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsSummonType(SUMMON_TYPE_XYZ) then return end
local mg=c:GetMaterial() local mg=c:GetMaterial()
for tc in aux.Next(mg) do for tc in aux.Next(mg) do
local code=tc:GetOriginalCode() local code=tc:GetOriginalCode()
if code>53722000 and code<53722008 and c:GetFlagEffect(code)==0 and ((not g) or (not g:IsExists(cm.tgfil,1,nil,tp))) then if code>53722000 and code<53722008 and c:GetFlagEffect(code)==0 then
c:CopyEffect(code,RESET_EVENT+RESETS_STANDARD,1) c:CopyEffect(code,RESET_EVENT+RESETS_STANDARD,1)
c:RegisterFlagEffect(code,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,code-53722000)) c:RegisterFlagEffect(code,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,code-53722000))
end end
......
...@@ -19,6 +19,7 @@ function cm.initial_effect(c) ...@@ -19,6 +19,7 @@ function cm.initial_effect(c)
e2:SetOperation(cm.imop) e2:SetOperation(cm.imop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
cm.has_text_type=TYPE_DUAL
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsType(TYPE_DUAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsType(TYPE_DUAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
......
...@@ -88,16 +88,17 @@ function c67200415.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -88,16 +88,17 @@ function c67200415.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.HintSelection(g) Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT) if Duel.Destroy(g,REASON_EFFECT)~=0 then
local ct=g:GetFirst():GetLevel() local ct=g:GetFirst():GetLevel()
if ct>0 and Duel.GetMatchingGroupCount(Card.IsCanAddCounter,tp,LOCATION_ONFIELD,0,nil,0x1,1)>0 if ct>0 and Duel.GetMatchingGroupCount(Card.IsCanAddCounter,tp,LOCATION_ONFIELD,0,nil,0x1,1)>0
and Duel.SelectYesNo(tp,aux.Stringid(67200415,4)) then and Duel.SelectYesNo(tp,aux.Stringid(67200415,4)) then
while ct>0 do while ct>0 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COUNTER) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COUNTER)
local ttc=Duel.SelectMatchingCard(tp,Card.IsCanAddCounter,tp,LOCATION_ONFIELD,0,1,1,nil,0x1,1):GetFirst() local ttc=Duel.SelectMatchingCard(tp,Card.IsCanAddCounter,tp,LOCATION_ONFIELD,0,1,1,nil,0x1,1):GetFirst()
if not ttc then break end if not ttc then break end
ttc:AddCounter(0x1,1) ttc:AddCounter(0x1,1)
ct=ct-1 ct=ct-1
end
end end
end end
end end
......
--术结天缘 古洛夫拉菲 --术结天缘 古洛夫拉菲
function c67200433.initial_effect(c) function c67200433.initial_effect(c)
--c:EnableReviveLimit() c:EnableReviveLimit()
aux.EnablePendulumAttribute(c,false) aux.EnablePendulumAttribute(c,false)
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x5671),5,2) aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x5671),5,2)
--Activate --Activate
......
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