name: Void
card_text: You can discard 1 card; add 1 "Void" Spell/Trap from your Deck to your hand, except "Void Vanishment" or "Null and Void", also you cannot Normal or Special Summon for the rest of this turn, except "Infernoid" monsters. You can only use this effect of "Void Vanishment" once per turn. If an "Infernoid" monster you control battles an opponent's monster, after damage calculation: You can send this card to the GY; banish those monsters.
external_ids: local SETCARD_ID_0 = 0xbb --Infernoid
  local SETCARD_ID_1 = 0xc5 --Void
  
lua: local SETCARD_ID_0 = 0xbb --Infernoid
  local SETCARD_ID_1 = 0xc5 --Void
  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)
  	--search
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCountLimit(1, id)
  	e2:SetCost(s.thcost)
  	e2:SetTarget(s.thtg)
  	e2:SetOperation(s.thop)
  	c:RegisterEffect(e2)
  	--remove
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_REMOVE)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e3:SetCode(EVENT_BATTLED)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetCost(s.cost)
  	e3:SetTarget(s.target)
  	e3:SetOperation(s.operation)
  	c:RegisterEffect(e3)
  end
  function s.thcost(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.thfilter(c)
  	return c:IsSetCard(SETCARD_ID_1) and c:IsType(TYPE_SPELL + TYPE_TRAP) and not c:IsCode(id) and c:IsAbleToHand()
  end
  function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.thfilter, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local g = Duel.SelectMatchingCard(tp, s.thfilter, tp, LOCATION_DECK, 0, 1, 1, nil)
  	if g:GetCount() > 0 then
  		Duel.SendtoHand(g, nil, REASON_EFFECT)
  		Duel.ConfirmCards(1 - tp, g)
  	end
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_CANNOT_SUMMON)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetTargetRange(1, 0)
  	e1:SetTarget(s.sumlimit)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  	local e2 = e1:Clone()
  	e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	Duel.RegisterEffect(e2, tp)
  end
  function s.sumlimit(e, c)
  	return not c:IsSetCard(SETCARD_ID_1)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsAbleToGraveAsCost()
  	end
  	Duel.SendtoGrave(e:GetHandler(), REASON_COST)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local a = Duel.GetAttacker()
  	local d = Duel.GetAttackTarget()
  	if a:IsControler(1 - tp) then
  		a, d = d, a
  	end
  	if chk == 0 then
  		return a and d and a:IsSetCard(SETCARD_ID_1) and (a:IsAbleToRemove() or d:IsAbleToRemove())
  	end
  	local g = Group.CreateGroup()
  	if a:IsRelateToBattle() then
  		g:AddCard(a)
  	end
  	if d:IsRelateToBattle() then
  		g:AddCard(d)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, g, g:GetCount(), 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local a = Duel.GetAttacker()
  	local d = Duel.GetAttackTarget()
  	local g = Group.FromCards(a, d)
  	local rg = g:Filter(Card.IsRelateToBattle, nil)
  	Duel.Remove(rg, POS_FACEUP, REASON_EFFECT)
  end
  
  
source_text: Void
  You can discard 1 card; add 1 "Void" Spell/Trap from your Deck to your hand, except "Void Vanishment" or "Null and Void", also you cannot Normal or Special Summon for the rest of this turn, except "Infernoid" monsters. You can only use this effect of "Void Vanishment" once per turn. If an "Infernoid" monster you control battles an opponent's monster, after damage calculation: You can send this card to the GY; banish those monsters.
target_text: -- Void
  local SETCARD_ID_0 = 0xbb --Infernoid
  local SETCARD_ID_1 = 0xc5 --Void
  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)
  	--search
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCountLimit(1, id)
  	e2:SetCost(s.thcost)
  	e2:SetTarget(s.thtg)
  	e2:SetOperation(s.thop)
  	c:RegisterEffect(e2)
  	--remove
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_REMOVE)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e3:SetCode(EVENT_BATTLED)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetCost(s.cost)
  	e3:SetTarget(s.target)
  	e3:SetOperation(s.operation)
  	c:RegisterEffect(e3)
  end
  function s.thcost(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.thfilter(c)
  	return c:IsSetCard(SETCARD_ID_1) and c:IsType(TYPE_SPELL + TYPE_TRAP) and not c:IsCode(id) and c:IsAbleToHand()
  end
  function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.thfilter, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local g = Duel.SelectMatchingCard(tp, s.thfilter, tp, LOCATION_DECK, 0, 1, 1, nil)
  	if g:GetCount() > 0 then
  		Duel.SendtoHand(g, nil, REASON_EFFECT)
  		Duel.ConfirmCards(1 - tp, g)
  	end
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_CANNOT_SUMMON)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetTargetRange(1, 0)
  	e1:SetTarget(s.sumlimit)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  	local e2 = e1:Clone()
  	e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	Duel.RegisterEffect(e2, tp)
  end
  function s.sumlimit(e, c)
  	return not c:IsSetCard(SETCARD_ID_1)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsAbleToGraveAsCost()
  	end
  	Duel.SendtoGrave(e:GetHandler(), REASON_COST)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local a = Duel.GetAttacker()
  	local d = Duel.GetAttackTarget()
  	if a:IsControler(1 - tp) then
  		a, d = d, a
  	end
  	if chk == 0 then
  		return a and d and a:IsSetCard(SETCARD_ID_1) and (a:IsAbleToRemove() or d:IsAbleToRemove())
  	end
  	local g = Group.CreateGroup()
  	if a:IsRelateToBattle() then
  		g:AddCard(a)
  	end
  	if d:IsRelateToBattle() then
  		g:AddCard(d)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, g, g:GetCount(), 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local a = Duel.GetAttacker()
  	local d = Duel.GetAttackTarget()
  	local g = Group.FromCards(a, d)
  	local rg = g:Filter(Card.IsRelateToBattle, nil)
  	Duel.Remove(rg, POS_FACEUP, REASON_EFFECT)
  end
  
  