name: Genex
card_text: Once per turn, you can send 1 face-up WATER "Genex" monster you control to the Graveyard to draw 2 cards.
external_ids: local SETCARD_ID_0 = 0x2 --Genex
  
lua: local SETCARD_ID_0 = 0x2 --Genex
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--draw
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DRAW)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetCost(s.drcost)
  	e1:SetTarget(s.drtg)
  	e1:SetOperation(s.drop)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToGraveAsCost()
  end
  function s.drcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, s.cfilter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  	Duel.SendtoGrave(g, REASON_COST)
  end
  function s.drtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsPlayerCanDraw(tp, 2)
  	end
  	Duel.SetTargetPlayer(tp)
  	Duel.SetTargetParam(2)
  	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, 2)
  end
  function s.drop(e, tp, eg, ep, ev, re, r, rp)
  	local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  	Duel.Draw(p, d, REASON_EFFECT)
  end
  
  
source_text: Genex
  Once per turn, you can send 1 face-up WATER "Genex" monster you control to the Graveyard to draw 2 cards.
target_text: -- Genex
  local SETCARD_ID_0 = 0x2 --Genex
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--draw
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DRAW)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetCost(s.drcost)
  	e1:SetTarget(s.drtg)
  	e1:SetOperation(s.drop)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToGraveAsCost()
  end
  function s.drcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, s.cfilter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  	Duel.SendtoGrave(g, REASON_COST)
  end
  function s.drtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsPlayerCanDraw(tp, 2)
  	end
  	Duel.SetTargetPlayer(tp)
  	Duel.SetTargetParam(2)
  	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, 2)
  end
  function s.drop(e, tp, eg, ep, ev, re, r, rp)
  	local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  	Duel.Draw(p, d, REASON_EFFECT)
  end
  
  