--Hybrid Design Flaw function c11000234.initial_effect(c) --destroy&damage local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE) e1:SetDescription(aux.Stringid(11000234,0)) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetTarget(c11000234.target) e1:SetOperation(c11000234.operation) c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(11000234,1)) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_DESTROYED) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e2:SetCondition(c11000234.descon) e2:SetTarget(c11000234.destg) e2:SetOperation(c11000234.desop) c:RegisterEffect(e2) end function c11000234.filter(c) return c:IsFaceup() and c:IsSetCard(0x1FA) and c:IsDestructable() end function c11000234.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c11000234.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(c11000234.filter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,c11000234.filter,tp,LOCATION_MZONE,0,1,1,nil) local atk=g:GetFirst():GetTextAttack() if atk<0 then atk=0 end Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,atk) end function c11000234.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsControler(tp) then local atk=tc:GetTextAttack() if atk<0 then atk=0 end if Duel.Destroy(tc,REASON_EFFECT)~=0 then Duel.Damage(1-tp,atk,REASON_EFFECT) end end end function c11000234.descon(e,tp,eg,ep,ev,re,r,rp) return rp~=tp and e:GetHandler():GetPreviousControler()==tp end function c11000234.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,nil) end local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_ONFIELD,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function c11000234.desop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,1,nil) if g:GetCount()>0 then Duel.HintSelection(g) Duel.Destroy(g,REASON_EFFECT) end end