Commit ef222bf3 authored by POLYMER's avatar POLYMER

fix

parent f9161793
......@@ -12,14 +12,25 @@ function s.initial_effect(c)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.costfilter(c)
return c:IsRace(RACE_WYRM) and c:IsAttribute(ATTRIBUTE_FIRE)
function s.costfilter(c,tp)
return c:IsReleasable() and (c:IsControler(tp) and c:IsRace(RACE_WYRM) and c:IsAttribute(ATTRIBUTE_FIRE) or c:IsControler(1-tp) and c:IsFaceup())
end
function s.fselect(g,tp,fe)
local ct=fe and 1 or 0
return g:FilterCount(Card.IsControler,nil,1-tp)<=ct
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local rlg=Duel.GetMatchingGroup(s.costfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp)
local spct=0
if Duel.CheckReleaseGroup(tp,s.costfilter,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
local g=Duel.SelectReleaseGroup(tp,s.costfilter,1,99,nil)
local fe=Duel.IsPlayerAffectedByEffect(tp,89490080)
if rlg:CheckSubGroup(s.fselect,1,#rlg,tp,fe) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=rlg:SelectSubGroup(tp,s.fselect,false,1,rgc,tp,fe)
if g:IsExists(Card.IsControler,1,nil,1-tp) then
Duel.Hint(HINT_CARD,0,89490080)
fe:UseCountLimit(tp)
end
Duel.Release(g,REASON_COST)
spct=#g
end
......@@ -36,6 +47,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
if e:GetLabel()>0 then
e:SetCategory(e:GetCategory()|CATEGORY_REMOVE)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_ONFIELD)
else
e:SetCategory(e:GetCategory()&~CATEGORY_REMOVE)
end
......@@ -45,10 +57,10 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
if tc:IsRelateToEffect(e) and aux.NecroValleyFilter()(tc) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
local spct=e:GetLabel()
if spct>0 and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,spct,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
if spct>0 and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,spct,spct,nil)
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,spct,nil)
if #sg<=0 then return end
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
end
......
......@@ -41,8 +41,14 @@ end
function c9910941.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c9910941.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
g:KeepAlive()
e:SetLabelObject(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c9910941.hintfilter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_HAND)
end
function c9910941.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
......@@ -66,11 +72,15 @@ function c9910941.spop(e,tp,eg,ep,ev,re,r,rp)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local g=e:GetLabelObject():Filter(c9910941.hintfilter,nil,tp)
if #g>0 then Duel.HintSelection(g) end
e:GetLabelObject():DeleteGroup()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c9910941.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
local sg=Duel.SelectMatchingCard(tp,c9910941.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
Duel.ShuffleHand(tp)
end
function c9910941.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x3954)
......
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