name: Limit
card_text: Send 2 cards from your hand to the GY; Special Summon 2 "Soul Tokens" (Fiend/DARK/Level 1/ATK 0/DEF 0). They cannot be Tributed except for a Tribute Summon.
external_ids: local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local CARD_ID_1 = 82324106 --Soul Token
  
lua: local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local CARD_ID_1 = 82324106 --Soul Token
  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:SetHintTiming(0, TIMING_END_PHASE)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost, tp, LOCATION_HAND, 0, 2, e:GetHandler())
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, Card.IsAbleToGraveAsCost, tp, LOCATION_HAND, 0, 2, 2, e:GetHandler())
  	Duel.SendtoGrave(g, REASON_COST)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return not Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0)
  			and Duel.GetLocationCount(tp, LOCATION_MZONE) > 1
  			and Duel.IsPlayerCanSpecialSummonMonster(tp, id + 1, 0, TYPES_TOKEN_MONSTER, 0, 0, 1, RACE_FIEND, ATTRIBUTE_DARK)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOKEN, nil, 2, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 2, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  		return
  	end
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) > 1 and Duel.IsPlayerCanSpecialSummonMonster(tp, id + 1, 0, TYPES_TOKEN_MONSTER, 0, 0, 1, RACE_FIEND, ATTRIBUTE_DARK) then
  		for i = 1, 2 do
  			local token = Duel.CreateToken(tp, id + 1)
  			Duel.SpecialSummonStep(token, 0, tp, tp, false, false, POS_FACEUP)
  			local e1 = Effect.CreateEffect(e:GetHandler())
  			e1:SetType(EFFECT_TYPE_SINGLE)
  			e1:SetCode(EFFECT_UNRELEASABLE_NONSUM)
  			e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  			e1:SetValue(1)
  			e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  			token:RegisterEffect(e1, true)
  		end
  		Duel.SpecialSummonComplete()
  	end
  end
  
  
source_text: Limit
  Send 2 cards from your hand to the GY; Special Summon 2 "Soul Tokens" (Fiend/DARK/Level 1/ATK 0/DEF 0). They cannot be Tributed except for a Tribute Summon.
target_text: -- Limit
  local CARD_ID_0 = 59822133 --Blue-Eyes Spirit Dragon
  local CARD_ID_1 = 82324106 --Soul Token
  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:SetHintTiming(0, TIMING_END_PHASE)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost, tp, LOCATION_HAND, 0, 2, e:GetHandler())
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, Card.IsAbleToGraveAsCost, tp, LOCATION_HAND, 0, 2, 2, e:GetHandler())
  	Duel.SendtoGrave(g, REASON_COST)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return not Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0)
  			and Duel.GetLocationCount(tp, LOCATION_MZONE) > 1
  			and Duel.IsPlayerCanSpecialSummonMonster(tp, id + 1, 0, TYPES_TOKEN_MONSTER, 0, 0, 1, RACE_FIEND, ATTRIBUTE_DARK)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOKEN, nil, 2, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 2, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0) then
  		return
  	end
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) > 1 and Duel.IsPlayerCanSpecialSummonMonster(tp, id + 1, 0, TYPES_TOKEN_MONSTER, 0, 0, 1, RACE_FIEND, ATTRIBUTE_DARK) then
  		for i = 1, 2 do
  			local token = Duel.CreateToken(tp, id + 1)
  			Duel.SpecialSummonStep(token, 0, tp, tp, false, false, POS_FACEUP)
  			local e1 = Effect.CreateEffect(e:GetHandler())
  			e1:SetType(EFFECT_TYPE_SINGLE)
  			e1:SetCode(EFFECT_UNRELEASABLE_NONSUM)
  			e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  			e1:SetValue(1)
  			e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  			token:RegisterEffect(e1, true)
  		end
  		Duel.SpecialSummonComplete()
  	end
  end
  
  