Commit 4d9b610e authored by Nemo Ma's avatar Nemo Ma

fix

parent 319bba28
...@@ -61,9 +61,10 @@ function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk) ...@@ -61,9 +61,10 @@ function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
local rg = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_HAND + 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, s.ChkfMMZ(1), 0) rg:CheckSubGroup(s.ChkfMMZ(1), 2, 2, tp)
end end
local g = aux.SelectUnselectGroup(rg, e, tp, 2, 2, s.ChkfMMZ(1), 1, tp, HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g = rg:SelectSubGroup(s.ChkfMMZ(1), tp, 2, 2, tp)
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)
......
...@@ -53,7 +53,7 @@ function s.MZFilter(c, tp) ...@@ -53,7 +53,7 @@ function s.MZFilter(c, tp)
return c:IsLocation(LOCATION_MZONE) and c:GetSequence() < 5 and c:IsControler(tp) return c:IsLocation(LOCATION_MZONE) and c:GetSequence() < 5 and c:IsControler(tp)
end end
function s.ChkfMMZ(sumcount) function s.ChkfMMZ(sumcount)
return function(sg, e, tp, mg) return function(sg, tp)
return sg:FilterCount(s.MZFilter, nil, tp) + Duel.GetLocationCount(tp, LOCATION_MZONE) >= sumcount return sg:FilterCount(s.MZFilter, nil, tp) + Duel.GetLocationCount(tp, LOCATION_MZONE) >= sumcount
end end
end end
...@@ -61,9 +61,10 @@ function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk) ...@@ -61,9 +61,10 @@ 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, s.ChkfMMZ(1), 0) rg:CheckSubGroup(s.ChkfMMZ(1), 3, 3, tp)
end end
local g = aux.SelectUnselectGroup(rg, e, tp, 3, 3, s.ChkfMMZ(1), 1, tp, HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g = rg:SelectSubGroup(s.ChkfMMZ(1), 3, 3, tp)
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)
......
...@@ -62,19 +62,17 @@ end ...@@ -62,19 +62,17 @@ end
function s.tgfilter(c) function s.tgfilter(c)
return c:IsSetCard(0x144e) and c:IsAbleToGrave() return c:IsSetCard(0x144e) and c:IsAbleToGrave()
end end
function s.rescon(sg, e, tp, mg)
return sg:GetClassCount(Card.GetCode) == #sg
end
function s.tgtg(e, tp, eg, ep, ev, re, r, rp, chk) function s.tgtg(e, tp, eg, ep, ev, re, r, rp, chk)
local g = Duel.GetMatchingGroup(s.tgfilter, tp, LOCATION_DECK, 0, nil) local g = Duel.GetMatchingGroup(s.tgfilter, tp, LOCATION_DECK, 0, nil)
if chk == 0 then if chk == 0 then
return aux.SelectUnselectGroup(g, e, tp, 1, 4, s.rescon, chk) return g:CheckSubGroup(aux.dncheck, 1, 4)
end end
Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, g, 1, 0, 0) Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, g, 1, 0, 0)
end end
function s.tgop(e, tp, eg, ep, ev, re, r, rp) function s.tgop(e, tp, eg, ep, ev, re, r, rp)
local g = Duel.GetMatchingGroup(s.tgfilter, tp, LOCATION_DECK, 0, nil, e, tp) local g = Duel.GetMatchingGroup(s.tgfilter, tp, LOCATION_DECK, 0, nil, e, tp)
local dg = aux.SelectUnselectGroup(g, e, tp, 1, 4, s.rescon, 1, tp, HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local dg = g:SelectSubGroup(aux.dncheck, tp, 1, 4)
if #dg > 0 then if #dg > 0 then
local ct = Duel.SendtoGrave(dg, REASON_EFFECT) local ct = Duel.SendtoGrave(dg, REASON_EFFECT)
if ct > 0 and Duel.Recover(tp, ct * 1000, REASON_EFFECT) > 0 then if ct > 0 and Duel.Recover(tp, ct * 1000, REASON_EFFECT) > 0 then
......
...@@ -33,16 +33,14 @@ end ...@@ -33,16 +33,14 @@ end
function s.tgfilter(c) function s.tgfilter(c)
return c:IsSetCard(0x144e) and c:IsAbleToGrave() return c:IsSetCard(0x144e) and c:IsAbleToGrave()
end end
function s.rescon(sg, e, tp, mg)
return sg:GetClassCount(Card.GetCode) == #sg
end
function s.activate(e, tp, eg, ep, ev, re, r, rp) function s.activate(e, tp, eg, ep, ev, re, r, rp)
if not e:GetHandler():IsRelateToEffect(e) then if not e:GetHandler():IsRelateToEffect(e) then
return return
end end
local g = Duel.GetMatchingGroup(s.tgfilter, tp, LOCATION_DECK, 0, nil) local g = Duel.GetMatchingGroup(s.tgfilter, tp, LOCATION_DECK, 0, nil)
if aux.SelectUnselectGroup(g, e, tp, 1, 3, s.rescon, 0) and Duel.SelectYesNo(tp, aux.Stringid(id, 0)) then if g:CheckSubGroup(aux.dncheck, 1, 3) and Duel.SelectYesNo(tp, aux.Stringid(id, 0)) then
local dg = aux.SelectUnselectGroup(g, e, tp, 1, 3, s.rescon, 1, tp, HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local dg = g:SelectSubGroup(aux.dncheck, tp, 1, 3)
Duel.SendtoGrave(dg, REASON_EFFECT) Duel.SendtoGrave(dg, REASON_EFFECT)
end end
end end
......
...@@ -21,8 +21,8 @@ function c9950143.initial_effect(c) ...@@ -21,8 +21,8 @@ function c9950143.initial_effect(c)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER) e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e3:SetCountLimit(1,9950143) e3:SetCountLimit(1,9950143)
e3:SetTarget(c9950143.target) e3:SetTarget(c9950143.target1)
e3:SetOperation(c9950143.operation) e3:SetOperation(c9950143.operation1)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--negate --negate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -33,9 +33,9 @@ function c9950143.initial_effect(c) ...@@ -33,9 +33,9 @@ function c9950143.initial_effect(c)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetCode(EVENT_CHAINING) e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c9950143.condition) e1:SetCondition(c9950143.condition2)
e1:SetTarget(c9950143.target) e1:SetTarget(c9950143.target2)
e1:SetOperation(c9950143.operation) e1:SetOperation(c9950143.operation2)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--spsummon bgm --spsummon bgm
local e8=Effect.CreateEffect(c) local e8=Effect.CreateEffect(c)
...@@ -53,7 +53,7 @@ end ...@@ -53,7 +53,7 @@ end
function c9950143.sumsuc(e,tp,eg,ep,ev,re,r,rp) function c9950143.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_MUSIC,0,aux.Stringid(9950143,0)) Duel.Hint(HINT_MUSIC,0,aux.Stringid(9950143,0))
end end
function c9950143.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c9950143.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and aux.disfilter1(chkc) end if chkc then return chkc:IsOnField() and aux.disfilter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingTarget(aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
...@@ -61,7 +61,7 @@ function c9950143.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -61,7 +61,7 @@ function c9950143.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end end
function c9950143.operation(e,tp,eg,ep,ev,re,r,rp) function c9950143.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if ((tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER)) and tc:IsRelateToEffect(e) then if ((tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER)) and tc:IsRelateToEffect(e) then
...@@ -104,17 +104,17 @@ function c9950143.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -104,17 +104,17 @@ function c9950143.operation(e,tp,eg,ep,ev,re,r,rp)
end end
Duel.Hint(HINT_MUSIC,0,aux.Stringid(9950143,0)) Duel.Hint(HINT_MUSIC,0,aux.Stringid(9950143,0))
end end
function c9950143.condition(e,tp,eg,ep,ev,re,r,rp,chk) function c9950143.condition2(e,tp,eg,ep,ev,re,r,rp,chk)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION) local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return ep~=tp and loc==LOCATION_MZONE and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev) return ep~=tp and loc==LOCATION_MZONE and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
and re:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL) and re:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL)
end end
function c9950143.target(e,tp,eg,ep,ev,re,r,rp,chk) function c9950143.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end end
function c9950143.operation(e,tp,eg,ep,ev,re,r,rp) function c9950143.operation2(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev) Duel.NegateActivation(ev)
Duel.BreakEffect() Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT) Duel.Draw(tp,1,REASON_EFFECT)
......
...@@ -6,6 +6,7 @@ function c9950187.initial_effect(c) ...@@ -6,6 +6,7 @@ function c9950187.initial_effect(c)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,9950187) e1:SetCountLimit(1,9950187)
e1:SetCost(c9950187.cost) e1:SetCost(c9950187.cost)
e1:SetTarget(c9950187.target) e1:SetTarget(c9950187.target)
......
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