name: Dimensionhole
card_text: Select 1 monster on your side of the field and remove it from play until your next Standby Phase. While the monster is removed from play, the Monster Card Zone of the selected monster cannot be used.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--remove
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_REMOVE)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return 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()
  	local val = aux.SequenceToGlobal(tc:GetControler(), LOCATION_MZONE, tc:GetSequence())
  	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:SetReset(RESET_PHASE + PHASE_STANDBY, 2)
  		e1:SetLabelObject(tc)
  		e1:SetCountLimit(1)
  		e1:SetCondition(s.rtcon)
  		e1:SetOperation(s.retop)
  		Duel.RegisterEffect(e1, tp)
  		local e2 = Effect.CreateEffect(e:GetHandler())
  		e2:SetType(EFFECT_TYPE_FIELD)
  		e2:SetCode(EFFECT_DISABLE_FIELD)
  		e2:SetLabelObject(tc)
  		e2:SetCondition(s.discon)
  		e2:SetValue(val)
  		Duel.RegisterEffect(e2, tp)
  	end
  end
  function s.rtcon(e, tp, eg, ep, ev, re, r, rp)
  	return tp == Duel.GetTurnPlayer()
  end
  function s.retop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.ReturnToField(e:GetLabelObject())
  end
  function s.discon(e, c)
  	if e:GetLabelObject():IsLocation(LOCATION_REMOVED) then
  		return true
  	else
  		e:Reset()
  		return false
  	end
  end
  
  
source_text: Dimensionhole
  Select 1 monster on your side of the field and remove it from play until your next Standby Phase. While the monster is removed from play, the Monster Card Zone of the selected monster cannot be used.
target_text: -- Dimensionhole
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--remove
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_REMOVE)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return 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()
  	local val = aux.SequenceToGlobal(tc:GetControler(), LOCATION_MZONE, tc:GetSequence())
  	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:SetReset(RESET_PHASE + PHASE_STANDBY, 2)
  		e1:SetLabelObject(tc)
  		e1:SetCountLimit(1)
  		e1:SetCondition(s.rtcon)
  		e1:SetOperation(s.retop)
  		Duel.RegisterEffect(e1, tp)
  		local e2 = Effect.CreateEffect(e:GetHandler())
  		e2:SetType(EFFECT_TYPE_FIELD)
  		e2:SetCode(EFFECT_DISABLE_FIELD)
  		e2:SetLabelObject(tc)
  		e2:SetCondition(s.discon)
  		e2:SetValue(val)
  		Duel.RegisterEffect(e2, tp)
  	end
  end
  function s.rtcon(e, tp, eg, ep, ev, re, r, rp)
  	return tp == Duel.GetTurnPlayer()
  end
  function s.retop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.ReturnToField(e:GetLabelObject())
  end
  function s.discon(e, c)
  	if e:GetLabelObject():IsLocation(LOCATION_REMOVED) then
  		return true
  	else
  		e:Reset()
  		return false
  	end
  end
  
  