Commit 5ab1f01b authored by wind2009's avatar wind2009

Update SelectFromOptions

parent 334cd55c
......@@ -14,7 +14,7 @@ function s.initial_effect(c)
e1:SetCountLimit(1,id)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
c:RegisterEffect(e1)
--special summon(self)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
......@@ -25,7 +25,7 @@ function s.initial_effect(c)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg1)
e2:SetOperation(s.spop1)
c:RegisterEffect(e2)
c:RegisterEffect(e2)
end
function s.spfilter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM)
......@@ -78,7 +78,7 @@ end
function s.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if c:IsRelateToEffect(e) then
if c:IsRelateToEffect(e) and aux.NecroValleyFilter()(c) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
......@@ -94,9 +94,20 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local b1=Duel.IsPlayerCanDraw(tp,1)
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp)
if chk==0 then return b1 or b2 end
local op=aux.SelectFromOptions(tp,
local op=0
if b1 and not b2 then
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,3))
op=1
end
if b2 and not b1 then
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,4))
op=2
end
if b1 and b2 then
op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(id,3)},
{b2,aux.Stringid(id,4)})
end
e:SetLabel(op)
if op==1 then
e:SetCategory(CATEGORY_DRAW)
......
......@@ -57,9 +57,20 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=res and Duel.GetFlagEffect(tp,id)==0
local b2=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,1,nil) and Duel.GetFlagEffect(tp,id+o)==0
if chk==0 then return b1 or b2 end
local op=aux.SelectFromOptions(tp,
local op=0
if b1 and not b2 then
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,1))
op=1
end
if b2 and not b1 then
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,2))
op=2
end
if b1 and b2 then
op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(id,1)},
{b2,aux.Stringid(id,2)})
end
e:SetLabel(op)
if op==1 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_DECKDES)
......
......@@ -34,9 +34,20 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
local b2=Duel.GetFlagEffect(tp,id+o)==0 and Duel.IsExistingMatchingCard(s.thfilter2,tp,LOCATION_DECK,0,1,nil)
if chk==0 then return b1 or b2 end
local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(id,1)},
{b2,aux.Stringid(id,2)})
local op=0
if b1 and not b2 then
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,1))
op=1
end
if b2 and not b1 then
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,2))
op=2
end
if b1 and b2 then
op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(id,1)},
{b2,aux.Stringid(id,2)})
end
Duel.RegisterFlagEffect(tp,id+(op-1)*o,RESET_PHASE+PHASE_END,0,1)
if op==1 then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
......
......@@ -51,9 +51,20 @@ function s.fstg(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
if chk==0 then return res1 or res2 end
local op=aux.SelectFromOptions(tp,
{res1,aux.Stringid(id,2),1},
{res2,aux.Stringid(id,3),2})
local op=0
if res1 and not res2 then
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,2))
op=1
end
if res2 and not res1 then
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,3))
op=2
end
if res1 and res2 then
op=aux.SelectFromOptions(tp,
{res1,aux.Stringid(id,2),1},
{res2,aux.Stringid(id,3),2})
end
e:SetLabel(op)
if op==1 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
......
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