name: Infernoid
card_text: Cannot be Normal Summoned/Set. Must be Special Summoned (from your hand or GY) by banishing 2 "Infernoid" monsters from your hand or GY while the total Levels and Ranks of all Effect Monsters you control are 8 or lower. When this card declares an attack: You can banish 1 monster from your opponent's Extra Deck (their choice). Once per turn (Quick Effect): You can Tribute 1 monster, then target 1 card in your opponent's GY; banish it.
external_ids: local CARD_ID_0 = 34822850 --Void Expansion
  local SETCARD_ID_0 = 0xbb --Infernoid
  
lua: local CARD_ID_0 = 34822850 --Void Expansion
  local SETCARD_ID_0 = 0xbb --Infernoid
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableReviveLimit()
  	--special summon condition
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetCode(EFFECT_SPSUMMON_CONDITION)
  	c:RegisterEffect(e1)
  	--special summon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_SPSUMMON_PROC)
  	e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e2:SetRange(LOCATION_HAND + LOCATION_GRAVE)
  	e2:SetCondition(s.spcon)
  	e2:SetTarget(s.sptg)
  	e2:SetOperation(s.spop)
  	c:RegisterEffect(e2)
  	--remove
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_REMOVE)
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e3:SetCode(EVENT_ATTACK_ANNOUNCE)
  	e3:SetTarget(s.rmtg1)
  	e3:SetOperation(s.rmop1)
  	c:RegisterEffect(e3)
  	--remove
  	local e4 = Effect.CreateEffect(c)
  	e4:SetCategory(CATEGORY_REMOVE)
  	e4:SetType(EFFECT_TYPE_QUICK_O)
  	e4:SetCode(EVENT_FREE_CHAIN)
  	e4:SetRange(LOCATION_MZONE)
  	e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e4:SetCountLimit(1)
  	e4:SetCost(s.rmcost2)
  	e4:SetTarget(s.rmtg2)
  	e4:SetOperation(s.rmop2)
  	c:RegisterEffect(e4)
  end
  function s.spfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
  end
  function s.sumfilter(c)
  	return c:IsFaceup() and c:IsType(TYPE_EFFECT)
  end
  function s.lv_or_rk(c)
  	if c:IsType(TYPE_XYZ) then
  		return c:GetRank()
  	else
  		return c:GetLevel()
  	end
  end
  function s.spcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	local sum = Duel.GetMatchingGroup(s.sumfilter, tp, LOCATION_MZONE, 0, nil):GetSum(s.lv_or_rk)
  	if sum > 8 then
  		return false
  	end
  	local loc = LOCATION_GRAVE + LOCATION_HAND
  	if c:IsHasEffect(CARD_ID_0) then
  		loc = loc + LOCATION_MZONE
  	end
  	local g = Duel.GetMatchingGroup(s.spfilter, tp, loc, 0, c)
  	return g:CheckSubGroup(aux.mzctcheck, 2, 2, tp)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, c)
  	local loc = LOCATION_GRAVE + LOCATION_HAND
  	if c:IsHasEffect(CARD_ID_0) then
  		loc = loc + LOCATION_MZONE
  	end
  	local g = Duel.GetMatchingGroup(s.spfilter, tp, loc, 0, c)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local sg = g:SelectSubGroup(tp, aux.mzctcheck, true, 2, 2, tp)
  	if sg then
  		sg:KeepAlive()
  		e:SetLabelObject(sg)
  		return true
  	else
  		return false
  	end
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp, c)
  	local g = e:GetLabelObject()
  	Duel.Remove(g, POS_FACEUP, REASON_SPSUMMON)
  	g:DeleteGroup()
  end
  function s.rmtg1(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsAbleToRemove, tp, 0, LOCATION_EXTRA, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, nil, 1, 1 - tp, LOCATION_EXTRA)
  end
  function s.rmop1(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, 1 - tp, HINTMSG_REMOVE)
  	local g = Duel.SelectMatchingCard(1 - tp, nil, 1 - tp, LOCATION_EXTRA, 0, 1, 1, nil)
  	Duel.Remove(g, POS_FACEUP, REASON_EFFECT)
  end
  function s.rmcost2(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckReleaseGroup(tp, nil, 1, nil)
  	end
  	local g = Duel.SelectReleaseGroup(tp, nil, 1, 1, nil)
  	Duel.Release(g, REASON_COST)
  end
  function s.rmtg2(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1 - tp) and chkc:IsAbleToRemove()
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(Card.IsAbleToRemove, tp, 0, LOCATION_GRAVE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g = Duel.SelectTarget(tp, Card.IsAbleToRemove, tp, 0, LOCATION_GRAVE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, g, 1, 1 - tp, LOCATION_GRAVE)
  end
  function s.rmop2(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		Duel.Remove(tc, POS_FACEUP, REASON_EFFECT)
  	end
  end
  
  
source_text: Infernoid
  Cannot be Normal Summoned/Set. Must be Special Summoned (from your hand or GY) by banishing 2 "Infernoid" monsters from your hand or GY while the total Levels and Ranks of all Effect Monsters you control are 8 or lower. When this card declares an attack: You can banish 1 monster from your opponent's Extra Deck (their choice). Once per turn (Quick Effect): You can Tribute 1 monster, then target 1 card in your opponent's GY; banish it.
target_text: -- Infernoid
  local CARD_ID_0 = 34822850 --Void Expansion
  local SETCARD_ID_0 = 0xbb --Infernoid
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableReviveLimit()
  	--special summon condition
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetCode(EFFECT_SPSUMMON_CONDITION)
  	c:RegisterEffect(e1)
  	--special summon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_SPSUMMON_PROC)
  	e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e2:SetRange(LOCATION_HAND + LOCATION_GRAVE)
  	e2:SetCondition(s.spcon)
  	e2:SetTarget(s.sptg)
  	e2:SetOperation(s.spop)
  	c:RegisterEffect(e2)
  	--remove
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_REMOVE)
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e3:SetCode(EVENT_ATTACK_ANNOUNCE)
  	e3:SetTarget(s.rmtg1)
  	e3:SetOperation(s.rmop1)
  	c:RegisterEffect(e3)
  	--remove
  	local e4 = Effect.CreateEffect(c)
  	e4:SetCategory(CATEGORY_REMOVE)
  	e4:SetType(EFFECT_TYPE_QUICK_O)
  	e4:SetCode(EVENT_FREE_CHAIN)
  	e4:SetRange(LOCATION_MZONE)
  	e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e4:SetCountLimit(1)
  	e4:SetCost(s.rmcost2)
  	e4:SetTarget(s.rmtg2)
  	e4:SetOperation(s.rmop2)
  	c:RegisterEffect(e4)
  end
  function s.spfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
  end
  function s.sumfilter(c)
  	return c:IsFaceup() and c:IsType(TYPE_EFFECT)
  end
  function s.lv_or_rk(c)
  	if c:IsType(TYPE_XYZ) then
  		return c:GetRank()
  	else
  		return c:GetLevel()
  	end
  end
  function s.spcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	local sum = Duel.GetMatchingGroup(s.sumfilter, tp, LOCATION_MZONE, 0, nil):GetSum(s.lv_or_rk)
  	if sum > 8 then
  		return false
  	end
  	local loc = LOCATION_GRAVE + LOCATION_HAND
  	if c:IsHasEffect(CARD_ID_0) then
  		loc = loc + LOCATION_MZONE
  	end
  	local g = Duel.GetMatchingGroup(s.spfilter, tp, loc, 0, c)
  	return g:CheckSubGroup(aux.mzctcheck, 2, 2, tp)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, c)
  	local loc = LOCATION_GRAVE + LOCATION_HAND
  	if c:IsHasEffect(CARD_ID_0) then
  		loc = loc + LOCATION_MZONE
  	end
  	local g = Duel.GetMatchingGroup(s.spfilter, tp, loc, 0, c)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local sg = g:SelectSubGroup(tp, aux.mzctcheck, true, 2, 2, tp)
  	if sg then
  		sg:KeepAlive()
  		e:SetLabelObject(sg)
  		return true
  	else
  		return false
  	end
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp, c)
  	local g = e:GetLabelObject()
  	Duel.Remove(g, POS_FACEUP, REASON_SPSUMMON)
  	g:DeleteGroup()
  end
  function s.rmtg1(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsAbleToRemove, tp, 0, LOCATION_EXTRA, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, nil, 1, 1 - tp, LOCATION_EXTRA)
  end
  function s.rmop1(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, 1 - tp, HINTMSG_REMOVE)
  	local g = Duel.SelectMatchingCard(1 - tp, nil, 1 - tp, LOCATION_EXTRA, 0, 1, 1, nil)
  	Duel.Remove(g, POS_FACEUP, REASON_EFFECT)
  end
  function s.rmcost2(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckReleaseGroup(tp, nil, 1, nil)
  	end
  	local g = Duel.SelectReleaseGroup(tp, nil, 1, 1, nil)
  	Duel.Release(g, REASON_COST)
  end
  function s.rmtg2(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1 - tp) and chkc:IsAbleToRemove()
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(Card.IsAbleToRemove, tp, 0, LOCATION_GRAVE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g = Duel.SelectTarget(tp, Card.IsAbleToRemove, tp, 0, LOCATION_GRAVE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, g, 1, 1 - tp, LOCATION_GRAVE)
  end
  function s.rmop2(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		Duel.Remove(tc, POS_FACEUP, REASON_EFFECT)
  	end
  end
  
  