name: Brain
card_text: FLIP: Equip this card to a monster on your opponent's side of the field and treat it as an Equip Card. Take control of the equipped monster. Your opponent gains 500 Life Points during each of their Standby Phases.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--flip
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_EQUIP)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_FLIP)
  	e1:SetTarget(s.eqtg)
  	e1:SetOperation(s.eqop)
  	c:RegisterEffect(e1)
  	--recover
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCode(EVENT_PHASE + PHASE_STANDBY)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.reccon)
  	e2:SetTarget(s.rectg)
  	e2:SetOperation(s.recop)
  	c:RegisterEffect(e2)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsControlerCanBeChanged()
  end
  function s.eqtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1 - tp) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return true
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_CONTROL)
  	local g = Duel.SelectTarget(tp, s.filter, tp, 0, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_CONTROL, g, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_EQUIP, e:GetHandler(), 1, 0, 0)
  end
  function s.eqlimit(e, c)
  	return e:GetOwner() == c
  end
  function s.eqop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if tc and not c:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsFaceup() and c:IsRelateToEffect(e) and Duel.Equip(tp, c, tc) then
  		--Add Equip limit
  		local e1 = Effect.CreateEffect(tc)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_EQUIP_LIMIT)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		e1:SetValue(s.eqlimit)
  		c:RegisterEffect(e1)
  		local e2 = Effect.CreateEffect(c)
  		e2:SetType(EFFECT_TYPE_EQUIP)
  		e2:SetCode(EFFECT_SET_CONTROL)
  		e2:SetValue(tp)
  		e2:SetReset(RESET_EVENT + RESETS_STANDARD - RESET_TURN_SET)
  		c:RegisterEffect(e2)
  	end
  end
  function s.reccon(e, tp, eg, ep, ev, re, r, rp)
  	return tp ~= Duel.GetTurnPlayer()
  end
  function s.rectg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetTargetPlayer(1 - tp)
  	Duel.SetTargetParam(500)
  	Duel.SetOperationInfo(0, CATEGORY_RECOVER, nil, 0, 1 - tp, 500)
  end
  function s.recop(e, tp, eg, ep, ev, re, r, rp)
  	local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  	Duel.Recover(p, d, REASON_EFFECT)
  end
  
  
source_text: Brain
  FLIP: Equip this card to a monster on your opponent's side of the field and treat it as an Equip Card. Take control of the equipped monster. Your opponent gains 500 Life Points during each of their Standby Phases.
target_text: -- Brain
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--flip
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_EQUIP)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_FLIP)
  	e1:SetTarget(s.eqtg)
  	e1:SetOperation(s.eqop)
  	c:RegisterEffect(e1)
  	--recover
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCode(EVENT_PHASE + PHASE_STANDBY)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.reccon)
  	e2:SetTarget(s.rectg)
  	e2:SetOperation(s.recop)
  	c:RegisterEffect(e2)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsControlerCanBeChanged()
  end
  function s.eqtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1 - tp) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return true
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_CONTROL)
  	local g = Duel.SelectTarget(tp, s.filter, tp, 0, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_CONTROL, g, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_EQUIP, e:GetHandler(), 1, 0, 0)
  end
  function s.eqlimit(e, c)
  	return e:GetOwner() == c
  end
  function s.eqop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if tc and not c:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsFaceup() and c:IsRelateToEffect(e) and Duel.Equip(tp, c, tc) then
  		--Add Equip limit
  		local e1 = Effect.CreateEffect(tc)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_EQUIP_LIMIT)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		e1:SetValue(s.eqlimit)
  		c:RegisterEffect(e1)
  		local e2 = Effect.CreateEffect(c)
  		e2:SetType(EFFECT_TYPE_EQUIP)
  		e2:SetCode(EFFECT_SET_CONTROL)
  		e2:SetValue(tp)
  		e2:SetReset(RESET_EVENT + RESETS_STANDARD - RESET_TURN_SET)
  		c:RegisterEffect(e2)
  	end
  end
  function s.reccon(e, tp, eg, ep, ev, re, r, rp)
  	return tp ~= Duel.GetTurnPlayer()
  end
  function s.rectg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetTargetPlayer(1 - tp)
  	Duel.SetTargetParam(500)
  	Duel.SetOperationInfo(0, CATEGORY_RECOVER, nil, 0, 1 - tp, 500)
  end
  function s.recop(e, tp, eg, ep, ev, re, r, rp)
  	local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  	Duel.Recover(p, d, REASON_EFFECT)
  end
  
  