Commit 42c93f8f authored by POLYMER's avatar POLYMER

fix

parent dc319905
......@@ -49,9 +49,17 @@ function cm.initial_effect(c)
local temp_f=Duel[fname]
Duel[fname]=function(p,c,...)
temp_f(p,c,...)
if Duel.GetCurrentChain()==1 then c:RegisterFlagEffect(11451905,RESET_CHAIN,0,1) end
c:RegisterFlagEffect(11451905,RESET_CHAIN,0,1)
end
end
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_ACTIVATING)
ge1:SetOperation(function()
local g=Duel.GetMatchingGroup(function(c) return c:GetFlagEffect(11451905)>0 end,0,0xff,0xff,nil)
for tc in aux.Next(g) do tc:ResetFlagEffect(11451905) end
end)
Duel.RegisterEffect(ge1,0)
end
end
function cm.check(e,tp,eg,ep,ev,re,r,rp)
......@@ -128,7 +136,7 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(rp,m+2)==0 and #g>0 then --and Duel.SelectYesNo(rp,aux.Stringid(m,1)) then
Duel.Hint(HINT_CARD,0,m)
Duel.Hint(HINT_SELECTMSG,rp,HINTMSG_ATOHAND)
local tg=g:CancelableSelect(rp,0,1,nil)
local tg=g:CancelableSelect(rp,1,1,nil)
if not tg then
if cm[rp+10]==nil then
cm[rp+10]=Duel.SelectYesNo(rp,aux.Stringid(m,3))
......
......@@ -166,7 +166,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local tg=g:Filter(function(c) return c:IsFacedown() and c:IsControler(1-tp) end,nil)
Duel.ConfirmCards(tp,tg)
Duel.Hint(HINT_SELECTMSG,0,aux.Stringid(11451031,4))
local sg=g:CancelableSelect(tp,0,1,nil)
local sg=g:CancelableSelect(tp,1,1,nil)
if not sg then
local ph=Duel.GetCurrentPhase()
if ph>PHASE_MAIN1 and ph<PHASE_MAIN2 then ph=PHASE_BATTLE end
......
......@@ -165,7 +165,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local tg=g:Filter(function(c) return c:IsFacedown() and c:IsControler(1-tp) end,nil)
Duel.ConfirmCards(tp,tg)
Duel.Hint(HINT_SELECTMSG,0,aux.Stringid(11451031,4))
local sg=g:CancelableSelect(tp,0,1,nil)
local sg=g:CancelableSelect(tp,1,1,nil)
if not sg then
local ph=Duel.GetCurrentPhase()
if ph>PHASE_MAIN1 and ph<PHASE_MAIN2 then ph=PHASE_BATTLE end
......
......@@ -163,7 +163,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local tg=g:Filter(function(c) return c:IsFacedown() and c:IsControler(1-tp) end,nil)
Duel.ConfirmCards(tp,tg)
Duel.Hint(HINT_SELECTMSG,0,aux.Stringid(11451031,4))
local sg=g:CancelableSelect(tp,0,1,nil)
local sg=g:CancelableSelect(tp,1,1,nil)
if not sg then
local ph=Duel.GetCurrentPhase()
if ph>PHASE_MAIN1 and ph<PHASE_MAIN2 then ph=PHASE_BATTLE end
......
......@@ -161,7 +161,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local tg=g:Filter(function(c) return c:IsFacedown() and c:IsControler(1-tp) end,nil)
Duel.ConfirmCards(tp,tg)
Duel.Hint(HINT_SELECTMSG,0,aux.Stringid(11451031,4))
local sg=g:CancelableSelect(tp,0,1,nil)
local sg=g:CancelableSelect(tp,1,1,nil)
if not sg then
local ph=Duel.GetCurrentPhase()
if ph>PHASE_MAIN1 and ph<PHASE_MAIN2 then ph=PHASE_BATTLE end
......
......@@ -132,7 +132,7 @@ function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local mt=1
if tab[3]&(1<<i)~=0 then mt=2 end
local g=Duel.GetMatchingGroup(cm.desfilter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,tp,i)
if #g>0 then dg:Merge(g:CancelableSelect(tp,0,mt,nil)) end
if #g>0 then dg:Merge(g:CancelableSelect(tp,1,mt,nil)) end
end
end
Duel.Destroy(dg,REASON_EFFECT)
......
......@@ -240,7 +240,7 @@ function cm.mvop(e,tp,eg,ep,ev,re,r,rp,opt,lab)
if #g1==0 then
sg=g2:Select(tp,1,ct,nil)
else
sg=g2:CancelableSelect(tp,0,ct,nil)
sg=g2:CancelableSelect(tp,1,ct,nil)
end
if sg and #sg>0 then
ct=ct-#sg
......@@ -256,7 +256,7 @@ function cm.mvop(e,tp,eg,ep,ev,re,r,rp,opt,lab)
if not chk then
local sg=g1:Select(tp,1,ct,nil)
else
sg=g1:CancelableSelect(tp,0,ct,nil)
sg=g1:CancelableSelect(tp,1,ct,nil)
end
if sg and #sg>0 then
if fid~=0 then Duel.RaiseEvent(c,11451718,e,fid,0,0,0) end
......
......@@ -412,7 +412,7 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local bg=ng:GetMinGroup(cm.distance2,ac,tp)
if bg and #bg>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local bcg=bg:CancelableSelect(tp,0,1,nil)
local bcg=bg:CancelableSelect(tp,1,1,nil)
if bcg then
Duel.HintSelection(bcg)
rg:Merge(bcg)
......
......@@ -33,6 +33,25 @@ function cm.initial_effect(c)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
if not PTFL_SUMMONRULE_CHECK then
PTFL_SUMMONRULE_CHECK=true
local summon_set={"Summon","MSet","SpecialSummonRule","SynchroSummon","XyzSummon","XyzSummonByRose","LinkSummon"}
for i,fname in pairs(summon_set) do
local temp_f=Duel[fname]
Duel[fname]=function(p,c,...)
temp_f(p,c,...)
c:RegisterFlagEffect(11451905,RESET_CHAIN,0,1)
end
end
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_ACTIVATING)
ge1:SetOperation(function()
local g=Duel.GetMatchingGroup(function(c) return c:GetFlagEffect(11451905)>0 end,0,0xff,0xff,nil)
for tc in aux.Next(g) do tc:ResetFlagEffect(11451905) end
end)
Duel.RegisterEffect(ge1,0)
end
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(ep,m,RESET_CHAIN,0,1)
......@@ -106,7 +125,7 @@ function cm.acop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(m)>0 then return end
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.GetMatchingGroup(cm.acfilter,tp,LOCATION_DECK,0,nil,tp):CancelableSelect(tp,0,1,nil)
local g=Duel.GetMatchingGroup(cm.acfilter,tp,LOCATION_DECK,0,nil,tp):CancelableSelect(tp,1,1,nil)
if g and #g>0 then
local code,code2=g:GetFirst():GetCode()
Duel.RegisterFlagEffect(0,m+code+0xffffff,RESET_PHASE+PHASE_END,0,1)
......@@ -121,7 +140,7 @@ function cm.acop(e,tp,eg,ep,ev,re,r,rp)
end
Duel.HintSelection(cg)
cg:KeepAlive()
cg:ForEach(Card.RegisterFlagEffect,m+1,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
cg:ForEach(Card.RegisterFlagEffect,m+0xffffff,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
local e1=Effect.CreateEffect(cg:GetFirst())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVED)
......@@ -134,16 +153,16 @@ function cm.acop(e,tp,eg,ep,ev,re,r,rp)
cm[0]=true
end
function cm.cfilterx(c)
return c:IsHasEffect(m) and c:GetFlagEffect(m+1)==0
return c:IsHasEffect(m) and c:GetFlagEffect(m+0xffffff)==0
end
function cm.cfilter(c)
return c:IsHasEffect(m) and c:GetFlagEffect(m+1)>0 and c:IsDestructable()
return c:IsHasEffect(m) and c:GetFlagEffect(m+0xffffff)>0 and c:IsDestructable()
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==ev then
Duel.Hint(HINT_CARD,0,m)
local cg=e:GetLabelObject():Filter(cm.cfilter,nil)
if re:GetHandler():IsRelateToEffect(re) and re:GetHandler():IsDestructable() then cg:AddCard(re:GetHandler()) end
if re:GetHandler():IsRelateToEffect(re) and re:GetHandler():IsDestructable() and re:GetHandler():GetFlagEffect(11451905)==0 then cg:AddCard(re:GetHandler()) end
if #cg>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
cg=cg:Select(tp,1,1,nil)
......
......@@ -273,7 +273,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp,c,sg,og)
local tp=c:GetControler()
local bg=Duel.GetMatchingGroup(cm.spcfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,0,c,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local bcg=bg:CancelableSelect(tp,0,1,nil)
local bcg=bg:CancelableSelect(tp,1,1,nil)
if bcg then
sg:Merge(bcg)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
......
......@@ -126,9 +126,17 @@ function cm.initial_effect(c)
local temp_f=Duel[fname]
Duel[fname]=function(p,c,...)
temp_f(p,c,...)
if Duel.GetCurrentChain()==1 then c:RegisterFlagEffect(11451905,RESET_CHAIN,0,1) end
c:RegisterFlagEffect(11451905,RESET_CHAIN,0,1)
end
end
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_ACTIVATING)
ge1:SetOperation(function()
local g=Duel.GetMatchingGroup(function(c) return c:GetFlagEffect(11451905)>0 end,0,0xff,0xff,nil)
for tc in aux.Next(g) do tc:ResetFlagEffect(11451905) end
end)
Duel.RegisterEffect(ge1,0)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -83,7 +83,7 @@ function cm.initial_effect(c)
local tp=tc:GetControler()
if 1==1 then --and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451912,0))
local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,nil,tp,tc):CancelableSelect(tp,0,1,nil)
local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,nil,tp,tc):CancelableSelect(tp,1,1,nil)
if tg and #tg>0 then Duel.RegisterFlagEffect(tp,tg:GetFirst():GetOriginalCode(),RESET_PHASE+PHASE_END,0,1) cm[1]=nil Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(11451912,6)) return _Merge(sg,tg) end
end
cm[1]=nil
......@@ -95,7 +95,7 @@ function cm.initial_effect(c)
local tp=tc:GetControler()
if 1==1 then --and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451912,0))
local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,nil,tp,tc):CancelableSelect(tp,0,1,nil)
local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,nil,tp,tc):CancelableSelect(tp,1,1,nil)
if tg and #tg>0 then Duel.RegisterFlagEffect(tp,tg:GetFirst():GetOriginalCode(),RESET_PHASE+PHASE_END,0,1) local tc2=tg:GetFirst() tc2.pendulum_rule[tc2]:SetLabel(1) if tc.pendulum_rule and tc.pendulum_rule[tc] then tc.pendulum_rule[tc]:SetLabel(0) end Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(11451912,6)) return _SpecialSummonRule(tp,tc2,SUMMON_TYPE_PENDULUM) end
end
_SpecialSummonRule(tp,tc,sumtype)
......
......@@ -83,7 +83,7 @@ function cm.initial_effect(c)
local tp=tc:GetControler()
if 1==1 then --and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451912,0))
local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,nil,tp,tc):CancelableSelect(tp,0,1,nil)
local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,nil,tp,tc):CancelableSelect(tp,1,1,nil)
if tg and #tg>0 then Duel.RegisterFlagEffect(tp,tg:GetFirst():GetOriginalCode(),RESET_PHASE+PHASE_END,0,1) cm[1]=nil Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(11451912,6)) return _Merge(sg,tg) end
end
cm[1]=nil
......@@ -95,7 +95,7 @@ function cm.initial_effect(c)
local tp=tc:GetControler()
if 1==1 then --and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451912,0))
local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,nil,tp,tc):CancelableSelect(tp,0,1,nil)
local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,nil,tp,tc):CancelableSelect(tp,1,1,nil)
if tg and #tg>0 then Duel.RegisterFlagEffect(tp,tg:GetFirst():GetOriginalCode(),RESET_PHASE+PHASE_END,0,1) local tc2=tg:GetFirst() tc2.pendulum_rule[tc2]:SetLabel(1) if tc.pendulum_rule and tc.pendulum_rule[tc] then tc.pendulum_rule[tc]:SetLabel(0) end Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(11451912,6)) return _SpecialSummonRule(tp,tc2,SUMMON_TYPE_PENDULUM) end
end
_SpecialSummonRule(tp,tc,sumtype)
......
......@@ -82,7 +82,7 @@ function cm.initial_effect(c)
local tp=tc:GetControler()
if 1==1 then --and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451912,0))
local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,nil,tp,tc):CancelableSelect(tp,0,1,nil)
local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,nil,tp,tc):CancelableSelect(tp,1,1,nil)
if tg and #tg>0 then Duel.RegisterFlagEffect(tp,tg:GetFirst():GetOriginalCode(),RESET_PHASE+PHASE_END,0,1) cm[1]=nil Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(11451912,6)) return _Merge(sg,tg) end
end
cm[1]=nil
......@@ -94,7 +94,7 @@ function cm.initial_effect(c)
local tp=tc:GetControler()
if 1==1 then --and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451912,0))
local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,nil,tp,tc):CancelableSelect(tp,0,1,nil)
local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,nil,tp,tc):CancelableSelect(tp,1,1,nil)
if tg and #tg>0 then Duel.RegisterFlagEffect(tp,tg:GetFirst():GetOriginalCode(),RESET_PHASE+PHASE_END,0,1) local tc2=tg:GetFirst() tc2.pendulum_rule[tc2]:SetLabel(1) if tc.pendulum_rule and tc.pendulum_rule[tc] then tc.pendulum_rule[tc]:SetLabel(0) end Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(11451912,6)) return _SpecialSummonRule(tp,tc2,SUMMON_TYPE_PENDULUM) end
end
_SpecialSummonRule(tp,tc,sumtype)
......
......@@ -76,7 +76,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local b3=Duel.GetTurnPlayer()==tp
if #g>0 and (b1 or b2 or b3) and Duel.GetCurrentChain()>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=g:CancelableSelect(tp,0,Duel.GetCurrentChain()-1,nil)
local rg=g:CancelableSelect(tp,1,Duel.GetCurrentChain()-1,nil)
if not rg or #rg==0 then return end
Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)
local fid=c:GetFieldID()
......
......@@ -45,6 +45,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetTurnPlayer()==tp then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
......
......@@ -41,7 +41,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_GRAVE) then
local g1=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp)
if g1:GetCount()>0 and Duel.GetMatchingGroupCount(nil,tp,0,LOCATION_MZONE,nil)>0
if g1:GetCount()>0 and Duel.GetMatchingGroupCount(nil,tp,0,LOCATION_ONFIELD,nil)>0
and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
......@@ -38,7 +38,7 @@ function s.filter1(c,e)
not c:IsImmuneToEffect(e) and c:IsAbleToRemove()
end
function s.filter4(c)
return aux.IsCodeListed(c,12866755) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
return c:IsType(TYPE_MONSTER) and aux.IsCodeListed(c,12866755) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
end
function s.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and aux.IsCodeListed(c,12866755) and (not f or f(c))
......
......@@ -2,6 +2,12 @@
local m=33330080
local cm=_G["c"..m]
function c33330080.initial_effect(c)
--act in hand
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e0:SetCost(cm.excost)
c:RegisterEffect(e0)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_POSITION+CATEGORY_REMOVE)
......@@ -11,27 +17,16 @@ function c33330080.initial_effect(c)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
c:RegisterEffect(e2)
end
function cm.excost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_EXTRA,0,5,e:GetHandler(),POS_FACEDOWN) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_EXTRA,0,5,99,e:GetHandler(),POS_FACEDOWN)
Duel.Remove(g,POS_FACEDOWN,REASON_COST)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetDecktopGroup(tp,10)
if chk==0 then
if c:IsLocation(LOCATION_HAND) then
return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_EXTRA,0,5,c) and g:FilterCount(Card.IsAbleToRemoveAsCost,nil,POS_FACEDOWN)==10
else
return g:FilterCount(Card.IsAbleToRemoveAsCost,nil,POS_FACEDOWN)==10
end
end
if e:GetHandler():IsStatus(STATUS_ACT_FROM_HAND) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_EXTRA,0,5,99,c)
Duel.Remove(g,POS_FACEDOWN,REASON_COST)
end
if chk==0 then return g:FilterCount(Card.IsAbleToRemoveAsCost,nil,POS_FACEDOWN)==10 end
Duel.DisableShuffleCheck()
Duel.Remove(g,POS_FACEDOWN,REASON_COST)
end
......@@ -48,11 +43,13 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanRemove(1-tp) and not Duel.IsPlayerAffectedByEffect(1-tp,EFFECT_CANNOT_MSET) and not Duel.IsPlayerAffectedByEffect(1-tp,EFFECT_CANNOT_SSET) then return end
local g=Duel.GetMatchingGroup(cm.tdfil,1-tp,LOCATION_ONFIELD,0,nil)
local gc=Duel.GetMatchingGroupCount(Card.IsFacedown,tp,LOCATION_REMOVED,0,nil)//10
if #g>0 then
if #g>0 and gc>0 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SET)
local sg=g:FilterSelect(1-tp,cm.tdfil,gc,gc,nil,1-tp,POS_FACEDOWN,REASON_RULE)
if #sg==0 then return end
Duel.ChangePosition(sg,POS_FACEDOWN_DEFENSE)
Duel.Remove(sg,POS_FACEDOWN,REASON_RULE)
Duel.BreakEffect()
local rg=Duel.GetMatchingGroup(Card.IsFacedown,1-tp,LOCATION_ONFIELD,0,nil)
Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment