Commit cb6def69 authored by 聖園ミカ's avatar 聖園ミカ 🐟

duiduiduiduidui

parent 67e1100b
......@@ -15,6 +15,7 @@ function cm.initial_effect(c)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.hspcon)
e1:SetTarget(cm.hsptg)
e1:SetOperation(cm.hspop)
c:RegisterEffect(e1)
......@@ -32,20 +33,23 @@ function cm.initial_effect(c)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
end
function cm.hspfilter(c,ft,tp)
function cm.hspfilter(c,tp)
return cm.MagicCombineDemon(c)
and (ft>0 or (c:IsControler(tp) and c:GetSequence()<5)) and (c:IsControler(tp) or c:IsFaceup())
and Duel.GetMZoneCount(tp,c)>0 and (c:IsControler(tp) or c:IsFaceup())
end
function cm.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return ft>-1 and Duel.CheckReleaseGroup(REASON_COST,tp,cm.hspfilter,1,nil,ft,tp)
return Duel.CheckReleaseGroupEx(tp,cm.hspfilter,1,REASON_SPSUMMON,false,nil,tp)
end
function cm.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.SelectReleaseGroup(REASON_COST,tp,cm.hspfilter,1,1,nil,ft,tp)
Duel.Release(g,REASON_COST)
function cm.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetReleaseGroup(tp,false,REASON_SPSUMMON):Filter(cm.hspfilter,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local tc=g:SelectUnselect(nil,tp,false,true,1,1)
if tc then
e:SetLabelObject(tc)
return true
else return false end
end
function cm.filter(c,tp)
return c:IsPreviousLocation(LOCATION_GRAVE) and c:IsPreviousControler(tp) and c:IsType(TYPE_SPELL)
......@@ -54,31 +58,30 @@ function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.filter,1,nil,tp)
end
function cm.thfilter(c,tp,e)
return c:IsFaceup() and cm.MagicCombineDemon(c) and c:IsLocation(LOCATION_REMOVED)
and c:IsControler(tp) and c:IsCanBeEffectTarget(e) and (c:IsAbleToDeck() or c:IsAbleToExtra())
function cm.thfilter(c)
return c:IsFaceup() and cm.MagicCombineDemon(c)
and (c:IsAbleToDeck() or c:IsAbleToExtra())
end
function cm.spfilter(c,e,tp)
return cm.MagicCombineDemon(c) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) and (c:IsLocation(LOCATION_DECK) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
or c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if chkc then return eg:IsContains(chkc) and cm.thfilter(chkc,tp,e) end
if chk==0 then return true end
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and cm.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.thfilter,tp,LOCATION_REMOVED,0,1,nil) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:FilterSelect(tp,cm.thfilter,1,1,nil,tp,e)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_TODECK,sg,1,0,0)
end
function cm.spfilter(c,e,tp)
return cm.MagicCombineDemon(c) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
local g=Duel.SelectTarget(tp,cm.thfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 then
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil,e,tp)
if #g>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.BreakEffect()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 and (tc:IsLocation(LOCATION_EXTRA)or tc:IsLocation(LOCATION_DECK)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,true,false,POS_FACEUP)
local g2=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,e,tp)
if g2:GetCount()>0 then
Duel.BreakEffect()
Duel.SpecialSummon(g2,0,tp,tp,true,false,POS_FACEUP)
end
end
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment