name: Wind-Up
card_text: (Quick Effect): You can target 1 "Wind-Up" monster you control; banish it until your next Standby Phase. This effect can be used only once while this card is face-up on the field.
external_ids: local SETCARD_ID_0 = 0x58 --Wind-Up
  
lua: local SETCARD_ID_0 = 0x58 --Wind-Up
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--remove
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_REMOVE)
  	e1:SetProperty(EFFECT_FLAG_NO_TURN_RESET + EFFECT_FLAG_CARD_TARGET)
  	e1:SetType(EFFECT_TYPE_QUICK_O)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:IsAbleToRemove()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, LOCATION_MZONE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g = Duel.SelectTarget(tp, s.filter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, g, 1, 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) and Duel.Remove(tc, 0, REASON_EFFECT + REASON_TEMPORARY) ~= 0 then
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  		e1:SetCode(EVENT_PHASE + PHASE_STANDBY)
  		e1:SetRange(LOCATION_REMOVED)
  		e1:SetCountLimit(1)
  		if Duel.GetTurnPlayer() == tp then
  			if Duel.GetCurrentPhase() == PHASE_DRAW then
  				e1:SetLabel(Duel.GetTurnCount())
  			else
  				e1:SetLabel(Duel.GetTurnCount() + 2)
  			end
  		else
  			e1:SetLabel(Duel.GetTurnCount() + 1)
  		end
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		e1:SetCondition(s.retcon)
  		e1:SetOperation(s.retop)
  		tc:RegisterEffect(e1)
  	end
  end
  function s.retcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnCount() == e:GetLabel()
  end
  function s.retop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.ReturnToField(e:GetHandler())
  	e:Reset()
  end
  
  
source_text: Wind-Up
  (Quick Effect): You can target 1 "Wind-Up" monster you control; banish it until your next Standby Phase. This effect can be used only once while this card is face-up on the field.
target_text: -- Wind-Up
  local SETCARD_ID_0 = 0x58 --Wind-Up
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--remove
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_REMOVE)
  	e1:SetProperty(EFFECT_FLAG_NO_TURN_RESET + EFFECT_FLAG_CARD_TARGET)
  	e1:SetType(EFFECT_TYPE_QUICK_O)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:IsAbleToRemove()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, LOCATION_MZONE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g = Duel.SelectTarget(tp, s.filter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, g, 1, 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) and Duel.Remove(tc, 0, REASON_EFFECT + REASON_TEMPORARY) ~= 0 then
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  		e1:SetCode(EVENT_PHASE + PHASE_STANDBY)
  		e1:SetRange(LOCATION_REMOVED)
  		e1:SetCountLimit(1)
  		if Duel.GetTurnPlayer() == tp then
  			if Duel.GetCurrentPhase() == PHASE_DRAW then
  				e1:SetLabel(Duel.GetTurnCount())
  			else
  				e1:SetLabel(Duel.GetTurnCount() + 2)
  			end
  		else
  			e1:SetLabel(Duel.GetTurnCount() + 1)
  		end
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		e1:SetCondition(s.retcon)
  		e1:SetOperation(s.retop)
  		tc:RegisterEffect(e1)
  	end
  end
  function s.retcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnCount() == e:GetLabel()
  end
  function s.retop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.ReturnToField(e:GetHandler())
  	e:Reset()
  end
  
  