Commit 8021daf6 authored by POLYMER's avatar POLYMER

fix

parent cda02571
...@@ -9,6 +9,7 @@ function s.initial_effect(c) ...@@ -9,6 +9,7 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(s.splimit)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--todeck --todeck
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -37,6 +38,9 @@ function s.initial_effect(c) ...@@ -37,6 +38,9 @@ function s.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter) Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter)
end end
function s.splimit(e,se,sp,st)
return se:GetHandler():IsCode(12866600)
end
function s.chainfilter(re,tp,cid) function s.chainfilter(re,tp,cid)
return not (re:GetHandler():IsCode(12866600)) return not (re:GetHandler():IsCode(12866600))
end end
......
...@@ -19,11 +19,13 @@ function c22021820.initial_effect(c) ...@@ -19,11 +19,13 @@ function c22021820.initial_effect(c)
e2:SetOperation(c22021820.spop) e2:SetOperation(c22021820.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c22021820.cfilter(c)
return c:IsFaceup()
end
function c22021820.ntcon(e,c,minc) function c22021820.ntcon(e,c,minc)
if c==nil then return true end if c==nil then return true end
return minc==0 and c:IsLevelAbove(5) return minc==0 and c:IsLevelAbove(5) and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.GetFieldGroupCount(tp,LOCATION_PZONE,0)>0 and Duel.IsExistingMatchingCard(c22021820.cfilter,c:GetControler(),LOCATION_PZONE,0,1,nil)
and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end end
function c22021820.filter(c,e,tp) function c22021820.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
...@@ -78,26 +78,25 @@ end ...@@ -78,26 +78,25 @@ end
function s.xyzfilter(c, e, tp) function s.xyzfilter(c, e, tp)
return c:IsRank(6) and s.ForceFighter(c) and c:IsType(TYPE_XYZ) return c:IsRank(6) and s.ForceFighter(c) and c:IsType(TYPE_XYZ)
and c:IsCanBeSpecialSummoned(e, 0, tp, false, false) and c:IsCanBeSpecialSummoned(e, 0, tp, true, false)
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)
if chk == 0 then return Duel.GetLocationCountFromEx(tp) > 0
and Duel.IsExistingMatchingCard(s.xyzfilter, tp, LOCATION_EXTRA, 0, 1, nil, e, tp) end if chk == 0 then return Duel.IsExistingMatchingCard(s.xyzfilter, tp, LOCATION_EXTRA, 0, 1, nil, e, tp) end
Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_EXTRA) Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_EXTRA)
end end
function s.spop(e, tp, eg, ep, ev, re, r, rp) function s.spop(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler() local c = e:GetHandler()
if Duel.GetLocationCountFromEx(tp) <= 0 then return end
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
local g = Duel.SelectMatchingCard(tp, s.xyzfilter, tp, LOCATION_EXTRA, 0, 1, 1, nil, e, tp) local g = Duel.SelectMatchingCard(tp, s.xyzfilter, tp, LOCATION_EXTRA, 0, 1, 1, nil, e, tp)
local sc = g:GetFirst() local sc = g:GetFirst()
if sc and Duel.SpecialSummon(sc, 0, tp, tp, false, false, POS_FACEUP) > 0 then if sc and Duel.SpecialSummon(sc, 0, tp, tp, true, false, POS_FACEUP) > 0 then
if c:IsRelateToEffect(e) and c:IsLocation(LOCATION_GRAVE) then if c:IsRelateToEffect(e) and c:IsLocation(LOCATION_GRAVE) then
Duel.Overlay(sc, Group.FromCards(c)) Duel.Overlay(sc, Group.FromCards(c))
end end
end end
end end
\ No newline at end of file
...@@ -65,24 +65,24 @@ end ...@@ -65,24 +65,24 @@ end
function s.spfilter(c, e, tp) function s.spfilter(c, e, tp)
return s.ForceFighter(c) and c:IsRank(4) and c:IsType(TYPE_XYZ) return s.ForceFighter(c) and c:IsRank(4) and c:IsType(TYPE_XYZ)
and c:IsCanBeSpecialSummoned(e, 0, tp, false, false) and c:IsCanBeSpecialSummoned(e, 0, tp, true, false)
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)
if chk == 0 then return Duel.GetLocationCountFromEx(tp) > 0
and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_EXTRA, 0, 1, nil, e, tp) end if chk == 0 then return Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_EXTRA, 0, 1, nil, e, tp) end
Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_EXTRA) Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_EXTRA)
end end
function s.spop(e, tp, eg, ep, ev, re, r, rp) function s.spop(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler() local c = e:GetHandler()
if Duel.GetLocationCountFromEx(tp) <= 0 then return end
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
local g = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_EXTRA, 0, 1, 1, nil, e, tp) local g = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_EXTRA, 0, 1, 1, nil, e, tp)
local sc = g:GetFirst() local sc = g:GetFirst()
if sc and Duel.SpecialSummon(sc, 0, tp, tp, false, false, POS_FACEUP) > 0 then if sc and Duel.SpecialSummon(sc, 0, tp, tp, true, false, POS_FACEUP) > 0 then
if c:IsRelateToEffect(e) and c:IsLocation(LOCATION_SZONE) then if c:IsRelateToEffect(e) and c:IsLocation(LOCATION_SZONE) then
Duel.Overlay(sc, Group.FromCards(c)) Duel.Overlay(sc, Group.FromCards(c))
end end
......
...@@ -28,7 +28,7 @@ function s.initial_effect(c) ...@@ -28,7 +28,7 @@ function s.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE) e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCountLimit(1, id + 100) --e2:SetCountLimit(1, id + 100)
e2:SetTarget(s.sptg) e2:SetTarget(s.sptg)
e2:SetOperation(s.spop) e2:SetOperation(s.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
...@@ -43,7 +43,7 @@ function s.initial_effect(c) ...@@ -43,7 +43,7 @@ function s.initial_effect(c)
e4:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_TO_GRAVE) e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1, id + 100) --e4:SetCountLimit(1, id + 100)
e4:SetCondition(s.leavecon) e4:SetCondition(s.leavecon)
e4:SetTarget(s.sptg) e4:SetTarget(s.sptg)
e4:SetOperation(s.spop) e4:SetOperation(s.spop)
...@@ -104,24 +104,23 @@ end ...@@ -104,24 +104,23 @@ end
function s.xyzfilter(c, e, tp) function s.xyzfilter(c, e, tp)
return s.ForceFighter(c) and c:IsRank(8) and c:IsType(TYPE_XYZ) return s.ForceFighter(c) and c:IsRank(8) and c:IsType(TYPE_XYZ)
and c:IsCanBeSpecialSummoned(e, 0, tp, false, false) and c:IsCanBeSpecialSummoned(e, 0, tp, true, false)
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)
if chk == 0 then return Duel.GetLocationCountFromEx(tp) > 0 if chk == 0 then return Duel.IsExistingMatchingCard(s.xyzfilter, tp, LOCATION_EXTRA, 0, 1, nil, e, tp) end
and Duel.IsExistingMatchingCard(s.xyzfilter, tp, LOCATION_EXTRA, 0, 1, nil, e, tp) end
Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_EXTRA) Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_EXTRA)
end end
function s.spop(e, tp, eg, ep, ev, re, r, rp) function s.spop(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler() local c = e:GetHandler()
if Duel.GetLocationCountFromEx(tp) <= 0 then return end
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
local g = Duel.SelectMatchingCard(tp, s.xyzfilter, tp, LOCATION_EXTRA, 0, 1, 1, nil, e, tp) local g = Duel.SelectMatchingCard(tp, s.xyzfilter, tp, LOCATION_EXTRA, 0, 1, 1, nil, e, tp)
local sc = g:GetFirst() local sc = g:GetFirst()
if sc and Duel.SpecialSummon(sc, 0, tp, tp, false, false, POS_FACEUP) > 0 then if sc and Duel.SpecialSummon(sc, 0, tp, tp, true, false, POS_FACEUP) > 0 then
if c:IsRelateToEffect(e) then if c:IsRelateToEffect(e) then
Duel.Overlay(sc, Group.FromCards(c)) Duel.Overlay(sc, Group.FromCards(c))
......
...@@ -43,6 +43,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -43,6 +43,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
att=att|tc:GetAttribute() att=att|tc:GetAttribute()
end end
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,att) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,att) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
e:SetLabel(att)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end end
function s.actfilter(c,tp) function s.actfilter(c,tp)
...@@ -50,11 +51,7 @@ function s.actfilter(c,tp) ...@@ -50,11 +51,7 @@ function s.actfilter(c,tp)
end end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
local att=0 local att=e:GetLabel()
local g=eg:Filter(Card.IsFaceup,nil)
for tc in aux.Next(g) do
att=att|tc:GetAttribute()
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,att) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,att)
if #g>0 then if #g>0 then
......
...@@ -51,7 +51,7 @@ end ...@@ -51,7 +51,7 @@ end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.Equip(tp,c,tc) Duel.Equip(tp,c,tc)
......
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