name: Icejade
card_text: If a face-up card is in a Field Zone, you can Special Summon this card (from your hand). You can only Special Summon "Icejade Kosmochlor" once per turn this way. While "Icejade Cenote Enion Cradle" is on the field, monsters your opponent controls can only activate their effects the turn they are Summoned. If your "Icejade" monster battles an opponent's monster, that opponent's monster loses 1000 ATK during that damage calculation only.
external_ids: local CARD_ID_0 = 7142724 --Icejade Cenote Enion Cradle
  local SETCARD_ID_0 = 0x16c --Icejade
  
lua: local CARD_ID_0 = 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_0)
  	--spsummon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_SPSUMMON_PROC)
  	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.spcon)
  	c:RegisterEffect(e1)
  	--cannot activate
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_CANNOT_TRIGGER)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTargetRange(0, LOCATION_MZONE)
  	e2:SetCondition(s.actcon)
  	e2:SetTarget(s.actlimit)
  	c:RegisterEffect(e2)
  	--atk down
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(EFFECT_UPDATE_ATTACK)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetTargetRange(0, LOCATION_MZONE)
  	e3:SetCondition(s.atkcon)
  	e3:SetTarget(s.atktg)
  	e3:SetValue(-1000)
  	c:RegisterEffect(e3)
  end
  function s.spcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(Card.IsFaceup, tp, LOCATION_FZONE, LOCATION_FZONE, 1, nil)
  end
  function s.actcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsEnvironment(CARD_ID_0)
  end
  function s.actlimit(e, c)
  	return not c:IsStatus(STATUS_SUMMON_TURN + STATUS_FLIP_SUMMON_TURN + STATUS_SPSUMMON_TURN)
  end
  function s.atkcon(e)
  	local tp = e:GetHandlerPlayer()
  	local a, d = Duel.GetBattleMonster(tp)
  	return Duel.GetCurrentPhase() == PHASE_DAMAGE_CAL and a and d and a:IsSetCard(SETCARD_ID_0)
  end
  function s.atktg(e, c)
  	local tp = e:GetHandlerPlayer()
  	local a, d = Duel.GetBattleMonster(tp)
  	return c == d
  end
  
  
source_text: Icejade
  If a face-up card is in a Field Zone, you can Special Summon this card (from your hand). You can only Special Summon "Icejade Kosmochlor" once per turn this way. While "Icejade Cenote Enion Cradle" is on the field, monsters your opponent controls can only activate their effects the turn they are Summoned. If your "Icejade" monster battles an opponent's monster, that opponent's monster loses 1000 ATK during that damage calculation only.
target_text: -- Icejade
  local CARD_ID_0 = 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_0)
  	--spsummon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_SPSUMMON_PROC)
  	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.spcon)
  	c:RegisterEffect(e1)
  	--cannot activate
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_CANNOT_TRIGGER)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTargetRange(0, LOCATION_MZONE)
  	e2:SetCondition(s.actcon)
  	e2:SetTarget(s.actlimit)
  	c:RegisterEffect(e2)
  	--atk down
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(EFFECT_UPDATE_ATTACK)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetTargetRange(0, LOCATION_MZONE)
  	e3:SetCondition(s.atkcon)
  	e3:SetTarget(s.atktg)
  	e3:SetValue(-1000)
  	c:RegisterEffect(e3)
  end
  function s.spcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(Card.IsFaceup, tp, LOCATION_FZONE, LOCATION_FZONE, 1, nil)
  end
  function s.actcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsEnvironment(CARD_ID_0)
  end
  function s.actlimit(e, c)
  	return not c:IsStatus(STATUS_SUMMON_TURN + STATUS_FLIP_SUMMON_TURN + STATUS_SPSUMMON_TURN)
  end
  function s.atkcon(e)
  	local tp = e:GetHandlerPlayer()
  	local a, d = Duel.GetBattleMonster(tp)
  	return Duel.GetCurrentPhase() == PHASE_DAMAGE_CAL and a and d and a:IsSetCard(SETCARD_ID_0)
  end
  function s.atktg(e, c)
  	local tp = e:GetHandlerPlayer()
  	local a, d = Duel.GetBattleMonster(tp)
  	return c == d
  end
  
  