name: Atlantean
card_text: During your Main Phase, you can Normal Summon 1 Level 4 or lower Sea Serpent monster in addition to your Normal Summon/Set. (You can only gain this effect once per turn.) If this card is sent to the GY to activate a WATER monster's effect: Target 1 face-up card your opponent controls; destroy that target.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--extra summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 1))
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTargetRange(LOCATION_HAND + LOCATION_MZONE, 0)
  	e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
  	e1:SetTarget(s.extg)
  	c:RegisterEffect(e1)
  	--destroy
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_DESTROY)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetCode(EVENT_TO_GRAVE)
  	e2:SetCondition(s.descon)
  	e2:SetTarget(s.destg)
  	e2:SetOperation(s.desop)
  	c:RegisterEffect(e2)
  end
  function s.extg(e, c)
  	return c:IsLevelBelow(4) and c:IsRace(RACE_SEASERPENT)
  end
  function s.descon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsReason(REASON_COST) and re:IsActivated() and re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsAttribute(ATTRIBUTE_WATER)
  end
  function s.desfilter(c)
  	return c:IsFaceup()
  end
  function s.destg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsOnField() and chkc:IsControler(1 - tp) and s.desfilter(chkc)
  	end
  	if chk == 0 then
  		return true
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  	local g = Duel.SelectTarget(tp, s.desfilter, tp, 0, LOCATION_ONFIELD, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, g:GetCount(), 0, 0)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then
  		Duel.Destroy(tc, REASON_EFFECT)
  	end
  end
  
  
source_text: Atlantean
  During your Main Phase, you can Normal Summon 1 Level 4 or lower Sea Serpent monster in addition to your Normal Summon/Set. (You can only gain this effect once per turn.) If this card is sent to the GY to activate a WATER monster's effect: Target 1 face-up card your opponent controls; destroy that target.
target_text: -- Atlantean
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--extra summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 1))
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTargetRange(LOCATION_HAND + LOCATION_MZONE, 0)
  	e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
  	e1:SetTarget(s.extg)
  	c:RegisterEffect(e1)
  	--destroy
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_DESTROY)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetCode(EVENT_TO_GRAVE)
  	e2:SetCondition(s.descon)
  	e2:SetTarget(s.destg)
  	e2:SetOperation(s.desop)
  	c:RegisterEffect(e2)
  end
  function s.extg(e, c)
  	return c:IsLevelBelow(4) and c:IsRace(RACE_SEASERPENT)
  end
  function s.descon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsReason(REASON_COST) and re:IsActivated() and re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsAttribute(ATTRIBUTE_WATER)
  end
  function s.desfilter(c)
  	return c:IsFaceup()
  end
  function s.destg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsOnField() and chkc:IsControler(1 - tp) and s.desfilter(chkc)
  	end
  	if chk == 0 then
  		return true
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  	local g = Duel.SelectTarget(tp, s.desfilter, tp, 0, LOCATION_ONFIELD, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, g:GetCount(), 0, 0)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then
  		Duel.Destroy(tc, REASON_EFFECT)
  	end
  end
  
  