Commit 1d4d0fb2 authored by nanahira's avatar nanahira

updates

parent 73c8dc8f
...@@ -24,7 +24,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -24,7 +24,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end end
......
...@@ -25,7 +25,7 @@ function cm.filter(c,e,tp) ...@@ -25,7 +25,7 @@ function cm.filter(c,e,tp)
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.filter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end and Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
......
...@@ -21,12 +21,12 @@ function cm.filter(c,e,tp) ...@@ -21,12 +21,12 @@ function cm.filter(c,e,tp)
return Senya.check_set_elem(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:GetLevel()==4 return Senya.check_set_elem(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:GetLevel()==4
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 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -75,7 +75,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -75,7 +75,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp) function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayGroup():IsExists(cm.filter7,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 return e:GetHandler():GetOverlayGroup():IsExists(cm.filter7,1,nil,e,tp) and Duel.GetMZoneCount(tp)>0
end end
function cm.filter7(c,e,tp) function cm.filter7(c,e,tp)
return c:IsType(TYPE_XYZ) and c:GetRank()==4 and c:IsCanBeSpecialSummoned(e,0,tp,true,true) return c:IsType(TYPE_XYZ) and c:GetRank()==4 and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
...@@ -83,7 +83,7 @@ end ...@@ -83,7 +83,7 @@ end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp) function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsControler(1-tp) or c:IsImmuneToEffect(e) then return end if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsControler(1-tp) or c:IsImmuneToEffect(e) then return end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
local g1=e:GetHandler():GetOverlayGroup() local g1=e:GetHandler():GetOverlayGroup()
local sg=g1:Filter(cm.filter7,nil,e,tp) local sg=g1:Filter(cm.filter7,nil,e,tp)
if ft==0 or sg:GetCount()==0 then return end if ft==0 or sg:GetCount()==0 then return end
......
...@@ -72,7 +72,7 @@ function cm.filter(c,e,tp) ...@@ -72,7 +72,7 @@ function cm.filter(c,e,tp)
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 cm.filter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and cm.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingTarget(cm.filter,tp,0,LOCATION_GRAVE,1,nil,e,tp) end and Duel.IsExistingTarget(cm.filter,tp,0,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.filter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,cm.filter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp)
......
...@@ -25,7 +25,7 @@ end ...@@ -25,7 +25,7 @@ end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_GRAVE and chkc:GetControler()==tp if chkc then return chkc:GetLocation()==LOCATION_GRAVE and chkc:GetControler()==tp
and chkc:IsCanBeSpecialSummoned(e,0,tp,false,false) end and chkc:IsCanBeSpecialSummoned(e,0,tp,false,false) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end and Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
......
...@@ -21,7 +21,7 @@ function cm.counterfilter(c) ...@@ -21,7 +21,7 @@ function cm.counterfilter(c)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetMZoneCount(tp)>0
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 end if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 end
......
...@@ -56,7 +56,7 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -56,7 +56,7 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not e:GetHandler():IsRelateToEffect(e) or e:GetHandler():IsFacedown() then return end if not e:GetHandler():IsRelateToEffect(e) or e:GetHandler():IsFacedown() then return end
Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_EFFECT) Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_EFFECT)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 and not g:GetFirst():IsHasEffect(EFFECT_NECRO_VALLEY) then if g:GetCount()>0 and not g:GetFirst():IsHasEffect(EFFECT_NECRO_VALLEY) then
......
...@@ -13,7 +13,7 @@ function cm.initial_effect(c) ...@@ -13,7 +13,7 @@ function cm.initial_effect(c)
e1:SetCondition(function(e,c) e1:SetCondition(function(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0,nil)==0 return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0,nil)==0
and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.GetMZoneCount(c:GetControler())>0
end) end)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--xm --xm
......
...@@ -33,7 +33,7 @@ function cm.ssfilter(c) ...@@ -33,7 +33,7 @@ function cm.ssfilter(c)
end end
function cm.hcon(e,c) function cm.hcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.ssfilter,c:GetControler(),LOCATION_MZONE,0,1,nil) return Duel.GetMZoneCount(c:GetControler())>0 and Duel.IsExistingMatchingCard(cm.ssfilter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end end
function cm.filter(c,e,tp) function cm.filter(c,e,tp)
return Senya.check_set_elem(c) and c:GetLevel()==4 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(m) and not c:IsHasEffect(EFFECT_NECRO_VALLEY) return Senya.check_set_elem(c) and c:GetLevel()==4 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(m) and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
...@@ -43,7 +43,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -43,7 +43,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK+LOCATION_GRAVE)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
......
...@@ -56,7 +56,7 @@ function cm.ssfilter(c,e,tp) ...@@ -56,7 +56,7 @@ function cm.ssfilter(c,e,tp)
end end
function cm.sstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.sstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and cm.ssfilter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and cm.ssfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingTarget(cm.ssfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end and Duel.IsExistingTarget(cm.ssfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.ssfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,cm.ssfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp)
......
...@@ -48,14 +48,14 @@ function cm.spcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -48,14 +48,14 @@ function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil) return eg:IsExists(cm.cfilter,1,nil)
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 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,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 c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 and Duel.GetMZoneCount(tp)<=0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.SendtoGrave(c,REASON_RULE) Duel.SendtoGrave(c,REASON_RULE)
end end
......
...@@ -25,7 +25,7 @@ end ...@@ -25,7 +25,7 @@ end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and cm.filter1(chkc,e,tp) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and cm.filter1(chkc,e,tp) end
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2) if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetMZoneCount(tp)>0
and Duel.GetLocationCountFromEx(tp)>0 and Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingTarget(cm.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetFlagEffect(tp,m)==0 end and Duel.IsExistingTarget(cm.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetFlagEffect(tp,m)==0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
...@@ -34,7 +34,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -34,7 +34,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,m)>0 then return end if Duel.GetFlagEffect(tp,m)>0 then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsImmuneToEffect(e) then return end if not tc:IsRelateToEffect(e) or tc:IsImmuneToEffect(e) then return end
Duel.RegisterFlagEffect(tp,m,0,0,0) Duel.RegisterFlagEffect(tp,m,0,0,0)
......
...@@ -82,12 +82,12 @@ function cm.fffilter(c,e,tp) ...@@ -82,12 +82,12 @@ function cm.fffilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) and not c:IsCode(m) return c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) and not c:IsCode(m)
end end
function cm.spptg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.spptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.fffilter,tp,LOCATION_EXTRA,LOCATION_EXTRA,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.fffilter,tp,LOCATION_EXTRA,LOCATION_EXTRA,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function cm.sppop(e,tp,eg,ep,ev,re,r,rp) function cm.sppop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
local g=Duel.GetMatchingGroup(cm.fffilter,tp,LOCATION_EXTRA,LOCATION_EXTRA,nil,e,tp) local g=Duel.GetMatchingGroup(cm.fffilter,tp,LOCATION_EXTRA,LOCATION_EXTRA,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
for i=0,9 do for i=0,9 do
......
...@@ -210,7 +210,8 @@ end ...@@ -210,7 +210,8 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local rc=Duel.GetFirstTarget() local rc=Duel.GetFirstTarget()
if rc:IsRelateToEffect(e) and Duel.Destroy(rc,REASON_EFFECT)~=0 and not rc:IsLocation(LOCATION_HAND+LOCATION_DECK) then if rc:IsRelateToEffect(e) and Duel.Destroy(rc,REASON_EFFECT)~=0 and not rc:IsLocation(LOCATION_HAND+LOCATION_DECK) then
if rc:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if rc:IsType(TYPE_MONSTER) and Duel.GetMZoneCount(tp)>0
and (not rc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp)>0)
and rc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and rc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
and Duel.SelectYesNo(tp,aux.Stringid(90809975,3)) then and Duel.SelectYesNo(tp,aux.Stringid(90809975,3)) then
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -23,7 +23,7 @@ function cm.ssfilter(c,e,tp) ...@@ -23,7 +23,7 @@ function cm.ssfilter(c,e,tp)
end end
function cm.xmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.xmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.xmfilter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.xmfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(cm.xmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end if chk==0 then return Duel.GetMZoneCount(tp)>0 and Duel.IsExistingTarget(cm.xmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g1=Duel.SelectTarget(tp,cm.xmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp) local g1=Duel.SelectTarget(tp,cm.xmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_MZONE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_MZONE)
...@@ -31,7 +31,7 @@ end ...@@ -31,7 +31,7 @@ end
function cm.xmop(e,tp,eg,ep,ev,re,r,rp) function cm.xmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local gg=tc:GetOverlayGroup() local gg=tc:GetOverlayGroup()
if not (gg:IsExists(cm.ssfilter,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsRelateToEffect(e)) or tc:IsImmuneToEffect(e) then return end if not (gg:IsExists(cm.ssfilter,1,nil,e,tp) and Duel.GetMZoneCount(tp)>0 and tc:IsRelateToEffect(e)) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=gg:FilterSelect(tp,cm.ssfilter,1,1,nil,e,tp) local sg=gg:FilterSelect(tp,cm.ssfilter,1,1,nil,e,tp)
if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)~=0 then if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)~=0 then
......
...@@ -32,7 +32,7 @@ end ...@@ -32,7 +32,7 @@ end
function cm.rmcon(e,c,og) function cm.rmcon(e,c,og)
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
local c=e:GetHandler() local c=e:GetHandler()
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) and c:IsFaceup() and not c:IsDisabled() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) and c:IsFaceup() and not c:IsDisabled() and Duel.GetMZoneCount(tp)>0
end end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp,c,sg,og) function cm.rmop(e,tp,eg,ep,ev,re,r,rp,c,sg,og)
Duel.Hint(HINT_CARD,0,e:GetHandler():GetOriginalCode()) Duel.Hint(HINT_CARD,0,e:GetHandler():GetOriginalCode())
......
...@@ -85,7 +85,7 @@ function c37564101.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -85,7 +85,7 @@ function c37564101.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function c37564101.thop(e,tp,eg,ep,ev,re,r,rp) function c37564101.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.Destroy(c,REASON_EFFECT)==0 or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if not c:IsRelateToEffect(e) or Duel.Destroy(c,REASON_EFFECT)==0 or Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c37564101.tfilter,tp,LOCATION_EXTRA,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c37564101.tfilter,tp,LOCATION_EXTRA,0,1,1,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -85,7 +85,7 @@ function c37564102.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -85,7 +85,7 @@ function c37564102.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function c37564102.thop(e,tp,eg,ep,ev,re,r,rp) function c37564102.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.Destroy(c,REASON_EFFECT)==0 or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if not c:IsRelateToEffect(e) or Duel.Destroy(c,REASON_EFFECT)==0 or Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c37564102.tfilter,tp,LOCATION_EXTRA,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c37564102.tfilter,tp,LOCATION_EXTRA,0,1,1,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -68,7 +68,7 @@ end ...@@ -68,7 +68,7 @@ end
function c37564103.spcon1(e,c) function c37564103.spcon1(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2 return Duel.GetMZoneCount(tp)>-2
and Duel.CheckReleaseGroup(tp,c37564103.spfilter1,1,nil,tp,c) and Duel.CheckReleaseGroup(tp,c37564103.spfilter1,1,nil,tp,c)
end end
function c37564103.spop1(e,tp,eg,ep,ev,re,r,rp,c) function c37564103.spop1(e,tp,eg,ep,ev,re,r,rp,c)
...@@ -117,7 +117,7 @@ function c37564103.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -117,7 +117,7 @@ function c37564103.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function c37564103.thop(e,tp,eg,ep,ev,re,r,rp) function c37564103.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.Destroy(c,REASON_EFFECT)==0 or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if not c:IsRelateToEffect(e) or Duel.Destroy(c,REASON_EFFECT)==0 or Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c37564103.tfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c37564103.tfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -115,7 +115,7 @@ function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -115,7 +115,7 @@ function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
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()
if not c:IsRelateToEffect(e) or Duel.Destroy(c,REASON_EFFECT)==0 or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if not c:IsRelateToEffect(e) or Duel.Destroy(c,REASON_EFFECT)==0 or Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.tfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.tfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -113,7 +113,7 @@ function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -113,7 +113,7 @@ function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
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()
if not c:IsRelateToEffect(e) or Duel.Destroy(c,REASON_EFFECT)==0 or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if not c:IsRelateToEffect(e) or Duel.Destroy(c,REASON_EFFECT)==0 or Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.tfilter,tp,LOCATION_EXTRA,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.tfilter,tp,LOCATION_EXTRA,0,1,1,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -33,7 +33,7 @@ function c37564109.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -33,7 +33,7 @@ function c37564109.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local res=e:GetLabel()==1 local res=e:GetLabel()==1
e:SetLabel(0) e:SetLabel(0)
return res and Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 return res and Duel.GetMZoneCount(tp)>-1
and Duel.IsExistingTarget(c37564109.filter1,tp,LOCATION_MZONE,0,1,nil) end and Duel.IsExistingTarget(c37564109.filter1,tp,LOCATION_MZONE,0,1,nil) end
e:SetLabel(0) e:SetLabel(0)
local rg=Duel.SelectTarget(tp,c37564109.filter1,tp,LOCATION_MZONE,0,1,1,nil) local rg=Duel.SelectTarget(tp,c37564109.filter1,tp,LOCATION_MZONE,0,1,1,nil)
...@@ -43,7 +43,7 @@ function c37564109.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -43,7 +43,7 @@ function c37564109.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_EXTRA)
end end
function c37564109.activate(e,tp,eg,ep,ev,re,r,rp) function c37564109.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
local tcode=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM) local tcode=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
......
...@@ -63,12 +63,12 @@ function c37564110.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -63,12 +63,12 @@ function c37564110.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(e:GetHandler(),REASON_COST) Duel.Release(e:GetHandler(),REASON_COST)
end end
function c37564110.target(e,tp,eg,ep,ev,re,r,rp,chk) function c37564110.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 if chk==0 then return Duel.GetMZoneCount(tp)>-1
and Duel.IsExistingMatchingCard(c37564110.rsfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(c37564110.rsfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND)
end end
function c37564110.operation(e,tp,eg,ep,ev,re,r,rp) function c37564110.operation(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
if ft<=0 then return end if ft<=0 then return end
if ft>2 then ft=2 end if ft>2 then ft=2 end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
......
...@@ -93,7 +93,7 @@ function c37564111.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -93,7 +93,7 @@ function c37564111.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function c37564111.thop(e,tp,eg,ep,ev,re,r,rp) function c37564111.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.Destroy(c,REASON_EFFECT)==0 or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if not c:IsRelateToEffect(e) or Duel.Destroy(c,REASON_EFFECT)==0 or Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c37564111.tfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c37564111.tfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -28,7 +28,7 @@ function cm.ssfilter(c,e,tp) ...@@ -28,7 +28,7 @@ function cm.ssfilter(c,e,tp)
end end
function cm.xmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.xmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.xmfilter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.xmfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(cm.xmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end if chk==0 then return Duel.GetMZoneCount(tp)>0 and Duel.IsExistingTarget(cm.xmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g1=Duel.SelectTarget(tp,cm.xmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp) local g1=Duel.SelectTarget(tp,cm.xmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_MZONE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_MZONE)
...@@ -36,7 +36,7 @@ end ...@@ -36,7 +36,7 @@ end
function cm.xmop(e,tp,eg,ep,ev,re,r,rp) function cm.xmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local gg=tc:GetOverlayGroup() local gg=tc:GetOverlayGroup()
if not (gg:IsExists(cm.ssfilter,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsRelateToEffect(e)) or tc:IsImmuneToEffect(e) then return end if not (gg:IsExists(cm.ssfilter,1,nil,e,tp) and Duel.GetMZoneCount(tp)>0 and tc:IsRelateToEffect(e)) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=gg:FilterSelect(tp,cm.ssfilter,1,1,nil,e,tp) local sg=gg:FilterSelect(tp,cm.ssfilter,1,1,nil,e,tp)
if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)~=0 then if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)~=0 then
......
...@@ -63,7 +63,7 @@ end ...@@ -63,7 +63,7 @@ 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
local tp=c:GetControler() local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,7,nil) and Senya.CheckNoExtra(e,tp) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,7,nil) and Senya.CheckNoExtra(e,tp)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c) function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
......
...@@ -22,7 +22,7 @@ function cm.filter(c,e,tp) ...@@ -22,7 +22,7 @@ function cm.filter(c,e,tp)
end end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and cm.filter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and cm.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) and Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)==0 end and Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) and Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)==0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp)
......
...@@ -31,7 +31,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp) ...@@ -31,7 +31,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
if Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)==0 then return end if Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)==0 then return end
if not tc:IsLocation(LOCATION_REMOVED) then return end if not tc:IsLocation(LOCATION_REMOVED) then return end
local cp=tc:GetOwner() local cp=tc:GetOwner()
if Duel.GetLocationCount(cp,LOCATION_MZONE)==0 or not tc:IsType(TYPE_MONSTER) then if Duel.GetMZoneCount(cp)==0 or not tc:IsType(TYPE_MONSTER) then
Duel.SendtoGrave(tc,REASON_RULE) Duel.SendtoGrave(tc,REASON_RULE)
return return
end end
......
...@@ -20,7 +20,7 @@ function cm.filter(c,e,tp) ...@@ -20,7 +20,7 @@ function cm.filter(c,e,tp)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED+LOCATION_GRAVE) and cm.filter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_REMOVED+LOCATION_GRAVE) and cm.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingTarget(cm.filter,tp,LOCATION_REMOVED+LOCATION_GRAVE,LOCATION_REMOVED+LOCATION_GRAVE,1,nil,e,tp) end and Duel.IsExistingTarget(cm.filter,tp,LOCATION_REMOVED+LOCATION_GRAVE,LOCATION_REMOVED+LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_REMOVED+LOCATION_GRAVE,LOCATION_REMOVED+LOCATION_GRAVE,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_REMOVED+LOCATION_GRAVE,LOCATION_REMOVED+LOCATION_GRAVE,1,1,nil,e,tp)
......
...@@ -36,7 +36,7 @@ function cm.filter2(c,e,tp) ...@@ -36,7 +36,7 @@ function cm.filter2(c,e,tp)
end end
function cm.op(e,tp,eg,ep,ev,re,r,rp) function cm.op(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(cm.filter2,nil,e,tp) local g=eg:Filter(cm.filter2,nil,e,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<g:GetCount() then return end if Duel.GetMZoneCount(tp)<g:GetCount() then return end
local tc=g:GetFirst() local tc=g:GetFirst()
while tc do while tc do
if Duel.GetControl(tc,tp) then if Duel.GetControl(tc,tp) then
......
...@@ -67,7 +67,7 @@ function cm.tlimit(e,c) ...@@ -67,7 +67,7 @@ function cm.tlimit(e,c)
end end
function cm.ttcon(e,c) function cm.ttcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-3 and Duel.GetTributeCount(c)>=3 and Senya.CheckNoExtra(e,c:GetControler()) return Duel.GetMZoneCount(c:GetControler())>-3 and Duel.GetTributeCount(c)>=3 and Senya.CheckNoExtra(e,c:GetControler())
end end
function cm.ttop(e,tp,eg,ep,ev,re,r,rp,c) function cm.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3) local g=Duel.SelectTribute(tp,c,3,3)
......
...@@ -36,7 +36,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -36,7 +36,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg1=Duel.GetRitualMaterial(tp) local mg1=Duel.GetRitualMaterial(tp)
local mg2=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_GRAVE,0,nil) local mg2=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_GRAVE,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
return ft>-1 and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg1,mg2,ft) return ft>-1 and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg1,mg2,ft)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
...@@ -44,7 +44,7 @@ end ...@@ -44,7 +44,7 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetRitualMaterial(tp) local mg1=Duel.GetRitualMaterial(tp)
local mg2=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_GRAVE,0,nil) local mg2=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_GRAVE,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg1,mg2,ft) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg1,mg2,ft)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -62,7 +62,7 @@ function cm.filter(c,e,tp) ...@@ -62,7 +62,7 @@ function cm.filter(c,e,tp)
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and cm.filter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and cm.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingTarget(cm.filter,tp,0,LOCATION_GRAVE,1,nil,e,tp) end and Duel.IsExistingTarget(cm.filter,tp,0,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.filter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,cm.filter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp)
......
...@@ -24,7 +24,7 @@ function cm.spfilter(c,e,tp,code) ...@@ -24,7 +24,7 @@ function cm.spfilter(c,e,tp,code)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and cm.filter(chkc,e,tp) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and cm.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end and Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
...@@ -32,7 +32,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -32,7 +32,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,tc:GetCode()) local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,tc:GetCode())
......
...@@ -49,7 +49,7 @@ function cm.spfilter(c) ...@@ -49,7 +49,7 @@ function cm.spfilter(c)
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
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 return Duel.GetMZoneCount(c:GetControler())>0
and Duel.IsExistingMatchingCard(cm.spfilter,c:GetControler(),LOCATION_HAND,0,3,c) and Senya.CheckNoExtra(e,c:GetControler()) and Duel.IsExistingMatchingCard(cm.spfilter,c:GetControler(),LOCATION_HAND,0,3,c) and Senya.CheckNoExtra(e,c:GetControler())
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c) function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
......
...@@ -32,7 +32,7 @@ function cm.dfilter(c,ft) ...@@ -32,7 +32,7 @@ function cm.dfilter(c,ft)
return c:IsRace(RACE_ZOMBIE) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsDestructable() and c:IsFaceup() return c:IsRace(RACE_ZOMBIE) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsDestructable() and c:IsFaceup()
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.dfilter(chkc,ft) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.dfilter(chkc,ft) end
if chk==0 then return Duel.IsExistingTarget(cm.dfilter,tp,LOCATION_MZONE,0,1,nil,ft) and Duel.IsPlayerCanDraw(tp,1) end if chk==0 then return Duel.IsExistingTarget(cm.dfilter,tp,LOCATION_MZONE,0,1,nil,ft) and Duel.IsPlayerCanDraw(tp,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
......
...@@ -49,7 +49,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -49,7 +49,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
end end
Duel.Remove(token,POS_FACEUP,REASON_RULE) Duel.Remove(token,POS_FACEUP,REASON_RULE)
Duel.Hint(HINT_CARD,0,token:GetOriginalCode()) Duel.Hint(HINT_CARD,0,token:GetOriginalCode())
if token:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummon(tp) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then if token:IsType(TYPE_MONSTER) and Duel.GetMZoneCount(tp)>0 and Duel.IsPlayerCanSpecialSummon(tp) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.SpecialSummon(token,0,tp,tp,true,true,POS_FACEUP) Duel.SpecialSummon(token,0,tp,tp,true,true,POS_FACEUP)
else else
Duel.SendtoHand(token,tp,REASON_RULE) Duel.SendtoHand(token,tp,REASON_RULE)
......
...@@ -142,7 +142,7 @@ function cm.spptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -142,7 +142,7 @@ function cm.spptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local sumtype=c:GetSummonType() local sumtype=c:GetSummonType()
if chk==0 then if chk==0 then
return not (bit.band(sumtype,SUMMON_TYPE_FUSION)~=SUMMON_TYPE_FUSION or mg:GetCount()==0 return not (bit.band(sumtype,SUMMON_TYPE_FUSION)~=SUMMON_TYPE_FUSION or mg:GetCount()==0
or mg:GetCount()>Duel.GetLocationCount(tp,LOCATION_MZONE) or mg:GetCount()>Duel.GetMZoneCount(tp)
or mg:IsExists(cm.mgfilter,1,nil,e,tp,c)) or mg:IsExists(cm.mgfilter,1,nil,e,tp,c))
end end
mg:KeepAlive() mg:KeepAlive()
...@@ -163,7 +163,7 @@ function cm.sppop(e,tp,eg,ep,ev,re,r,rp) ...@@ -163,7 +163,7 @@ function cm.sppop(e,tp,eg,ep,ev,re,r,rp)
local g=mg:Clone() local g=mg:Clone()
mg:DeleteGroup() mg:DeleteGroup()
if not (g:GetCount()==0 if not (g:GetCount()==0
or g:GetCount()>Duel.GetLocationCount(tp,LOCATION_MZONE) or g:GetCount()>Duel.GetMZoneCount(tp)
or g:IsExists(cm.mgfilterx,1,nil,e,tp,c)) then or g:IsExists(cm.mgfilterx,1,nil,e,tp,c)) then
local tc=g:GetFirst() local tc=g:GetFirst()
while tc do while tc do
......
...@@ -28,12 +28,12 @@ function cm.filter(c,e,tp) ...@@ -28,12 +28,12 @@ function cm.filter(c,e,tp)
and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup())
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,3,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,3,tp,LOCATION_HAND)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local ft=math.min(Duel.GetLocationCount(tp,LOCATION_MZONE),3) local ft=math.min(Duel.GetMZoneCount(tp),3)
if ft<=0 then return end if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local tg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_HAND,0,nil,e,tp) local tg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_HAND,0,nil,e,tp)
......
...@@ -95,14 +95,14 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -95,14 +95,14 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=e:GetLabel() or 0 local ft=e:GetLabel() or 0
e:SetLabel(0) e:SetLabel(0)
local ct=-ft local ct=-ft
return Duel.GetLocationCount(tp,LOCATION_MZONE)>ct return Duel.GetMZoneCount(tp)>ct
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp)
end end
e:SetLabel(0) e:SetLabel(0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not e:GetHandler():IsRelateToEffect(e) then return end if Duel.GetMZoneCount(tp)<=0 or not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -61,14 +61,14 @@ end ...@@ -61,14 +61,14 @@ end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg,ft) return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg,ft)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg,ft) local tg=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg,ft)
local tc=tg:GetFirst() local tc=tg:GetFirst()
......
...@@ -91,7 +91,7 @@ end ...@@ -91,7 +91,7 @@ end
function cm.sfilter(c,e,tp) function cm.sfilter(c,e,tp)
if c:IsType(TYPE_MONSTER) then if c:IsType(TYPE_MONSTER) then
return c:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) return c:IsType(TYPE_MONSTER) and Duel.GetMZoneCount(tp)>0 and (not c:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp)>0) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
else else
return (c:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0) and c:IsSSetable() return (c:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0) and c:IsSSetable()
end end
......
...@@ -15,11 +15,11 @@ function cm.filter(c) ...@@ -15,11 +15,11 @@ function cm.filter(c)
return c:IsType(TYPE_MONSTER) return c:IsType(TYPE_MONSTER)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil) end and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil) end
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -66,7 +66,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp) ...@@ -66,7 +66,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
tc=g:GetNext() tc=g:GetNext()
end end
for i,t in pairs(tokent) do for i,t in pairs(tokent) do
if Duel.GetLocationCount(p,LOCATION_MZONE)>0 then if Duel.GetMZoneCount(p)>0 then
local token=Duel.CreateToken(t.p,m+1) local token=Duel.CreateToken(t.p,m+1)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
......
...@@ -72,7 +72,7 @@ function cm.ffilter(c,e,tp,m,f,chkf) ...@@ -72,7 +72,7 @@ function cm.ffilter(c,e,tp,m,f,chkf)
end end
cm.tg={ cm.tg={
[1]=function(e,tp,eg,ep,ev,re,r,rp,chk) [1]=function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_HAND,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end, end,
...@@ -104,7 +104,7 @@ end, ...@@ -104,7 +104,7 @@ end,
cm.op={ cm.op={
[1]=function(e,tp,eg,ep,ev,re,r,rp) [1]=function(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter1,tp,LOCATION_HAND,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.filter1,tp,LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -48,7 +48,7 @@ function cm.nfilter(c,g,t) ...@@ -48,7 +48,7 @@ function cm.nfilter(c,g,t)
return true return true
end end
function cm.fieldcheck(tp,mgf,sgf,co) function cm.fieldcheck(tp,mgf,sgf,co)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)-sgf:GetCount()+mgf:FilterCount(cm.ffilter,nil,tp) local ft=Duel.GetMZoneCount(tp)-sgf:GetCount()+mgf:FilterCount(cm.ffilter,nil,tp)
for fc,mg in pairs(co) do for fc,mg in pairs(co) do
ft=ft+mg:FilterCount(cm.ffilter,nil,tp) ft=ft+mg:FilterCount(cm.ffilter,nil,tp)
end end
......
...@@ -88,7 +88,7 @@ end ...@@ -88,7 +88,7 @@ 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)
local c=e:GetHandler() local c=e:GetHandler()
local og=e:GetHandler():GetOverlayGroup() local og=e:GetHandler():GetOverlayGroup()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
if chkc then return false end if chkc then return false end
if chk==0 then return ft>=-1 and Duel.IsExistingTarget(cm.filter1,tp,LOCATION_MZONE,0,1,c,e,tp,og,ft) end if chk==0 then return ft>=-1 and Duel.IsExistingTarget(cm.filter1,tp,LOCATION_MZONE,0,1,c,e,tp,og,ft) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
...@@ -107,7 +107,7 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -107,7 +107,7 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() or c:IsControler(1-tp) then return end if not c:IsRelateToEffect(e) or c:IsFacedown() or c:IsControler(1-tp) then return end
local og=e:GetHandler():GetOverlayGroup() local og=e:GetHandler():GetOverlayGroup()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
if ft<0 then return end if ft<0 then return end
local mg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local mg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if mg:IsExists(cm.counterfilter,1,nil,e) then return end if mg:IsExists(cm.counterfilter,1,nil,e) then return end
......
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
local m=37564335 local m=37564335
local cm=_G["c"..m] local cm=_G["c"..m]
xpcall(function() require("expansions/script/c37564765") end,function() require("script/c37564765") end) xpcall(function() require("expansions/script/c37564765") end,function() require("script/c37564765") end)
cm.dfc_front_side=m cm.dfc_front_side=m+1
cm.dfc_back_side=m+1
cm.fit_monster={m+1} cm.fit_monster={m+1}
function cm.initial_effect(c) function cm.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -26,12 +25,12 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -26,12 +25,12 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(0) e:SetLabel(0)
if chk==0 then if chk==0 then
local c=e:GetHandler() local c=e:GetHandler()
local tcode=c.dfc_back_side local tcode=c.dfc_front_side
if not tcode or l~=1 then return false end if not tcode or l~=1 then return false end
local tempc=Senya.IgnoreActionCheck(Duel.CreateToken,tp,tcode) local tempc=Senya.IgnoreActionCheck(Duel.CreateToken,tp,tcode)
if not tempc:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,true) then return false end if not tempc:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,true) then return false end
local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsCanBeRitualMaterial,e:GetHandler(),tempc) local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsCanBeRitualMaterial,e:GetHandler(),tempc)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
if ft<0 then return false end if ft<0 then return false end
if ft>0 then if ft>0 then
return mg:CheckWithSumGreater(Card.GetRitualLevel,tempc:GetLevel(),tempc) return mg:CheckWithSumGreater(Card.GetRitualLevel,tempc:GetLevel(),tempc)
...@@ -45,10 +44,10 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -45,10 +44,10 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
e:SetLabel(1) e:SetLabel(1)
if not cm.target(e,tp,eg,ep,ev,re,r,rp,0) or c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsControler(1-tp) or c:IsImmuneToEffect(e) then return end if not cm.target(e,tp,eg,ep,ev,re,r,rp,0) or c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsControler(1-tp) or c:IsImmuneToEffect(e) then return end
local tcode=c.dfc_back_side local tcode=c.dfc_front_side
local tempc=Duel.CreateToken(tp,tcode) local tempc=Duel.CreateToken(tp,tcode)
local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsCanBeRitualMaterial,c,tempc) local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsCanBeRitualMaterial,c,tempc)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
local mat=nil local mat=nil
if ft>0 then if ft>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
...@@ -66,6 +65,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -66,6 +65,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.BreakEffect() Duel.BreakEffect()
c:SetEntityCode(tcode,true) c:SetEntityCode(tcode,true)
c:ReplaceEffect(tcode,0,0) c:ReplaceEffect(tcode,0,0)
Duel.SetMetatable(c,_G["c"..tcode])
Duel.Hint(11,0,m*16) Duel.Hint(11,0,m*16)
Duel.Hint(HINT_CARD,0,m+1) Duel.Hint(HINT_CARD,0,m+1)
Duel.ConfirmCards(tp,Group.FromCards(c)) Duel.ConfirmCards(tp,Group.FromCards(c))
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
local m=37564336 local m=37564336
local cm=_G["c"..m] local cm=_G["c"..m]
xpcall(function() require("expansions/script/c37564765") end,function() require("script/c37564765") end) xpcall(function() require("expansions/script/c37564765") end,function() require("script/c37564765") end)
cm.dfc_back_side=m-1
function cm.initial_effect(c) function cm.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
Senya.DFCBackSideCommonEffect(c) Senya.DFCBackSideCommonEffect(c)
......
...@@ -6,6 +6,7 @@ function cm.initial_effect(c) ...@@ -6,6 +6,7 @@ function cm.initial_effect(c)
--link summon --link summon
aux.AddLinkProcedure(c,aux.TRUE,4) aux.AddLinkProcedure(c,aux.TRUE,4)
c:EnableReviveLimit() c:EnableReviveLimit()
Senya.AddSummonMusic(c,m*16+1,SUMMON_TYPE_LINK)
--atk --atk
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
......
...@@ -11,7 +11,7 @@ function cm.filter(c,e,tp) ...@@ -11,7 +11,7 @@ function cm.filter(c,e,tp)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and cm.filter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and cm.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end and Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp)
......
...@@ -10,12 +10,12 @@ function cm.filter(c,e,tp) ...@@ -10,12 +10,12 @@ function cm.filter(c,e,tp)
return Senya.CheckPrism(c) and not c:IsCode(m) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return Senya.CheckPrism(c) and not c:IsCode(m) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
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 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -44,7 +44,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -44,7 +44,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and cm.filter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and cm.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end and Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
......
...@@ -28,13 +28,13 @@ function cm.filter2(c,code) ...@@ -28,13 +28,13 @@ function cm.filter2(c,code)
return c:IsCode(code) and c:IsAbleToHand() return c:IsCode(code) and c:IsAbleToHand()
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
......
...@@ -10,12 +10,12 @@ function cm.filter(c,e,tp) ...@@ -10,12 +10,12 @@ function cm.filter(c,e,tp)
return Senya.CheckPrism(c) and not c:IsCode(37564422) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:GetLevel()==3 and Duel.GetFlagEffect(tp,c:GetCode())==0 return Senya.CheckPrism(c) and not c:IsCode(37564422) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:GetLevel()==3 and Duel.GetFlagEffect(tp,c:GetCode())==0
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 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -59,7 +59,7 @@ function cm.tdop(e,tp,eg,ep,ev,re,r,rp) ...@@ -59,7 +59,7 @@ function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
local sg=ag:Filter(cm.tfilter,nil,e,tp) local sg=ag:Filter(cm.tfilter,nil,e,tp)
if sg:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>=sg:GetCount() and not (sg:GetCount()>1 and Duel.IsPlayerAffectedByEffect(tp,59822133)) then if sg:GetCount()>0 and Duel.GetMZoneCount(tp)>=sg:GetCount() and not (sg:GetCount()>1 and Duel.IsPlayerAffectedByEffect(tp,59822133)) then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
local cval=math.floor(val[1]/2) local cval=math.floor(val[1]/2)
Duel.BreakEffect() Duel.BreakEffect()
...@@ -72,12 +72,12 @@ function cm.filter(c,e,tp) ...@@ -72,12 +72,12 @@ function cm.filter(c,e,tp)
return Senya.CheckPrism(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:GetLevel()==3 and Duel.GetFlagEffect(tp,c:GetCode())==0 return Senya.CheckPrism(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:GetLevel()==3 and Duel.GetFlagEffect(tp,c:GetCode())==0
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 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -50,13 +50,13 @@ function cm.sfilter(c,e,tp) ...@@ -50,13 +50,13 @@ function cm.sfilter(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 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.sfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.sfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.sfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.sfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
...@@ -109,7 +109,7 @@ function cm.filter(c) ...@@ -109,7 +109,7 @@ function cm.filter(c)
return c:IsFaceup() and c:IsCanTurnSet() return c:IsFaceup() and c:IsCanTurnSet()
end end
function cm.chtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.chtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(rp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(rp)>0
and re:GetHandler():IsCanBeSpecialSummoned(re,0,rp,false,false) and not re:GetHandler():IsLocation(LOCATION_MZONE) end and re:GetHandler():IsCanBeSpecialSummoned(re,0,rp,false,false) and not re:GetHandler():IsLocation(LOCATION_MZONE) end
end end
function cm.chop(e,tp,eg,ep,ev,re,r,rp) function cm.chop(e,tp,eg,ep,ev,re,r,rp)
...@@ -117,7 +117,7 @@ function cm.chop(e,tp,eg,ep,ev,re,r,rp) ...@@ -117,7 +117,7 @@ function cm.chop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeChainOperation(ev,cm.repop) Duel.ChangeChainOperation(ev,cm.repop)
end end
function cm.repop(e,tp,eg,ep,ev,re,r,rp) function cm.repop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc and tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) then if e:GetHandler():IsRelateToEffect(e) and tc and tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) then
e:GetHandler():RegisterFlagEffect(37564499,RESET_EVENT+0x1fe0000,0,1) e:GetHandler():RegisterFlagEffect(37564499,RESET_EVENT+0x1fe0000,0,1)
......
...@@ -59,11 +59,11 @@ function cm.spcon(e,c) ...@@ -59,11 +59,11 @@ function cm.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_MZONE,0,nil) local mg=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_MZONE,0,nil)
return Senya.CheckGroup(mg,cm.spgcheck,nil,3,3,Duel.GetLocationCount(tp,LOCATION_MZONE)) return Senya.CheckGroup(mg,cm.spgcheck,nil,3,3,Duel.GetMZoneCount(tp))
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c) function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_MZONE,0,nil) local mg=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_MZONE,0,nil)
local g=Senya.SelectGroup(tp,HINTMSG_RTOHAND,mg,cm.spgcheck,nil,3,3,Duel.GetLocationCount(tp,LOCATION_MZONE)) local g=Senya.SelectGroup(tp,HINTMSG_RTOHAND,mg,cm.spgcheck,nil,3,3,Duel.GetMZoneCount(tp))
c:SetMaterial(g) c:SetMaterial(g)
Duel.SendtoHand(g,nil,REASON_COST+REASON_FUSION+REASON_MATERIAL) Duel.SendtoHand(g,nil,REASON_COST+REASON_FUSION+REASON_MATERIAL)
end end
......
...@@ -33,7 +33,7 @@ function cm.sfilter(c,e,tp,g) ...@@ -33,7 +33,7 @@ function cm.sfilter(c,e,tp,g)
end end
function cm.scheck(g,c,tp) function cm.scheck(g,c,tp)
if c:IsLocation(LOCATION_EXTRA) then return Duel.GetLocationCountFromEx(tp,tp,g,c)>0 end if c:IsLocation(LOCATION_EXTRA) then return Duel.GetLocationCountFromEx(tp,tp,g,c)>0 end
return Duel.GetLocationCount(tp,LOCATION_MZONE)+g:GetCount()>0 return Duel.GetMZoneCount(tp)+g:GetCount()>0
end end
function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.rfilter,tp,LOCATION_MZONE,0,e:GetHandler()) local g=Duel.GetMatchingGroup(cm.rfilter,tp,LOCATION_MZONE,0,e:GetHandler())
...@@ -78,7 +78,7 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp) ...@@ -78,7 +78,7 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local sg=Duel.GetMatchingGroup(cm.sfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil,e,tp) local sg=Duel.GetMatchingGroup(cm.sfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil,e,tp)
local ft=math.min(Duel.GetUsableMZoneCount(tp),ct) local ft=math.min(Duel.GetUsableMZoneCount(tp),ct)
local mft=Duel.GetLocationCount(tp,LOCATION_MZONE) local mft=Duel.GetMZoneCount(tp)
local eft=c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and math.min(c29724053[tp],Duel.GetLocationCountFromEx(tp)) or Duel.GetLocationCountFromEx(tp) local eft=c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and math.min(c29724053[tp],Duel.GetLocationCountFromEx(tp)) or Duel.GetLocationCountFromEx(tp)
local tg=Senya.SelectGroup(tp,HINTMSG_SPSUMMON,sg,cm.gcheck,nil,1,ft,mft,eft) local tg=Senya.SelectGroup(tp,HINTMSG_SPSUMMON,sg,cm.gcheck,nil,1,ft,mft,eft)
local etg=tg:Filter(Card.IsLocation,nil,LOCATION_EXTRA) local etg=tg:Filter(Card.IsLocation,nil,LOCATION_EXTRA)
......
...@@ -21,7 +21,7 @@ function cm.filter(c,e,tp) ...@@ -21,7 +21,7 @@ function cm.filter(c,e,tp)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and cm.filter(chkc,e,tp) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and cm.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and e:GetHandler():IsAbleToDeck() end and Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and e:GetHandler():IsAbleToDeck() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
......
...@@ -19,12 +19,12 @@ function cm.filter(c,e,tp) ...@@ -19,12 +19,12 @@ function cm.filter(c,e,tp)
return Senya.CheckPrism(c) and not c:IsCode(m) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return Senya.CheckPrism(c) and not c:IsCode(m) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
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 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) and e:GetHandler():IsAbleToDeck() end and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) and e:GetHandler():IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
......
...@@ -48,13 +48,13 @@ function cm.ssfilter(c,e,tp) ...@@ -48,13 +48,13 @@ function cm.ssfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) and c:GetOwner()==1-tp return c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) and c:GetOwner()==1-tp
end end
function cm.xmtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.xmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():GetOverlayGroup():IsExists(cm.ssfilter,1,nil,e,tp) and e:GetHandler():IsType(TYPE_XYZ) end if chk==0 then return Duel.GetMZoneCount(tp)>0 and e:GetHandler():GetOverlayGroup():IsExists(cm.ssfilter,1,nil,e,tp) and e:GetHandler():IsType(TYPE_XYZ) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_MZONE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_MZONE)
end end
function cm.xmop(e,tp,eg,ep,ev,re,r,rp) function cm.xmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local gg=c:GetOverlayGroup() local gg=c:GetOverlayGroup()
if not (c:IsRelateToEffect(e) and c:IsFaceup() and c:IsControler(tp) and not c:IsImmuneToEffect(e) and gg:IsExists(cm.ssfilter,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) then return end if not (c:IsRelateToEffect(e) and c:IsFaceup() and c:IsControler(tp) and not c:IsImmuneToEffect(e) and gg:IsExists(cm.ssfilter,1,nil,e,tp) and Duel.GetMZoneCount(tp)>0) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=gg:FilterSelect(tp,cm.ssfilter,1,1,nil,e,tp):GetFirst() local sg=gg:FilterSelect(tp,cm.ssfilter,1,1,nil,e,tp):GetFirst()
if sg and Duel.SpecialSummonStep(sg,0,tp,tp,true,true,POS_FACEUP) then if sg and Duel.SpecialSummonStep(sg,0,tp,tp,true,true,POS_FACEUP) then
......
...@@ -28,7 +28,7 @@ end ...@@ -28,7 +28,7 @@ end
function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then if chk==0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsCanBeRitualMaterial,c,c) local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsCanBeRitualMaterial,c,c)
if c.mat_filter then if c.mat_filter then
mg=mg:Filter(c.mat_filter,nil) mg=mg:Filter(c.mat_filter,nil)
...@@ -49,7 +49,7 @@ function cm.mfilterf(c,tp,mg,rc) ...@@ -49,7 +49,7 @@ function cm.mfilterf(c,tp,mg,rc)
else return false end else return false end
end end
function cm.spop2(e,tp,eg,ep,ev,re,r,rp) function cm.spop2(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
local c=e:GetHandler() local c=e:GetHandler()
local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsCanBeRitualMaterial,c,c) local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsCanBeRitualMaterial,c,c)
......
...@@ -53,7 +53,7 @@ function cm.splimit(e,c) ...@@ -53,7 +53,7 @@ function cm.splimit(e,c)
end end
function cm.ntcon(e,c,minc) function cm.ntcon(e,c,minc)
if c==nil then return true end if c==nil then return true end
return minc==0 and c:GetLevel()>4 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 return minc==0 and c:GetLevel()>4 and Duel.GetMZoneCount(c:GetControler())>0
end end
function cm.ntop(e,tp,eg,ep,ev,re,r,rp,c) function cm.ntop(e,tp,eg,ep,ev,re,r,rp,c)
--change base attack --change base attack
......
...@@ -25,7 +25,7 @@ function cm.initial_effect(c) ...@@ -25,7 +25,7 @@ function cm.initial_effect(c)
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
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0)==0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0)==0 and Duel.GetMZoneCount(c:GetControler())>0
end end
function cm.filter(c,e,tp) function cm.filter(c,e,tp)
return c:IsCode(37564765) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsHasEffect(EFFECT_NECRO_VALLEY) return c:IsCode(37564765) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
...@@ -35,11 +35,11 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -35,11 +35,11 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(0) e:SetLabel(0)
local mft=0 local mft=0
if l==1 and e:GetHandler():GetSequence()<5 then mft=-1 end if l==1 and e:GetHandler():GetSequence()<5 then mft=-1 end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>mft and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end if chk==0 then return Duel.GetMZoneCount(tp)>mft and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK+LOCATION_GRAVE)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
......
...@@ -21,12 +21,12 @@ function cm.filter(c,e,tp) ...@@ -21,12 +21,12 @@ function cm.filter(c,e,tp)
return (c:IsCode(37564765) or c.Senya_desc_with_nanahira) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return (c:IsCode(37564765) or c.Senya_desc_with_nanahira) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
......
...@@ -18,12 +18,12 @@ function cm.filter(c,e,tp) ...@@ -18,12 +18,12 @@ function cm.filter(c,e,tp)
return c:GetLevel()==7 and c:IsRace(RACE_FAIRY) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:GetLevel()==7 and c:IsRace(RACE_FAIRY) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then
......
...@@ -22,7 +22,7 @@ function cm.filter1(c,e,tp) ...@@ -22,7 +22,7 @@ function cm.filter1(c,e,tp)
end end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and cm.filter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and cm.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetMZoneCount(tp)>0 end
local pr1,pr2=e:GetProperty() local pr1,pr2=e:GetProperty()
e:SetProperty(bit.bor(pr1,EFFECT_FLAG_CARD_TARGET),pr2) e:SetProperty(bit.bor(pr1,EFFECT_FLAG_CARD_TARGET),pr2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
...@@ -30,7 +30,7 @@ function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -30,7 +30,7 @@ function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetMZoneCount(tp)>0 end
local pr1,pr2=e:GetProperty() local pr1,pr2=e:GetProperty()
e:SetProperty(pr1-bit.band(pr1,EFFECT_FLAG_CARD_TARGET),pr2) e:SetProperty(pr1-bit.band(pr1,EFFECT_FLAG_CARD_TARGET),pr2)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
...@@ -42,7 +42,7 @@ function cm.op1(e,tp,eg,ep,ev,re,r,rp) ...@@ -42,7 +42,7 @@ function cm.op1(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.op2(e,tp,eg,ep,ev,re,r,rp) function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
local tg=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_GRAVE,0,nil,e,tp) local tg=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_GRAVE,0,nil,e,tp)
if ft<=0 or tg:GetCount()==0 or (ft>1 and tg:GetCount()>1 and Duel.IsPlayerAffectedByEffect(tp,59822133)) then return end if ft<=0 or tg:GetCount()==0 or (ft>1 and tg:GetCount()>1 and Duel.IsPlayerAffectedByEffect(tp,59822133)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
...@@ -82,12 +82,12 @@ function cm.thcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -82,12 +82,12 @@ function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_SZONE) return e:GetHandler():IsPreviousLocation(LOCATION_SZONE)
end end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,m,0,0x21,7,2850,2100,RACE_FAIRY,ATTRIBUTE_LIGHT) end and Duel.IsPlayerCanSpecialSummonMonster(tp,m,0,0x21,7,2850,2100,RACE_FAIRY,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
function cm.thop(e,tp,eg,ep,ev,re,r,rp) function cm.thop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.IsPlayerCanSpecialSummonMonster(tp,m,0,0x21,7,2850,2100,RACE_FAIRY,ATTRIBUTE_LIGHT) then if c:IsRelateToEffect(e) and Duel.IsPlayerCanSpecialSummonMonster(tp,m,0,0x21,7,2850,2100,RACE_FAIRY,ATTRIBUTE_LIGHT) then
--c:AddMonsterAttribute(0,0,0,0,0) --c:AddMonsterAttribute(0,0,0,0,0)
......
...@@ -35,7 +35,7 @@ function cm.ssfilter(c) ...@@ -35,7 +35,7 @@ function cm.ssfilter(c)
end end
function cm.hcon(e,c) function cm.hcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.ssfilter,c:GetControler(),LOCATION_MZONE,0,1,nil) and c:IsFaceup() and not c:IsDisabled() return Duel.GetMZoneCount(c:GetControler())>0 and Duel.IsExistingMatchingCard(cm.ssfilter,c:GetControler(),LOCATION_MZONE,0,1,nil) and c:IsFaceup() and not c:IsDisabled()
end end
function cm.spcon2(e,tp,eg,ep,ev,re,r,rp) function cm.spcon2(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0 return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
...@@ -44,12 +44,12 @@ function cm.spfilter(c,e,tp) ...@@ -44,12 +44,12 @@ function cm.spfilter(c,e,tp)
return c:IsCode(37564765) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(37564765) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function cm.spop2(e,tp,eg,ep,ev,re,r,rp) function cm.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
......
...@@ -47,7 +47,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -47,7 +47,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SSet(tp,g:GetFirst()) Duel.SSet(tp,g:GetFirst())
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
--[[if tc:GetOriginalCode()==37564765 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) then --[[if tc:GetOriginalCode()==37564765 and Duel.GetMZoneCount(tp)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end]] end]]
end end
......
...@@ -33,7 +33,7 @@ end ...@@ -33,7 +33,7 @@ end
function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then if chk==0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
local mg=Duel.GetRitualMaterial(tp):Filter(cm.matfilter,c,c) local mg=Duel.GetRitualMaterial(tp):Filter(cm.matfilter,c,c)
if c.mat_filter then if c.mat_filter then
mg=mg:Filter(c.mat_filter,nil) mg=mg:Filter(c.mat_filter,nil)
...@@ -54,7 +54,7 @@ function cm.mfilterf(c,tp,mg,rc) ...@@ -54,7 +54,7 @@ function cm.mfilterf(c,tp,mg,rc)
else return false end else return false end
end end
function cm.spop2(e,tp,eg,ep,ev,re,r,rp) function cm.spop2(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
local c=e:GetHandler() local c=e:GetHandler()
local mg=Duel.GetRitualMaterial(tp):Filter(cm.matfilter,c,c) local mg=Duel.GetRitualMaterial(tp):Filter(cm.matfilter,c,c)
......
...@@ -46,7 +46,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -46,7 +46,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg1=Duel.GetRitualMaterial(tp) local mg1=Duel.GetRitualMaterial(tp)
local mg2=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_GRAVE,0,nil) local mg2=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_GRAVE,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
return ft>-1 and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg1,mg2,ft) return ft>-1 and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg1,mg2,ft)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
...@@ -54,7 +54,7 @@ end ...@@ -54,7 +54,7 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetRitualMaterial(tp) local mg1=Duel.GetRitualMaterial(tp)
local mg2=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_GRAVE,0,nil) local mg2=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_GRAVE,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg1,mg2,ft) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg1,mg2,ft)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -43,7 +43,7 @@ end ...@@ -43,7 +43,7 @@ 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
local tp=c:GetControler() local tp=c:GetControler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end if Duel.GetMZoneCount(tp)<=0 then return false end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
return g:GetCount()==1 and Senya.NanahiraFilter(tc,true) return g:GetCount()==1 and Senya.NanahiraFilter(tc,true)
......
...@@ -29,7 +29,7 @@ function cm.initial_effect(c) ...@@ -29,7 +29,7 @@ function cm.initial_effect(c)
e1:SetRange(LOCATION_GRAVE) e1:SetRange(LOCATION_GRAVE)
e1:SetCondition(function(e,c) e1:SetCondition(function(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and c:GetFlagEffect(m)>0 return Duel.GetMZoneCount(c:GetControler())>0 and c:GetFlagEffect(m)>0
end) end)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -55,11 +55,11 @@ end ...@@ -55,11 +55,11 @@ end
function cm.bmrlcon(e,c) function cm.bmrlcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
return ft>-1 and Duel.CheckReleaseGroup(tp,cm.bmrlfilter,1,nil,ft) return ft>-1 and Duel.CheckReleaseGroup(tp,cm.bmrlfilter,1,nil,ft)
end end
function cm.bmrlop(e,tp,eg,ep,ev,re,r,rp,c) function cm.bmrlop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
local g=Duel.SelectReleaseGroup(tp,cm.bmrlfilter,1,1,nil,ft) local g=Duel.SelectReleaseGroup(tp,cm.bmrlfilter,1,1,nil,ft)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
......
...@@ -50,7 +50,7 @@ end ...@@ -50,7 +50,7 @@ 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
local tp=c:GetControler() local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,3,nil) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,3,nil)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c) function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
......
...@@ -49,7 +49,7 @@ function cm.filter1(c,e,tp) ...@@ -49,7 +49,7 @@ function cm.filter1(c,e,tp)
end end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and cm.filter1(chkc,e,tp) and chkc:IsControler(tp) and chkc~=e:GetHandler() end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and cm.filter1(chkc,e,tp) and chkc:IsControler(tp) and chkc~=e:GetHandler() end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingTarget(cm.filter1,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e,tp) end and Duel.IsExistingTarget(cm.filter1,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.filter1,tp,LOCATION_GRAVE,0,1,1,e:GetHandler(),e,tp) local g=Duel.SelectTarget(tp,cm.filter1,tp,LOCATION_GRAVE,0,1,1,e:GetHandler(),e,tp)
......
...@@ -35,7 +35,7 @@ function cm.spcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -35,7 +35,7 @@ function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.spfilter,1,nil,1-tp) return eg:IsExists(cm.spfilter,1,nil,1-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 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
...@@ -53,7 +53,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -53,7 +53,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SSet(tp,g) Duel.SSet(tp,g)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
elseif Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then elseif Duel.GetMZoneCount(tp)<=0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.SendtoGrave(c,REASON_RULE) Duel.SendtoGrave(c,REASON_RULE)
end end
end end
\ No newline at end of file
...@@ -28,7 +28,7 @@ function cm.filter(c,e,tp) ...@@ -28,7 +28,7 @@ function cm.filter(c,e,tp)
end end
function cm.setfilter(c,e,tp) function cm.setfilter(c,e,tp)
if c:IsLocation(LOCATION_HAND+LOCATION_DECK) then return false end if c:IsLocation(LOCATION_HAND+LOCATION_DECK) then return false end
if c:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) then return true end if c:IsType(TYPE_MONSTER) and Duel.GetMZoneCount(tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) then return true end
if (c:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0) and c:IsSSetable() then return true end if (c:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0) and c:IsSSetable() then return true end
return false return false
end end
......
...@@ -104,7 +104,7 @@ function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -104,7 +104,7 @@ function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if not tc or tc:GetFlagEffect(m)==0 or not tc:IsAbleToExtra() then return false end if not tc or tc:GetFlagEffect(m)==0 or not tc:IsAbleToExtra() then return false end
local ft=0 local ft=0
if tc:IsControler(tp) then ft=-1 end if tc:IsControler(tp) then ft=-1 end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=ft then return false end if Duel.GetMZoneCount(tp)<=ft then return false end
if not Duel.IsExistingMatchingCard(cm.f2,tp,LOCATION_EXTRA,0,1,tc,e,tp,tc) then return false end if not Duel.IsExistingMatchingCard(cm.f2,tp,LOCATION_EXTRA,0,1,tc,e,tp,tc) then return false end
return tc==Duel.GetAttacker() or tc==Duel.GetAttackTarget() return tc==Duel.GetAttacker() or tc==Duel.GetAttackTarget()
end end
......
...@@ -224,12 +224,12 @@ function cm.CopySpellChainingFilter(c,e,tp,eg,ep,ev,re,r,rp) ...@@ -224,12 +224,12 @@ function cm.CopySpellChainingFilter(c,e,tp,eg,ep,ev,re,r,rp)
return true return true
end end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,m,0,0x21,7,2850,2100,RACE_FAIRY,ATTRIBUTE_LIGHT) end and Duel.IsPlayerCanSpecialSummonMonster(tp,m,0,0x21,7,2850,2100,RACE_FAIRY,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
function cm.thop(e,tp,eg,ep,ev,re,r,rp) function cm.thop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.IsPlayerCanSpecialSummonMonster(tp,m,0,0x21,7,2850,2100,RACE_FAIRY,ATTRIBUTE_LIGHT) then if c:IsRelateToEffect(e) and Duel.IsPlayerCanSpecialSummonMonster(tp,m,0,0x21,7,2850,2100,RACE_FAIRY,ATTRIBUTE_LIGHT) then
c:AddMonsterAttribute(TYPE_EFFECT) c:AddMonsterAttribute(TYPE_EFFECT)
......
...@@ -59,13 +59,13 @@ function cm.ssfilter(c,e,tp) ...@@ -59,13 +59,13 @@ function cm.ssfilter(c,e,tp)
return c:IsType(TYPE_TRAP) and c.Senya_desc_with_nanahira and Duel.IsPlayerCanSpecialSummonMonster(tp,c:GetOriginalCode(),0,0x21,7,2850,2100,RACE_FAIRY,ATTRIBUTE_LIGHT) return c:IsType(TYPE_TRAP) and c.Senya_desc_with_nanahira and Duel.IsPlayerCanSpecialSummonMonster(tp,c:GetOriginalCode(),0,0x21,7,2850,2100,RACE_FAIRY,ATTRIBUTE_LIGHT)
end end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():GetOverlayGroup():IsExists(cm.ssfilter,1,nil,e,tp) and e:GetHandler():IsType(TYPE_XYZ) end if chk==0 then return Duel.GetMZoneCount(tp)>0 and e:GetHandler():GetOverlayGroup():IsExists(cm.ssfilter,1,nil,e,tp) and e:GetHandler():IsType(TYPE_XYZ) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_MZONE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_MZONE)
end end
function cm.op(e,tp,eg,ep,ev,re,r,rp) function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local gg=c:GetOverlayGroup() local gg=c:GetOverlayGroup()
if not (c:IsRelateToEffect(e) and c:IsFaceup() and c:IsControler(tp) and not c:IsImmuneToEffect(e) and gg:IsExists(cm.ssfilter,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) then return end if not (c:IsRelateToEffect(e) and c:IsFaceup() and c:IsControler(tp) and not c:IsImmuneToEffect(e) and gg:IsExists(cm.ssfilter,1,nil,e,tp) and Duel.GetMZoneCount(tp)>0) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=gg:FilterSelect(tp,cm.ssfilter,1,1,nil,e,tp):GetFirst() local sc=gg:FilterSelect(tp,cm.ssfilter,1,1,nil,e,tp):GetFirst()
if sc then if sc then
......
...@@ -34,7 +34,7 @@ function cm.sfilter(c,e,tp) ...@@ -34,7 +34,7 @@ function cm.sfilter(c,e,tp)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil,e) local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil,e)
if chk==0 then return Duel.IsExistingMatchingCard(cm.sfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and Senya.CheckGroup(g,cm.gcheck,nil,3,3,ft) end if chk==0 then return Duel.IsExistingMatchingCard(cm.sfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and Senya.CheckGroup(g,cm.gcheck,nil,3,3,ft) end
local tg=Senya.SelectGroup(tp,HINTMSG_TOGRAVE,g,cm.gcheck,nil,3,3,ft) local tg=Senya.SelectGroup(tp,HINTMSG_TOGRAVE,g,cm.gcheck,nil,3,3,ft)
...@@ -52,7 +52,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,7 +52,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if not g or g:FilterCount(cm.chkfilter,nil,e,tp)~=3 then return end if not g or g:FilterCount(cm.chkfilter,nil,e,tp)~=3 then return end
local v=g:GetSum(cm.val) local v=g:GetSum(cm.val)
Duel.SendtoGrave(g,REASON_EFFECT) Duel.SendtoGrave(g,REASON_EFFECT)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.sfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local sg=Duel.SelectMatchingCard(tp,cm.sfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=sg:GetFirst() local tc=sg:GetFirst()
......
...@@ -33,14 +33,14 @@ function cm.otcon(e,c,minc) ...@@ -33,14 +33,14 @@ function cm.otcon(e,c,minc)
local tp=c:GetControler() local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(cm.otfilter,tp,LOCATION_SZONE,0,nil) local mg=Duel.GetMatchingGroup(cm.otfilter,tp,LOCATION_SZONE,0,nil)
return c:GetLevel()>6 and minc<=2 return c:GetLevel()>6 and minc<=2
and (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and mg:GetCount()>=2 and (Duel.GetMZoneCount(tp)>0 and mg:GetCount()>=2
or Duel.CheckTribute(c,1) and mg:GetCount()>=1) or Duel.CheckTribute(c,1) and mg:GetCount()>=1)
or c:GetLevel()>4 and c:GetLevel()<=6 and minc<=1 or c:GetLevel()>4 and c:GetLevel()<=6 and minc<=1
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and mg:GetCount()>=1 and Duel.GetMZoneCount(tp)>0 and mg:GetCount()>=1
end end
function cm.otop(e,tp,eg,ep,ev,re,r,rp,c) function cm.otop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(cm.otfilter,tp,LOCATION_SZONE,0,nil) local mg=Duel.GetMatchingGroup(cm.otfilter,tp,LOCATION_SZONE,0,nil)
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and mg:GetCount()>=2 local b1=Duel.GetMZoneCount(tp)>0 and mg:GetCount()>=2
local b2=Duel.CheckTribute(c,1) local b2=Duel.CheckTribute(c,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=mg:Select(tp,1,1,nil) local g=mg:Select(tp,1,1,nil)
......
...@@ -64,14 +64,14 @@ function cm.spfilter(c,e,tp,m) ...@@ -64,14 +64,14 @@ function cm.spfilter(c,e,tp,m)
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
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end if Duel.GetMZoneCount(tp)<=0 then return false end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e)
return cm.spfilter(e:GetHandler(),e,tp,mg) return cm.spfilter(e:GetHandler(),e,tp,mg)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,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)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg) local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg)
......
...@@ -91,14 +91,14 @@ function cm.spfilter(c,e,tp,m) ...@@ -91,14 +91,14 @@ function cm.spfilter(c,e,tp,m)
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
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end if Duel.GetMZoneCount(tp)<=0 then return false end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e)
return cm.spfilter(e:GetHandler(),e,tp,mg) return cm.spfilter(e:GetHandler(),e,tp,mg)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,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)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg) local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg)
......
...@@ -82,7 +82,7 @@ end ...@@ -82,7 +82,7 @@ end
function cm.retop(e,tp,eg,ep,ev,re,r,rp) function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject():Filter(cm.rfilter,nil,e,tp) local g=e:GetLabelObject():Filter(cm.rfilter,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<g:GetCount() then if Duel.GetMZoneCount(tp)<g:GetCount() then
Duel.SpecialSummon(g,0,tp,tp,true,true,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,true,true,POS_FACEUP)
end end
e:Reset() e:Reset()
...@@ -132,14 +132,14 @@ function cm.spfilter(c,e,tp,m) ...@@ -132,14 +132,14 @@ function cm.spfilter(c,e,tp,m)
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
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end if Duel.GetMZoneCount(tp)<=0 then return false end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e)
return cm.spfilter(e:GetHandler(),e,tp,mg) return cm.spfilter(e:GetHandler(),e,tp,mg)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,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)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg) local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg)
......
...@@ -98,14 +98,14 @@ function cm.spfilter(c,e,tp,m) ...@@ -98,14 +98,14 @@ function cm.spfilter(c,e,tp,m)
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
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end if Duel.GetMZoneCount(tp)<=0 then return false end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e)
return cm.spfilter(e:GetHandler(),e,tp,mg) return cm.spfilter(e:GetHandler(),e,tp,mg)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,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)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg) local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg)
......
...@@ -60,14 +60,14 @@ function cm.spfilter(c,e,tp,m) ...@@ -60,14 +60,14 @@ function cm.spfilter(c,e,tp,m)
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
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end if Duel.GetMZoneCount(tp)<=0 then return false end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e)
return cm.spfilter(e:GetHandler(),e,tp,mg) return cm.spfilter(e:GetHandler(),e,tp,mg)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,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)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg) local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg)
......
...@@ -62,13 +62,13 @@ function cm.filter(c,e,tp,mg) ...@@ -62,13 +62,13 @@ function cm.filter(c,e,tp,mg)
end end
function cm.sptg1(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=e:GetHandler():GetMaterial() local mg=e:GetHandler():GetMaterial()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp,mg) end and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp,mg) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end end
function cm.spop1(e,tp,eg,ep,ev,re,r,rp) function cm.spop1(e,tp,eg,ep,ev,re,r,rp)
local mg=e:GetHandler():GetMaterial() local mg=e:GetHandler():GetMaterial()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg)
local tc=g:GetFirst() local tc=g:GetFirst()
...@@ -109,14 +109,14 @@ function cm.spfilter(c,e,tp,m) ...@@ -109,14 +109,14 @@ function cm.spfilter(c,e,tp,m)
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
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end if Duel.GetMZoneCount(tp)<=0 then return false end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e)
return cm.spfilter(e:GetHandler(),e,tp,mg) return cm.spfilter(e:GetHandler(),e,tp,mg)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,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)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg) local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg)
......
...@@ -71,7 +71,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -71,7 +71,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
--if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and cm.filter(chkc,e,tp) end --if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and cm.filter(chkc,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_GRAVE,0,e:GetHandler(),e,tp) local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_GRAVE,0,e:GetHandler(),e,tp)
if chk==0 then if chk==0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
return ft>0 and g:CheckWithSumEqual(Card.GetLevel,4,1,ft) return ft>0 and g:CheckWithSumEqual(Card.GetLevel,4,1,ft)
end end
--Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) --Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
...@@ -80,7 +80,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -80,7 +80,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_GRAVE,0,nil,e,tp) local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_GRAVE,0,nil,e,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
if not (ft>0 and g:CheckWithSumEqual(Card.GetLevel,4,1,ft)) then return end if not (ft>0 and g:CheckWithSumEqual(Card.GetLevel,4,1,ft)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectWithSumEqual(tp,Card.GetLevel,4,1,ft) local sg=g:SelectWithSumEqual(tp,Card.GetLevel,4,1,ft)
...@@ -98,14 +98,14 @@ function cm.spfilter(c,e,tp,m) ...@@ -98,14 +98,14 @@ function cm.spfilter(c,e,tp,m)
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
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end if Duel.GetMZoneCount(tp)<=0 then return false end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e)
return cm.spfilter(e:GetHandler(),e,tp,mg) return cm.spfilter(e:GetHandler(),e,tp,mg)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,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)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg) local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg)
......
...@@ -70,7 +70,7 @@ function cm.filter1(c,e,tp) ...@@ -70,7 +70,7 @@ function cm.filter1(c,e,tp)
end end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and cm.filter1(chkc,e,tp) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and cm.filter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingTarget(cm.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end and Duel.IsExistingTarget(cm.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.filter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,cm.filter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
...@@ -94,14 +94,14 @@ function cm.spfilter(c,e,tp,m) ...@@ -94,14 +94,14 @@ function cm.spfilter(c,e,tp,m)
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
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end if Duel.GetMZoneCount(tp)<=0 then return false end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e)
return cm.spfilter(e:GetHandler(),e,tp,mg) return cm.spfilter(e:GetHandler(),e,tp,mg)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,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)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg) local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg)
......
...@@ -60,14 +60,14 @@ function cm.spfilter(c,e,tp,m) ...@@ -60,14 +60,14 @@ function cm.spfilter(c,e,tp,m)
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
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end if Duel.GetMZoneCount(tp)<=0 then return false end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e)
return cm.spfilter(e:GetHandler(),e,tp,mg) return cm.spfilter(e:GetHandler(),e,tp,mg)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,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)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg) local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg)
......
...@@ -44,7 +44,7 @@ function cm.spcon(e,c) ...@@ -44,7 +44,7 @@ function cm.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.IsExistingMatchingCard(cm.sfilter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(cm.sfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.GetMZoneCount(c:GetControler())>0
end end
function cm.reccon(e,tp,eg,ep,ev,re,r,rp) function cm.reccon(e,tp,eg,ep,ev,re,r,rp)
local rc=e:GetHandler():GetReasonCard() local rc=e:GetHandler():GetReasonCard()
...@@ -75,14 +75,14 @@ function cm.spfilter(c,e,tp,m) ...@@ -75,14 +75,14 @@ function cm.spfilter(c,e,tp,m)
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
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end if Duel.GetMZoneCount(tp)<=0 then return false end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e)
return cm.spfilter(e:GetHandler(),e,tp,mg) return cm.spfilter(e:GetHandler(),e,tp,mg)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,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)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg) local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg)
......
...@@ -50,14 +50,14 @@ function cm.spcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -50,14 +50,14 @@ function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil) return eg:IsExists(cm.cfilter,1,nil)
end end
function cm.sptg1(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
function cm.spop1(e,tp,eg,ep,ev,re,r,rp) function cm.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 and Duel.GetMZoneCount(tp)<=0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.SendtoGrave(c,REASON_RULE) Duel.SendtoGrave(c,REASON_RULE)
end end
...@@ -93,14 +93,14 @@ function cm.spfilter(c,e,tp,m) ...@@ -93,14 +93,14 @@ function cm.spfilter(c,e,tp,m)
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
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end if Duel.GetMZoneCount(tp)<=0 then return false end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e)
return cm.spfilter(e:GetHandler(),e,tp,mg) return cm.spfilter(e:GetHandler(),e,tp,mg)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,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)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg) local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg)
......
...@@ -61,14 +61,14 @@ function cm.spfilter(c,e,tp,m) ...@@ -61,14 +61,14 @@ function cm.spfilter(c,e,tp,m)
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
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end if Duel.GetMZoneCount(tp)<=0 then return false end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e)
return cm.spfilter(e:GetHandler(),e,tp,mg) return cm.spfilter(e:GetHandler(),e,tp,mg)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,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)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg) local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg)
......
...@@ -70,14 +70,14 @@ function cm.spfilter(c,e,tp,m) ...@@ -70,14 +70,14 @@ function cm.spfilter(c,e,tp,m)
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
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end if Duel.GetMZoneCount(tp)<=0 then return false end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e)
return cm.spfilter(e:GetHandler(),e,tp,mg) return cm.spfilter(e:GetHandler(),e,tp,mg)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,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)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg) local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg)
......
...@@ -63,14 +63,14 @@ function cm.spfilter(c,e,tp,m) ...@@ -63,14 +63,14 @@ function cm.spfilter(c,e,tp,m)
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
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end if Duel.GetMZoneCount(tp)<=0 then return false end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e)
return cm.spfilter(e:GetHandler(),e,tp,mg) return cm.spfilter(e:GetHandler(),e,tp,mg)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,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)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e) local mg=Duel.GetMatchingGroup(cm.mtfilter,tp,LOCATION_GRAVE,0,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg) local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg)
......
...@@ -143,7 +143,7 @@ end ...@@ -143,7 +143,7 @@ end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local loc=0 local loc=0
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_HAND end if Duel.GetMZoneCount(tp)>0 then loc=loc+LOCATION_HAND end
if Duel.GetLocationCountFromEx(tp)>0 then loc=loc+LOCATION_EXTRA end if Duel.GetLocationCountFromEx(tp)>0 then loc=loc+LOCATION_EXTRA end
if loc==0 then return false end if loc==0 then return false end
local g=nil local g=nil
...@@ -159,7 +159,7 @@ end ...@@ -159,7 +159,7 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if not cm.target(e,tp,eg,ep,ev,re,r,rp,0) then return end if not cm.target(e,tp,eg,ep,ev,re,r,rp,0) then return end
local sg=Group.CreateGroup() local sg=Group.CreateGroup()
local ft1=math.max(Duel.GetLocationCount(tp,LOCATION_MZONE),2) local ft1=math.max(Duel.GetMZoneCount(tp),2)
local ft2=math.max(Duel.GetLocationCountFromEx(tp),2) local ft2=math.max(Duel.GetLocationCountFromEx(tp),2)
local ft=math.max(Duel.GetUsableMZoneCount(tp),2) local ft=math.max(Duel.GetUsableMZoneCount(tp),2)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then if Duel.IsPlayerAffectedByEffect(tp,59822133) then
......
...@@ -20,12 +20,12 @@ if not Duel.GetLocationCountFromEx then ...@@ -20,12 +20,12 @@ if not Duel.GetLocationCountFromEx then
SUMMON_TYPE_LINK=0x4c000000 SUMMON_TYPE_LINK=0x4c000000
EFFECT_CANNOT_BE_LINK_MATERIAL=0 EFFECT_CANNOT_BE_LINK_MATERIAL=0
function Duel.GetLocationCountFromEx(tp,p,sg,c) function Duel.GetLocationCountFromEx(tp,p,sg,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
if sg then ft=ft+sg:FilterCount(aux.FConditionCheckF,nil,tp) end if sg then ft=ft+sg:FilterCount(aux.FConditionCheckF,nil,tp) end
return ft return ft
end end
function Duel.GetUsableMZoneCount(tp) function Duel.GetUsableMZoneCount(tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE) return Duel.GetMZoneCount(tp)
end end
local pz=LOCATION_PZONE local pz=LOCATION_PZONE
LOCATION_PZONE=LOCATION_SZONE LOCATION_PZONE=LOCATION_SZONE
...@@ -497,7 +497,7 @@ function cm.MokouRebornCondition(eff,con) ...@@ -497,7 +497,7 @@ function cm.MokouRebornCondition(eff,con)
end end
function cm.MokouRebornTarget(comp) function cm.MokouRebornTarget(comp)
return function(e,tp,eg,ep,ev,re,r,rp,chk) return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,comp,comp) end and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,comp,comp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
...@@ -505,7 +505,7 @@ end ...@@ -505,7 +505,7 @@ end
function cm.MokouRebornOperation(exop,excon,comp) function cm.MokouRebornOperation(exop,excon,comp)
return function(e,tp,eg,ep,ev,re,r,rp) return function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
if not c:IsRelateToEffect(e) or not c:IsCanBeSpecialSummoned(e,0,tp,comp,comp) then return end if not c:IsRelateToEffect(e) or not c:IsCanBeSpecialSummoned(e,0,tp,comp,comp) then return end
if Duel.SpecialSummon(c,0,tp,tp,comp,comp,POS_FACEUP)>0 and exop and (not excon or excon(e,tp,eg,ep,ev,re,r,rp)) then if Duel.SpecialSummon(c,0,tp,tp,comp,comp,POS_FACEUP)>0 and exop and (not excon or excon(e,tp,eg,ep,ev,re,r,rp)) then
exop(e,tp,eg,ep,ev,re,r,rp) exop(e,tp,eg,ep,ev,re,r,rp)
...@@ -708,7 +708,7 @@ function cm.SawawaSpsummonCost(ct,exf) ...@@ -708,7 +708,7 @@ function cm.SawawaSpsummonCost(ct,exf)
end end
end end
function cm.SelfSpsummonTarget(e,tp,eg,ep,ev,re,r,rp,chk) function cm.SelfSpsummonTarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
...@@ -784,7 +784,7 @@ return function(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -784,7 +784,7 @@ return function(e,tp,eg,ep,ev,re,r,rp,chk)
end end
end end
function cm.PrismSpsummonTarget(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.PrismSpsummonTarget(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.PrismSpsummonFilter(chkc,ft) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.PrismSpsummonFilter(chkc,ft) end
if chk==0 then return ft>-1 if chk==0 then return ft>-1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingTarget(cm.PrismSpsummonFilter,tp,LOCATION_MZONE,0,1,nil,ft) end and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingTarget(cm.PrismSpsummonFilter,tp,LOCATION_MZONE,0,1,nil,ft) end
...@@ -941,11 +941,11 @@ end ...@@ -941,11 +941,11 @@ end
function cm.PrismProcCondition(e,c) function cm.PrismProcCondition(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
return ft>-1 and Duel.CheckReleaseGroup(tp,cm.PrismProcFilter,1,nil,ft) return ft>-1 and Duel.CheckReleaseGroup(tp,cm.PrismProcFilter,1,nil,ft)
end end
function cm.PrismProcOperation(e,tp,eg,ep,ev,re,r,rp,c) function cm.PrismProcOperation(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
local g=Duel.SelectReleaseGroup(tp,cm.PrismProcFilter,1,1,nil,ft) local g=Duel.SelectReleaseGroup(tp,cm.PrismProcFilter,1,1,nil,ft)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
...@@ -1098,7 +1098,7 @@ function cm.PendConditionNanahira() ...@@ -1098,7 +1098,7 @@ function cm.PendConditionNanahira()
if lscale>rscale then lscale,rscale=rscale,lscale end if lscale>rscale then lscale,rscale=rscale,lscale end
local ft=Duel.GetUsableMZoneCount(tp) local ft=Duel.GetUsableMZoneCount(tp)
if ft<=0 then return false end if ft<=0 then return false end
local mft=Duel.GetLocationCount(tp,LOCATION_MZONE) local mft=Duel.GetMZoneCount(tp)
local eft=Duel.GetLocationCountFromEx(tp) local eft=Duel.GetLocationCountFromEx(tp)
local g=nil local g=nil
if og then if og then
...@@ -1152,7 +1152,7 @@ function cm.PendOperationNanahira() ...@@ -1152,7 +1152,7 @@ function cm.PendOperationNanahira()
local rscale=rpz:GetRightScale() local rscale=rpz:GetRightScale()
if lscale>rscale then lscale,rscale=rscale,lscale end if lscale>rscale then lscale,rscale=rscale,lscale end
local ft=Duel.GetUsableMZoneCount(tp) local ft=Duel.GetUsableMZoneCount(tp)
local mft=Duel.GetLocationCount(tp,LOCATION_MZONE) local mft=Duel.GetMZoneCount(tp)
local eft=Duel.GetLocationCountFromEx(tp) local eft=Duel.GetLocationCountFromEx(tp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then if Duel.IsPlayerAffectedByEffect(tp,59822133) then
mft=math.min(1,mft) mft=math.min(1,mft)
...@@ -2435,7 +2435,7 @@ end ...@@ -2435,7 +2435,7 @@ end
function cm.CheckSummonLocation(c,tp,g) function cm.CheckSummonLocation(c,tp,g)
local g=g or Group.CreateGroup() local g=g or Group.CreateGroup()
if c:IsLocation(LOCATION_EXTRA) then return Duel.GetLocationCountFromEx(tp,tp,g,c)>0 end if c:IsLocation(LOCATION_EXTRA) then return Duel.GetLocationCountFromEx(tp,tp,g,c)>0 end
return Duel.GetLocationCount(tp,LOCATION_MZONE)+g:FilterCount(cm.CheckMFilter,nil)>0 return Duel.GetMZoneCount(tp)+g:FilterCount(cm.CheckMFilter,nil)>0
end end
function cm.AND(...) function cm.AND(...)
local t={...} local t={...}
...@@ -2536,14 +2536,17 @@ function cm.DFCBackSideCommonEffect(c) ...@@ -2536,14 +2536,17 @@ function cm.DFCBackSideCommonEffect(c)
e2:SetRange(LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_HAND+LOCATION_EXTRA) e2:SetRange(LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_HAND+LOCATION_EXTRA)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return c.dfc_front_side and c:GetOriginalCode()==c.dfc_back_side local c=e:GetHandler()
return c.dfc_back_side
end) end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local tcode=c.dfc_front_side local c=e:GetHandler()
local tcode=c.dfc_back_side
c:SetEntityCode(tcode) c:SetEntityCode(tcode)
Duel.ConfirmCards(tp,Group.FromCards(c)) Duel.ConfirmCards(tp,Group.FromCards(c))
Duel.ConfirmCards(1-tp,Group.FromCards(c)) Duel.ConfirmCards(1-tp,Group.FromCards(c))
c:ReplaceEffect(tcode,0,0) c:ReplaceEffect(tcode,0,0)
Duel.SetMetatable(c,_G["c"..tcode])
end) end)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
\ No newline at end of file
...@@ -59,7 +59,7 @@ return function(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -59,7 +59,7 @@ return function(e,tp,eg,ep,ev,re,r,rp,chk)
end end
end end
function prim.sesstg(e,tp,eg,ep,ev,re,r,rp,chk) function prim.sesstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
...@@ -117,7 +117,7 @@ function prim.sefilter(c,at,e,tp) ...@@ -117,7 +117,7 @@ function prim.sefilter(c,at,e,tp)
return true return true
elseif at==ATTRIBUTE_FIRE and Duel.IsExistingMatchingCard(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then elseif at==ATTRIBUTE_FIRE and Duel.IsExistingMatchingCard(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then
return true return true
elseif at==ATTRIBUTE_EARTH and Duel.IsExistingMatchingCard(prim.sefilter4,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then elseif at==ATTRIBUTE_EARTH and Duel.IsExistingMatchingCard(prim.sefilter4,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetMZoneCount(tp)>0 then
return true return true
elseif at==ATTRIBUTE_WATER and Duel.IsExistingMatchingCard(prim.sefilter5,tp,LOCATION_DECK,0,1,nil,e,tp) then elseif at==ATTRIBUTE_WATER and Duel.IsExistingMatchingCard(prim.sefilter5,tp,LOCATION_DECK,0,1,nil,e,tp) then
return true return true
...@@ -187,7 +187,7 @@ return function(e,tp,eg,ep,ev,re,r,rp) ...@@ -187,7 +187,7 @@ return function(e,tp,eg,ep,ev,re,r,rp)
Duel.HintSelection(g) Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT) Duel.Destroy(g,REASON_EFFECT)
end end
if at1==ATTRIBUTE_EARTH and Duel.IsExistingMatchingCard(prim.sefilter4,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then if at1==ATTRIBUTE_EARTH and Duel.IsExistingMatchingCard(prim.sefilter4,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetMZoneCount(tp)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,prim.sefilter4,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,prim.sefilter4,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
...@@ -215,7 +215,7 @@ function prim.ntcon(e,c,minc) ...@@ -215,7 +215,7 @@ function prim.ntcon(e,c,minc)
if lv<=4 then return false end if lv<=4 then return false end
if lv>4 and lv<7 then ct=1 end if lv>4 and lv<7 then ct=1 end
if lv>=7 then ct=2 end if lv>=7 then ct=2 end
return minc<=0 and ct>0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.IsPlayerAffectedByEffect(tp,66677708) and Duel.IsExistingMatchingCard(prim.ntfilter,tp,LOCATION_REMOVED,0,ct,nil) and Duel.GetFlagEffect(tp,66677750)==0 return minc<=0 and ct>0 and Duel.GetMZoneCount(c:GetControler())>0 and Duel.IsPlayerAffectedByEffect(tp,66677708) and Duel.IsExistingMatchingCard(prim.ntfilter,tp,LOCATION_REMOVED,0,ct,nil) and Duel.GetFlagEffect(tp,66677750)==0
end end
function prim.ntop(e,tp,eg,ep,ev,re,r,rp,c) function prim.ntop(e,tp,eg,ep,ev,re,r,rp,c)
local lv=c:GetLevel() local lv=c:GetLevel()
...@@ -250,7 +250,7 @@ function prim.ses(c,at) ...@@ -250,7 +250,7 @@ function prim.ses(c,at)
e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk) e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
local spg=Duel.GetMatchingGroup(prim.sesspfilter,tp,LOCATION_DECK,0,nil,e,tp,m) local spg=Duel.GetMatchingGroup(prim.sesspfilter,tp,LOCATION_DECK,0,nil,e,tp,m)
local rmg=Duel.GetMatchingGroup(prim.sessrfilter,tp,LOCATION_DECK,0,nil,at) local rmg=Duel.GetMatchingGroup(prim.sessrfilter,tp,LOCATION_DECK,0,nil,at)
local sp=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and spg:GetCount()>0 local sp=Duel.GetMZoneCount(tp)>0 and spg:GetCount()>0
local dr=Duel.IsPlayerCanDraw(tp,1) and rmg:GetCount()>0 local dr=Duel.IsPlayerCanDraw(tp,1) and rmg:GetCount()>0
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() and Duel.IsExistingMatchingCard(prim.sesscfilter,tp,LOCATION_HAND,0,1,e:GetHandler(),at,sp,dr) end if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() and Duel.IsExistingMatchingCard(prim.sesscfilter,tp,LOCATION_HAND,0,1,e:GetHandler(),at,sp,dr) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
...@@ -277,7 +277,7 @@ function prim.ses(c,at) ...@@ -277,7 +277,7 @@ function prim.ses(c,at)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local l=e:GetLabel() local l=e:GetLabel()
local b=false local b=false
if bit.band(l,1)~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then if bit.band(l,1)~=0 and Duel.GetMZoneCount(tp)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,prim.sesspfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,m) local g=Duel.SelectMatchingCard(tp,prim.sesspfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,m)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -76,7 +76,8 @@ end ...@@ -76,7 +76,8 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local rc=Duel.GetFirstTarget() local rc=Duel.GetFirstTarget()
if rc:IsRelateToEffect(e) and Duel.Destroy(rc,REASON_EFFECT)~=0 and not rc:IsLocation(LOCATION_HAND+LOCATION_DECK) then if rc:IsRelateToEffect(e) and Duel.Destroy(rc,REASON_EFFECT)~=0 and not rc:IsLocation(LOCATION_HAND+LOCATION_DECK) then
if rc:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if rc:IsType(TYPE_MONSTER) and Duel.GetMZoneCount(tp)>0
and (not rc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp)>0)
and rc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and rc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
and Duel.SelectYesNo(tp,aux.Stringid(90809975,3)) then and Duel.SelectYesNo(tp,aux.Stringid(90809975,3)) then
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -53,7 +53,7 @@ function cm.filter(c,e,tp) ...@@ -53,7 +53,7 @@ function cm.filter(c,e,tp)
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.filter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end and Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
......
...@@ -39,12 +39,12 @@ function cm.filter(c,e,tp) ...@@ -39,12 +39,12 @@ function cm.filter(c,e,tp)
return Senya.check_set_3L(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsLevelBelow(4) return Senya.check_set_3L(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsLevelBelow(4)
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 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -82,7 +82,7 @@ function cm.cfilter(c,e) ...@@ -82,7 +82,7 @@ function cm.cfilter(c,e)
end end
function cm.MokouRebornTarget(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.MokouRebornTarget(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and chkc~=e:GetHandler() and cm.cfilter(chkc,e) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and chkc~=e:GetHandler() and cm.cfilter(chkc,e) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,true) and Duel.IsExistingTarget(cm.cfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e) end and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,true) and Duel.IsExistingTarget(cm.cfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,cm.cfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler(),e) local g=Duel.SelectTarget(tp,cm.cfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler(),e)
...@@ -91,7 +91,7 @@ end ...@@ -91,7 +91,7 @@ end
function cm.MokouRebornOperation(e,tp,eg,ep,ev,re,r,rp) function cm.MokouRebornOperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
if not c:IsRelateToEffect(e) or not c:IsCanBeSpecialSummoned(e,0,tp,true,true) then return end if not c:IsRelateToEffect(e) or not c:IsCanBeSpecialSummoned(e,0,tp,true,true) then return end
Duel.SpecialSummon(c,0,tp,tp,true,true,POS_FACEUP) Duel.SpecialSummon(c,0,tp,tp,true,true,POS_FACEUP)
c:CompleteProcedure() c:CompleteProcedure()
......
...@@ -26,14 +26,14 @@ function cm.effect_operation_3L(c) ...@@ -26,14 +26,14 @@ function cm.effect_operation_3L(c)
end end
cm.announce_forbidden_3L=true cm.announce_forbidden_3L=true
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,m,0,0x21,1000,800,1,RACE_BEAST,ATTRIBUTE_EARTH) end and Duel.IsPlayerCanSpecialSummonMonster(tp,m,0,0x21,1000,800,1,RACE_BEAST,ATTRIBUTE_EARTH) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 if Duel.GetMZoneCount(tp)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,m,0,0x21,1000,800,1,RACE_BEAST,ATTRIBUTE_EARTH) then return end or not Duel.IsPlayerCanSpecialSummonMonster(tp,m,0,0x21,1000,800,1,RACE_BEAST,ATTRIBUTE_EARTH) then return end
c:AddMonsterAttribute(TYPE_EFFECT+TYPE_TRAP) c:AddMonsterAttribute(TYPE_EFFECT+TYPE_TRAP)
Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP) Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP)
......
...@@ -93,12 +93,12 @@ end, ...@@ -93,12 +93,12 @@ 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
local ft=Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE) local ft=Duel.GetMZoneCount(c:GetControler())
local ct=math.max(1,-ft) local ct=math.max(1,-ft)
return Duel.CheckReleaseGroup(c:GetControler(),Senya.check_set_3L,ct,nil) return Duel.CheckReleaseGroup(c:GetControler(),Senya.check_set_3L,ct,nil)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c) function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE) local ft=Duel.GetMZoneCount(c:GetControler())
local ct=math.max(1,-ft) local ct=math.max(1,-ft)
local g=Duel.SelectReleaseGroup(c:GetControler(),Senya.check_set_3L,ct,63,nil) local g=Duel.SelectReleaseGroup(c:GetControler(),Senya.check_set_3L,ct,63,nil)
c:SetMaterial(g) c:SetMaterial(g)
......
...@@ -61,14 +61,14 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -61,14 +61,14 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
end end
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 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,m+1,0,0x4011,800,1000,1,RACE_FIEND,ATTRIBUTE_DARK) end and Duel.IsPlayerCanSpecialSummonMonster(tp,m+1,0,0x4011,800,1000,1,RACE_FIEND,ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,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 c=e:GetHandler() local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 if Duel.GetMZoneCount(tp)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,m+1,0,0x4011,800,1000,1,RACE_FIEND,ATTRIBUTE_DARK) then return end or not Duel.IsPlayerCanSpecialSummonMonster(tp,m+1,0,0x4011,800,1000,1,RACE_FIEND,ATTRIBUTE_DARK) then return end
local token=Duel.CreateToken(tp,m+1) local token=Duel.CreateToken(tp,m+1)
if Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP) then if Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP) then
......
...@@ -83,12 +83,12 @@ function cm.sfilter(c,e,tp) ...@@ -83,12 +83,12 @@ function cm.sfilter(c,e,tp)
return c:IsType(TYPE_FUSION) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial() return c:IsType(TYPE_FUSION) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial()
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 if chk==0 then return Duel.GetMZoneCount(tp)>-1
and Duel.IsExistingMatchingCard(cm.sfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.sfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.sfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.sfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -27,13 +27,13 @@ function cm.initial_effect(c) ...@@ -27,13 +27,13 @@ function cm.initial_effect(c)
e2:SetHintTiming(0,0x1c0+TIMING_MAIN_END) e2:SetHintTiming(0,0x1c0+TIMING_MAIN_END)
e2:SetCondition(cm.rmcon) e2:SetCondition(cm.rmcon)
e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk) e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_HAND,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end) end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter1,tp,LOCATION_HAND,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.filter1,tp,LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -33,7 +33,7 @@ function cm.battlecheck(c,tp) ...@@ -33,7 +33,7 @@ function cm.battlecheck(c,tp)
end end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
if rp==tp or eg:GetCount()~=1 or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end if rp==tp or eg:GetCount()~=1 or Duel.GetMZoneCount(tp)<=0 then return false end
local tc=eg:GetFirst() local tc=eg:GetFirst()
if not Senya.check_set_3L(tc) or not tc:IsType(TYPE_MONSTER) or not tc:IsLocation(LOCATION_GRAVE) or not tc:IsAbleToRemove() or not cm.battlecheck(tc,tp) then return false end if not Senya.check_set_3L(tc) or not tc:IsType(TYPE_MONSTER) or not tc:IsLocation(LOCATION_GRAVE) or not tc:IsAbleToRemove() or not cm.battlecheck(tc,tp) then return false end
local mg=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_DECK,0,nil) local mg=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_DECK,0,nil)
...@@ -44,7 +44,7 @@ function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -44,7 +44,7 @@ function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function cm.desop(e,tp,eg,ep,ev,re,r,rp) function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst() local tc=eg:GetFirst()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not tc:IsRelateToEffect(e) or not tc:IsAbleToRemove() or tc:IsImmuneToEffect(e) then return end if Duel.GetMZoneCount(tp)<=0 or not tc:IsRelateToEffect(e) or not tc:IsAbleToRemove() or tc:IsImmuneToEffect(e) then return end
local mg=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_DECK,0,nil,e) local mg=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_DECK,0,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,mg,tc) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,mg,tc)
......
...@@ -37,12 +37,12 @@ function cm.filter(c,e,tp) ...@@ -37,12 +37,12 @@ function cm.filter(c,e,tp)
return Senya.check_set_3L(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return Senya.check_set_3L(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
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 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
......
...@@ -40,7 +40,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -40,7 +40,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg1=Duel.GetRitualMaterial(tp) local mg1=Duel.GetRitualMaterial(tp)
local mg2=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_GRAVE,0,nil) local mg2=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_GRAVE,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg1,mg2,ft) return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg1,mg2,ft)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
...@@ -48,7 +48,7 @@ end ...@@ -48,7 +48,7 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetRitualMaterial(tp) local mg1=Duel.GetRitualMaterial(tp)
local mg2=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_GRAVE,0,nil) local mg2=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_GRAVE,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg1,mg2,ft) local tg=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg1,mg2,ft)
local tc=tg:GetFirst() local tc=tg:GetFirst()
......
...@@ -35,14 +35,14 @@ end ...@@ -35,14 +35,14 @@ end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,mg,ft) return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,mg,ft)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.filter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,mg,ft) local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.filter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,mg,ft)
local tc=tg:GetFirst() local tc=tg:GetFirst()
......
...@@ -35,14 +35,14 @@ end ...@@ -35,14 +35,14 @@ end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg,ft) return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg,ft)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg,ft) local tg=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg,ft)
local tc=tg:GetFirst() local tc=tg:GetFirst()
......
...@@ -15,7 +15,8 @@ function cm.initial_effect(c) ...@@ -15,7 +15,8 @@ function cm.initial_effect(c)
local rc=re:GetHandler() local rc=re:GetHandler()
if not Duel.NegateActivation(ev) then return end if not Duel.NegateActivation(ev) then return end
if rc:IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)~=0 and not rc:IsLocation(LOCATION_HAND+LOCATION_DECK) then if rc:IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)~=0 and not rc:IsLocation(LOCATION_HAND+LOCATION_DECK) then
if rc:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if rc:IsType(TYPE_MONSTER) and Duel.GetMZoneCount(tp)>0
and (not rc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp)>0)
and rc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and rc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
and Duel.SelectYesNo(tp,aux.Stringid(90809975,3)) then and Duel.SelectYesNo(tp,aux.Stringid(90809975,3)) then
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -38,7 +38,7 @@ function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -38,7 +38,7 @@ function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.DiscardHand(tp,cm.cfilter,2,2,REASON_COST,e:GetHandler()) Duel.DiscardHand(tp,cm.cfilter,2,2,REASON_COST,e:GetHandler())
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 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,true) end and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,true) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
......
...@@ -53,12 +53,12 @@ function cm.sfilter(c,e,tp) ...@@ -53,12 +53,12 @@ function cm.sfilter(c,e,tp)
return Senya.check_set_sayuri(c) and not c:IsCode(m) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) and c:IsLevelBelow(8) return Senya.check_set_sayuri(c) and not c:IsCode(m) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) and c:IsLevelBelow(8)
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 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.sfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.sfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.sfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.sfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
......
...@@ -150,7 +150,7 @@ function cm.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -150,7 +150,7 @@ function cm.disop(e,tp,eg,ep,ev,re,r,rp)
e1:SetRange(LOCATION_REMOVED) e1:SetRange(LOCATION_REMOVED)
e1:SetReset(0x1fe1000+RESET_PHASE+PHASE_END) e1:SetReset(0x1fe1000+RESET_PHASE+PHASE_END)
e1:SetCondition(function(e,tp) e1:SetCondition(function(e,tp)
return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,true) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,true) and Duel.GetMZoneCount(tp)>0
end) end)
e1:SetOperation(function(e,tp) e1:SetOperation(function(e,tp)
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,true,true,POS_FACEUP) Duel.SpecialSummon(e:GetHandler(),0,tp,tp,true,true,POS_FACEUP)
......
...@@ -71,7 +71,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp) ...@@ -71,7 +71,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
e1:SetOperation(function(e,tp) e1:SetOperation(function(e,tp)
local c=e:GetHandler() local c=e:GetHandler()
local p=e:GetOwnerPlayer() local p=e:GetOwnerPlayer()
if Duel.GetLocationCount(p,LOCATION_MZONE)>0 and c:IsType(TYPE_MONSTER) then if Duel.GetMZoneCount(p)>0 and c:IsType(TYPE_MONSTER) then
Duel.MoveToField(c,p,p,LOCATION_MZONE,e:GetLabel(),true) Duel.MoveToField(c,p,p,LOCATION_MZONE,e:GetLabel(),true)
else else
Duel.SendtoGrave(c,REASON_RULE) Duel.SendtoGrave(c,REASON_RULE)
......
...@@ -56,7 +56,7 @@ function cm.spfilter(c,e,tp) ...@@ -56,7 +56,7 @@ function cm.spfilter(c,e,tp)
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.spfilter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingTarget(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end and Duel.IsExistingTarget(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
......
...@@ -43,7 +43,7 @@ end ...@@ -43,7 +43,7 @@ end
function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then if chk==0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
local mg=Duel.GetRitualMaterial(tp):Filter(cm.matfilter,c,c) local mg=Duel.GetRitualMaterial(tp):Filter(cm.matfilter,c,c)
if c.mat_filter then if c.mat_filter then
mg=mg:Filter(c.mat_filter,nil) mg=mg:Filter(c.mat_filter,nil)
...@@ -64,7 +64,7 @@ function cm.mfilterf(c,tp,mg,rc) ...@@ -64,7 +64,7 @@ function cm.mfilterf(c,tp,mg,rc)
else return false end else return false end
end end
function cm.spop2(e,tp,eg,ep,ev,re,r,rp) function cm.spop2(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
local c=e:GetHandler() local c=e:GetHandler()
local mg=Duel.GetRitualMaterial(tp):Filter(cm.matfilter,c,c) local mg=Duel.GetRitualMaterial(tp):Filter(cm.matfilter,c,c)
...@@ -97,12 +97,12 @@ function cm.sfilter1(c,e,tp) ...@@ -97,12 +97,12 @@ function cm.sfilter1(c,e,tp)
return c:IsLevelBelow(8) and Senya.check_set_sayuri(c) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) and bit.band(c:GetType(),0x81)==0x81 return c:IsLevelBelow(8) and Senya.check_set_sayuri(c) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) and bit.band(c:GetType(),0x81)==0x81
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 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.sfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.sfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.sfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.sfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
...@@ -116,7 +116,7 @@ function cm.filter(c) ...@@ -116,7 +116,7 @@ function cm.filter(c)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.sfilter1,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,2,e:GetHandler()) end if chk==0 then return Duel.GetMZoneCount(tp)>0 and Duel.IsExistingMatchingCard(cm.sfilter1,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,2,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,2,2,e:GetHandler()) local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,2,2,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,3,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,3,0,0)
...@@ -130,7 +130,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -130,7 +130,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetOperatedGroup() local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA) local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==3 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then if ct==3 and Duel.GetMZoneCount(tp)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.sfilter1,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.sfilter1,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -30,14 +30,14 @@ end ...@@ -30,14 +30,14 @@ end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg=Duel.GetMatchingGroup(cm.exfilter,tp,LOCATION_EXTRA,0,nil) local mg=Duel.GetMatchingGroup(cm.exfilter,tp,LOCATION_EXTRA,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
return ft>0 and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg) return ft>0 and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(cm.exfilter,tp,LOCATION_EXTRA,0,nil) local mg=Duel.GetMatchingGroup(cm.exfilter,tp,LOCATION_EXTRA,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
if ft<=0 then return end if ft<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg) local tg=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg)
......
...@@ -45,15 +45,15 @@ function cm.atkval(e,c) ...@@ -45,15 +45,15 @@ function cm.atkval(e,c)
return c:GetBattleTarget():GetAttack() return c:GetBattleTarget():GetAttack()
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,m+1,0,0x4011,0,0,1,RACE_MACHINE,ATTRIBUTE_EARTH) end and Duel.IsPlayerCanSpecialSummonMonster(tp,m+1,0,0x4011,0,0,1,RACE_MACHINE,ATTRIBUTE_EARTH) end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,ft,0,0) Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,ft,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,ft,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,ft,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetMZoneCount(tp)
if ft<=0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,m+1,0,0x4011,0,0,1,RACE_MACHINE,ATTRIBUTE_EARTH) then return end if ft<=0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,m+1,0,0x4011,0,0,1,RACE_MACHINE,ATTRIBUTE_EARTH) then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
for i=1,ft do for i=1,ft do
......
...@@ -35,7 +35,7 @@ function cm.mfilter(c,lc) ...@@ -35,7 +35,7 @@ function cm.mfilter(c,lc)
return c:IsFaceup() and Senya.check_set_sayuri(c) and c:IsLinkType(TYPE_RITUAL) and c:IsReleasable() return c:IsFaceup() and Senya.check_set_sayuri(c) and c:IsLinkType(TYPE_RITUAL) and c:IsReleasable()
end end
function cm.lcheck(g,tp,lc) function cm.lcheck(g,tp,lc)
return Duel.GetLocationCount(tp,LOCATION_MZONE)+g:FilterCount(aux.FConditionCheckF,nil,tp)>0 and not g:IsExists(cm.lfilter,1,nil,g) return Duel.GetMZoneCount(tp)+g:FilterCount(aux.FConditionCheckF,nil,tp)>0 and not g:IsExists(cm.lfilter,1,nil,g)
end end
function cm.lfilter(c,g) function cm.lfilter(c,g)
return g:IsExists(Card.IsCode,1,c,c:GetCode()) return g:IsExists(Card.IsCode,1,c,c:GetCode())
...@@ -67,13 +67,13 @@ function cm.filter(c,e,tp) ...@@ -67,13 +67,13 @@ function cm.filter(c,e,tp)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and cm.filter(chkc,e,tp) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and cm.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end if chk==0 then return Duel.GetMZoneCount(tp)>0 and Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsCanBeSpecialSummoned(e,0,tp,true,true) then if tc:IsRelateToEffect(e) and tc:IsCanBeSpecialSummoned(e,0,tp,true,true) then
Duel.SpecialSummon(tc,0,tp,tp,true,true,POS_FACEUP) Duel.SpecialSummon(tc,0,tp,tp,true,true,POS_FACEUP)
......
...@@ -41,7 +41,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -41,7 +41,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(cm.tdfilter,tp,LOCATION_DECK,0,nil) local g1=Duel.GetMatchingGroup(cm.tdfilter,tp,LOCATION_DECK,0,nil)
local g2=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_DECK,0,nil,e,tp) local g2=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
local gc1=(g1:GetCount()>0) local gc1=(g1:GetCount()>0)
local gc2=(g2:GetCount()>0) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 local gc2=(g2:GetCount()>0) and Duel.GetMZoneCount(tp)>0
local ch1=false local ch1=false
local ch2=false local ch2=false
if gc1 and not gc2 then ch1=(Duel.SelectYesNo(tp,aux.Stringid(m,0))) end if gc1 and not gc2 then ch1=(Duel.SelectYesNo(tp,aux.Stringid(m,0))) end
......
...@@ -28,12 +28,12 @@ function cm.filter(c,e,tp) ...@@ -28,12 +28,12 @@ function cm.filter(c,e,tp)
return c:IsSetCard(0x777) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(cm.rfilter,tp,LOCATION_DECK,0,1,nil,c) return c:IsSetCard(0x777) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(cm.rfilter,tp,LOCATION_DECK,0,1,nil,c)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then
......
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