Commit dab7160b authored by POLYMER's avatar POLYMER

fix

parent 4c1bd8ab
......@@ -14,36 +14,28 @@ function c22023370.initial_effect(c)
c:RegisterEffect(e1)
end
function c22023370.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
return true
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsCode,1,nil,22023350) end
local g=Duel.SelectReleaseGroup(tp,Card.IsCode,1,1,nil,22023350)
Duel.Release(g,REASON_COST)
end
function c22023370.filter1(c,e,tp)
return c:IsCode(22023350) and Duel.IsExistingMatchingCard(c22023370.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,nil,c)
end
function c22023370.filter2(c,e,tp,att,mc)
function c22023370.filter(c,e,tp,att,mc)
return c:IsCode(22023360) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_LINK,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function c22023370.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_LMATERIAL) and Duel.CheckReleaseGroup(REASON_COST,tp,c22023370.filter1,1,nil,e,tp)
end
local rg=Duel.SelectReleaseGroup(REASON_COST,tp,c22023370.filter1,1,1,nil,e,tp)
e:SetLabel(rg:GetFirst():GetOriginalAttribute())
if chk==0 then return aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_LMATERIAL)
and Duel.IsExistingMatchingCard(c22023370.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.Hint(HINT_CARD,0,22023350)
Duel.SelectOption(tp,aux.Stringid(22023370,1))
Duel.SelectOption(tp,aux.Stringid(22023370,2))
Duel.Release(rg,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c22023370.activate(e,tp,eg,ep,ev,re,r,rp)
if not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_LMATERIAL) then return end
local att=e:GetLabel()
Duel.SelectOption(tp,aux.Stringid(22023370,3))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c22023370.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,att,nil)
local g=Duel.SelectMatchingCard(tp,c22023370.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,att,nil)
local tc=g:GetFirst()
if tc then
Duel.SelectOption(tp,aux.Stringid(22023370,4))
......
......@@ -51,18 +51,32 @@ end
function s.tgfilter(c)
return c:IsRace(RACE_WYRM) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function s.rlfilter(c)
return c:IsFaceup() and c:IsReleasable()
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local fe=Duel.IsPlayerAffectedByEffect(tp,89490052)
local b1=fe and Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil)
local b2=c:IsReleasable()
if chk==0 then return b1 or b2 end
if b1 and (not b2 or Duel.SelectYesNo(tp,fe:GetDescription())) then
local fe1=Duel.IsPlayerAffectedByEffect(tp,89490052)
local b1=fe1 and Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil)
local fe2=Duel.IsPlayerAffectedByEffect(tp,89490080)
local b2=fe2 and Duel.IsExistingMatchingCard(s.rlfilter,tp,0,LOCATION_MZONE,1,nil)
local b3=c:IsReleasable()
if chk==0 then return b1 or b2 or b3 end
local op=aux.SelectFromOptions(tp,{b1,fe1 and fe1:GetDescription() or nil},{b2,fe2 and fe2:GetDescription() or nil},{b3,1150})
if op==1 then
Duel.Hint(HINT_CARD,0,89490052)
fe:UseCountLimit(tp)
fe1:UseCountLimit(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
e:SetLabel(0)
elseif op==2 then
Duel.Hint(HINT_CARD,0,89490080)
fe2:UseCountLimit(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,s.rlfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.Release(g,REASON_COST)
e:SetLabel(0)
else
Duel.Release(c,REASON_COST)
if c:IsLocation(LOCATION_HAND) then e:SetLabel(1) else e:SetLabel(0) 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