--Indomitable Nature Defender --Made and Scripted by Swaggy local cid,id=GetID() function cid.initial_effect(c) --time leap procedure aux.AddOrigTimeleapType(c,false) aux.AddTimeleapProc(c,5,cid.sumcon,cid.tlfilter,nil) c:EnableReviveLimit() --Real World Dino Wrestling Hours local e0=Effect.CreateEffect(c) e0:SetType(TYPE_FIELD) e0:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e0:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE) e0:SetRange(LOCATION_MZONE) e0:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e0:SetTarget(cid.limtg) c:RegisterEffect(e0) --I'll be back. e1=Effect.CreateEffect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCategory(CATEGORY_REMOVE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(cid.bancon) e1:SetTarget(cid.bantg) e1:SetOperation(cid.banop) c:RegisterEffect(e1) --Get the other guy! e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_CHAINING) e2:SetRange(LOCATION_MZONE) e2:SetCondition(cid.cairncon) e2:SetTarget(cid.cairntg) e2:SetOperation(cid.cairnop) c:RegisterEffect(e2) --:clap: :clap: REVIVE REVIEW :clap: :clap: local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DELAY) e3:SetRange(LOCATION_GRAVE) e3:SetCode(EVENT_LEAVE_FIELD) e3:SetCondition(cid.revcon) e3:SetTarget(cid.revtg) e3:SetOperation(cid.revop) c:RegisterEffect(e3) end function cid.sumcon(e,c) if c==nil then return true end local tp=c:GetControler() return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)-Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>=3 end function cid.tlfilter(c,e,mg) return c:IsAttribute(ATTRIBUTE_EARTH) and c:GetLevel()==e:GetHandler():GetFuture()-1 end function cid.limtg(e,c) return c:GetFieldID()~=e:GetLabel() end function cid.bancon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_TIMELEAP) end function cid.banfilter(c,e,tp) return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsAbleToRemove() end function cid.bantg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cid.banfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_GRAVE) end function cid.banop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,cid.banfilter,tp,LOCATION_GRAVE,0,1,1,nil) local tg=g:GetFirst() if tg==nil then return end Duel.Remove(tg,POS_FACEUP,REASON_EFFECT) if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetRange(LOCATION_REMOVED) e1:SetCode(EVENT_PHASE+PHASE_STANDBY) e1:SetCountLimit(1) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,1) e1:SetCondition(cid.thcon) e1:SetOperation(cid.thop) e1:SetLabel(0) tg:RegisterEffect(e1) end function cid.thcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnPlayer()==tp end function cid.thop(e,tp,eg,ep,ev,re,r,rp) local ct=e:GetLabel() e:GetHandler():SetTurnCounter(ct) if ct==1 then Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,e:GetHandler()) end end function cid.cairncon(e,tp,eg,ep,ev,re,r,rp) if e==re or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) if not g or g:GetCount()~=1 then return false end local tc=g:GetFirst() e:SetLabelObject(tc) return tc:IsFaceUp() and tc:IsType(TYPE_MONSTER) and tc:IsAttribute(ATTRIBUTE_EARTH) and tc:IsControler(tp) end function cid.cairnfilter(c,re,rp,tf,ceg,cep,cev,cre,cr,crp) return tf(re,rp,ceg,cep,cev,cre,cr,crp,0,c) end function cid.cairntg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local ct=ev local label=Duel.GetFlagEffectLabel(0,id) if label then if ev==bit.rshift(label,16) then ct=bit.band(label,0xffff) end end local ce,cp=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER) local tf=ce:GetTarget() local ceg,cep,cev,cre,cr,crp=Duel.GetChainEvent(ct) if chkc then return chkc:IsOnField() and cid.cairnfilter(chkc,ce,cp,tf,ceg,cep,cev,cre,cr,crp) end if chk==0 then return Duel.IsExistingTarget(cid.cairnfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetLabelObject(),ce,cp,tf,ceg,cep,cev,cre,cr,crp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.SelectTarget(tp,cid.cairnfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetLabelObject(),ce,cp,tf,ceg,cep,cev,cre,cr,crp) local val=ct+bit.lshift(ev+1,16) if label then Duel.SetFlagEffectLabel(0,id,val) else Duel.RegisterFlagEffect(0,id,RESET_CHAIN,0,1,val) end end function cid.cairnop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.ChangeTargetCard(ev,Group.FromCards(tc)) end end function cid.revfilter(c,tp) return c:GetSummonLocation()==LOCATION_EXTRA and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) and bit.band(c:GetPreviousRaceOnField(),RACE_PLANT)>0 end function cid.revcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(cid.revfilter,1,nil,tp) and not eg:IsContains(e:GetHandler()) end function cid.revtg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) end function cid.revop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetValue(LOCATION_REMOVED) e1:SetReset(RESET_EVENT+RESETS_REDIRECT) c:RegisterEffect(e1,true) end end