--100,000-Year White Turtle local s,id=GetID() function s.initial_effect(c) aux.AddOrigTimeleapType(c,false) aux.AddTimeleapProc(c,6,s.sumcon,s.tlfilter) c:EnableReviveLimit() --Cannot be destroyed by battle or card effects. local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetValue(1) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) c:RegisterEffect(e2) --Once per turn, when your opponent activates a card or effect that targets a card(s) you control (Quick Effect): You can change this face-up Defense Position card you control to Attack Position, --and if you do, negate that effect, and if you do that, banish that card. local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_CHAINING) e3:SetCountLimit(1) e3:SetRange(LOCATION_MZONE) e3:SetCondition(s.discon) e3:SetTarget(s.distg) e3:SetOperation(s.disop) c:RegisterEffect(e3) --Once per turn during the End Phase: Gain 2000 LP. local e4=Effect.CreateEffect(c) e4:SetCategory(CATEGORY_RECOVER) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e4:SetCode(EVENT_PHASE+PHASE_END) e4:SetRange(LOCATION_MZONE) e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e4:SetCountLimit(1) e4:SetTarget(s.rectg) e4:SetOperation(s.recop) c:RegisterEffect(e4) end function s.cfilter(c) return not c:IsStatus(STATUS_SUMMON_TURN+STATUS_SPSUMMON_TURN+STATUS_FLIP_SUMMON_TURN) end function s.sumcon(e) local c=e:GetHandler() local tp=c:GetControler() return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) end function s.tlfilter(c,e) local tp=c:GetControler() local ef=e:GetHandler():GetFuture() return c:IsLevelBelow(ef-1) and c:IsDefensePos() end function s.discfilter(c,tp) return c:IsControler(tp) and c:IsOnField() end function s.discon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end if rp~=1-tp or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) return tg and tg:IsExists(s.discfilter,1,nil,tp) and c:IsDefensePos() and c:IsCanChangePosition() and Duel.IsChainDisablable(ev) end function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return aux.nbcon(tp,re) end Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) if re:GetHandler():IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,1,0,0) end if re:GetActivateLocation()==LOCATION_GRAVE then e:SetCategory(e:GetCategory()|CATEGORY_GRAVE_ACTION) else e:SetCategory(e:GetCategory()&~CATEGORY_GRAVE_ACTION) end end function s.disop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsDefensePos() and c:IsCanChangePosition() then if Duel.ChangePosition(c,POS_FACEUP_ATTACK)>0 then if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Remove(eg,POS_FACEUP,REASON_EFFECT) end end end end function s.rectg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(2000) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,2000) end function s.recop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Recover(p,d,REASON_EFFECT) end