name: Searing
card_text: Banish any number of "Laval" monsters from your Graveyard; Special Summon an equal number of "Laval Tokens" (Pyro-Type/FIRE/Level 1/ATK 0/DEF 0) in Defense Position.
external_ids: local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local CARD_ID_1 = 47658965 --Laval Token
  local SETCARD_ID_0 = 0x39 --Laval
  
lua: local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local CARD_ID_1 = 47658965 --Laval Token
  local SETCARD_ID_0 = 0x39 --Laval
  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.cfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsAbleToRemoveAsCost()
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_GRAVE, 0, 1, nil)
  	end
  	local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  	if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  		ft = 1
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g = Duel.SelectMatchingCard(tp, s.cfilter, tp, LOCATION_GRAVE, 0, 1, ft, nil)
  	e:SetLabel(g:GetCount())
  	Duel.Remove(g, POS_FACEUP, REASON_COST)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsPlayerCanSpecialSummonMonster(
  			tp,
  			id + 1,
  			SETCARD_ID_0,
  			TYPES_TOKEN_MONSTER,
  			0,
  			0,
  			1,
  			RACE_PYRO,
  			ATTRIBUTE_FIRE,
  			POS_FACEUP_DEFENSE
  		)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOKEN, nil, e:GetLabel(), 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, e:GetLabel(), 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  	if
  		ft < e:GetLabel()
  		or not Duel.IsPlayerCanSpecialSummonMonster(tp, id + 1, SETCARD_ID_0, TYPES_TOKEN_MONSTER, 0, 0, 1, RACE_PYRO, ATTRIBUTE_FIRE, POS_FACEUP_DEFENSE)
  		or (e:GetLabel() > 1 and Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0))
  	then
  		return
  	end
  	for i = 1, e:GetLabel() do
  		local token = Duel.CreateToken(tp, id + 1)
  		Duel.SpecialSummonStep(token, 0, tp, tp, false, false, POS_FACEUP_DEFENSE)
  	end
  	Duel.SpecialSummonComplete()
  end
  
  
source_text: Searing
  Banish any number of "Laval" monsters from your Graveyard; Special Summon an equal number of "Laval Tokens" (Pyro-Type/FIRE/Level 1/ATK 0/DEF 0) in Defense Position.
target_text: -- Searing
  local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local CARD_ID_1 = 47658965 --Laval Token
  local SETCARD_ID_0 = 0x39 --Laval
  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.cfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsAbleToRemoveAsCost()
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_GRAVE, 0, 1, nil)
  	end
  	local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  	if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  		ft = 1
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g = Duel.SelectMatchingCard(tp, s.cfilter, tp, LOCATION_GRAVE, 0, 1, ft, nil)
  	e:SetLabel(g:GetCount())
  	Duel.Remove(g, POS_FACEUP, REASON_COST)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsPlayerCanSpecialSummonMonster(
  			tp,
  			id + 1,
  			SETCARD_ID_0,
  			TYPES_TOKEN_MONSTER,
  			0,
  			0,
  			1,
  			RACE_PYRO,
  			ATTRIBUTE_FIRE,
  			POS_FACEUP_DEFENSE
  		)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOKEN, nil, e:GetLabel(), 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, e:GetLabel(), 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  	if
  		ft < e:GetLabel()
  		or not Duel.IsPlayerCanSpecialSummonMonster(tp, id + 1, SETCARD_ID_0, TYPES_TOKEN_MONSTER, 0, 0, 1, RACE_PYRO, ATTRIBUTE_FIRE, POS_FACEUP_DEFENSE)
  		or (e:GetLabel() > 1 and Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0))
  	then
  		return
  	end
  	for i = 1, e:GetLabel() do
  		local token = Duel.CreateToken(tp, id + 1)
  		Duel.SpecialSummonStep(token, 0, tp, tp, false, false, POS_FACEUP_DEFENSE)
  	end
  	Duel.SpecialSummonComplete()
  end
  
  