name: Springans
card_text: Add 1 "Great Sand Sea - Gold Golgonda" from your Deck to your hand. If "Great Sand Sea - Gold Golgonda" is in your Field Zone, you can apply this effect instead.
  ● Add 1 "Springans" monster from your Deck to your hand, and if you do, send 1 "Springans" monster from your Deck to the GY.
  You can only activate 1 "Springans Watch" per turn.
external_ids: local CARD_ID_0 = 60884672 --Great Sand Sea - Gold Golgonda
  local SETCARD_ID_0 = 0x155 --Springans
  
lua: local CARD_ID_0 = 60884672 --Great Sand Sea - Gold Golgonda
  local SETCARD_ID_0 = 0x155 --Springans
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH + CATEGORY_TOGRAVE)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsCode(CARD_ID_0) and c:IsAbleToHand()
  end
  function s.thfilter(c, tp)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and Duel.IsExistingMatchingCard(s.tgfilter, tp, LOCATION_DECK, 0, 1, c)
  end
  function s.tgfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local b = Duel.IsEnvironment(CARD_ID_0, tp, LOCATION_FZONE)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_DECK, 0, 1, nil) or b and Duel.IsExistingMatchingCard(s.thfilter, tp, LOCATION_DECK, 0, 1, nil, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
  	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, nil, 0, tp, LOCATION_DECK)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local b = Duel.IsEnvironment(CARD_ID_0, tp, LOCATION_FZONE)
  	if
  		b
  		and Duel.IsExistingMatchingCard(s.thfilter, tp, LOCATION_DECK, 0, 1, nil, tp)
  		and (not Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_DECK, 0, 1, nil) or Duel.SelectYesNo(tp, aux.Stringid(id, 0)))
  	then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  		local g = Duel.SelectMatchingCard(tp, s.thfilter, tp, LOCATION_DECK, 0, 1, 1, nil, tp)
  		local tc = g:GetFirst()
  		if Duel.SendtoHand(tc, nil, REASON_EFFECT) ~= 0 and tc:IsLocation(LOCATION_HAND) then
  			Duel.ConfirmCards(1 - tp, tc)
  			Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  			local tg = Duel.SelectMatchingCard(tp, s.tgfilter, tp, LOCATION_DECK, 0, 1, 1, nil)
  			Duel.SendtoGrave(tg, REASON_EFFECT)
  		end
  	else
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  		local g = Duel.SelectMatchingCard(tp, s.filter, tp, LOCATION_DECK, 0, 1, 1, nil)
  		if g:GetCount() > 0 then
  			Duel.SendtoHand(g, nil, REASON_EFFECT)
  			Duel.ConfirmCards(1 - tp, g)
  		end
  	end
  end
  
  
source_text: Springans
  Add 1 "Great Sand Sea - Gold Golgonda" from your Deck to your hand. If "Great Sand Sea - Gold Golgonda" is in your Field Zone, you can apply this effect instead.
  ● Add 1 "Springans" monster from your Deck to your hand, and if you do, send 1 "Springans" monster from your Deck to the GY.
  You can only activate 1 "Springans Watch" per turn.
target_text: -- Springans
  local CARD_ID_0 = 60884672 --Great Sand Sea - Gold Golgonda
  local SETCARD_ID_0 = 0x155 --Springans
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH + CATEGORY_TOGRAVE)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsCode(CARD_ID_0) and c:IsAbleToHand()
  end
  function s.thfilter(c, tp)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and Duel.IsExistingMatchingCard(s.tgfilter, tp, LOCATION_DECK, 0, 1, c)
  end
  function s.tgfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local b = Duel.IsEnvironment(CARD_ID_0, tp, LOCATION_FZONE)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_DECK, 0, 1, nil) or b and Duel.IsExistingMatchingCard(s.thfilter, tp, LOCATION_DECK, 0, 1, nil, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
  	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, nil, 0, tp, LOCATION_DECK)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local b = Duel.IsEnvironment(CARD_ID_0, tp, LOCATION_FZONE)
  	if
  		b
  		and Duel.IsExistingMatchingCard(s.thfilter, tp, LOCATION_DECK, 0, 1, nil, tp)
  		and (not Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_DECK, 0, 1, nil) or Duel.SelectYesNo(tp, aux.Stringid(id, 0)))
  	then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  		local g = Duel.SelectMatchingCard(tp, s.thfilter, tp, LOCATION_DECK, 0, 1, 1, nil, tp)
  		local tc = g:GetFirst()
  		if Duel.SendtoHand(tc, nil, REASON_EFFECT) ~= 0 and tc:IsLocation(LOCATION_HAND) then
  			Duel.ConfirmCards(1 - tp, tc)
  			Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  			local tg = Duel.SelectMatchingCard(tp, s.tgfilter, tp, LOCATION_DECK, 0, 1, 1, nil)
  			Duel.SendtoGrave(tg, REASON_EFFECT)
  		end
  	else
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  		local g = Duel.SelectMatchingCard(tp, s.filter, tp, LOCATION_DECK, 0, 1, 1, nil)
  		if g:GetCount() > 0 then
  			Duel.SendtoHand(g, nil, REASON_EFFECT)
  			Duel.ConfirmCards(1 - tp, g)
  		end
  	end
  end
  
  