name: Icejade
card_text: This card's name becomes "Icejade Cenote Enion Cradle" while equipped with an Equip Card. You can discard 1 other "Icejade" card or WATER monster; Special Summon this card from your hand, then you can Special Summon 1 "Icejade Token" (Aqua/WATER/Level 3/ATK 0/DEF 0). While that Token is in the Monster Zone, the player who Summoned it cannot Special Summon from the Extra Deck, except WATER monsters. You can only use this effect of "Icejade Ran Aegirine" once per turn.
external_ids: local CARD_ID_0 = 18494512 --Icejade Token
  local CARD_ID_1 = 7142724 --Icejade Cenote Enion Cradle
  local SETCARD_ID_0 = 0x16c --Icejade
  
lua: local CARD_ID_0 = 18494512 --Icejade Token
  local CARD_ID_1 = 7142724 --Icejade Cenote Enion Cradle
  local SETCARD_ID_0 = 0x16c --Icejade
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_1)
  	--special summon (self)
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_TOKEN)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id)
  	e1:SetCost(s.spcost)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--change name
  	aux.EnableChangeCode(c, CARD_ID_1, LOCATION_MZONE, s.codecon)
  end
  function s.costfilter(c)
  	local b1 = c:IsSetCard(SETCARD_ID_0)
  	local b2 = c:IsAttribute(ATTRIBUTE_WATER) and c:IsType(TYPE_MONSTER)
  	return (b1 or b2) and c:IsDiscardable()
  end
  function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.costfilter, tp, LOCATION_HAND, 0, 1, e:GetHandler())
  	end
  	Duel.DiscardHand(tp, s.costfilter, 1, 1, REASON_COST + REASON_DISCARD, e:GetHandler())
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and e:GetHandler():IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, e:GetHandler(), 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) and Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP) ~= 0 then
  		local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  		if ft > 0 and Duel.IsPlayerCanSpecialSummonMonster(tp, id + 1, SETCARD_ID_0, TYPES_TOKEN_MONSTER, 0, 0, 3, RACE_AQUA, ATTRIBUTE_WATER) and Duel.SelectYesNo(tp, aux.Stringid(id, 1)) then
  			Duel.BreakEffect()
  			local token = Duel.CreateToken(tp, id + 1)
  			Duel.SpecialSummonStep(token, 0, tp, tp, false, false, POS_FACEUP)
  			local e1 = Effect.CreateEffect(c)
  			e1:SetType(EFFECT_TYPE_FIELD)
  			e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  			e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  			e1:SetRange(LOCATION_MZONE)
  			e1:SetAbsoluteRange(tp, 1, 0)
  			e1:SetTarget(s.splimit)
  			e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  			token:RegisterEffect(e1, true)
  			Duel.SpecialSummonComplete()
  		end
  	end
  end
  function s.splimit(e, c)
  	return not c:IsAttribute(ATTRIBUTE_WATER) and c:IsLocation(LOCATION_EXTRA)
  end
  function s.codecon(e)
  	return e:GetHandler():GetEquipCount() > 0
  end
  
  
source_text: Icejade
  This card's name becomes "Icejade Cenote Enion Cradle" while equipped with an Equip Card. You can discard 1 other "Icejade" card or WATER monster; Special Summon this card from your hand, then you can Special Summon 1 "Icejade Token" (Aqua/WATER/Level 3/ATK 0/DEF 0). While that Token is in the Monster Zone, the player who Summoned it cannot Special Summon from the Extra Deck, except WATER monsters. You can only use this effect of "Icejade Ran Aegirine" once per turn.
target_text: -- Icejade
  local CARD_ID_0 = 18494512 --Icejade Token
  local CARD_ID_1 = 7142724 --Icejade Cenote Enion Cradle
  local SETCARD_ID_0 = 0x16c --Icejade
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_1)
  	--special summon (self)
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_TOKEN)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id)
  	e1:SetCost(s.spcost)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--change name
  	aux.EnableChangeCode(c, CARD_ID_1, LOCATION_MZONE, s.codecon)
  end
  function s.costfilter(c)
  	local b1 = c:IsSetCard(SETCARD_ID_0)
  	local b2 = c:IsAttribute(ATTRIBUTE_WATER) and c:IsType(TYPE_MONSTER)
  	return (b1 or b2) and c:IsDiscardable()
  end
  function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.costfilter, tp, LOCATION_HAND, 0, 1, e:GetHandler())
  	end
  	Duel.DiscardHand(tp, s.costfilter, 1, 1, REASON_COST + REASON_DISCARD, e:GetHandler())
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and e:GetHandler():IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, e:GetHandler(), 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) and Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP) ~= 0 then
  		local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  		if ft > 0 and Duel.IsPlayerCanSpecialSummonMonster(tp, id + 1, SETCARD_ID_0, TYPES_TOKEN_MONSTER, 0, 0, 3, RACE_AQUA, ATTRIBUTE_WATER) and Duel.SelectYesNo(tp, aux.Stringid(id, 1)) then
  			Duel.BreakEffect()
  			local token = Duel.CreateToken(tp, id + 1)
  			Duel.SpecialSummonStep(token, 0, tp, tp, false, false, POS_FACEUP)
  			local e1 = Effect.CreateEffect(c)
  			e1:SetType(EFFECT_TYPE_FIELD)
  			e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  			e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  			e1:SetRange(LOCATION_MZONE)
  			e1:SetAbsoluteRange(tp, 1, 0)
  			e1:SetTarget(s.splimit)
  			e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  			token:RegisterEffect(e1, true)
  			Duel.SpecialSummonComplete()
  		end
  	end
  end
  function s.splimit(e, c)
  	return not c:IsAttribute(ATTRIBUTE_WATER) and c:IsLocation(LOCATION_EXTRA)
  end
  function s.codecon(e)
  	return e:GetHandler():GetEquipCount() > 0
  end
  
  