Commit f1fef804 authored by salix5's avatar salix5
parent 83053adb
...@@ -18,23 +18,22 @@ end ...@@ -18,23 +18,22 @@ end
function c12247206.nfilter(c,tc) function c12247206.nfilter(c,tc)
return c:IsCode(tc:GetCode()) return c:IsCode(tc:GetCode())
end end
function c12247206.spfilter1(c,tc,e,tp)
return c12247206.nfilter(c,tc) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK)
end
function c12247206.spfilter2(c,tc,e,tp)
return c12247206.nfilter(c,tc) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c12247206.target(e,tp,eg,ep,ev,re,r,rp,chk) function c12247206.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=eg:GetFirst() local tc=eg:GetFirst()
if chk==0 then if chk==0 then
local g=Duel.GetMatchingGroup(c12247206.nfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,tc) local g=Duel.GetMatchingGroup(c12247206.spfilter1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,tc,e,tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and g:GetCount()>0
and g:GetCount()>0 and g:GetCount()==g:FilterCount(Card.IsCanBeSpecialSummoned,nil,e,0,tp,false,false,POS_FACEUP_ATTACK)
end end
tc:CreateEffectRelation(e) tc:CreateEffectRelation(e)
local g=Duel.GetMatchingGroup(c12247206.filter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,tc,e,tp) local g=Duel.GetMatchingGroup(c12247206.spfilter1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,tc,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),PLAYER_ALL,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),PLAYER_ALL,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end end
function c12247206.filter(c,tc,e,tp)
return c12247206.nfilter(c,tc) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK)
end
function c12247206.selfilter(c,e,tp)
return c:IsFaceup() and Duel.IsExistingMatchingCard(c12247206.filter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,c,e,tp)
end
function c12247206.sp(g,tp,pos) function c12247206.sp(g,tp,pos)
local sc=g:GetFirst() local sc=g:GetFirst()
while sc do while sc do
...@@ -46,24 +45,22 @@ function c12247206.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -46,24 +45,22 @@ function c12247206.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst() local tc=eg:GetFirst()
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft1>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then ft1=1 end if ft1>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then ft1=1 end
local gg=Group.CreateGroup() local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c12247206.spfilter1),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,tc,e,tp)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c12247206.filter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,tc,e,tp)
if ft1>0 and tc:IsFaceup() and tc:IsRelateToEffect(e) then if ft1>0 and tc:IsFaceup() and tc:IsRelateToEffect(e) then
if g:GetCount()<=ft1 then c12247206.sp(g,tp,POS_FACEUP_ATTACK) if g:GetCount()<=ft1 then
c12247206.sp(g,tp,POS_FACEUP_ATTACK)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local fg=g:Select(tp,ft1,ft1,nil) local fg=g:Select(tp,ft1,ft1,nil)
c12247206.sp(fg,tp,POS_FACEUP_ATTACK) c12247206.sp(fg,tp,POS_FACEUP_ATTACK)
g:Sub(fg)
gg:Merge(g)
end end
end end
local ft2=Duel.GetLocationCount(1-tp,LOCATION_MZONE) local ft2=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
if ft2>1 and Duel.IsPlayerAffectedByEffect(1-tp,59822133) then ft2=1 end if ft2>1 and Duel.IsPlayerAffectedByEffect(1-tp,59822133) then ft2=1 end
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_FACEUP)
local sg=Duel.SelectMatchingCard(1-tp,c12247206.selfilter,1-tp,LOCATION_MZONE,0,1,1,nil,e,1-tp) local sg=Duel.SelectMatchingCard(1-tp,Card.IsFaceup,1-tp,LOCATION_MZONE,0,1,1,nil)
if ft2>0 and sg:GetCount()>0 then if ft2>0 and sg:GetCount()>0 then
local g2=Duel.GetMatchingGroup(aux.NecroValleyFilter(c12247206.filter),1-tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,sg:GetFirst(),e,1-tp) local g2=Duel.GetMatchingGroup(aux.NecroValleyFilter(c12247206.spfilter2),1-tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,sg:GetFirst(),e,1-tp)
if g2:GetCount()>0 then if g2:GetCount()>0 then
if g2:GetCount()<=ft2 then if g2:GetCount()<=ft2 then
c12247206.sp(g2,1-tp,POS_FACEUP) c12247206.sp(g2,1-tp,POS_FACEUP)
...@@ -71,11 +68,8 @@ function c12247206.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -71,11 +68,8 @@ function c12247206.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local fg=g2:Select(1-tp,ft2,ft2,nil) local fg=g2:Select(1-tp,ft2,ft2,nil)
c12247206.sp(fg,1-tp,POS_FACEUP) c12247206.sp(fg,1-tp,POS_FACEUP)
g2:Sub(fg)
gg:Merge(g2)
end end
end end
end end
Duel.SpecialSummonComplete() Duel.SpecialSummonComplete()
Duel.SendtoGrave(gg,REASON_EFFECT)
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