--Chronovert Dragon local s,id=GetID() function s.initial_effect(c) aux.AddOrigTimeleapType(c,false) aux.AddTimeleapProc(c,8,s.sumcon,{s.tlfilter,true}) c:EnableReviveLimit() Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter) --Once per turn when your opponent activates a card or effect in response to your card or effect activation: You can return this card you control to the Extra Deck, and if you do, negate that opponent's card, and if you do that, shuffle that card into the Deck. local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TODECK+CATEGORY_NEGATE) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(s.ngcon) e1:SetTarget(s.ngtg) e1:SetOperation(s.ngop) c:RegisterEffect(e1) aux.GlobalCheck(s,function() local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetCode(EVENT_CHAIN_NEGATED) ge1:SetLabel(id) ge1:SetOperation(s.regop) Duel.RegisterEffect(ge1,0) local ge2=ge1:Clone() ge2:SetCode(EVENT_CHAIN_DISABLED) ge2:SetLabel(id) Duel.RegisterEffect(ge2,0) end) end function s.sumcon(e,c) local tp=c:GetControler() return Duel.GetCustomActivityCount(id,1-tp,ACTIVITY_CHAIN)~=0 end function s.tlfilter(c,e,mg) local tp=c:GetControler() local ef=e:GetHandler():GetFuture() return c:IsType(TYPE_EFFECT) and (c:IsLevel(ef-1) or (Duel.GetFlagEffect(e:GetHandlerPlayer(),id)>0 and (c:IsLevel(ef-2) or c:IsLevel(ef-3)))) end function s.regop(e,tp,eg,ep,ev,re,r,rp) Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(1-tp,id,RESET_PHASE+PHASE_END,0,1) end function s.chainfilter(re,tp,cid) return not (re:IsActiveType(TYPE_MONSTER) and Duel.IsMainPhase()) end function s.ngcon(e,tp,eg,ep,ev,re,r,rp) if not (ep==1-tp and Duel.IsChainDisablable(ev)) or re:GetHandler():IsDisabled() then return false end local ch=Duel.GetCurrentChain(true)-1 if ch>0 then local cplayer=Duel.GetChainInfo(ch,CHAININFO_TRIGGERING_CONTROLER) local ceff=Duel.GetChainInfo(ch,CHAININFO_TRIGGERING_EFFECT) if cplayer==tp then return true end end end function s.ngtg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return not c:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsAbleToExtra() end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,0,0) if re:GetHandler():IsAbleToDeck() and re:GetHandler():IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_TODECK,eg,1,0,0) end end function s.ngop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsControler(tp) then if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,0,REASON_EFFECT) then if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then re:GetHandler():CancelToGrave() Duel.SendtoDeck(re:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end end end end