--Cyber-Varia Counter Technique function c249000947.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_CHAINING) e1:SetCondition(c249000947.condition) e1:SetTarget(c249000947.target) e1:SetOperation(c249000947.activate) c:RegisterEffect(e1) end function c249000947.cfilter(c,tp) return c:IsLocation(LOCATION_ONFIELD) and c:GetControler()==tp end function c249000947.cfilter2(c) return c:IsPosition(POS_FACEUP) and c:IsSetCard(0x1FD) end function c249000947.condition(e,tp,eg,ep,ev,re,r,rp) if ep==tp or not Duel.IsExistingMatchingCard(c249000947.cfilter2,tp,LOCATION_MZONE,0,1,nil) then return false end if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) return tg and tg:IsExists(c249000947.cfilter,1,nil,tp) and Duel.IsChainNegatable(ev) end function c249000947.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) end end function c249000947.activate(e,tp,eg,ep,ev,re,r,rp) Duel.NegateActivation(ev) if re:GetHandler():IsRelateToEffect(re) then if Duel.Destroy(eg,REASON_EFFECT) then if Duel.IsExistingMatchingCard(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(16037007,1)) then Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.HintSelection(g) Duel.Destroy(g,REASON_EFFECT) end end end end