name: 同族感染ウィルス
card_text: 1:手札を1枚捨て、種族を1つ宣言して発動できる。
  フィールドの宣言した種族のモンスターを全て破壊する。
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--destroy
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	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.filter(c)
  	return c:IsFaceup()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil)
  	end
  	local g = Duel.GetMatchingGroup(s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, nil)
  	local tc = g:GetFirst()
  	local race = 0
  	while tc do
  		race = bit.bor(race, tc:GetRace())
  		tc = g:GetNext()
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RACE)
  	local arc = Duel.AnnounceRace(tp, 1, race)
  	e:SetLabel(arc)
  	local dg = g:Filter(Card.IsRace, nil, arc)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, dg, dg:GetCount(), 0, 0)
  end
  function s.filter2(c, rc)
  	return c:IsFaceup() and c:IsRace(rc)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local arc = e:GetLabel()
  	local g = Duel.GetMatchingGroup(s.filter2, tp, LOCATION_MZONE, LOCATION_MZONE, nil, arc)
  	Duel.Destroy(g, REASON_EFFECT)
  end
  
  
source_text: 同族感染ウィルス
  1:手札を1枚捨て、種族を1つ宣言して発動できる。
  フィールドの宣言した種族のモンスターを全て破壊する。
target_text: -- 同族感染ウィルス
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--destroy
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	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.filter(c)
  	return c:IsFaceup()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil)
  	end
  	local g = Duel.GetMatchingGroup(s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, nil)
  	local tc = g:GetFirst()
  	local race = 0
  	while tc do
  		race = bit.bor(race, tc:GetRace())
  		tc = g:GetNext()
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RACE)
  	local arc = Duel.AnnounceRace(tp, 1, race)
  	e:SetLabel(arc)
  	local dg = g:Filter(Card.IsRace, nil, arc)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, dg, dg:GetCount(), 0, 0)
  end
  function s.filter2(c, rc)
  	return c:IsFaceup() and c:IsRace(rc)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local arc = e:GetLabel()
  	local g = Duel.GetMatchingGroup(s.filter2, tp, LOCATION_MZONE, LOCATION_MZONE, nil, arc)
  	Duel.Destroy(g, REASON_EFFECT)
  end
  
  