name: Boycotton
card_text: You take any battle damage your opponent would have taken from battles involving this card, instead. If this card battles, is not destroyed, and you took damage from that battle: Return this card to the hand.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--damage
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetTargetRange(0, 1)
  	e1:SetCondition(s.rfcon)
  	c:RegisterEffect(e1)
  	--to hand
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_TOHAND)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCode(EVENT_DAMAGE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCondition(s.thcon)
  	e2:SetTarget(s.thtg)
  	e2:SetOperation(s.thop)
  	c:RegisterEffect(e2)
  end
  function s.rfcon(e)
  	return Duel.GetAttacker() == e:GetHandler() or Duel.GetAttackTarget() == e:GetHandler()
  end
  function s.thcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	return ep == tp and bit.band(r, REASON_BATTLE) ~= 0 and (Duel.GetAttacker() == c or Duel.GetAttackTarget() == c) and not c:IsStatus(STATUS_BATTLE_DESTROYED)
  end
  function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, e:GetHandler(), 1, 0, 0)
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.SendtoHand(e:GetHandler(), nil, REASON_EFFECT)
  end
  
  
source_text: Boycotton
  You take any battle damage your opponent would have taken from battles involving this card, instead. If this card battles, is not destroyed, and you took damage from that battle: Return this card to the hand.
target_text: -- Boycotton
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--damage
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetTargetRange(0, 1)
  	e1:SetCondition(s.rfcon)
  	c:RegisterEffect(e1)
  	--to hand
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_TOHAND)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCode(EVENT_DAMAGE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCondition(s.thcon)
  	e2:SetTarget(s.thtg)
  	e2:SetOperation(s.thop)
  	c:RegisterEffect(e2)
  end
  function s.rfcon(e)
  	return Duel.GetAttacker() == e:GetHandler() or Duel.GetAttackTarget() == e:GetHandler()
  end
  function s.thcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	return ep == tp and bit.band(r, REASON_BATTLE) ~= 0 and (Duel.GetAttacker() == c or Duel.GetAttackTarget() == c) and not c:IsStatus(STATUS_BATTLE_DESTROYED)
  end
  function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, e:GetHandler(), 1, 0, 0)
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.SendtoHand(e:GetHandler(), nil, REASON_EFFECT)
  end
  
  