本帖最后由 guoxiaomi 于 2017-5-22 21:11 编辑
修改interpreter里面对应的command
Game_Actor 里的第 390 - 432 行是关于更换装备的方法,其中 equip_type = 0~3 是武器防具的种类, id 是武器防具的编号。
#-------------------------------------------------------------------------- # ● 变更装备 # equip_type : 装备类型 # id : 武器 or 防具 ID (0 为解除装备) #-------------------------------------------------------------------------- def equip(equip_type, id) case equip_type when 0 # 武器 if id == 0 or $game_party.weapon_number(id) > 0 $game_party.gain_weapon(@weapon_id, 1) @weapon_id = id $game_party.lose_weapon(id, 1) end when 1 # 盾 if id == 0 or $game_party.armor_number(id) > 0 update_auto_state($data_armors[@armor1_id], $data_armors[id]) $game_party.gain_armor(@armor1_id, 1) @armor1_id = id $game_party.lose_armor(id, 1) end when 2 # 头 if id == 0 or $game_party.armor_number(id) > 0 update_auto_state($data_armors[@armor2_id], $data_armors[id]) $game_party.gain_armor(@armor2_id, 1) @armor2_id = id $game_party.lose_armor(id, 1) end when 3 # 身体 if id == 0 or $game_party.armor_number(id) > 0 update_auto_state($data_armors[@armor3_id], $data_armors[id]) $game_party.gain_armor(@armor3_id, 1) @armor3_id = id $game_party.lose_armor(id, 1) end when 4 # 装饰品 if id == 0 or $game_party.armor_number(id) > 0 update_auto_state($data_armors[@armor4_id], $data_armors[id]) $game_party.gain_armor(@armor4_id, 1) @armor4_id = id $game_party.lose_armor(id, 1) end end end
#--------------------------------------------------------------------------
# ● 变更装备
# equip_type : 装备类型
# id : 武器 or 防具 ID (0 为解除装备)
#--------------------------------------------------------------------------
def equip(equip_type, id)
case equip_type
when 0 # 武器
if id == 0 or $game_party.weapon_number(id) > 0
$game_party.gain_weapon(@weapon_id, 1)
@weapon_id = id
$game_party.lose_weapon(id, 1)
end
when 1 # 盾
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@armor1_id], $data_armors[id])
$game_party.gain_armor(@armor1_id, 1)
@armor1_id = id
$game_party.lose_armor(id, 1)
end
when 2 # 头
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@armor2_id], $data_armors[id])
$game_party.gain_armor(@armor2_id, 1)
@armor2_id = id
$game_party.lose_armor(id, 1)
end
when 3 # 身体
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@armor3_id], $data_armors[id])
$game_party.gain_armor(@armor3_id, 1)
@armor3_id = id
$game_party.lose_armor(id, 1)
end
when 4 # 装饰品
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@armor4_id], $data_armors[id])
$game_party.gain_armor(@armor4_id, 1)
@armor4_id = id
$game_party.lose_armor(id, 1)
end
end
end
接着后面写或者这样做:
class Game_Actor < Game_Battler alias _change_variables_equip equip def equip(equip_type, id) # 装备 10 号武器时 if (equip_type == 0 && id == 10) $game_variables[1] += 100 end # 脱下 10 号装备时 if @weapon_id == 10 if (equip_type == 0 && id != 10) $game_variables[1] -= 100 end end # 执行原来更换装备的方法 _change_variables_equip(equip_type, id) end end
class Game_Actor < Game_Battler
alias _change_variables_equip equip
def equip(equip_type, id)
# 装备 10 号武器时
if (equip_type == 0 && id == 10)
$game_variables[1] += 100
end
# 脱下 10 号装备时
if @weapon_id == 10
if (equip_type == 0 && id != 10)
$game_variables[1] -= 100
end
end
# 执行原来更换装备的方法
_change_variables_equip(equip_type, id)
end
end
|