--Temporius in the Past - "PEPE" local s,id=GetID() function s.initial_effect(c) aux.EnablePendulumAttribute(c,false) aux.AddOrigTimeleapType(c,false) aux.AddTimeleapProc(c,5,s.sumcon,s.tlfilter) c:EnableReviveLimit() --If a Time Leap Monster is Time Leap Summoned: All Time Leap monsters you currently control gain 1000 ATK until the end of this turn. local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e1:SetRange(LOCATION_PZONE) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(s.atkcon) e1:SetOperation(s.atkop) c:RegisterEffect(e1) --Place this card in the Pendulum Zone local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_DESTROYED) e2:SetCondition(s.pencon) e2:SetTarget(s.pentg) e2:SetOperation(s.penop) c:RegisterEffect(e2) --If this card is Special Summoned: You can target up to 2 cards you control; destroy them, and if you do, add "Temporius" cards with different names from your Deck to your hand equal to the number of cards destroyed. local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCountLimit(1,id) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) c:RegisterEffect(e3) end function s.sumcon(e,c) return not Duel.CheckPendulumZones(e:GetHandlerPlayer()) end function s.tlfilter(c,e,mg) local tp=c:GetControler() local ef=e:GetHandler():GetFuture() return c:IsLevelBelow(ef-1) and (c:IsAttribute(ATTRIBUTE_EARTH) or c:IsType(TYPE_PENDULUM)) end function s.cfilter(c,tp) return c:IsFaceup() and c:IsType(TYPE_TIMELEAP) and c:IsControler(tp) and c:IsSummonType(SUMMON_TYPE_TIMELEAP) end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,tp) end function s.filter(c) return c:IsFaceup() and c:IsType(TYPE_TIMELEAP) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,0,nil) local tc=g:GetFirst() for tc in aux.Next(g) do local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(1000) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e1) end end function s.pencon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsFaceup() and c:IsPreviousLocation(LOCATION_MZONE) end function s.pentg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckPendulumZones(tp) end end function s.penop(e,tp,eg,ep,ev,re,r,rp) if not Duel.CheckPendulumZones(tp) then return end local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true) end end function s.thfilter(c) return c:IsSetCard(0x723) and not c:IsCode(id) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsOnField() end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,0,1,nil) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil) local ct=g:GetClassCount(Card.GetCode) if ct>2 then ct=2 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local dg=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,ct,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,#dg,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,#dg,tp,LOCATION_DECK) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local dg=Duel.GetTargetCards(e) local ct=Duel.Destroy(dg,REASON_EFFECT) local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil) if ct==0 or #g==0 then return end if ct>g:GetClassCount(Card.GetCode) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g1=g:Select(tp,1,1,nil) if ct==2 then g:Remove(Card.IsCode,nil,g1:GetFirst():GetCode()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g2=g:Select(tp,1,1,nil) g1:Merge(g2) end Duel.SendtoHand(g1,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g1) end