Commit dfa0e49f authored by mercury233's avatar mercury233 Committed by GitHub

update 宝玉の氾濫 (#1932)

parent e157e317
...@@ -11,45 +11,47 @@ function c72881007.initial_effect(c) ...@@ -11,45 +11,47 @@ function c72881007.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c72881007.costfilter(c) function c72881007.costfilter(c)
return c:IsFaceup() and c:IsSetCard(0x1034) and c:IsAbleToGraveAsCost() return c:IsFaceup() and c:IsSetCard(0x1034) and c:IsAbleToGraveAsCost() and c:GetSequence()<5
end
function c72881007.gcheck(g,tg)
return tg:FilterCount(aux.TRUE,g)>0
end end
function c72881007.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c72881007.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1) local g=Duel.GetMatchingGroup(c72881007.costfilter,tp,LOCATION_SZONE,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(c72881007.costfilter,tp,LOCATION_SZONE,0,4,nil) end local tg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
if chk==0 then return g:CheckSubGroup(c72881007.gcheck,4,4,tg) end
local sg=g
if #g~=4 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c72881007.costfilter,tp,LOCATION_SZONE,0,4,4,nil) sg=g:SelectSubGroup(tp,c72881007.gcheck,false,4,4,tg)
Duel.SendtoGrave(g,REASON_COST) end
end Duel.SendtoGrave(sg,REASON_COST)
function c72881007.filter(c,e,tp)
return c:IsSetCard(0x1034) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c72881007.target(e,tp,eg,ep,ev,re,r,rp,chk) function c72881007.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then local tg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
if e:GetLabel()~=1 then if chk==0 then return e:IsCostChecked() or #tg>0 end
return Duel.IsExistingMatchingCard(c72881007.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,tg,#tg,0,0)
else
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c72881007.filter,tp,LOCATION_SZONE,0,1,nil,e,tp)
end
end
e:SetLabel(0)
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 c72881007.ctfilter(c,tp) function c72881007.ctfilter(c,tp)
return c:IsPreviousControler(tp) and c:IsLocation(LOCATION_GRAVE) return c:IsPreviousControler(tp) and c:IsLocation(LOCATION_GRAVE)
end end
function c72881007.spfilter(c,e,tp)
return c:IsSetCard(0x1034) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c72881007.activate(e,tp,eg,ep,ev,re,r,rp) function c72881007.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD) local tg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.SendtoGrave(g,REASON_EFFECT) Duel.SendtoGrave(tg,REASON_EFFECT)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local g=Duel.GetOperatedGroup()
g=Duel.GetOperatedGroup()
local ct=g:FilterCount(c72881007.ctfilter,nil,1-tp) local ct=g:FilterCount(c72881007.ctfilter,nil,1-tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft>ct then ft=ct end if ft>ct then ft=ct 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
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
g=Duel.SelectMatchingCard(tp,c72881007.filter,tp,LOCATION_GRAVE,0,ft,ft,nil,e,tp) local sg=Duel.SelectMatchingCard(tp,c72881007.spfilter,tp,LOCATION_GRAVE,0,ft,ft,nil,e,tp)
if g:GetCount()>0 then if sg:GetCount()>0 then
Duel.BreakEffect() Duel.BreakEffect()
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
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