--Padre Lucearmato --Scripted by: XGlitchy30 local s,id=GetID() function s.initial_effect(c) --SS local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DDD) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:HOPT() e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --negate local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY+CATEGORY_RECOVER) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_CHAINING) e2:SetRange(LOCATION_MZONE) e2:HOPT() e2:SetCondition(s.condition) e2:SetCost(s.cost) e2:SetTarget(s.target) e2:SetOperation(s.operation) c:RegisterEffect(e2) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonLocation(LOCATION_GRAVE) and e:GetHandler():IsPreviousControler(tp) end function s.spfilter(c,e,tp) return #pg<=0 and c:IsSetCard(0x11f) and c:IsRitualMonster() and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,false,POS_FACEUP) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local en=Duel.GetEngagedCard(tp) if chk==0 then return en and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and en:IsCanBeSpecialSummoned(e,SUMMON_TYPE_DRIVE,tp,true,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,en,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local en=Duel.GetEngagedCard(tp) if en and Duel.SpecialSummon(en,SUMMON_TYPE_DRIVE,tp,tp,true,false,POS_FACEUP)>0 then en:CompleteProcedure() end end function s.negfilter(c,tp) return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsFaceup() and c:IsMonster(TYPE_DRIVE) end function s.condition(e,tp,eg,ep,ev,re,r,rp) if tp==ep or e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) or not Duel.IsChainDisablable(ev) then return false end local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DESTROY) return ex and tg~=nil and tc+tg:FilterCount(s.negfilter,nil,tp)-#tg>0 end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsReleasable() end Duel.Release(e:GetHandler(),REASON_COST) end function s.target(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():IsRelateToChain(ev) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) end Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000) end function s.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToChain(ev) and Duel.Destroy(eg,REASON_EFFECT)>0 then Duel.Recover(tp,1000,REASON_EFFECT) end end