name: Dai
card_text: Choose 1 opponent's unused Main Monster Zone; if your opponent would Normal or Special Summon a monster to their Main Monster Zone, and the chosen zone can be used, they must use that zone. (They cannot Summon multiple monsters to their Main Monster Zones while this effect is applied.) This effect applies until the zone is occupied or becomes unusable. You can only apply the effect of "Dai Dance" once per Duel.
lua: function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetFlagEffect(tp, id) == 0
  	end
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(1 - tp, LOCATION_MZONE, PLAYER_NONE, 0) > 0
  	end
  	local flag = Duel.SelectDisableField(tp, 1, 0, LOCATION_MZONE, 0)
  	e:SetLabel(flag)
  	Duel.Hint(HINT_ZONE, tp, flag)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local flag = e:GetLabel()
  	local seq = math.log(bit.rshift(flag, 16), 2)
  	if not Duel.CheckLocation(1 - tp, LOCATION_MZONE, seq) or Duel.GetFlagEffect(tp, id) ~= 0 then
  		return
  	end
  	Duel.RegisterFlagEffect(tp, id, 0, 0, 0)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_MUST_USE_MZONE)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_NO_TURN_RESET)
  	e1:SetTargetRange(0, 1)
  	e1:SetValue(flag | 0x600060)
  	e1:SetCountLimit(1)
  	Duel.RegisterEffect(e1, tp)
  end
  
  
source_text: Dai
  Choose 1 opponent's unused Main Monster Zone; if your opponent would Normal or Special Summon a monster to their Main Monster Zone, and the chosen zone can be used, they must use that zone. (They cannot Summon multiple monsters to their Main Monster Zones while this effect is applied.) This effect applies until the zone is occupied or becomes unusable. You can only apply the effect of "Dai Dance" once per Duel.
target_text: -- Dai
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetFlagEffect(tp, id) == 0
  	end
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(1 - tp, LOCATION_MZONE, PLAYER_NONE, 0) > 0
  	end
  	local flag = Duel.SelectDisableField(tp, 1, 0, LOCATION_MZONE, 0)
  	e:SetLabel(flag)
  	Duel.Hint(HINT_ZONE, tp, flag)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local flag = e:GetLabel()
  	local seq = math.log(bit.rshift(flag, 16), 2)
  	if not Duel.CheckLocation(1 - tp, LOCATION_MZONE, seq) or Duel.GetFlagEffect(tp, id) ~= 0 then
  		return
  	end
  	Duel.RegisterFlagEffect(tp, id, 0, 0, 0)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_MUST_USE_MZONE)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_NO_TURN_RESET)
  	e1:SetTargetRange(0, 1)
  	e1:SetValue(flag | 0x600060)
  	e1:SetCountLimit(1)
  	Duel.RegisterEffect(e1, tp)
  end
  
  