--[[ S.S.D.: Solid State Dragon S.S.D.: Drago Stato Solido Original Script by: Lyris Rescripted by: XGlitchy30 ]] local s,id=GetID() function s.initial_effect(c) --link summon c:EnableReviveLimit() aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_CYBERSE),2) --protection 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:SetCondition(s.indcon) e1:SetValue(1) c:RegisterEffect(e1) --negate local e2=Effect.CreateEffect(c) e2:Desc(2) e2:SetCategory(CATEGORY_DISABLE|CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetRange(LOCATION_MZONE) e2:SetCode(EVENT_CHAINING) e2:SetCountLimit(1) e2:SetCondition(s.condition) e2:SetCost(s.cost) e2:SetTarget(s.distg) e2:SetOperation(s.disop) c:RegisterEffect(e2) end --E1 function s.indfilter(c) return c:IsFaceup() and c:IsType(TYPE_XYZ) end function s.indcon(e) return e:GetHandler():GetLinkedGroup():IsExists(s.indfilter,1,nil) end --E2 function s.tfilter(c,g) return c:IsLocation(LOCATION_MZONE) and g:IsContains(c) end function s.condition(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not Duel.IsChainDisablable(ev) or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) local lg=c:GetLinkedGroup() return tg and tg:IsExists(s.tfilter,1,nil,lg) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) local b1=Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_COST) local b2=Duel.CheckLPCost(tp,1000) if chk==0 then return b1 or b2 end local op=aux.Option(tp,id,0,b1,b2) if op==0 then Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_COST) else Duel.PayLPCost(tp,1000) end end function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return not re:GetHandler():IsStatus(STATUS_DISABLED) 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 end function s.disop(e,tp,eg,ep,ev,re,r,rp,chk) if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToChain(ev) then Duel.Destroy(eg,REASON_EFFECT) end end