Commit bf027833 authored by Tachibana's avatar Tachibana

得得得得得

parent bf28bb2f
Pipeline #11467 passed with stages
in 28 minutes and 42 seconds
......@@ -80,28 +80,39 @@ function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToExtraAsCost() end
Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_COST)
end
function cm.filter(c,code,e,tp)
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
function cm.spfilter(c,e,tp)
return c:IsCode(81048009) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(cm.ssfilter,tp,LOCATION_GRAVE,0,1,c,e,tp)
end
function cm.sptargetfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCode(81048009,81048010) and c:IsCanBeEffectTarget(e)
function cm.ssfilter(c,e,tp)
return c:IsCode(81048010) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local g=Duel.GetMatchingGroup(cm.sptargetfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetMZoneCount(tp,e:GetHandler())>=2
and g:CheckSubGroupEach(cm.spchecks)
if chk==0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if e:GetHandler():GetSequence()<5 then ft=ft+1 end
return ft>1 and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.IsExistingTarget(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroupEach(tp,cm.spchecks)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg,2,0,0)
local g1=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectTarget(tp,cm.ssfilter,tp,LOCATION_GRAVE,0,1,1,g1:GetFirst(),e,tp)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g1,2,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g:FilterCount(Card.IsRelateToEffect,nil,e)~=2 then return end
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()==0 or (g:GetCount()>1 and Duel.IsPlayerAffectedByEffect(tp,59822133)) then return end
if g:GetCount()<=ft then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,ft,ft,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
g:Sub(sg)
Duel.SendtoGrave(g,REASON_RULE)
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