Commit 86c4d30e authored by wind2009's avatar wind2009

Fix サイバー・ヨルムンガンド

parent 36f6238e
Pipeline #31961 passed with stages
in 1 minute and 8 seconds
--サイバー・ヨルムンガンド --サイバー・ヨルムンガンド
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
aux.AddCodeList(c,70095154) aux.AddCodeList(c,70095154,24094653)
--splimit --splimit
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE) e0:SetType(EFFECT_TYPE_SINGLE)
...@@ -38,36 +38,49 @@ end ...@@ -38,36 +38,49 @@ end
function s.spcon(e,tp,eg,ep,ev,re,r,rp) function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
end end
function s.eqfilter(c,e,tp) function s.eqfilter(c,e,tp,chk)
return c:IsCode(70095154) return c:IsCode(70095154)
and ((not ec and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 or Duel.IsPlayerCanSpecialSummonCount(tp,2) and Duel.GetLocationCount(tp,LOCATION_MZONE)>1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and
or Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and c:CheckUniqueOnField(tp)) (not chk and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
or chk and Duel.IsPlayerCanSpecialSummonCount(tp,2) and Duel.GetLocationCount(tp,LOCATION_MZONE)>1)
or Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and c:CheckUniqueOnField(tp)
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 c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(s.eqfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(s.eqfilter,tp,LOCATION_DECK,0,1,nil,e,tp,true) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
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()
if c:IsRelateToChain() and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then if c:IsRelateToChain() and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.eqfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,s.eqfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,false)
local tc=g:GetFirst() local tc=g:GetFirst()
if not tc then return end if tc then
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) and (Duel.GetLocationCount(tp,LOCATION_SZONE)<1 or not Duel.SelectYesNo(tp,aux.Stringid(id,2))) then local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) local b2=Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and tc:CheckUniqueOnField(tp)
else local op=0
Duel.Equip(tp,tc,c) if b1 and not b2 then op=1 end
local e1=Effect.CreateEffect(c) if b2 and not b1 then op=2 end
e1:SetType(EFFECT_TYPE_SINGLE) if b1 and b2 then
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE) op=aux.SelectFromOptions(tp,
e1:SetCode(EFFECT_EQUIP_LIMIT) {b1,1152,1},
e1:SetReset(RESET_EVENT+RESETS_STANDARD) {b2,1068,2})
e1:SetValue(s.eqlimit) end
tc:RegisterEffect(e1) if op==1 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
elseif op==2 then
Duel.Equip(tp,tc,c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(s.eqlimit)
tc:RegisterEffect(e1)
end
end end
end end
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -86,12 +99,13 @@ function s.eqlimit(e,c) ...@@ -86,12 +99,13 @@ function s.eqlimit(e,c)
return e:GetOwner()==c return e:GetOwner()==c
end end
function s.costfilter(c) function s.costfilter(c)
return c:IsCode(70095154) and c:IsAbleToHandAsCost() return c:IsFaceup() and c:IsCode(70095154) and c:IsAbleToHandAsCost()
end end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_ONFIELD,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_ONFIELD,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.HintSelection(g)
Duel.SendtoHand(g,nil,REASON_COST) Duel.SendtoHand(g,nil,REASON_COST)
end end
function s.thfilter(c) function s.thfilter(c)
......
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