--Chronovert Paladin local s,id=GetID() function s.initial_effect(c) aux.AddOrigTimeleapType(c,false) aux.AddTimeleapProc(c,7,s.sumcon,s.tlfilter) c:EnableReviveLimit() --If this card is Time Leap Summoned: You can shuffle up to 2 cards from your hand or field into the Deck, except this card, and if you do, for each card shuffled, this card gains 1 additional attack during each Battle Phase this turn. local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TODECK) e1:SetRange(LOCATION_MZONE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCountLimit(1,id) e1:SetCondition(s.atkcon) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) c:RegisterEffect(e1) --If this Time Leap Summoned card in its owner's control leaves the field because of an opponent's card effect: You can target 1 monster your opponent controls; Shuffle it into the Deck. local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_TODECK) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_LEAVE_FIELD) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.tdcon) e2:SetTarget(s.tdtg) e2:SetOperation(s.tdop) c:RegisterEffect(e2) aux.GlobalCheck(s,function() local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetCode(EVENT_TO_DECK) ge1:SetLabel(id) ge1:SetOperation(s.regop) Duel.RegisterEffect(ge1,0) end) end function s.sumcon(e,c) return Duel.GetFlagEffect(e:GetHandlerPlayer(),id)>0 end function s.tlfilter(c,e,mg) local tp=c:GetControler() local ef=e:GetHandler():GetFuture() return c:IsLevelBelow(ef-1) and c:IsRace(RACE_WARRIOR) end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_TIMELEAP) end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,c) end Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,2,c) if #g>0 then local td=Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) if td>0 then local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,td-1)) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EXTRA_ATTACK) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetValue(td) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) c:RegisterEffect(e1) end end end function s.tdcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsSummonType(SUMMON_TYPE_TIMELEAP) and c:GetReasonPlayer()~=tp and c:IsPreviousControler(tp) and c:IsReason(REASON_EFFECT) end function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(1-tp) end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local tc=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TODECK,tc,1,1-tp,tc:GetFirst():GetLocation()) end function s.tdop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end end function s.regop(e,tp,eg,ep,ev,re,r,rp) local tc=eg:GetFirst() for tc in aux.Next(eg) do Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(1-tp,id,RESET_PHASE+PHASE_END,0,1) end end