name: Neo-Spacian
card_text: Once per turn: You can discard 1 card; look at your opponent's hand and choose 1 monster. If you control a monster with ATK greater than or equal to the ATK of the chosen card, destroy the chosen card, and if you do, inflict 500 damage to your opponent. Otherwise, take 500 damage.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsDiscardable, tp, LOCATION_HAND, 0, 1, nil)
  	end
  	Duel.DiscardHand(tp, Card.IsDiscardable, 1, 1, REASON_COST + REASON_DISCARD)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetFieldGroupCount(tp, 0, LOCATION_HAND) > 0
  	end
  end
  function s.filter(c, atk)
  	return c:IsFaceup() and c:IsAttackAbove(atk)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetFieldGroup(tp, 0, LOCATION_HAND)
  	if g:GetCount() > 0 then
  		Duel.ConfirmCards(tp, g)
  		Duel.Hint(HINT_SELECTMSG, tp, aux.Stringid(id, 1))
  		local tg = g:FilterSelect(tp, Card.IsType, 1, 1, nil, TYPE_MONSTER)
  		local tc = tg:GetFirst()
  		if tc then
  			if tc:IsAttackAbove(0) and Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_MZONE, 0, 1, nil, tc:GetAttack()) then
  				Duel.Destroy(tc, REASON_EFFECT)
  				Duel.Damage(1 - tp, 500, REASON_EFFECT)
  			else
  				Duel.Damage(tp, 500, REASON_EFFECT)
  			end
  		end
  		Duel.ShuffleHand(1 - tp)
  	end
  end
  
  
source_text: Neo-Spacian
  Once per turn: You can discard 1 card; look at your opponent's hand and choose 1 monster. If you control a monster with ATK greater than or equal to the ATK of the chosen card, destroy the chosen card, and if you do, inflict 500 damage to your opponent. Otherwise, take 500 damage.
target_text: -- Neo-Spacian
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsDiscardable, tp, LOCATION_HAND, 0, 1, nil)
  	end
  	Duel.DiscardHand(tp, Card.IsDiscardable, 1, 1, REASON_COST + REASON_DISCARD)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetFieldGroupCount(tp, 0, LOCATION_HAND) > 0
  	end
  end
  function s.filter(c, atk)
  	return c:IsFaceup() and c:IsAttackAbove(atk)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetFieldGroup(tp, 0, LOCATION_HAND)
  	if g:GetCount() > 0 then
  		Duel.ConfirmCards(tp, g)
  		Duel.Hint(HINT_SELECTMSG, tp, aux.Stringid(id, 1))
  		local tg = g:FilterSelect(tp, Card.IsType, 1, 1, nil, TYPE_MONSTER)
  		local tc = tg:GetFirst()
  		if tc then
  			if tc:IsAttackAbove(0) and Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_MZONE, 0, 1, nil, tc:GetAttack()) then
  				Duel.Destroy(tc, REASON_EFFECT)
  				Duel.Damage(1 - tp, 500, REASON_EFFECT)
  			else
  				Duel.Damage(tp, 500, REASON_EFFECT)
  			end
  		end
  		Duel.ShuffleHand(1 - tp)
  	end
  end
  
  