Commit 61923595 authored by Nemo Ma's avatar Nemo Ma

fix

parent 499f5645
...@@ -47,16 +47,23 @@ function s.spcon(e, tp, eg, ep, ev, re, r, rp) ...@@ -47,16 +47,23 @@ function s.spcon(e, tp, eg, ep, ev, re, r, rp)
return Duel.GetTurnPlayer() == tp and ns + ss == 0 return Duel.GetTurnPlayer() == tp and ns + ss == 0
end end
function s.spfilter(c) function s.spfilter(c)
return c:IsSetCard(0x144e) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() and return c:IsSetCard(0x144e) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
(c:IsLocation(LOCATION_HAND) or aux.SpElimFilter(c, true)) end
function s.MZFilter(c, tp)
return c:IsLocation(LOCATION_MZONE) and c:GetSequence() < 5 and c:IsControler(tp)
end
function s.ChkfMMZ(sumcount)
return function(sg, e, tp, mg)
return sg:FilterCount(s.MZFilter, nil, tp) + Duel.GetLocationCount(tp, LOCATION_MZONE) >= sumcount
end
end end
function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk) function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
local rg = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_HAND + LOCATION_MZONE + LOCATION_GRAVE, 0, e:GetHandler()) local rg = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_HAND + LOCATION_GRAVE, 0, e:GetHandler())
if chk == 0 then if chk == 0 then
return Duel.GetLocationCount(tp, LOCATION_MZONE) > -2 and #rg > 1 and return Duel.GetLocationCount(tp, LOCATION_MZONE) > -2 and #rg > 1 and
aux.SelectUnselectGroup(rg, e, tp, 2, 2, aux.ChkfMMZ(1), 0) aux.SelectUnselectGroup(rg, e, tp, 2, 2, s.ChkfMMZ(1), 0)
end end
local g = aux.SelectUnselectGroup(rg, e, tp, 2, 2, aux.ChkfMMZ(1), 1, tp, HINTMSG_REMOVE) local g = aux.SelectUnselectGroup(rg, e, tp, 2, 2, s.ChkfMMZ(1), 1, tp, HINTMSG_REMOVE)
Duel.Remove(g, POS_FACEUP, REASON_COST) Duel.Remove(g, POS_FACEUP, REASON_COST)
end end
function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk) function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
......
...@@ -47,16 +47,23 @@ function s.spcon(e, tp, eg, ep, ev, re, r, rp) ...@@ -47,16 +47,23 @@ function s.spcon(e, tp, eg, ep, ev, re, r, rp)
return Duel.GetTurnPlayer() == tp and ns + ss == 0 return Duel.GetTurnPlayer() == tp and ns + ss == 0
end end
function s.spfilter(c) function s.spfilter(c)
return c:IsSetCard(0x144e) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() and return c:IsSetCard(0x144e) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
(c:IsLocation(LOCATION_HAND) or aux.SpElimFilter(c, true)) end
function s.MZFilter(c, tp)
return c:IsLocation(LOCATION_MZONE) and c:GetSequence() < 5 and c:IsControler(tp)
end
function s.ChkfMMZ(sumcount)
return function(sg, e, tp, mg)
return sg:FilterCount(s.MZFilter, nil, tp) + Duel.GetLocationCount(tp, LOCATION_MZONE) >= sumcount
end
end end
function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk) function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
local rg = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_HAND + LOCATION_MZONE + LOCATION_GRAVE, 0, e:GetHandler()) local rg = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_HAND + LOCATION_MZONE + LOCATION_GRAVE, 0, e:GetHandler())
if chk == 0 then if chk == 0 then
return Duel.GetLocationCount(tp, LOCATION_MZONE) > -3 and #rg > 1 and return Duel.GetLocationCount(tp, LOCATION_MZONE) > -3 and #rg > 1 and
aux.SelectUnselectGroup(rg, e, tp, 3, 3, aux.ChkfMMZ(1), 0) aux.SelectUnselectGroup(rg, e, tp, 3, 3, s.ChkfMMZ(1), 0)
end end
local g = aux.SelectUnselectGroup(rg, e, tp, 3, 3, aux.ChkfMMZ(1), 1, tp, HINTMSG_REMOVE) local g = aux.SelectUnselectGroup(rg, e, tp, 3, 3, s.ChkfMMZ(1), 1, tp, HINTMSG_REMOVE)
Duel.Remove(g, POS_FACEUP, REASON_COST) Duel.Remove(g, POS_FACEUP, REASON_COST)
end end
function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk) function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
......
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