name: Recette
card_text: You can target 1 Ritual Monster you control; Special Summon 1 "Nouvelles Token" (Fiend/DARK/Level 1/ATK 50/DEF 50). This Token's Level becomes the same as that monster's. You can send this face-up card from your Spell & Trap Zone to the GY; Ritual Summon 1 "Nouvelles" Ritual Monster from your hand by Tributing monsters from your hand or field whose total Levels exactly equal the Level of that Ritual Monster. You can only use each effect of "Recette de Personnel (Staff Recipe)" once per turn.
external_ids: local CARD_ID_0 = 40551411 --Nouvelles Token
  local SETCARD_ID_0 = 0x196 --Nouvelles
  
lua: local CARD_ID_0 = 40551411 --Nouvelles Token
  local SETCARD_ID_0 = 0x196 --Nouvelles
  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)
  	--token
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_TOKEN)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCountLimit(1, id)
  	e2:SetTarget(s.tktg)
  	e2:SetOperation(s.tkop)
  	c:RegisterEffect(e2)
  	--ritual
  	local e3 = aux.AddRitualProcEqual2(c, s.filter, LOCATION_HAND, nil, nil, true)
  	e3:SetDescription(aux.Stringid(id, 1))
  	e3:SetType(EFFECT_TYPE_QUICK_O)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetHintTiming(0, TIMINGS_CHECK_MONSTER + TIMING_END_PHASE)
  	e3:SetCountLimit(1, id + o)
  	e3:SetCost(s.ritcost)
  	c:RegisterEffect(e3)
  end
  function s.tgfilter(c)
  	return c:IsFaceup() and c:GetType() & 0x81 == 0x81
  end
  function s.tktg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.tgfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
  			and Duel.IsExistingTarget(s.tgfilter, tp, LOCATION_MZONE, 0, 1, nil)
  			and Duel.IsPlayerCanSpecialSummonMonster(tp, id + 1, 0, TYPES_TOKEN_MONSTER, 50, 50, 1, RACE_FIEND, ATTRIBUTE_DARK, POS_FACEUP)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
  	local g = Duel.SelectTarget(tp, s.tgfilter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOKEN, nil, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, 0, 0)
  end
  function s.tkop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 or not Duel.IsPlayerCanSpecialSummonMonster(tp, id + 1, 0, TYPES_TOKEN_MONSTER, 50, 50, 1, RACE_FIEND, ATTRIBUTE_DARK, POS_FACEUP) then
  		return
  	end
  	local token = Duel.CreateToken(tp, id + 1)
  	if Duel.SpecialSummonStep(token, 0, tp, tp, false, false, POS_FACEUP) then
  		local tc = Duel.GetFirstTarget()
  		if tc:IsRelateToEffect(e) then
  			local lv = tc:GetLevel()
  			local e1 = Effect.CreateEffect(e:GetHandler())
  			e1:SetType(EFFECT_TYPE_SINGLE)
  			e1:SetCode(EFFECT_CHANGE_LEVEL)
  			e1:SetValue(lv)
  			e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  			token:RegisterEffect(e1)
  		end
  		Duel.SpecialSummonComplete()
  	end
  end
  function s.filter(c, e, tp)
  	return c:IsSetCard(SETCARD_ID_0)
  end
  function s.ritcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return c:IsAbleToGraveAsCost() and c:IsStatus(STATUS_EFFECT_ENABLED)
  	end
  	Duel.SendtoGrave(c, REASON_COST)
  end
  
  
source_text: Recette
  You can target 1 Ritual Monster you control; Special Summon 1 "Nouvelles Token" (Fiend/DARK/Level 1/ATK 50/DEF 50). This Token's Level becomes the same as that monster's. You can send this face-up card from your Spell & Trap Zone to the GY; Ritual Summon 1 "Nouvelles" Ritual Monster from your hand by Tributing monsters from your hand or field whose total Levels exactly equal the Level of that Ritual Monster. You can only use each effect of "Recette de Personnel (Staff Recipe)" once per turn.
target_text: -- Recette
  local CARD_ID_0 = 40551411 --Nouvelles Token
  local SETCARD_ID_0 = 0x196 --Nouvelles
  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)
  	--token
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_TOKEN)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCountLimit(1, id)
  	e2:SetTarget(s.tktg)
  	e2:SetOperation(s.tkop)
  	c:RegisterEffect(e2)
  	--ritual
  	local e3 = aux.AddRitualProcEqual2(c, s.filter, LOCATION_HAND, nil, nil, true)
  	e3:SetDescription(aux.Stringid(id, 1))
  	e3:SetType(EFFECT_TYPE_QUICK_O)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetHintTiming(0, TIMINGS_CHECK_MONSTER + TIMING_END_PHASE)
  	e3:SetCountLimit(1, id + o)
  	e3:SetCost(s.ritcost)
  	c:RegisterEffect(e3)
  end
  function s.tgfilter(c)
  	return c:IsFaceup() and c:GetType() & 0x81 == 0x81
  end
  function s.tktg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.tgfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
  			and Duel.IsExistingTarget(s.tgfilter, tp, LOCATION_MZONE, 0, 1, nil)
  			and Duel.IsPlayerCanSpecialSummonMonster(tp, id + 1, 0, TYPES_TOKEN_MONSTER, 50, 50, 1, RACE_FIEND, ATTRIBUTE_DARK, POS_FACEUP)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
  	local g = Duel.SelectTarget(tp, s.tgfilter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOKEN, nil, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, 0, 0)
  end
  function s.tkop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 or not Duel.IsPlayerCanSpecialSummonMonster(tp, id + 1, 0, TYPES_TOKEN_MONSTER, 50, 50, 1, RACE_FIEND, ATTRIBUTE_DARK, POS_FACEUP) then
  		return
  	end
  	local token = Duel.CreateToken(tp, id + 1)
  	if Duel.SpecialSummonStep(token, 0, tp, tp, false, false, POS_FACEUP) then
  		local tc = Duel.GetFirstTarget()
  		if tc:IsRelateToEffect(e) then
  			local lv = tc:GetLevel()
  			local e1 = Effect.CreateEffect(e:GetHandler())
  			e1:SetType(EFFECT_TYPE_SINGLE)
  			e1:SetCode(EFFECT_CHANGE_LEVEL)
  			e1:SetValue(lv)
  			e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  			token:RegisterEffect(e1)
  		end
  		Duel.SpecialSummonComplete()
  	end
  end
  function s.filter(c, e, tp)
  	return c:IsSetCard(SETCARD_ID_0)
  end
  function s.ritcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return c:IsAbleToGraveAsCost() and c:IsStatus(STATUS_EFFECT_ENABLED)
  	end
  	Duel.SendtoGrave(c, REASON_COST)
  end
  
  