--Iperdrive Incatenato --Scripted by: XGlitchy30 local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,1)) e1:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_CHAINING) e1:HOPT(true) e1:SetCondition(s.negcon) e1:SetCost(s.negcost) e1:SetTarget(s.negtg) e1:SetOperation(s.negop) c:RegisterEffect(e1) end function s.negcon(e,tp,eg,ep,ev,re,r,rp) return ep~=tp and Duel.IsChainDisablable(ev) and Duel.IsExistingMatchingCard(aux.Faceup(Card.IsType),tp,LOCATION_MZONE,0,1,nil,TYPE_DRIVE) end function s.negfilter(c) return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsLevel(7) and c:IsAbleToHandAsCost() end function s.negcost(e,tp,eg,ep,ev,re,r,rp,chk) local en=Duel.GetEngagedCard(tp) if chk==0 then return en and en:IsCanUpdateEnergy(-5,tp,REASON_COST) end en:UpdateEnergy(-5,tp,REASON_COST,0,e:GetHandler()) end function s.negtg(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():IsRelateToChain(ev) and re:GetHandler():IsDestructable() then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) end end function s.negop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToChain(ev) then Duel.Destroy(eg,REASON_EFFECT) end end