--Draghetto Ardente Bushido --Script by XGlitchy30 local cid,id=GetID() function cid.initial_effect(c) local e0=aux.AddThisCardBanishedAlreadyCheck(c) --normal summon event local e1=Effect.CreateEffect(c) e1:Desc(0) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCondition(cid.spcon) e1:SetTarget(cid.sptg) e1:SetOperation(cid.spop) c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:Desc(1) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,id) e2:SetCondition(cid.spscon) e2:SetTarget(cid.spstg) e2:SetOperation(cid.spsop) c:RegisterEffect(e2) --recycle local e3=Effect.CreateEffect(c) e3:Desc(2) e3:SetCategory(CATEGORY_TODECK) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetRange(LOCATION_REMOVED) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCountLimit(1,id+100) e3:SetLabelObject(e0) e3:SetCondition(cid.rccon) e3:SetTarget(cid.rctg) e3:SetOperation(cid.rcop) c:RegisterEffect(e3) end --filters function cid.ncheck(c) return c:IsFaceup() and c:IsSetCard(0x4b0) end function cid.spcheck(c) return c:IsFaceup() and c:IsSetCard(0x4b0) and ((c:HasLevel() and c:GetLevel()<=4) or (c:HasRank() and c:GetRank()<=4)) end function cid.rccheck(c,tp,se) return c:IsFaceup() and c:IsSetCard(0x4b0) and (c:GetLevel()>=5 or c:GetRank()>=5) and c:GetSummonPlayer()==tp and (se==nil or c:GetReasonEffect()~=se) end --normal summon event function cid.spcon(e,tp,eg,ep,ev,re,r,rp) return ep==tp and eg:IsExists(cid.ncheck,1,nil) end function cid.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function cid.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToChain() or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end --spsummon function cid.spscon(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0) return g:IsExists(cid.spcheck,1,nil) end function cid.spstg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function cid.spsop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToChain() or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.SpecialSummonRedirect(e,c,0,tp,tp,false,false,POS_FACEUP) end --recyle function cid.rccon(e,tp,eg,ep,ev,re,r,rp) local se=e:GetLabelObject():GetLabelObject() return eg:IsExists(cid.rccheck,1,nil,tp,se) and not eg:IsContains(e:GetHandler()) end function cid.rctg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToDeck() end Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,tp,LOCATION_REMOVED) end function cid.rcop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToChain() and c:IsFaceup() then Duel.SendtoDeck(c,nil,2,REASON_EFFECT) end end