Commit e6cc54ee authored by POLYMER's avatar POLYMER

fix

parent 743ba59f
......@@ -46,7 +46,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_REMOVED,nil):RandomSelect(tp,g:GetFirst():GetLevel())
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummon(g,SUMMON_TYPE_RITUAL,tp,tp,false,false,POS_FACEUP)
g:GetFirst():CompleteProcedure()
end
end
......
......@@ -41,12 +41,15 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
end
if Duel.GetDecktopGroup(1-tp,num):FilterCount(Card.IsAbleToRemove,nil)~=num then return end
local g=Duel.GetDecktopGroup(1-tp,num)
if Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
if Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(cm.cfil,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.GetMatchingGroup(nil,tp,0,LOCATION_ONFIELD,nil):Select(tp,1,1,nil)
Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)
end
end
function cm.cfil(c)
return c:IsCode(23410013) and c:IsFaceup()
end
function cm.cfilter(c,tp)
return c:IsFacedown() and c:GetControler()==1-tp
end
......
......@@ -38,10 +38,15 @@ function cm.initial_effect(c)
c:RegisterEffect(e5)
if not cm.global_check then
cm.global_check=true
local ge=Effect.GlobalEffect()
ge:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge:SetCode(EVENT_ADJUST)
ge:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) cm.check=false end)
Duel.RegisterEffect(ge,0)
cm[0]=Duel.ConfirmDecktop
Duel.ConfirmDecktop=function(tp,ct)
local g=Duel.GetDecktopGroup(tp,ct)
if ct<5 then
if ct<5 and not cm.check then
if g:IsExists(Card.IsHasEffect,1,nil,m) then Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1) end
end
local ch=Duel.GetCurrentChain()
......@@ -62,8 +67,14 @@ function cm.initial_effect(c)
e2:SetOperation(cm.reset)
e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp)
cm.check=false
return cm[0](tp,ct)
end
local f2=Duel.MoveSequence
Duel.MoveSequence=function(...)
cm.check=true
return f2(...)
end
end
end
function cm.reset(e,tp,eg,ep,ev,re,r,rp)
......
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