--Mage-Core of Space function c249001262.initial_effect(c) aux.EnableDualAttribute(c) --special summon local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCondition(c249001262.descon) e1:SetCost(c249001262.descost) e1:SetTarget(c249001262.destg) e1:SetOperation(c249001262.desop) c:RegisterEffect(e1) end function c249001262.cfilter(c) return c:IsFaceup() and c:IsCode(249001261) end function c249001262.descon(e,tp,eg,ep,ev,re,r,rp) return aux.IsDualState(e) and Duel.IsExistingMatchingCard(c249001262.cfilter,tp,LOCATION_ONFIELD,0,1,nil) end function c249001262.descost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsReleasable() end Duel.Release(e:GetHandler(),REASON_COST) end function c249001262.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) local tg=g:GetMinGroup(Card.GetAttack) Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,1,0,0) end function c249001262.desop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) if g:GetCount()>0 then local tc=nil local tg=g:GetMinGroup(Card.GetAttack) if tg:GetCount()>1 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local sg=tg:Select(tp,1,1,nil) Duel.HintSelection(sg) tc=sg:GetFirst() else tc=tg:GetFirst() end local atk=tc:GetAttack() if Duel.Destroy(tc,REASON_EFFECT)>0 then Duel.BreakEffect() Duel.Damage(1-tp,math.floor(atk / 2),REASON_EFFECT) end end if Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,504) then Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.HintSelection(g) Duel.SendtoGrave(g,REASON_EFFECT) end end