name: Ice
card_text: Gains 400 ATK for each Aqua monster you control. Once per turn: You can activate this effect; you can Normal Summon 1 WATER monster during your Main Phase this turn, in addition to your Normal Summon/Set (you can only gain this effect once per turn), also you cannot Normal or Special Summon monsters for the rest of this turn, except WATER monsters.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--atkup
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetCode(EFFECT_UPDATE_ATTACK)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetValue(s.val)
  	c:RegisterEffect(e1)
  	--extra normal summon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.sumcon)
  	e2:SetTarget(s.sumtg)
  	e2:SetOperation(s.sumop)
  	c:RegisterEffect(e2)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsRace(RACE_AQUA)
  end
  function s.val(e, c)
  	return Duel.GetMatchingGroupCount(s.cfilter, c:GetControler(), LOCATION_MZONE, 0, nil) * 400
  end
  function s.sumcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetFlagEffect(tp, id) == 0
  end
  function s.sumtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsPlayerCanSummon(tp) and Duel.IsPlayerCanAdditionalSummon(tp)
  	end
  end
  function s.sumop(e, tp, eg, ep, ev, re, r, rp)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetDescription(aux.Stringid(id, 1))
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetTargetRange(LOCATION_HAND + LOCATION_MZONE, 0)
  	e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
  	e1:SetTarget(s.extrasumtg)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  	Duel.RegisterFlagEffect(tp, id, RESET_PHASE + PHASE_END, 0, 1)
  	local e2 = Effect.CreateEffect(e:GetHandler())
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_CANNOT_SUMMON)
  	e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e2:SetTargetRange(1, 0)
  	e2:SetTarget(s.splimit)
  	e2:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e2, tp)
  	local e3 = e2:Clone()
  	e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	Duel.RegisterEffect(e3, tp)
  end
  function s.extrasumtg(e, c)
  	return c:IsAttribute(ATTRIBUTE_WATER)
  end
  function s.splimit(e, c)
  	return not c:IsAttribute(ATTRIBUTE_WATER)
  end
  
  
source_text: Ice
  Gains 400 ATK for each Aqua monster you control. Once per turn: You can activate this effect; you can Normal Summon 1 WATER monster during your Main Phase this turn, in addition to your Normal Summon/Set (you can only gain this effect once per turn), also you cannot Normal or Special Summon monsters for the rest of this turn, except WATER monsters.
target_text: -- Ice
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--atkup
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetCode(EFFECT_UPDATE_ATTACK)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetValue(s.val)
  	c:RegisterEffect(e1)
  	--extra normal summon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.sumcon)
  	e2:SetTarget(s.sumtg)
  	e2:SetOperation(s.sumop)
  	c:RegisterEffect(e2)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsRace(RACE_AQUA)
  end
  function s.val(e, c)
  	return Duel.GetMatchingGroupCount(s.cfilter, c:GetControler(), LOCATION_MZONE, 0, nil) * 400
  end
  function s.sumcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetFlagEffect(tp, id) == 0
  end
  function s.sumtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsPlayerCanSummon(tp) and Duel.IsPlayerCanAdditionalSummon(tp)
  	end
  end
  function s.sumop(e, tp, eg, ep, ev, re, r, rp)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetDescription(aux.Stringid(id, 1))
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetTargetRange(LOCATION_HAND + LOCATION_MZONE, 0)
  	e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
  	e1:SetTarget(s.extrasumtg)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  	Duel.RegisterFlagEffect(tp, id, RESET_PHASE + PHASE_END, 0, 1)
  	local e2 = Effect.CreateEffect(e:GetHandler())
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_CANNOT_SUMMON)
  	e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e2:SetTargetRange(1, 0)
  	e2:SetTarget(s.splimit)
  	e2:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e2, tp)
  	local e3 = e2:Clone()
  	e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	Duel.RegisterEffect(e3, tp)
  end
  function s.extrasumtg(e, c)
  	return c:IsAttribute(ATTRIBUTE_WATER)
  end
  function s.splimit(e, c)
  	return not c:IsAttribute(ATTRIBUTE_WATER)
  end
  
  