Commit a86e9017 authored by 聖園ミカ's avatar 聖園ミカ 🐟

vme50

parent 6ef3dd5c
--新序系8 以太索贝克
function c17032460.initial_effect(c)
--新序系8 以太索贝克--新序系8 以太索贝克
local s,id,o=GetID()
function s.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,8,2,c17032460.ovfilter,aux.Stringid(17032460,1),2,c17032460.xyzop)
aux.AddXyzProcedure(c,nil,8,2,s.ovfilter,aux.Stringid(17032460,1),2,s.xyzop)
c:EnableReviveLimit()
--search
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c17032460.thcon)
e1:SetTarget(c17032460.thtg)
e1:SetOperation(c17032460.thop)
e1:SetCondition(s.thcon)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--destroy
local e3=Effect.CreateEffect(c)
......@@ -20,25 +21,25 @@ function c17032460.initial_effect(c)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCost(c17032460.cost)
e3:SetTarget(c17032460.target)
e3:SetOperation(c17032460.operation)
e3:SetCost(s.cost)
e3:SetTarget(s.target)
e3:SetOperation(s.operation)
c:RegisterEffect(e3)
end
c17032460.New_Order=8
function c17032460.cfilter(c)
s.New_Order=8
function s.cfilter(c)
return c:IsSetCard(0x95) and c:IsType(TYPE_SPELL) and (c:IsDiscardable() or c:IsAbleToHand())
end
function c17032460.ovfilter(c)
function s.ovfilter(c)
return c:IsFaceup() and c.New_Order and c:IsRank(6)
end
function c17032460.xyzop(e,tp,chk)
function s.xyzop(e,tp,chk)
local fe=Duel.IsPlayerAffectedByEffect(tp,17032500)
local loc=LOCATION_HAND
if fe then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c17032460.cfilter,tp,loc,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,loc,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c17032460.cfilter,tp,loc,0,1,1,nil):GetFirst()
local tc=Duel.SelectMatchingCard(tp,s.cfilter,tp,loc,0,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_DECK) then
Duel.Hint(HINT_CARD,0,17032500)
fe:UseCountLimit(tp)
......@@ -47,53 +48,91 @@ function c17032460.xyzop(e,tp,chk)
Duel.SendtoGrave(tc,REASON_DISCARD+REASON_COST)
end
end
function c17032460.thcon(e,tp,eg,ep,ev,re,r,rp)
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function c17032460.thfilter(c)
function s.thfilter(c)
return c:IsCode(17032510) and c:IsAbleToHand()
end
function c17032460.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c17032460.thfilter,tp,LOCATION_DECK,0,1,nil) end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c17032460.thop(e,tp,eg,ep,ev,re,r,rp)
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c17032460.thfilter,tp,LOCATION_DECK,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c17032460.cost(e,tp,eg,ep,ev,re,r,rp,chk)
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c17032460.filter(c,tp)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:CheckActivateEffect(false,false,false)~=nil
function s.filter(c,e,tp)
local te,eg,ep,ev,re,r,rp=c:CheckActivateEffect(true,true,true)
local cost=nil
if te and te:GetCost() then cost=te:GetCost() end
local condition=nil
if te and te:GetCondition() then condition=te:GetCondition() end
local tg=nil
if te and te:GetTarget() then tg=te:GetTarget() end
local res=c:CheckActivateEffect(true,true,false)~=nil
and (not cost or cost(e,tp,eg,ep,ev,re,r,rp,0)) and te:CheckCountLimit(tp)==true
and (not condition or condition(e,tp,eg,ep,ev,re,r,rp)) and (not tg or tg(e,tp,eg,ep,ev,re,r,rp,0))
return c:IsType(TYPE_SPELL+TYPE_TRAP) and res
end
function c17032460.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c17032460.filter,tp,LOCATION_HAND,0,1,nil,tp) end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.ClearOperationInfo(0)
end
function c17032460.operation(e,tp,eg,ep,ev,re,r,rp)
function s.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(17032460,0))
local tc=Duel.SelectMatchingCard(tp,c17032460.filter,tp,LOCATION_HAND,0,1,1,nil,tp):GetFirst()
local tc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp):GetFirst()
local loc=nil
if tc:IsType(TYPE_FIELD) then loc=LOCATION_FZONE else loc=LOCATION_SZONE end
if tc then
Duel.MoveToField(tc,tp,tp,loc,POS_FACEUP,true)
local te=tc:GetActivateEffect()
local cte,ceg,cep,cev,cre,cr,crp=tc:CheckActivateEffect(true,true,true)
local cost=nil
if cte and cte:GetCost() then cost=cte:GetCost() end
local condition=nil
if cte and cte:GetCondition() then condition=cte:GetCondition() end
local target=nil
if cte and cte:GetTarget() then target=cte:GetTarget() end
if tc and tc:CheckActivateEffect(true,true,false)~=nil
and (not cost or cost(e,tp,eg,ep,ev,re,r,rp,0)) and te:CheckCountLimit(tp)==true
and (not condition or condition(e,tp,eg,ep,ev,re,r,rp)) and (not target or target(e,tp,eg,ep,ev,re,r,rp,0)) then
Duel.MoveToField(tc,tp,tp,loc,POS_FACEUP,true)
local bc=Duel.GetOperatedGroup():GetFirst()
te:UseCountLimit(tp,1,true)
tc:CreateEffectRelation(te)
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
e:SetLabelObject(te:GetLabelObject())
local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
local target=te:GetTarget()
if target then
target(e,tp,eg,ep,ev,re,r,rp,1)
Duel.RaiseEvent(bc,EVENT_CHAINING,cte,0,tp,tp,Duel.GetCurrentChain())
end
local ag=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if ag then
for ac in aux.Next(ag) do
--Duel.Hint(HINT_CARD,0,ac:GetOriginalCode())
ac:CreateEffectRelation(te)
end
end
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
if not tc:IsType(TYPE_FIELD+TYPE_CONTINUOUS) then
tc:ReleaseEffectRelation(te)
if ag then
for ac in aux.Next(ag) do
ac:ReleaseEffectRelation(te)
end
end
if not tc:IsType(TYPE_CONTINUOUS+TYPE_FIELD) then
Duel.SendtoGrave(tc,REASON_RULE)
end
end
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