--Cascata Nottesfumo della Rimozione --Script by XGlitchy30 local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:Desc(0) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:HOPT() e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) local e3=e1:Clone() e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS) c:RegisterEffect(e3) --destroy replace local e4=Effect.CreateEffect(c) e4:Desc(1) e4:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS) e4:SetCode(EFFECT_DESTROY_REPLACE) e4:SetRange(LOCATION_GRAVE) e4:SHOPT() e4:SetTarget(s.reptg) e4:SetValue(s.repval) e4:SetOperation(s.repop) c:RegisterEffect(e4) end --filters function s.filter(c) return c:IsFaceup() and c:IsSetCard(ARCHE_NIGHTSHADE) and c:IsType(TYPE_SYNCHRO|TYPE_XYZ) end function s.repfilter(c,tp) return c:IsFaceup() and c:IsOnField() and c:IsControler(tp) and c:IsSetCard(ARCHE_NIGHTSHADE) and not c:IsReason(REASON_REPLACE) end --Activate function s.condition(e,tp,eg,ep,ev,re,r,rp) if #eg~=1 then return false end local tc=eg:GetFirst() return tc:GetSummonPlayer()==1-tp and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,0,1,nil) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local tc=eg:GetFirst() Duel.SetTargetCard(tc) Duel.SetCardOperationInfo(tc,CATEGORY_DESTROY) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToChain() then Duel.Destroy(tc,REASON_EFFECT) end end --destroy replace function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsAbleToRemove() and eg:IsExists(s.repfilter,1,nil,tp) end return Duel.SelectEffectYesNo(tp,c,96) end function s.repval(e,c) return s.repfilter(c,e:GetHandlerPlayer()) end function s.repop(e,tp,eg,ep,ev,re,r,rp) Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT) end