name: White
card_text: You can Special Summon this card (from your hand) by discarding 1 WATER monster. You can only Special Summon "White Stingray" once per turn this way. If this card is Special Summoned from the GY: You can treat it as a Tuner this turn. You can only use this effect of "White Stingray" once per turn.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetCode(EFFECT_SPSUMMON_PROC)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.spcon)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--tuner
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e2:SetProperty(EFFECT_FLAG_DELAY)
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e2:SetCountLimit(1, id + 1)
  	e2:SetCondition(s.tncon)
  	e2:SetOperation(s.tnop)
  	c:RegisterEffect(e2)
  end
  s.treat_itself_tuner = true
  function s.cfilter(c)
  	return c:IsAttribute(ATTRIBUTE_WATER) and c:IsDiscardable()
  end
  function s.spcon(e, c)
  	if c == nil then
  		return true
  	end
  	return Duel.GetLocationCount(c:GetControler(), LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.cfilter, c:GetControler(), LOCATION_HAND, 0, 1, c)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, c)
  	local g = Duel.GetMatchingGroup(s.cfilter, tp, LOCATION_HAND, 0, c)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DISCARD)
  	local tc = g:SelectUnselect(nil, tp, false, true, 1, 1)
  	if tc then
  		e:SetLabelObject(tc)
  		return true
  	else
  		return false
  	end
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp, c)
  	local g = e:GetLabelObject()
  	Duel.SendtoGrave(g, REASON_DISCARD + REASON_SPSUMMON)
  end
  function s.tncon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsPreviousLocation(LOCATION_GRAVE)
  end
  function s.tnop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetCode(EFFECT_ADD_TYPE)
  		e1:SetValue(TYPE_TUNER)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		c:RegisterEffect(e1)
  	end
  end
  
  
source_text: White
  You can Special Summon this card (from your hand) by discarding 1 WATER monster. You can only Special Summon "White Stingray" once per turn this way. If this card is Special Summoned from the GY: You can treat it as a Tuner this turn. You can only use this effect of "White Stingray" once per turn.
target_text: -- White
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetCode(EFFECT_SPSUMMON_PROC)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.spcon)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--tuner
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e2:SetProperty(EFFECT_FLAG_DELAY)
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e2:SetCountLimit(1, id + 1)
  	e2:SetCondition(s.tncon)
  	e2:SetOperation(s.tnop)
  	c:RegisterEffect(e2)
  end
  s.treat_itself_tuner = true
  function s.cfilter(c)
  	return c:IsAttribute(ATTRIBUTE_WATER) and c:IsDiscardable()
  end
  function s.spcon(e, c)
  	if c == nil then
  		return true
  	end
  	return Duel.GetLocationCount(c:GetControler(), LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.cfilter, c:GetControler(), LOCATION_HAND, 0, 1, c)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, c)
  	local g = Duel.GetMatchingGroup(s.cfilter, tp, LOCATION_HAND, 0, c)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DISCARD)
  	local tc = g:SelectUnselect(nil, tp, false, true, 1, 1)
  	if tc then
  		e:SetLabelObject(tc)
  		return true
  	else
  		return false
  	end
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp, c)
  	local g = e:GetLabelObject()
  	Duel.SendtoGrave(g, REASON_DISCARD + REASON_SPSUMMON)
  end
  function s.tncon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsPreviousLocation(LOCATION_GRAVE)
  end
  function s.tnop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetCode(EFFECT_ADD_TYPE)
  		e1:SetValue(TYPE_TUNER)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		c:RegisterEffect(e1)
  	end
  end
  
  