name: Royal
card_text: If this card is Tribute Summoned: Special Summon 1 "Ice Coffin Token" (Aqua/WATER/Level 1/ATK 1000/DEF 0) in Attack Position to your opponent's field. This Token cannot be Tributed for a Tribute Summon.
external_ids: local CARD_ID_0 = 66661679 --Ice Coffin Token
  
lua: local CARD_ID_0 = 66661679 --Ice Coffin Token
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--token
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_TOKEN)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, 0)
  	Duel.SetOperationInfo(0, CATEGORY_TOKEN, nil, 1, tp, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	if
  		Duel.GetLocationCount(1 - tp, LOCATION_MZONE, tp) <= 0 or not Duel.IsPlayerCanSpecialSummonMonster(
  			tp,
  			id + 1,
  			0,
  			TYPES_TOKEN_MONSTER,
  			1000,
  			0,
  			1,
  			RACE_AQUA,
  			ATTRIBUTE_WATER,
  			POS_FACEUP_ATTACK,
  			1 - tp
  		)
  	then
  		return
  	end
  	local token = Duel.CreateToken(tp, id + 1)
  	Duel.SpecialSummonStep(token, 0, tp, 1 - tp, false, false, POS_FACEUP_ATTACK)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_UNRELEASABLE_SUM)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e1:SetValue(1)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  	token:RegisterEffect(e1, true)
  	Duel.SpecialSummonComplete()
  end
  
  
source_text: Royal
  If this card is Tribute Summoned: Special Summon 1 "Ice Coffin Token" (Aqua/WATER/Level 1/ATK 1000/DEF 0) in Attack Position to your opponent's field. This Token cannot be Tributed for a Tribute Summon.
target_text: -- Royal
  local CARD_ID_0 = 66661679 --Ice Coffin Token
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--token
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_TOKEN)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, 0)
  	Duel.SetOperationInfo(0, CATEGORY_TOKEN, nil, 1, tp, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	if
  		Duel.GetLocationCount(1 - tp, LOCATION_MZONE, tp) <= 0 or not Duel.IsPlayerCanSpecialSummonMonster(
  			tp,
  			id + 1,
  			0,
  			TYPES_TOKEN_MONSTER,
  			1000,
  			0,
  			1,
  			RACE_AQUA,
  			ATTRIBUTE_WATER,
  			POS_FACEUP_ATTACK,
  			1 - tp
  		)
  	then
  		return
  	end
  	local token = Duel.CreateToken(tp, id + 1)
  	Duel.SpecialSummonStep(token, 0, tp, 1 - tp, false, false, POS_FACEUP_ATTACK)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_UNRELEASABLE_SUM)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e1:SetValue(1)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  	token:RegisterEffect(e1, true)
  	Duel.SpecialSummonComplete()
  end
  
  