name: Void
card_text: You can discard 1 card; send 1 Fiend monster from your Deck to the GY. You can send this face-up card from your Spell & Trap Zone to the GY; send "Infernoid" monsters with different names from your hand and/or Deck to the GY, up to the number of monsters your opponent controls that were Special Summoned from the Extra Deck. You can only use 1 "Void Apocalypse" effect per turn, and only once that turn.
external_ids: local SETCARD_ID_0 = 0xbb --Infernoid
  
lua: local SETCARD_ID_0 = 0xbb --Infernoid
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--to grave1
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_TOGRAVE)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCountLimit(1, id)
  	e2:SetCost(s.tgcost1)
  	e2:SetTarget(s.tgtg1)
  	e2:SetOperation(s.tgop1)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetDescription(aux.Stringid(id, 1))
  	e3:SetCategory(CATEGORY_TOGRAVE)
  	e3:SetCost(s.tgcost2)
  	e3:SetTarget(s.tgtg2)
  	e3:SetOperation(s.tgop2)
  	c:RegisterEffect(e3)
  end
  function s.tgcost1(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.Hint(HINT_OPSELECTED, 1 - tp, e:GetDescription())
  	local g = Duel.SelectMatchingCard(tp, Card.IsDiscardable, tp, LOCATION_HAND, 0, 1, 1, nil)
  	Duel.SendtoGrave(g, REASON_COST + REASON_DISCARD)
  end
  function s.filter1(c)
  	return c:IsRace(RACE_FIEND) and c:IsAbleToGrave()
  end
  function s.tgtg1(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter1, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, nil, 1, tp, LOCATION_DECK)
  end
  function s.tgop1(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, s.filter1, tp, LOCATION_DECK, 0, 1, 1, nil)
  	if g:GetCount() > 0 then
  		Duel.SendtoGrave(g, REASON_EFFECT)
  	end
  end
  function s.tgcost2(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsAbleToGraveAsCost()
  	end
  	Duel.Hint(HINT_OPSELECTED, 1 - tp, e:GetDescription())
  	Duel.SendtoGrave(e:GetHandler(), REASON_COST)
  end
  function s.filter2(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
  end
  function s.exfilter(c)
  	return c:IsSummonLocation(LOCATION_EXTRA)
  end
  function s.tgtg2(e, tp, eg, ep, ev, re, r, rp, chk)
  	local ct = Duel.GetMatchingGroupCount(s.exfilter, tp, 0, LOCATION_MZONE, nil)
  	local g = Duel.GetMatchingGroup(s.filter2, tp, LOCATION_HAND + LOCATION_DECK, 0, nil)
  	if chk == 0 then
  		return ct > 0 and g:GetCount() > 0
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, nil, 1, tp, LOCATION_HAND + LOCATION_DECK)
  end
  function s.tgop2(e, tp, eg, ep, ev, re, r, rp)
  	local ct = Duel.GetMatchingGroupCount(s.exfilter, tp, 0, LOCATION_MZONE, nil)
  	if ct <= 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.GetMatchingGroup(s.filter2, tp, LOCATION_HAND + LOCATION_DECK, 0, nil)
  	aux.GCheckAdditional = aux.dncheck
  	local sg = g:SelectSubGroup(tp, aux.TRUE, false, 1, ct)
  	aux.GCheckAdditional = nil
  	if sg:GetCount() > 0 then
  		Duel.SendtoGrave(sg, REASON_EFFECT)
  	end
  end
  
  
source_text: Void
  You can discard 1 card; send 1 Fiend monster from your Deck to the GY. You can send this face-up card from your Spell & Trap Zone to the GY; send "Infernoid" monsters with different names from your hand and/or Deck to the GY, up to the number of monsters your opponent controls that were Special Summoned from the Extra Deck. You can only use 1 "Void Apocalypse" effect per turn, and only once that turn.
target_text: -- Void
  local SETCARD_ID_0 = 0xbb --Infernoid
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--to grave1
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_TOGRAVE)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCountLimit(1, id)
  	e2:SetCost(s.tgcost1)
  	e2:SetTarget(s.tgtg1)
  	e2:SetOperation(s.tgop1)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetDescription(aux.Stringid(id, 1))
  	e3:SetCategory(CATEGORY_TOGRAVE)
  	e3:SetCost(s.tgcost2)
  	e3:SetTarget(s.tgtg2)
  	e3:SetOperation(s.tgop2)
  	c:RegisterEffect(e3)
  end
  function s.tgcost1(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.Hint(HINT_OPSELECTED, 1 - tp, e:GetDescription())
  	local g = Duel.SelectMatchingCard(tp, Card.IsDiscardable, tp, LOCATION_HAND, 0, 1, 1, nil)
  	Duel.SendtoGrave(g, REASON_COST + REASON_DISCARD)
  end
  function s.filter1(c)
  	return c:IsRace(RACE_FIEND) and c:IsAbleToGrave()
  end
  function s.tgtg1(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter1, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, nil, 1, tp, LOCATION_DECK)
  end
  function s.tgop1(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, s.filter1, tp, LOCATION_DECK, 0, 1, 1, nil)
  	if g:GetCount() > 0 then
  		Duel.SendtoGrave(g, REASON_EFFECT)
  	end
  end
  function s.tgcost2(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsAbleToGraveAsCost()
  	end
  	Duel.Hint(HINT_OPSELECTED, 1 - tp, e:GetDescription())
  	Duel.SendtoGrave(e:GetHandler(), REASON_COST)
  end
  function s.filter2(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
  end
  function s.exfilter(c)
  	return c:IsSummonLocation(LOCATION_EXTRA)
  end
  function s.tgtg2(e, tp, eg, ep, ev, re, r, rp, chk)
  	local ct = Duel.GetMatchingGroupCount(s.exfilter, tp, 0, LOCATION_MZONE, nil)
  	local g = Duel.GetMatchingGroup(s.filter2, tp, LOCATION_HAND + LOCATION_DECK, 0, nil)
  	if chk == 0 then
  		return ct > 0 and g:GetCount() > 0
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, nil, 1, tp, LOCATION_HAND + LOCATION_DECK)
  end
  function s.tgop2(e, tp, eg, ep, ev, re, r, rp)
  	local ct = Duel.GetMatchingGroupCount(s.exfilter, tp, 0, LOCATION_MZONE, nil)
  	if ct <= 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.GetMatchingGroup(s.filter2, tp, LOCATION_HAND + LOCATION_DECK, 0, nil)
  	aux.GCheckAdditional = aux.dncheck
  	local sg = g:SelectSubGroup(tp, aux.TRUE, false, 1, ct)
  	aux.GCheckAdditional = nil
  	if sg:GetCount() > 0 then
  		Duel.SendtoGrave(sg, REASON_EFFECT)
  	end
  end
  
  