name: Spiritual
card_text: Once per turn: You can banish 1 "Ritual Beast" card from your Deck, face-up. During your second Standby Phase after this effect's activation, add the card banished by this effect to your hand. You can only Special Summon "Spiritual Beast Cannahawk(s)" once per turn.
external_ids: local SETCARD_ID_0 = 0xb5 --Ritual
  
lua: local SETCARD_ID_0 = 0xb5 --Ritual
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:SetSPSummonOnce(id)
  	--tohand
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_REMOVE)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetCountLimit(1)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsAbleToRemove()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, nil, 1, tp, LOCATION_DECK)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g = Duel.SelectMatchingCard(tp, s.filter, tp, LOCATION_DECK, 0, 1, 1, nil)
  	local tc = g:GetFirst()
  	if tc then
  		Duel.Remove(tc, POS_FACEUP, REASON_EFFECT)
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  		e1:SetRange(LOCATION_REMOVED)
  		e1:SetCode(EVENT_PHASE + PHASE_STANDBY)
  		e1:SetCountLimit(1)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_STANDBY + RESET_SELF_TURN, 2)
  		e1:SetCondition(s.thcon)
  		e1:SetOperation(s.thop)
  		e1:SetLabel(0)
  		tc:RegisterEffect(e1)
  	end
  end
  function s.thcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() == tp
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	local ct = e:GetLabel()
  	e:GetHandler():SetTurnCounter(ct + 1)
  	if ct == 1 then
  		Duel.SendtoHand(e:GetHandler(), nil, REASON_EFFECT)
  		Duel.ConfirmCards(1 - tp, e:GetHandler())
  	else
  		e:SetLabel(1)
  	end
  end
  
  
source_text: Spiritual
  Once per turn: You can banish 1 "Ritual Beast" card from your Deck, face-up. During your second Standby Phase after this effect's activation, add the card banished by this effect to your hand. You can only Special Summon "Spiritual Beast Cannahawk(s)" once per turn.
target_text: -- Spiritual
  local SETCARD_ID_0 = 0xb5 --Ritual
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:SetSPSummonOnce(id)
  	--tohand
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_REMOVE)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetCountLimit(1)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsAbleToRemove()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, nil, 1, tp, LOCATION_DECK)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g = Duel.SelectMatchingCard(tp, s.filter, tp, LOCATION_DECK, 0, 1, 1, nil)
  	local tc = g:GetFirst()
  	if tc then
  		Duel.Remove(tc, POS_FACEUP, REASON_EFFECT)
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  		e1:SetRange(LOCATION_REMOVED)
  		e1:SetCode(EVENT_PHASE + PHASE_STANDBY)
  		e1:SetCountLimit(1)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_STANDBY + RESET_SELF_TURN, 2)
  		e1:SetCondition(s.thcon)
  		e1:SetOperation(s.thop)
  		e1:SetLabel(0)
  		tc:RegisterEffect(e1)
  	end
  end
  function s.thcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() == tp
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	local ct = e:GetLabel()
  	e:GetHandler():SetTurnCounter(ct + 1)
  	if ct == 1 then
  		Duel.SendtoHand(e:GetHandler(), nil, REASON_EFFECT)
  		Duel.ConfirmCards(1 - tp, e:GetHandler())
  	else
  		e:SetLabel(1)
  	end
  end
  
  