Commit 9c6c1b43 authored by Nemo Ma's avatar Nemo Ma

fix

parent 28c7d722
...@@ -39,7 +39,7 @@ function s.initial_effect(c) ...@@ -39,7 +39,7 @@ function s.initial_effect(c)
end end
function s.regop(e,tp,eg,ep,ev,re,r,rp) function s.regop(e,tp,eg,ep,ev,re,r,rp)
for p=0,1 do for p=0,1 do
if eg:IsExists(Card.IsControler,1,nil,p) then if eg:IsExists(Card.IsControler,1,nil,p) and Duel.GetTurnCount(p)+Duel.GetTurnCount(1-p)>0 then
Duel.RegisterFlagEffect(p,id,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(p,id,RESET_PHASE+PHASE_END,0,1)
end end
end end
......
...@@ -116,7 +116,7 @@ function s.RestoreCon(e,tp,eg,ep,ev,re,r,rp) ...@@ -116,7 +116,7 @@ function s.RestoreCon(e,tp,eg,ep,ev,re,r,rp)
end end
function s.RestoreTypeReg(tpe) function s.RestoreTypeReg(tpe)
return function(e,tp,eg,ep,ev,re,r,rp) return function(e,tp,eg,ep,ev,re,r,rp)
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(e:GetHandler())
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SET_AVAILABLE) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SET_AVAILABLE)
e0:SetCode(EVENT_LEAVE_FIELD) e0:SetCode(EVENT_LEAVE_FIELD)
......
...@@ -97,8 +97,14 @@ function cm.tdop(e,tp,eg,ep,ev,re,r,rp) ...@@ -97,8 +97,14 @@ function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
--local sg=g2:Select(tp,1,ft,nil) --local sg=g2:Select(tp,1,ft,nil)
local cg=g2:SelectSubGroup(tp,aux.dncheck,false,1,ft) local tg=g2:SelectSubGroup(tp,aux.dncheck,false,1,ft)
Duel.MoveToField(cg,tp,tp,LOCATION_SZONE,POS_FACEUP,true) if tg then
local tc=tg:GetFirst()
while tc do
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
tc=tg:GetNext()
end
end
end end
function cm.indfilter(c) function cm.indfilter(c)
return c:IsFaceup() and cm.Chrono(c) return c:IsFaceup() and cm.Chrono(c)
......
...@@ -51,10 +51,14 @@ end ...@@ -51,10 +51,14 @@ end
function cm.fncon2(e,tp,eg,ep,ev,re,r,rp) function cm.fncon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,40008477) return Duel.IsPlayerAffectedByEffect(tp,40008477)
end end
function cm.spfilter1(c,e,tp) --function cm.spfilter1(c,e,tp)
local lv=c:GetLevel() -- local lv=c:GetLevel()
-- return c:IsFaceup()
-- and Duel.IsExistingMatchingCard(cm.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp,lv) and c:IsAbleToRemove()
--end
function cm.spfilter1(c)
return c:IsFaceup() return c:IsFaceup()
and Duel.IsExistingMatchingCard(cm.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp,lv) and c:IsAbleToRemove() and c:IsAbleToRemove()
end end
function cm.spfilter2(c,e,tp,clv) function cm.spfilter2(c,e,tp,clv)
local lv=c:GetLevel() local lv=c:GetLevel()
...@@ -62,16 +66,16 @@ function cm.spfilter2(c,e,tp,clv) ...@@ -62,16 +66,16 @@ function cm.spfilter2(c,e,tp,clv)
end end
function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and cm.spfilter1(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and cm.spfilter1(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.spfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end if chk==0 then return Duel.IsExistingTarget(cm.spfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,cm.spfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,cm.spfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp) function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local g=Duel.GetMatchingGroup(cm.spfilter2,tp,LOCATION_DECK,0,nil,e,tp,tc:GetLevel()) if tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 and tc:GetLevel()>0 then
if tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local g=Duel.GetMatchingGroup(cm.spfilter2,tp,LOCATION_DECK,0,nil,e,tp,tc:GetLevel())
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
...@@ -55,6 +55,7 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -55,6 +55,7 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject()) Duel.ReturnToField(e:GetLabelObject())
end end
function cm.remop(e,tp,eg,ep,ev,re,r,rp) function cm.remop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_IMMUNE_EFFECT) e2:SetCode(EFFECT_IMMUNE_EFFECT)
......
...@@ -96,4 +96,5 @@ function cm.remop(e,tp,eg,ep,ev,re,r,rp) ...@@ -96,4 +96,5 @@ function cm.remop(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()~=0 then if g:GetCount()~=0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
end end
e:SetLabel(0)
end end
\ No newline at end of file
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