Commit 4c0b93dc authored by wind2009's avatar wind2009

format

parent ef6e039c
Pipeline #30663 passed with stages
in 1 minute and 55 seconds
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
local s,id,o=GetID() local s,id,o=GetID()
---@param c Card ---@param c Card
function s.initial_effect(c) function s.initial_effect(c)
--link summon --link summon
aux.AddLinkProcedure(c,nil,2,99,s.lcheck) aux.AddLinkProcedure(c,nil,2,99,s.lcheck)
c:EnableReviveLimit() c:EnableReviveLimit()
--activate --activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
...@@ -17,8 +17,8 @@ function s.initial_effect(c) ...@@ -17,8 +17,8 @@ function s.initial_effect(c)
e1:SetTarget(s.actarget) e1:SetTarget(s.actarget)
e1:SetOperation(s.acoperation) e1:SetOperation(s.acoperation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--draw --draw
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DRAW+CATEGORY_TODECK) e2:SetCategory(CATEGORY_DRAW+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY) e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
...@@ -38,58 +38,58 @@ function s.accost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -38,58 +38,58 @@ function s.accost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD) Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end end
function s.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return c:IsAttribute(ATTRIBUTE_DARK+ATTRIBUTE_LIGHT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsAttribute(ATTRIBUTE_DARK+ATTRIBUTE_LIGHT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function s.actarget(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.actarget(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler() local c=e:GetHandler()
local b1=Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) local b1=Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
local b2=Duel.GetMZoneCount(tp,c)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) local b2=Duel.GetMZoneCount(tp,c)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
if chk==0 then return b1 or b2 end if chk==0 then return b1 or b2 end
local op=aux.SelectFromOptions(tp, local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(id,2)}, {b1,aux.Stringid(id,2)},
{b2,aux.Stringid(id,3)}) {b2,aux.Stringid(id,3)})
e:SetLabel(op) e:SetLabel(op)
if op==1 then if op==1 then
e:SetCategory(CATEGORY_DESTROY) e:SetCategory(CATEGORY_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
elseif op==2 then elseif op==2 then
e:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON) e:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end end
end end
function s.acoperation(e,tp,eg,ep,ev,re,r,rp) function s.acoperation(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel() local op=e:GetLabel()
if op==1 then if op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if #g>0 then if #g>0 then
Duel.HintSelection(g) Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT) Duel.Destroy(g,REASON_EFFECT)
end end
elseif op==2 then elseif op==2 then
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.Remove(c,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then if c:IsRelateToEffect(e) and Duel.Remove(c,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then
if c:GetOriginalCode()==id then if c:GetOriginalCode()==id then
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1) c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(c) e1:SetLabelObject(c)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetCondition(s.retcon) e1:SetCondition(s.retcon)
e1:SetOperation(s.retop) e1:SetOperation(s.retop)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
if Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp) then if Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end end
end end
end end
end end
function s.retcon(e,tp,eg,ep,ev,re,r,rp) function s.retcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabelObject():GetFlagEffect(id)~=0 return e:GetLabelObject():GetFlagEffect(id)~=0
...@@ -98,24 +98,24 @@ function s.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -98,24 +98,24 @@ function s.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject()) Duel.ReturnToField(e:GetLabelObject())
end end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_MONSTER) local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_MONSTER)
local ct=g:GetClassCount(Card.GetRace) local ct=g:GetClassCount(Card.GetRace)
if chk==0 then return ct>0 and Duel.IsPlayerCanDraw(tp,ct) end if chk==0 then return ct>0 and Duel.IsPlayerCanDraw(tp,ct) end
Duel.SetTargetPlayer(tp) Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ct) Duel.SetTargetParam(ct)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,ct,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,ct,tp,LOCATION_HAND)
end end
function s.dract(e,tp,eg,ep,ev,re,r,rp) function s.dract(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_MONSTER) local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_MONSTER)
local ct=g:GetClassCount(Card.GetRace) local ct=g:GetClassCount(Card.GetRace)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
if ct>0 then if ct>0 then
Duel.Draw(p,ct,REASON_EFFECT) Duel.Draw(p,ct,REASON_EFFECT)
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.GetFieldGroup(p,LOCATION_HAND,0):Select(p,ct,ct,nil) local g=Duel.GetFieldGroup(p,LOCATION_HAND,0):Select(p,ct,ct,nil)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
aux.PlaceCardsOnDeckBottom(tp,g) aux.PlaceCardsOnDeckBottom(tp,g)
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