Commit 2c7d44ff authored by wind2009's avatar wind2009

Fix 大輪の霊使い

parent c3b2ff05
No preview for this file type
...@@ -16,18 +16,27 @@ function s.initial_effect(c) ...@@ -16,18 +16,27 @@ function s.initial_effect(c)
e1:SetTarget(s.sptg) e1:SetTarget(s.sptg)
e1:SetOperation(s.spop) e1:SetOperation(s.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--material check
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_MATERIAL_CHECK)
e2:SetValue(s.valcheck)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
end end
function s.ffilter(c,fc) function s.ffilter(c,fc)
return c:IsFusionSetCard(0xbf,0xc0) return c:IsFusionSetCard(0xbf,0xc0)
end end
function s.valcheck(e,c)
local ct=c:GetMaterial():GetClassCount(Card.GetOriginalAttribute)
e:GetLabelObject():SetLabel(ct)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp) function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION) return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
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)
local c=e:GetHandler() local ct=e:GetLabel()
local ct=c:GetMaterialCount()
if chk==0 then return ct>0 end if chk==0 then return ct>0 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function s.thfilter(c) function s.thfilter(c)
return c:IsSetCard(0xc0) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand() return c:IsSetCard(0xc0) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
...@@ -37,20 +46,25 @@ function s.spfilter(c,e,tp) ...@@ -37,20 +46,25 @@ function s.spfilter(c,e,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)
local c=e:GetHandler() local c=e:GetHandler()
local ct=c:GetMaterial():GetClassCount(Card.GetOriginalAttribute) local ct=e:GetLabel()
if ct<=0 then return end if ct<=0 then return end
if ct>4 then ct=4 end if ct>4 then ct=4 end
for i=1,ct do for i=1,ct do
local b1=c:IsRelateToEffect(e) and c:IsFaceup() local b1=c:IsRelateToChain() and c:IsFaceup() and c:IsType(TYPE_MONSTER)
local b2=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) local b2=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil)
local b3=Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) local b3=Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
local b4=Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 local b4=Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local b5=i>1
if not b1 and not b2 and not b3 and not b4 then break end if not b1 and not b2 and not b3 and not b4 then break end
local op=aux.SelectFromOptions(tp, local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(id,1)}, {b1,aux.Stringid(id,1),1},
{b2,aux.Stringid(id,2)}, {b2,aux.Stringid(id,2),2},
{b3,aux.Stringid(id,3)}, {b3,aux.Stringid(id,3),3},
{b4,aux.Stringid(id,4)}) {b4,aux.Stringid(id,4),4},
{b5,aux.Stringid(id,5),5})
if i>1 and op~=5 then
Duel.BreakEffect()
end
if op==1 then if op==1 then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
...@@ -69,6 +83,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -69,6 +83,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
end end
elseif op==4 then elseif op==4 then
...@@ -77,6 +92,8 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -77,6 +92,8 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end end
elseif op==5 then
break
end end
end end
end end
\ No newline at end of file
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