name: Bounzer
card_text: Target 1 face-up "Bounzer" monster you control; this turn, it cannot be targeted by other card effects, or be destroyed by battle. This turn, if an opponent's monster attacks, it must target that monster for an attack if it is still on the field.
external_ids: local SETCARD_ID_0 = 0x6b --Bounzer
  
lua: local SETCARD_ID_0 = 0x6b --Bounzer
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) 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_FACEUP)
  	Duel.SelectTarget(tp, s.filter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsFaceup() and tc:IsRelateToEffect(e) then
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
  		e1:SetValue(1)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e1)
  		local e2 = Effect.CreateEffect(e:GetHandler())
  		e2:SetType(EFFECT_TYPE_SINGLE)
  		e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
  		e2:SetValue(1)
  		e2:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e2)
  		local fid = tc:GetRealFieldID()
  		local e4 = Effect.CreateEffect(e:GetHandler())
  		e4:SetType(EFFECT_TYPE_FIELD)
  		e4:SetCode(EFFECT_MUST_ATTACK_MONSTER)
  		e4:SetTargetRange(0, LOCATION_MZONE)
  		e4:SetValue(s.atklimit)
  		e4:SetLabel(fid)
  		e4:SetReset(RESET_PHASE + PHASE_END)
  		Duel.RegisterEffect(e4, tp)
  	end
  end
  function s.atklimit(e, c)
  	return c:GetRealFieldID() == e:GetLabel()
  end
  
  
source_text: Bounzer
  Target 1 face-up "Bounzer" monster you control; this turn, it cannot be targeted by other card effects, or be destroyed by battle. This turn, if an opponent's monster attacks, it must target that monster for an attack if it is still on the field.
target_text: -- Bounzer
  local SETCARD_ID_0 = 0x6b --Bounzer
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) 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_FACEUP)
  	Duel.SelectTarget(tp, s.filter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsFaceup() and tc:IsRelateToEffect(e) then
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
  		e1:SetValue(1)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e1)
  		local e2 = Effect.CreateEffect(e:GetHandler())
  		e2:SetType(EFFECT_TYPE_SINGLE)
  		e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
  		e2:SetValue(1)
  		e2:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e2)
  		local fid = tc:GetRealFieldID()
  		local e4 = Effect.CreateEffect(e:GetHandler())
  		e4:SetType(EFFECT_TYPE_FIELD)
  		e4:SetCode(EFFECT_MUST_ATTACK_MONSTER)
  		e4:SetTargetRange(0, LOCATION_MZONE)
  		e4:SetValue(s.atklimit)
  		e4:SetLabel(fid)
  		e4:SetReset(RESET_PHASE + PHASE_END)
  		Duel.RegisterEffect(e4, tp)
  	end
  end
  function s.atklimit(e, c)
  	return c:GetRealFieldID() == e:GetLabel()
  end
  
  