--PSY-Framelord Sigma local s,id=GetID() function s.initial_effect(c) aux.AddOrigTimeleapType(c,false) aux.AddTimeleapProc(c,7,aux.FALSE,aux.FALSE) c:EnableReviveLimit() --You can also Time Leap Summon this card using a Level 2 or lower Psychic monster with 0 DEF. local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetRange(LOCATION_EXTRA) e1:SetCondition(s.sumcon) e1:SetTarget(s.sumtg) e1:SetOperation(s.sumop) e1:SetValue(SUMMON_TYPE_TIMELEAP) c:RegisterEffect(e1) --During the Main Phase (Quick Effect): You can banish both this card you control and the top 5 cards of your opponent's Deck until your next Standby Phase. local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_REMOVE) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,0}) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END) e2:SetCondition(function() return Duel.IsMainPhase() end) e2:SetTarget(s.rmtg) e2:SetOperation(s.rmop) c:RegisterEffect(e2) c:RegisterFlagEffect(id,0,EFFECT_FLAG_UNCOPYABLE,0) --If this card is in your GY: You can target 1 banished card; shuffle both that card and this card into the Deck. local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_TODECK) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetRange(LOCATION_GRAVE) e3:SetCountLimit(1,{id,1}) e3:SetTarget(s.tdtg) e3:SetOperation(s.tdop) c:RegisterEffect(e3) aux.GlobalCheck(s,function() local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetCode(EVENT_REMOVE) ge1:SetLabel(id) ge1:SetCondition(s.regcon) ge1:SetOperation(s.regop) Duel.RegisterEffect(ge1,0) end) end function s.sumcon(e) local c=e:GetHandler() local tp=c:GetControler() return Duel.GetFlagEffect(e:GetHandlerPlayer(),id)>0 and Duel.IsExistingMatchingCard(s.tlfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) and s.checkatls(c,e,tp) end function s.tlfilter(c,e,tp) return c:IsFaceup() and c:IsRace(RACE_PSYCHO) and (c:IsLevel(6) or (c:IsLevelBelow(2) and c:IsDefense(0))) and c:IsAbleToRemove(tp,POS_FACEUP,REASON_MATERIAL+REASON_TIMELEAP) and c:IsCanBeTimeleapMaterial() --and (Duel.GetLocationCountFromEx(tp,tp,c,TYPE_TIMELEAP)>0 end function s.sumtg(e,tp,eg,ep,ev,re,r,rp,chk,c) s.performatls(tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.tlfilter,tp,LOCATION_MZONE,0,0,1,nil,e,tp) if #g==0 then return false end if #g>0 then g:KeepAlive() e:SetLabelObject(g) return true end end function s.sumop(e,tp,eg,ep,ev,re,r,rp,c) local g=e:GetLabelObject() if not g then return end c:SetMaterial(g) Duel.Remove(g,POS_FACEUP,REASON_MATERIAL+REASON_TIMELEAP) aux.TimeleapHOPT(tp) end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetDecktopGroup(1-tp,5) local c=e:GetHandler() if chk==0 then return c:IsAbleToRemove() and g:FilterCount(Card.IsAbleToRemove,nil)==5 and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_DECK,5,nil) end local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_DECK,nil) g:AddCard(c) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,6,0,0) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local g=Duel.GetDecktopGroup(1-tp,5) if #g<5 or not c:IsRelateToEffect(e) or not c:IsControler(tp) then return end local rg=g+c Duel.DisableShuffleCheck() if Duel.Remove(rg,POS_FACEUP,REASON_EFFECT+REASON_TEMPORARY)~=0 then local fid=c:GetFieldID() local og=Duel.GetOperatedGroup() local oc=og:GetFirst() while oc do oc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1,fid) oc=og:GetNext() end og:KeepAlive() local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetCode(EVENT_PHASE+PHASE_STANDBY) e1:SetCountLimit(1) e1:SetLabel(fid) e1:SetLabelObject(og) e1:SetCondition(s.retcon) e1:SetOperation(s.retop) e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN) Duel.RegisterEffect(e1,tp) end end function s.retfilter(c,fid,tc) return c:GetFlagEffectLabel(id)==fid or c==tc end function s.retcon(e,tp,eg,ep,ev,re,r,rp) if Duel.GetTurnPlayer()~=tp then return false end local g=e:GetLabelObject() if not g:IsExists(s.retfilter,1,nil,e:GetLabel()) then g:DeleteGroup() e:Reset() return false else return true end end function s.retop(e,tp,eg,ep,ev,re,r,rp) local g=e:GetLabelObject() local sg=g:Filter(s.retfilter,nil,e:GetLabel(),e:GetHandler()) g:DeleteGroup() local tc=sg:GetFirst() Duel.DisableShuffleCheck() while tc do if tc==e:GetHandler() then Duel.ReturnToField(tc) else Duel.SendtoDeck(tc,tc:GetPreviousControler(),SEQ_DECKTOP,REASON_EFFECT) end tc=sg:GetNext() end end function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsAbleToDeck() and chkc~=c end if chk==0 then return c:IsAbleToExtra() and Duel.IsExistingTarget(Card.IsAbleToDeck,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,1,c) g:AddCard(c) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,0,0) end function s.tdop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then local g=Group.CreateGroup(c,tc) Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end end function s.regcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(Card.IsType,1,nil,TYPE_MONSTER) 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 --STUFF TO MAKE IT WORK WITH EFFECT_EXTRA_TIMELEAP_SUMMON function s.checkatls(c,e,tp) if c==nil then return true end if (c:IsType(TYPE_PENDULUM) or c:IsType(TYPE_PANDEMONIUM)) and c:IsFaceup() then return false end local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_TIMELEAP_SUMMON)} local exsumcheck=false for _,te in ipairs(eset) do if not te:GetValue() or type(te:GetValue())=="number" or te:GetValue()(e,c) then exsumcheck=true end end eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_IGNORE_TIMELEAP_HOPT)} local ignsumcheck=false for _,te in ipairs(eset) do if te:CheckCountLimit(tp) then ignsumcheck=true break end end return (Duel.GetFlagEffect(tp,828)<=0 or (exsumcheck and Duel.GetFlagEffect(tp,830)<=0) or c:IsHasEffect(EFFECT_IGNORE_TIMELEAP_HOPT) or ignsumcheck) end function s.performatls(tp) local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_TIMELEAP_SUMMON)} local igneset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_IGNORE_TIMELEAP_HOPT)} local exsumeff,ignsumeff local options={} if (#eset>0 and Duel.GetFlagEffect(tp,830)<=0) or #igneset>0 then local cond=1 if Duel.GetFlagEffect(tp,828)<=0 then table.insert(options,aux.Stringid(433005,15)) cond=0 end for _,te in ipairs(eset) do table.insert(options,te:GetDescription()) end for _,te in ipairs(igneset) do if te:CheckCountLimit(tp) then table.insert(options,te:GetDescription()) end end local op=Duel.SelectOption(tp,table.unpack(options))+cond if op>0 then if op<=#eset then exsumeff=eset[op] else ignsumeff=igneset[op-#eset] end end end if exsumeff~=nil then Duel.RegisterFlagEffect(tp,829,RESET_PHASE+PHASE_END,0,1) Duel.Hint(HINT_CARD,0,exsumeff:GetHandler():GetOriginalCode()) elseif ignsumeff~=nil then Duel.Hint(HINT_CARD,0,ignsumeff:GetHandler():GetOriginalCode()) ignsumeff:UseCountLimit(tp) end end