Commit 935825d4 authored by nanahira's avatar nanahira

catchup for mr5

parent a3d9844e
...@@ -42,12 +42,12 @@ function cm.filter(c,e,tp) ...@@ -42,12 +42,12 @@ function cm.filter(c,e,tp)
return Senya.check_set_elem(c) and c:GetRank()==4 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return Senya.check_set_elem(c) and c:GetRank()==4 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.GetLocationCountFromEx(tp)>0 if chk==0 then return Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_XYZ)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.filter,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.GetLocationCountFromEx(tp)<=0 then return end if Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_XYZ)<=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_EXTRA,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if #g>0 then if #g>0 then
......
...@@ -24,7 +24,7 @@ function cm.spfilter2(c,e,tp,code,rk) ...@@ -24,7 +24,7 @@ function cm.spfilter2(c,e,tp,code,rk)
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_MZONE) and chkc:IsControler(tp) and cm.thfilter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.thfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCountFromEx(tp)>0 if chk==0 then return Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_XYZ)>0
and Duel.IsExistingTarget(cm.thfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end and Duel.IsExistingTarget(cm.thfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.thfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,cm.thfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
...@@ -33,7 +33,7 @@ end ...@@ -33,7 +33,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 tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
if Duel.GetLocationCountFromEx(tp)<=0 then return end if Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_XYZ)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.spfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc:GetCode(),tc:GetRank()) local sg=Duel.SelectMatchingCard(tp,cm.spfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc:GetCode(),tc:GetRank())
local mg=sg:GetFirst() local mg=sg:GetFirst()
......
...@@ -41,7 +41,7 @@ function cm.spcon(e,c) ...@@ -41,7 +41,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()
local g=Duel.GetMatchingGroup(cm.spfilter1,tp,LOCATION_GRAVE+LOCATION_HAND,0,nil) local g=Duel.GetMatchingGroup(cm.spfilter1,tp,LOCATION_GRAVE+LOCATION_HAND,0,nil)
return Duel.GetLocationCountFromEx(tp)>0 return Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_XYZ)>0
and g:GetClassCount(Card.GetCode)>=5 and g:GetClassCount(Card.GetCode)>=5
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)
......
...@@ -118,7 +118,7 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -118,7 +118,7 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
if dr:IsAttribute(ATTRIBUTE_WIND) then if dr:IsAttribute(ATTRIBUTE_WIND) then
Duel.Draw(tp,2,REASON_EFFECT) Duel.Draw(tp,2,REASON_EFFECT)
end end
if dr:IsAttribute(ATTRIBUTE_EARTH) and Duel.GetLocationCountFromEx(tp)>0 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) then if dr:IsAttribute(ATTRIBUTE_EARTH) and Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_XYZ)>0 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) then
if Duel.SelectYesNo(tp,aux.Stringid(37564030,4)) then if Duel.SelectYesNo(tp,aux.Stringid(37564030,4)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
......
...@@ -26,7 +26,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -26,7 +26,7 @@ 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.GetMZoneCount(tp)>0 and Duel.GetMZoneCount(tp)>0
and Duel.GetLocationCountFromEx(tp)>0 and Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_XYZ)>0
and Senya.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_XMATERIAL) and Senya.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_XMATERIAL)
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)
...@@ -40,7 +40,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -40,7 +40,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
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)
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)==0 then return end if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)==0 then return end
if Duel.GetLocationCountFromEx(tp,tp,tc)<=0 or not Senya.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) then return end if Duel.GetLocationCountFromEx(tp,tp,tc,TYPE_XYZ)<=0 or not Senya.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank()+1) local g=Duel.SelectMatchingCard(tp,cm.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank()+1)
local sc=g:GetFirst() local sc=g:GetFirst()
......
...@@ -211,7 +211,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -211,7 +211,7 @@ 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.GetMZoneCount(tp)>0 if rc:IsType(TYPE_MONSTER) and Duel.GetMZoneCount(tp)>0
and (not rc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp)>0) and (not rc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp,tp,nil,rc)>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()
......
...@@ -118,7 +118,7 @@ end ...@@ -118,7 +118,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.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) return c:IsType(TYPE_MONSTER) and Duel.GetMZoneCount(tp)>0 and (not c:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp,tp,nil,c)>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
......
...@@ -86,7 +86,7 @@ function cm.operation1(e,tp,eg,ep,ev,re,r,rp) ...@@ -86,7 +86,7 @@ function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.filter(c,e,tp) function cm.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCode(37564331) and Duel.GetLocationCountFromEx(tp)>0 return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCode(37564331) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
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.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
......
...@@ -38,7 +38,7 @@ end ...@@ -38,7 +38,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)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then if chk==0 then
return Duel.GetLocationCountFromEx(tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,true,true) return Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end end
......
...@@ -41,9 +41,14 @@ function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -41,9 +41,14 @@ function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,#g,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,#g,0,0)
end end
function cm.gcheck(g,mft,eft) function cm.gcheck(g,mft,eft1,eft2)
local ect=g:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA) local ect1=g:FilterCount(function(c)
return ect<=eft and #g-ect<=mft return c:IsLocation(LOCATION_EXTRA) and c:IsFacedown() and not c:IsType(TYPE_LINK)
end,nil)
local ect2=g:FilterCount(function(c)
return c:IsLocation(LOCATION_EXTRA) and c(:IsFaceup() or c:IsType(TYPE_LINK))
end,nil)
return ect1<=eft1 and ect2<=eft2 and #g-ect1-ect2<=mft
end end
function cm.RegisterBuff(c,ec) function cm.RegisterBuff(c,ec)
local e1=Effect.CreateEffect(ec) local e1=Effect.CreateEffect(ec)
...@@ -79,11 +84,22 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp) ...@@ -79,11 +84,22 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
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.GetMZoneCount(tp) 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 eft1=c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and math.min(c29724053[tp],(Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_XYZ))) or Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_XYZ)
local eft2=c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and math.min(c29724053[tp],(Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM))) or Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)
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 etg1=g:Filter(function(c)
tg:Sub(etg) return c:IsLocation(LOCATION_EXTRA) and c:IsFacedown() and not c:IsType(TYPE_LINK)
for tc in aux.Next(etg) do end)
local etg2=g:Filter(function(c)
return c:IsLocation(LOCATION_EXTRA) and c(:IsFaceup() or c:IsType(TYPE_LINK))
end,nil)
tg:Sub(etg1)
tg:Sub(etg2)
for tc in aux.Next(etg2) do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
cm.RegisterBuff(tc,e:GetHandler())
end
for tc in aux.Next(etg1) do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
cm.RegisterBuff(tc,e:GetHandler()) cm.RegisterBuff(tc,e:GetHandler())
end end
......
...@@ -53,7 +53,7 @@ function cm.filter(c,e,tp,t) ...@@ -53,7 +53,7 @@ function cm.filter(c,e,tp,t)
return c:IsType(t) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and f(c,8) return c:IsType(t) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and f(c,8)
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.GetLocationCountFromEx(tp)>2 if chk==0 then return Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_XYZ)>2
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp,TYPE_FUSION) and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp,TYPE_FUSION)
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp,TYPE_SYNCHRO) and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp,TYPE_SYNCHRO)
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp,TYPE_XYZ) and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp,TYPE_XYZ)
......
...@@ -158,7 +158,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -158,7 +158,7 @@ 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.GetMZoneCount(tp)>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,tp,nil,TYPE_PENDULUM)>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
if og then if og then
...@@ -174,7 +174,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -174,7 +174,7 @@ 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.GetMZoneCount(tp),2) local ft1=math.max(Duel.GetMZoneCount(tp),2)
local ft2=math.max(Duel.GetLocationCountFromEx(tp),2) local ft2=math.max(Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM),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
if ft1>0 then ft1=1 end if ft1>0 then ft1=1 end
......
...@@ -1016,7 +1016,7 @@ function cm.PendConditionNanahira() ...@@ -1016,7 +1016,7 @@ function cm.PendConditionNanahira()
if ft<=0 then return false end if ft<=0 then return false end
local mft=Duel.GetMZoneCount(tp) local mft=Duel.GetMZoneCount(tp)
cm.SetForceExtra(tp,true) cm.SetForceExtra(tp,true)
local eft=Duel.GetLocationCountFromEx(tp) local eft=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)
cm.SetForceExtra(tp,false) cm.SetForceExtra(tp,false)
local g=nil local g=nil
if og then if og then
...@@ -1064,7 +1064,7 @@ function cm.PendOperationNanahira() ...@@ -1064,7 +1064,7 @@ function cm.PendOperationNanahira()
local ft=Duel.GetUsableMZoneCount(tp) local ft=Duel.GetUsableMZoneCount(tp)
local mft=Duel.GetMZoneCount(tp) local mft=Duel.GetMZoneCount(tp)
cm.SetForceExtra(tp,true) cm.SetForceExtra(tp,true)
local eft=Duel.GetLocationCountFromEx(tp) local eft=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)
cm.SetForceExtra(tp,false) cm.SetForceExtra(tp,false)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then if Duel.IsPlayerAffectedByEffect(tp,59822133) then
mft=math.min(1,mft) mft=math.min(1,mft)
......
...@@ -77,7 +77,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -77,7 +77,7 @@ 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.GetMZoneCount(tp)>0 if rc:IsType(TYPE_MONSTER) and Duel.GetMZoneCount(tp)>0
and (not rc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp)>0) and (not rc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp,tp,nil,rc)>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()
......
...@@ -71,7 +71,6 @@ function cm.filter2(c,e,tp,m,f) ...@@ -71,7 +71,6 @@ function cm.filter2(c,e,tp,m,f)
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 if chk==0 then
if Duel.GetLocationCountFromEx(tp)<=0 then return false end
local mg1=Senya.GetFusionMaterial(tp,LOCATION_DECK,nil,cm.mfilter,nil) local mg1=Senya.GetFusionMaterial(tp,LOCATION_DECK,nil,cm.mfilter,nil)
local res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil) local res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil)
if not res then if not res then
...@@ -88,7 +87,6 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -88,7 +87,6 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
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.GetLocationCountFromEx(tp)<=0 then return end
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
local mg1=Senya.GetFusionMaterial(tp,LOCATION_DECK,nil,cm.mfilter,nil,e) local mg1=Senya.GetFusionMaterial(tp,LOCATION_DECK,nil,cm.mfilter,nil,e)
local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil) local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil)
......
...@@ -17,7 +17,7 @@ function cm.initial_effect(c) ...@@ -17,7 +17,7 @@ function cm.initial_effect(c)
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.GetMZoneCount(tp)>0 if rc:IsType(TYPE_MONSTER) and Duel.GetMZoneCount(tp)>0
and (not rc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp)>0) and (not rc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp,tp,nil,rc)>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()
......
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