Commit 19243c9a authored by TanakaKotoha's avatar TanakaKotoha

mopempoe

parent e20450e6
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
local m=33400210 local m=33400210
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
--spsummon --spsummon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
...@@ -12,7 +12,7 @@ function cm.initial_effect(c) ...@@ -12,7 +12,7 @@ function cm.initial_effect(c)
e1:SetTarget(cm.sptg) e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop) e1:SetOperation(cm.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--sps --sps
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
...@@ -23,10 +23,10 @@ function cm.initial_effect(c) ...@@ -23,10 +23,10 @@ function cm.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.cfilter1(c) function cm.cfilter1(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL) return c:IsFaceup() and c:IsType(TYPE_SPELL)
end end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp) function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 or Duel.IsExistingMatchingCard(cm.cfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 or Duel.IsExistingMatchingCard(cm.cfilter1,tp,LOCATION_ONFIELD,0,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.GetLocationCount(tp,LOCATION_MZONE)>0
...@@ -35,8 +35,8 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -35,8 +35,8 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
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 or not c:IsRelateToEffect(e) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end end
function cm.filter(c,e,tp) function cm.filter(c,e,tp)
return c:IsSetCard(0x6342) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x6342) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
...@@ -50,37 +50,36 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -50,37 +50,36 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
getmetatable(e:GetHandler()).announce_filter={TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK,OPCODE_ISTYPE,OPCODE_NOT} getmetatable(e:GetHandler()).announce_filter={TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK,OPCODE_ISTYPE,OPCODE_NOT}
local ac=Duel.AnnounceCard(tp,table.unpack(getmetatable(e:GetHandler()).announce_filter)) local ac=Duel.AnnounceCard(tp,table.unpack(getmetatable(e:GetHandler()).announce_filter))
Duel.ConfirmDecktop(tp,1) Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1) local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc:IsCode(ac) then if tc:IsCode(ac) then
if Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) then if Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g1=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g1:GetCount()>0 then if g1:GetCount()>0 then
Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP)
end end
local ct1=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0) local ct1=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if ct1>2 then ct1=2 end if ct1>2 then ct1=2 end
local g=Duel.GetDecktopGroup(tp,ct1) local g=Duel.GetDecktopGroup(tp,ct1)
Duel.ConfirmCards(tp,g) Duel.ConfirmCards(tp,g)
Duel.SortDecktop(tp,tp,ct1) Duel.SortDecktop(tp,tp,ct1)
end end
else else
if Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) then if Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g1=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g1:GetCount()>0 then if g1:GetCount()>0 then
Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP)
end end
if Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil) if Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g2=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil)
local g2=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil) if g2:GetCount()>0 then
if g2:GetCount()>0 then Duel.SendtoDeck(g2,tp,0,REASON_EFFECT)
Duel.SendtoDeck(g2,tp,0,REASON_EFFECT) end
end end
end end
end
end end
end end
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