Commit b4525691 authored by TanakaKotoha's avatar TanakaKotoha

fix

parent fe41336e
...@@ -13,6 +13,7 @@ function cm.initial_effect(c) ...@@ -13,6 +13,7 @@ function cm.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_PZONE) e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,m) e1:SetCountLimit(1,m)
e1:SetCost(cm.spcost)
e1:SetCondition(cm.ctgcon) e1:SetCondition(cm.ctgcon)
e1:SetTarget(cm.sptg) e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop) e1:SetOperation(cm.spop)
...@@ -38,10 +39,25 @@ function cm.initial_effect(c) ...@@ -38,10 +39,25 @@ function cm.initial_effect(c)
e3:SetTarget(cm.splimit) e3:SetTarget(cm.splimit)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--- ---
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
end end
function cm.splimit(e,c,tp,sumtp,sumpos) function cm.splimit(e,c,tp,sumtp,sumpos)
return not (c:IsSetCard(0xcc3) or c:IsLevel(10) or c:IsRank(10)) return not (c:IsSetCard(0xcc3) or c:IsLevel(10) or c:IsRank(10))
end end
function cm.counterfilter(c)
return c:IsSetCard(0xcc3) or c:IsLevel(10) or c:IsRank(10)
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetLabelObject(e)
e1:SetTarget(cm.spsplimit)
Duel.RegisterEffect(e1,tp)
end
function cm.spsplimit(e,c,sump,sumtype,sumpos,targetp,se) function cm.spsplimit(e,c,sump,sumtype,sumpos,targetp,se)
return not (c:IsLevel(10) or c:IsRank(10) or c:IsSetCard(0xcc3)) return not (c:IsLevel(10) or c:IsRank(10) or c:IsSetCard(0xcc3))
end end
...@@ -53,25 +69,18 @@ function cm.spfilter(c,e,tp) ...@@ -53,25 +69,18 @@ function cm.spfilter(c,e,tp)
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,2,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>=1
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler()) if not (e:GetHandler():IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>=1 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,2,nil,e,tp) ) then return end
e1:SetType(EFFECT_TYPE_FIELD) local tc1=Duel.GetLocationCount(tp,LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) if Duel.IsPlayerAffectedByEffect(tp,59822133) then tc1=1 end
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetLabelObject(e)
e1:SetTarget(cm.spsplimit)
Duel.RegisterEffect(e1,tp)
if not (e:GetHandler():IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,2,nil,e,tp) ) then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,cm.spfiter,tp,LOCATION_HAND,0,2,2,nil,e,tp) local tc=Duel.SelectMatchingCard(tp,cm.spfiter,tp,LOCATION_HAND,0,1,math.min(tc1,2),nil,e,tp)
if tc:GetCount()==2 then if tc:GetCount()>0 then
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)==2 then if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)==2 then
Duel.Destroy(e:GetHandler(),REASON_EFFECT) Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end end
......
...@@ -13,6 +13,7 @@ function cm.initial_effect(c) ...@@ -13,6 +13,7 @@ function cm.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_PZONE) e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,m) e1:SetCountLimit(1,m)
e1:SetCost(cm.spcost)
e1:SetCondition(cm.ctgcon) e1:SetCondition(cm.ctgcon)
e1:SetTarget(cm.sptg) e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop) e1:SetOperation(cm.spop)
...@@ -37,6 +38,8 @@ function cm.initial_effect(c) ...@@ -37,6 +38,8 @@ function cm.initial_effect(c)
e3:SetTargetRange(1,0) e3:SetTargetRange(1,0)
e3:SetTarget(cm.splimit) e3:SetTarget(cm.splimit)
c:RegisterEffect(e3) c:RegisterEffect(e3)
---
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
end end
function cm.splimit(e,c,tp,sumtp,sumpos) function cm.splimit(e,c,tp,sumtp,sumpos)
return not (c:IsSetCard(0xcc3) or c:IsLevel(10) or c:IsRank(10)) return not (c:IsSetCard(0xcc3) or c:IsLevel(10) or c:IsRank(10))
...@@ -44,6 +47,17 @@ end ...@@ -44,6 +47,17 @@ end
function cm.counterfilter(c) function cm.counterfilter(c)
return c:IsSetCard(0xcc3) or c:IsLevel(10) or c:IsRank(10) return c:IsSetCard(0xcc3) or c:IsLevel(10) or c:IsRank(10)
end end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetLabelObject(e)
e1:SetTarget(cm.spsplimit)
Duel.RegisterEffect(e1,tp)
end
function cm.spsplimit(e,c,sump,sumtype,sumpos,targetp,se) function cm.spsplimit(e,c,sump,sumtype,sumpos,targetp,se)
return not (c:IsLevel(10) or c:IsRank(10) or c:IsSetCard(0xcc3)) return not (c:IsLevel(10) or c:IsRank(10) or c:IsSetCard(0xcc3))
end end
...@@ -55,25 +69,18 @@ function cm.spfilter(c,e,tp) ...@@ -55,25 +69,18 @@ function cm.spfilter(c,e,tp)
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
return Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,2,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 return Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>=1
end end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_GRAVE)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler()) if not (e:GetHandler():IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>=1 and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp)) then return end
e1:SetType(EFFECT_TYPE_FIELD) local tc1=Duel.GetLocationCount(tp,LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) if Duel.IsPlayerAffectedByEffect(tp,59822133) then tc1=1 end
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetLabelObject(e)
e1:SetTarget(cm.spsplimit)
Duel.RegisterEffect(e1,tp)
if not (e:GetHandler():IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,2,nil,e,tp)) then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,2,2,nil,e,tp) local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,math.min(tc1,2),nil,e,tp)
if tc:GetCount()==2 then if tc:GetCount()>0 then
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)==2 then if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)==2 then
Duel.Destroy(e:GetHandler(),REASON_EFFECT) Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end end
......
...@@ -92,8 +92,9 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -92,8 +92,9 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
e5:SetTargetRange(1,1) e5:SetTargetRange(1,1)
e5:SetTarget(cm.distg) e5:SetTarget(cm.distg)
e5:SetLabelObject(sc) e5:SetLabelObject(sc)
e:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e5,tp) Duel.RegisterEffect(e5,tp)
sc=og:GetNext() sc=g:GetNext()
end end
end end
end end
......
...@@ -4,7 +4,7 @@ local cm=_G["c"..m] ...@@ -4,7 +4,7 @@ local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
--S summon --S summon
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0xcc3),aux.NonTuner(cm.synfiter),1) aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0xcc3),aux.NonTuner(cm.synfilter),1)
-----P EFFECT -----P EFFECT
--imm --imm
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
...@@ -89,7 +89,7 @@ function cm.initial_effect(c) ...@@ -89,7 +89,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e8) c:RegisterEffect(e8)
end end
function cm.sppcon(e,tp) function cm.sppcon(e,tp)
return Duel.GetTurnPlayer()~=tp return Duel.GetTurnPlayer()==tp
end end
function cm.slimit(e,se,sp,st) function cm.slimit(e,se,sp,st)
return se:GetHandler()==e:GetHandler() or (bit.band(st,SUMMON_TYPE_SYNCHRO)==SUMMON_TYPE_SYNCHRO) or (bit.band(st,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM) return se:GetHandler()==e:GetHandler() or (bit.band(st,SUMMON_TYPE_SYNCHRO)==SUMMON_TYPE_SYNCHRO) or (bit.band(st,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM)
...@@ -187,7 +187,7 @@ function cm.dstg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -187,7 +187,7 @@ function cm.dstg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function cm.dsop(e,tp,eg,ep,ev,re,r,rp) function cm.dsop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg) Duel.NegateSummon(eg)
Duel.SendtoDeck(eg,nil,2,REASON_EFFECT) Duel.Destroy(eg,REASON_EFFECT)
end end
function cm.toptarget(e,tp,eg,ep,ev,re,r,rp,chk) function cm.toptarget(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0) local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
......
...@@ -68,7 +68,8 @@ function cm.initial_effect(c) ...@@ -68,7 +68,8 @@ function cm.initial_effect(c)
c:RegisterEffect(e8) c:RegisterEffect(e8)
end end
function cm.sppcon(e,tp) function cm.sppcon(e,tp)
return Duel.GetTurnPlayer()~=tp local tp=e:GetHandler():GetControler()
return Duel.GetTurnPlayer()==tp
end end
function cm.slimit(e,se,sp,st) function cm.slimit(e,se,sp,st)
return (bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION) or (bit.band(st,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM) return (bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION) or (bit.band(st,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM)
...@@ -150,7 +151,7 @@ end ...@@ -150,7 +151,7 @@ end
function cm.disrmtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.disrmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.GetFlagEffect(tp,m)==0 and Duel.GetMatchingGroupCount(nil,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil)>0 local b1=Duel.GetFlagEffect(tp,m)==0 and Duel.GetMatchingGroupCount(nil,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil)>0
local b2=Duel.IsExistingMatchingCard(aux.disfilter1,tp,0,LOCATION_ONFIELD+LOCATION_REMOVED,1,nil) local b2=Duel.IsExistingMatchingCard(aux.disfilter1,tp,0,LOCATION_ONFIELD+LOCATION_REMOVED,1,nil)
and Duel.GetFlagEffect(tp,m+1)==0 and Duel.GetFlagEffect(tp,m)==0
if chk==0 then return b1 or b2 end if chk==0 then return b1 or b2 end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,0,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE,0,1,0,0)
end end
......
...@@ -69,7 +69,7 @@ function cm.initial_effect(c) ...@@ -69,7 +69,7 @@ function cm.initial_effect(c)
end end
cm.pendulum_level=12 cm.pendulum_level=12
function cm.sppcon(e,tp) function cm.sppcon(e,tp)
return Duel.GetTurnPlayer()~=tp return Duel.GetTurnPlayer()==tp
end end
function cm.mfilter(c,xyzc) function cm.mfilter(c,xyzc)
return c:IsSetCard(0xcc3) return c:IsSetCard(0xcc3)
...@@ -87,7 +87,7 @@ function cm.efilter2(e,re) ...@@ -87,7 +87,7 @@ function cm.efilter2(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer() return e:GetOwnerPlayer()~=re:GetOwnerPlayer()
end end
function cm.tdfilter(c,e,tp) function cm.tdfilter(c,e,tp)
return c:IsSetCard(0xcc3) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) return c:IsSetCard(0xcc3) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) and c:IsType(TYPE_MONSTER)
end end
function cm.spptarget(e,tp,eg,ep,ev,re,r,rp,chk) function cm.spptarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tdilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and e:GetHandler():IsAbleToExtra() end if chk==0 then return Duel.IsExistingMatchingCard(cm.tdilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and e:GetHandler():IsAbleToExtra() end
...@@ -96,11 +96,11 @@ function cm.spptarget(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -96,11 +96,11 @@ function cm.spptarget(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function cm.sppop(e,tp,eg,ep,ev,re,r,rp) function cm.sppop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not (c:IsRelateToEffect(e) and Duel.IsExistingMatchingCard(cm.tdilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and c:IsAbleToExtra()) then return end if not (c:IsRelateToEffect(e) and Duel.IsExistingMatchingCard(cm.tdfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and c:IsAbleToExtra()) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,cm.tdilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local tc=Duel.SelectMatchingCard(tp,cm.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if tc:GetCount()>0 then if tc:GetCount()>0 then
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then if Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)~=0 then
Duel.SendtoExtraP(c,nil,REASON_EFFECT) Duel.SendtoExtraP(c,nil,REASON_EFFECT)
end end
end end
...@@ -116,13 +116,13 @@ function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -116,13 +116,13 @@ function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0) local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
local num1=Duel.GetMatchingGroupCount(cm.settfilter,tp,LOCATION_PZONE,0,nil) local num1=Duel.GetMatchingGroupCount(cm.settfilter,tp,LOCATION_PZONE,0,nil)
if chk==0 then return #g==num1 if chk==0 then return #g==num1
and Duel.GetLocationCount(tp,LOCATION_MZONE)>=#g and Duel.IsExistingMatchingCard(cm.setfilter1,tp,LOCATION_DECK+LOCATION_EXTRA,0,2,nil) and num1>0 end and Duel.IsExistingMatchingCard(cm.setfilter1,tp,LOCATION_DECK+LOCATION_EXTRA,0,2,nil) and num1>0 end
end end
function cm.setop(e,tp,eg,ep,ev,re,r,rp) function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0) local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
local num1=Duel.GetMatchingGroupCount(cm.settfilter,tp,LOCATION_PZONE,0,nil,e,tp) local num1=Duel.GetMatchingGroupCount(cm.settfilter,tp,LOCATION_PZONE,0,nil,e,tp)
if not (#g==num1 if not (#g==num1
and Duel.GetLocationCount(tp,LOCATION_MZONE)>=#g and Duel.IsExistingMatchingCard(cm.setfilter1,tp,LOCATION_DECK+LOCATION_EXTRA,0,2,nil) and num1>0) then return end and Duel.IsExistingMatchingCard(cm.setfilter1,tp,LOCATION_DECK+LOCATION_EXTRA,0,2,nil) and num1>0) then return end
if not Duel.SendtoExtraP(g,nil,REASON_EFFECT)==#g then return false end if not Duel.SendtoExtraP(g,nil,REASON_EFFECT)==#g then return false end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g1=Duel.SelectMatchingCard(tp,cm.setfilter1,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil) local g1=Duel.SelectMatchingCard(tp,cm.setfilter1,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil)
...@@ -155,7 +155,7 @@ end ...@@ -155,7 +155,7 @@ end
function cm.disrmtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.disrmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.GetFlagEffect(tp,m)==0 local b1=Duel.GetFlagEffect(tp,m)==0
local b2=Duel.IsExistingMatchingCard(cm.tddfilter,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) local b2=Duel.IsExistingMatchingCard(cm.tddfilter,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil)
and Duel.GetFlagEffect(tp,m+1)==0 and Duel.GetFlagEffect(tp,m)==0
if chk==0 then return b1 or b2 end if chk==0 then return b1 or b2 end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,0,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE,0,1,0,0)
end end
......
...@@ -50,21 +50,23 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -50,21 +50,23 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_ONFIELD,1,2,nil) local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_ONFIELD,1,2,nil)
if #g>0 then if #g>0 then
Duel.HintSelection(g) Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end end
local ct=Duel.Destroy(g,REASON_EFFECT)
for rc in aux.Next(g) do for rc in aux.Next(g) do
if rc:IsType(TYPE_TOKEN) then return end if ct~=0 then
if rc:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if rc:IsType(TYPE_TOKEN) then return end
and (not rc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp,tp,nil,rc)>0) if rc:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and rc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and (not rc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp,tp,nil,rc)>0)
and Duel.SelectYesNo(tp,aux.Stringid(90809975,3)) then and rc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.BreakEffect() and Duel.SelectYesNo(tp,aux.Stringid(90809975,3)) then
Duel.SpecialSummon(rc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE) Duel.BreakEffect()
Duel.ConfirmCards(1-tp,rc) Duel.SpecialSummon(rc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
elseif (rc:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0) Duel.ConfirmCards(1-tp,rc)
and rc:IsSSetable() and Duel.SelectYesNo(tp,aux.Stringid(90809975,4)) then elseif (rc:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0)
Duel.BreakEffect() and rc:IsSSetable() and Duel.SelectYesNo(tp,aux.Stringid(90809975,4)) then
Duel.SSet(tp,rc) Duel.BreakEffect()
Duel.SSet(tp,rc)
end
end end
end end
end end
......
...@@ -43,12 +43,11 @@ function cm.initial_effect(c) ...@@ -43,12 +43,11 @@ function cm.initial_effect(c)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(17035340,2)) e3:SetDescription(aux.Stringid(17035340,2))
e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD) e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetCode(EVENT_PHASE+PHASE_END) e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_GRAVE) e3:SetRange(LOCATION_EXTRA+LOCATION_GRAVE+LOCATION_REMOVED)
e3:SetCountLimit(1) e3:SetCountLimit(1)
e3:SetTarget(cm.sumtg) e3:SetTarget(cm.pentg)
e3:SetOperation(cm.sumop) e3:SetOperation(cm.penop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--to deck --to deck
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
...@@ -239,15 +238,15 @@ function cm.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -239,15 +238,15 @@ function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev) Duel.NegateActivation(ev)
e:GetHandler():RegisterFlagEffect(17035340,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0) e:GetHandler():RegisterFlagEffect(17035340,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0)
end end
function cm.sumtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() if chk==0 then return c:GetFlagEffect(17035340)>0
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:GetFlagEffect(17035340)>0 and Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end end
function cm.sumop(e,tp,eg,ep,ev,re,r,rp) function cm.penop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return false end
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end end
end end
function cm.filter(c) function cm.filter(c)
......
...@@ -80,7 +80,7 @@ end ...@@ -80,7 +80,7 @@ end
--e2 --e2
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemoveAsCost() end if chk==0 then return c:IsAbleToRemoveAsCost() and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil) end
if Duel.Remove(c,POS_FACEUP,REASON_COST+REASON_TEMPORARY)~=0 then if Duel.Remove(c,POS_FACEUP,REASON_COST+REASON_TEMPORARY)~=0 then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) 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