--Prodigal Android of a Possible Future local s,id=GetID() function s.initial_effect(c) aux.AddOrigTimeleapType(c,false) aux.AddTimeleapProc(c,8,s.sumcon,s.tlfilter) c:EnableReviveLimit() aux.GlobalCheck(s,function() local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetCode(EVENT_CHAIN_SOLVED) ge1:SetOperation(s.checkop) Duel.RegisterEffect(ge1,0) end) --If this card is Time Leap Summoned while you control a card in the Pandemonium Zone(s): this card gains ATK/DEF equal to the difference between the Pandemonium Scales x 200 of 1 of these cards. local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCondition(s.adcon) e1:SetOperation(s.adop) c:RegisterEffect(e1) --Once per turn, when your opponent activates a monster effect (Quick Effect): You can shuffle 1 Pandemonium Monster from your face-up Extra Deck into the Deck; negate that effect, and if you do, destroy that card. local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_CHAINING) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCondition(s.discon) e2:SetCost(s.discost) e2:SetTarget(s.distg) e2:SetOperation(s.disop) c:RegisterEffect(e2) end function s.sumcon(e,c) local c=e:GetHandler() local tp=c:GetControler() return Duel.GetFlagEffect(tp,id)~=0 or Duel.GetFlagEffect(tp,id+1)~=0 end function s.tlfilter(c,e,mg) local tp=c:GetControler() local ef=e:GetHandler():GetFuture() return c:IsLevelBelow(ef-1) and c:IsType(TYPE_PANDEMONIUM) end function s.checkop(e,tp,eg,ep,ev,re,r,rp) if not re or not re:IsActiveType(TYPE_MONSTER) then return end local p1=false local p2=false if re:GetHandlerPlayer()==0 then p1=true end if re:GetHandlerPlayer()==1 then p2=true end if p1 then Duel.RegisterFlagEffect(0,id,RESET_PHASE+PHASE_END,0,1) end if p2 then Duel.RegisterFlagEffect(1,id,RESET_PHASE+PHASE_END,0,1) end end function s.adcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_TIMELEAP) end function s.adfilter(c) return c:IsFaceup() and c:GetFlagEffect(726)>0 end function s.adop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=nil if c:IsFacedown() or not c:IsRelateToEffect(e) then return end local ct=Duel.GetMatchingGroup(s.adfilter,tp,LOCATION_SZONE,0,nil) if #ct<=0 then return end if #ct==1 then tc=ct end if #ct>=2 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT) tc=Duel.SelectMatchingCard(tp,s.adfilter,tp,LOCATION_SZONE,0,1,1,nil) end Duel.HintSelection(tc) local lsc=tc:GetFirst():GetLeftScale() local rsc=tc:GetFirst():GetRightScale() local fsc=math.abs(lsc-rsc) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(fsc*200) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e2) end function s.discost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.disfilter,tp,LOCATION_EXTRA,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,s.disfilter,tp,LOCATION_EXTRA,0,1,1,nil) if #g>0 then Duel.SendtoDeck(g,nil,2,REASON_COST) end end function s.discon(e,tp,eg,ep,ev,re,r,rp) return rp==1-tp and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainDisablable(ev) end function s.disfilter(c) return c:IsFaceup() and c:IsType(TYPE_PANDEMONIUM) and c:IsAbleToDeckAsCost() end function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) end end function s.disop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end end