name: 重力砲
card_text: 機械族モンスターにのみ装備可能。
  1ターンに1度、装備モンスターの攻撃力を400ポイントアップできる。
  また、装備モンスターが相手モンスターと戦闘を行う場合、バトルフェイズの間だけその相手モンスターの効果は無効化される。
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_EQUIP)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_CONTINUOUS_TARGET)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	--Equip limit
  	local e2 = Effect.CreateEffect(c)
  	e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_EQUIP_LIMIT)
  	e2:SetValue(s.eqlimit)
  	c:RegisterEffect(e2)
  	--atkup
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 0))
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetCountLimit(1)
  	e3:SetOperation(s.atkop)
  	c:RegisterEffect(e3)
  	--disable
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e4:SetCode(EVENT_BE_BATTLE_TARGET)
  	e4:SetRange(LOCATION_SZONE)
  	e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e4:SetCondition(s.discon)
  	e4:SetOperation(s.disop)
  	c:RegisterEffect(e4)
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_FIELD)
  	e5:SetCode(EFFECT_DISABLE)
  	e5:SetRange(LOCATION_SZONE)
  	e5:SetTargetRange(0, LOCATION_MZONE)
  	e5:SetTarget(s.distg)
  	c:RegisterEffect(e5)
  	local e6 = e5:Clone()
  	e6:SetCode(EFFECT_DISABLE_EFFECT)
  	c:RegisterEffect(e6)
  end
  function s.eqlimit(e, c)
  	return c:IsRace(RACE_MACHINE)
  end
  function s.eqfilter(c)
  	return c:IsFaceup() and c:IsRace(RACE_MACHINE)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and s.eqfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.eqfilter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	Duel.SelectTarget(tp, s.eqfilter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_EQUIP, e:GetHandler(), 1, 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
  		Duel.Equip(tp, e:GetHandler(), tc)
  	end
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local ec = c:GetEquipTarget()
  	if ec and c:IsRelateToEffect(e) then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_UPDATE_ATTACK)
  		e1:SetValue(400)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		ec:RegisterEffect(e1)
  	end
  end
  function s.discon(e, tp, eg, ep, ev, re, r, rp)
  	local ec = e:GetHandler():GetEquipTarget()
  	return ec and ec:IsControler(tp) and (ec == Duel.GetAttacker() or ec == Duel.GetAttackTarget()) and ec:GetBattleTarget()
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = e:GetHandler():GetEquipTarget():GetBattleTarget()
  	tc:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_BATTLE, 0, 1)
  	Duel.AdjustInstantly(e:GetHandler())
  end
  function s.distg(e, c)
  	return c:GetFlagEffect(id) ~= 0
  end
  
  
source_text: 重力砲
  機械族モンスターにのみ装備可能。
  1ターンに1度、装備モンスターの攻撃力を400ポイントアップできる。
  また、装備モンスターが相手モンスターと戦闘を行う場合、バトルフェイズの間だけその相手モンスターの効果は無効化される。
target_text: -- 重力砲
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_EQUIP)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_CONTINUOUS_TARGET)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	--Equip limit
  	local e2 = Effect.CreateEffect(c)
  	e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_EQUIP_LIMIT)
  	e2:SetValue(s.eqlimit)
  	c:RegisterEffect(e2)
  	--atkup
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 0))
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetCountLimit(1)
  	e3:SetOperation(s.atkop)
  	c:RegisterEffect(e3)
  	--disable
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e4:SetCode(EVENT_BE_BATTLE_TARGET)
  	e4:SetRange(LOCATION_SZONE)
  	e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e4:SetCondition(s.discon)
  	e4:SetOperation(s.disop)
  	c:RegisterEffect(e4)
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_FIELD)
  	e5:SetCode(EFFECT_DISABLE)
  	e5:SetRange(LOCATION_SZONE)
  	e5:SetTargetRange(0, LOCATION_MZONE)
  	e5:SetTarget(s.distg)
  	c:RegisterEffect(e5)
  	local e6 = e5:Clone()
  	e6:SetCode(EFFECT_DISABLE_EFFECT)
  	c:RegisterEffect(e6)
  end
  function s.eqlimit(e, c)
  	return c:IsRace(RACE_MACHINE)
  end
  function s.eqfilter(c)
  	return c:IsFaceup() and c:IsRace(RACE_MACHINE)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and s.eqfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.eqfilter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	Duel.SelectTarget(tp, s.eqfilter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_EQUIP, e:GetHandler(), 1, 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
  		Duel.Equip(tp, e:GetHandler(), tc)
  	end
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local ec = c:GetEquipTarget()
  	if ec and c:IsRelateToEffect(e) then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_UPDATE_ATTACK)
  		e1:SetValue(400)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		ec:RegisterEffect(e1)
  	end
  end
  function s.discon(e, tp, eg, ep, ev, re, r, rp)
  	local ec = e:GetHandler():GetEquipTarget()
  	return ec and ec:IsControler(tp) and (ec == Duel.GetAttacker() or ec == Duel.GetAttackTarget()) and ec:GetBattleTarget()
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = e:GetHandler():GetEquipTarget():GetBattleTarget()
  	tc:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_BATTLE, 0, 1)
  	Duel.AdjustInstantly(e:GetHandler())
  end
  function s.distg(e, c)
  	return c:GetFlagEffect(id) ~= 0
  end
  
  