name: 煉獄の狂宴
card_text: 1:自分の手札・フィールド(表側表示)の「煉獄」魔法・罠カード1枚を墓地へ送って発動できる。
  レベルの合計が8になるように、デッキから「インフェルノイド」モンスターを3体まで召喚条件を無視して特殊召喚する。
external_ids: local CARD_ID_0 = 59822133 --青眼の精霊龍
  local SETCARD_ID_0 = 0xbb --インフェルノイド
  local SETCARD_ID_1 = 0xc5 --煉獄
  
lua: local CARD_ID_0 = 59822133 --青眼の精霊龍
  local SETCARD_ID_0 = 0xbb --インフェルノイド
  local SETCARD_ID_1 = 0xc5 --煉獄
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.costfilter(c)
  	return c:IsSetCard(SETCARD_ID_1) and c:IsType(TYPE_SPELL + TYPE_TRAP) and (c:IsFaceup() or c:IsLocation(LOCATION_HAND)) and c:IsAbleToGraveAsCost()
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.costfilter, tp, LOCATION_HAND + LOCATION_ONFIELD, 0, 1, e:GetHandler())
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, s.costfilter, tp, LOCATION_HAND + LOCATION_ONFIELD, 0, 1, 1, e:GetHandler())
  	Duel.SendtoGrave(g, REASON_COST)
  end
  function s.spfilter(c, e, tp)
  	return c:IsSetCard(SETCARD_ID_1) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e, 0, tp, true, false)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		local ft = math.min((Duel.GetLocationCount(tp, LOCATION_MZONE)), 3)
  		if ft > 1 and Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  			ft = 1
  		end
  		local g = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_DECK, 0, nil, e, tp)
  		return ft > 0 and g:CheckWithSumEqual(Card.GetLevel, 8, 1, ft)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_DECK)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local ft = math.min((Duel.GetLocationCount(tp, LOCATION_MZONE)), 3)
  	if ft > 1 and Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  		ft = 1
  	end
  	local g = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_DECK, 0, nil, e, tp)
  	if ft <= 0 or g:GetCount() == 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local sg = g:SelectWithSumEqual(tp, Card.GetLevel, 8, 1, ft)
  	Duel.SpecialSummon(sg, 0, tp, tp, true, false, POS_FACEUP)
  end
  
  
source_text: 煉獄の狂宴
  1:自分の手札・フィールド(表側表示)の「煉獄」魔法・罠カード1枚を墓地へ送って発動できる。
  レベルの合計が8になるように、デッキから「インフェルノイド」モンスターを3体まで召喚条件を無視して特殊召喚する。
target_text: -- 煉獄の狂宴
  local CARD_ID_0 = 59822133 --青眼の精霊龍
  local SETCARD_ID_0 = 0xbb --インフェルノイド
  local SETCARD_ID_1 = 0xc5 --煉獄
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.costfilter(c)
  	return c:IsSetCard(SETCARD_ID_1) and c:IsType(TYPE_SPELL + TYPE_TRAP) and (c:IsFaceup() or c:IsLocation(LOCATION_HAND)) and c:IsAbleToGraveAsCost()
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.costfilter, tp, LOCATION_HAND + LOCATION_ONFIELD, 0, 1, e:GetHandler())
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, s.costfilter, tp, LOCATION_HAND + LOCATION_ONFIELD, 0, 1, 1, e:GetHandler())
  	Duel.SendtoGrave(g, REASON_COST)
  end
  function s.spfilter(c, e, tp)
  	return c:IsSetCard(SETCARD_ID_1) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e, 0, tp, true, false)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		local ft = math.min((Duel.GetLocationCount(tp, LOCATION_MZONE)), 3)
  		if ft > 1 and Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  			ft = 1
  		end
  		local g = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_DECK, 0, nil, e, tp)
  		return ft > 0 and g:CheckWithSumEqual(Card.GetLevel, 8, 1, ft)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_DECK)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local ft = math.min((Duel.GetLocationCount(tp, LOCATION_MZONE)), 3)
  	if ft > 1 and Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  		ft = 1
  	end
  	local g = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_DECK, 0, nil, e, tp)
  	if ft <= 0 or g:GetCount() == 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local sg = g:SelectWithSumEqual(tp, Card.GetLevel, 8, 1, ft)
  	Duel.SpecialSummon(sg, 0, tp, tp, true, false, POS_FACEUP)
  end
  
  