name: Hebo,
card_text: Cannot be Special Summoned. If this card is Normal Summoned or flipped face-up: You can target 1 face-up monster on the field; that target is treated as a Spirit monster, also return that target to the hand during the End Phase. Once per turn, during the End Phase, if this card was Normal Summoned or flipped face-up this turn: Return it to the hand.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--spirit return
  	aux.EnableSpiritReturn(c, EVENT_SUMMON_SUCCESS, EVENT_FLIP)
  	--cannot special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_SPSUMMON_CONDITION)
  	e1:SetValue(aux.FALSE)
  	c:RegisterEffect(e1)
  	--pos
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_DELAY)
  	e2:SetCode(EVENT_SUMMON_SUCCESS)
  	e2:SetTarget(s.postg)
  	e2:SetOperation(s.posop)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EVENT_FLIP)
  	c:RegisterEffect(e3)
  end
  function s.postg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup()
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(Card.IsFaceup, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
  	Duel.SelectTarget(tp, Card.IsFaceup, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil)
  end
  function s.posop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) and tc:IsFaceup() and not tc:IsImmuneToEffect(e) then
  		local c = e:GetHandler()
  		local fid = c:GetFieldID()
  		tc:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 1, fid)
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetCode(EFFECT_ADD_TYPE)
  		e1:SetValue(TYPE_SPIRIT)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		tc:RegisterEffect(e1)
  		local e2 = Effect.CreateEffect(c)
  		e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  		e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
  		e2:SetCode(EVENT_PHASE + PHASE_END)
  		e2:SetCountLimit(1)
  		e2:SetLabel(fid)
  		e2:SetLabelObject(tc)
  		e2:SetCondition(s.retcon)
  		e2:SetOperation(s.retop)
  		Duel.RegisterEffect(e2, tp)
  	end
  end
  function s.retcon(e, tp, eg, ep, ev, re, r, rp)
  	if not (e:GetLabelObject():GetFlagEffectLabel(id) == e:GetLabel()) then
  		e:Reset()
  		return false
  	else
  		return true
  	end
  end
  function s.retop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = e:GetLabelObject()
  	Duel.SendtoHand(tc, nil, REASON_EFFECT)
  end
  
  
source_text: Hebo,
  Cannot be Special Summoned. If this card is Normal Summoned or flipped face-up: You can target 1 face-up monster on the field; that target is treated as a Spirit monster, also return that target to the hand during the End Phase. Once per turn, during the End Phase, if this card was Normal Summoned or flipped face-up this turn: Return it to the hand.
target_text: -- Hebo,
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--spirit return
  	aux.EnableSpiritReturn(c, EVENT_SUMMON_SUCCESS, EVENT_FLIP)
  	--cannot special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_SPSUMMON_CONDITION)
  	e1:SetValue(aux.FALSE)
  	c:RegisterEffect(e1)
  	--pos
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_DELAY)
  	e2:SetCode(EVENT_SUMMON_SUCCESS)
  	e2:SetTarget(s.postg)
  	e2:SetOperation(s.posop)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EVENT_FLIP)
  	c:RegisterEffect(e3)
  end
  function s.postg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup()
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(Card.IsFaceup, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
  	Duel.SelectTarget(tp, Card.IsFaceup, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil)
  end
  function s.posop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) and tc:IsFaceup() and not tc:IsImmuneToEffect(e) then
  		local c = e:GetHandler()
  		local fid = c:GetFieldID()
  		tc:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 1, fid)
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetCode(EFFECT_ADD_TYPE)
  		e1:SetValue(TYPE_SPIRIT)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		tc:RegisterEffect(e1)
  		local e2 = Effect.CreateEffect(c)
  		e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  		e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
  		e2:SetCode(EVENT_PHASE + PHASE_END)
  		e2:SetCountLimit(1)
  		e2:SetLabel(fid)
  		e2:SetLabelObject(tc)
  		e2:SetCondition(s.retcon)
  		e2:SetOperation(s.retop)
  		Duel.RegisterEffect(e2, tp)
  	end
  end
  function s.retcon(e, tp, eg, ep, ev, re, r, rp)
  	if not (e:GetLabelObject():GetFlagEffectLabel(id) == e:GetLabel()) then
  		e:Reset()
  		return false
  	else
  		return true
  	end
  end
  function s.retop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = e:GetLabelObject()
  	Duel.SendtoHand(tc, nil, REASON_EFFECT)
  end
  
  