Commit cfa0c3ac authored by 八宫一月's avatar 八宫一月

add

parent 7fcda779
Pipeline #43015 passed with stages
in 5 minutes and 6 seconds
--Vortex of Time
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,97077563)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_COIN)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.condition)
e1:SetTarget(s.chtg)
e1:SetOperation(s.chop)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,0,nil)
local check=g:IsExists(Card.IsRace,1,nil,RACE_ZOMBIE) and g:IsExists(Card.IsCode,1,nil,97077563)
return rp==1-tp and (re:IsActiveType(TYPE_MONSTER)
or (re:GetActiveType()==TYPE_SPELL or re:IsActiveType(TYPE_QUICKPLAY)) and re:IsHasType(EFFECT_TYPE_ACTIVATE)) and check
end
function s.chtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
end
function s.chop(e,tp,eg,ep,ev,re,r,rp)
local res=Duel.TossCoin(1-tp,1)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
if res==1 then
Duel.ChangeChainOperation(ev,s.repop1)
else
Duel.ChangeChainOperation(ev,s.repop2)
end
end
function s.repop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(1-tp,Card.IsAbleToRemove,1-tp,LOCATION_MZONE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_RULE)
end
function s.repop2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_MZONE,0,nil)
Duel.Remove(g,POS_FACEUP,REASON_RULE)
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