Project1
标题:
如何在指定战斗中禁用道具?
[打印本页]
作者:
布里蓝
时间:
2012-8-23 21:16
标题:
如何在指定战斗中禁用道具?
想做个斗技场,因为斗技场使用道具就没意思了,所以有没有办法禁止使用?
作者:
吾不知
时间:
2012-8-23 22:02
本帖最后由 吾不知 于 2012-8-23 22:05 编辑
Window_ActorCommand中
#--------------------------------------------------------------------------
# ● 生成指令列表
#--------------------------------------------------------------------------
def make_command_list
return unless @actor
if $game_switches[5] ==true #五号开关
add_attack_command
add_skill_commands
add_guard_command
#~ add_item_command
else
add_attack_command
add_skill_commands
add_guard_command
add_item_command
end
end
复制代码
Scene_Battle中
#--------------------------------------------------------------------------
# ● 生成角色指令窗口
#--------------------------------------------------------------------------
def create_actor_command_window
@actor_command_window = Window_ActorCommand.new
@actor_command_window.viewport = @info_viewport
if $game_switches[5] ==true #五号开关
@actor_command_window.set_handler(:attack, method(:command_attack))
@actor_command_window.set_handler(:skill, method(:command_skill))
@actor_command_window.set_handler(:guard, method(:command_guard))
#~ @actor_command_window.set_handler(:item, method(:command_item))
@actor_command_window.set_handler(:cancel, method(:prior_command))
else
@actor_command_window.set_handler(:attack, method(:command_attack))
@actor_command_window.set_handler(:skill, method(:command_skill))
@actor_command_window.set_handler(:guard, method(:command_guard))
@actor_command_window.set_handler(:item, method(:command_item))
@actor_command_window.set_handler(:cancel, method(:prior_command))
end
#~ @actor_command_window.set_handler(:attack, method(:command_attack))
#~ @actor_command_window.set_handler(:skill, method(:command_skill))
#~ @actor_command_window.set_handler(:guard, method(:command_guard))
#~ @actor_command_window.set_handler(:item, method(:command_item))
#~ @actor_command_window.set_handler(:cancel, method(:prior_command))
@actor_command_window.x = Graphics.width
end
复制代码
即可实现打开5号开关在角色指令中禁止物品!
作者:
chxush
时间:
2012-8-23 22:08
class Window_ActorCommand < Window_Command
DEFENCE_SWITCH_ID = 1
def add_item_command
enabled = DEFENCE_SWITCH_ID == 0 || $game_switches[DEFENCE_SWITCH_ID]
add_command(Vocab::item, :item, enabled)
end
end
复制代码
DEFENCE_SWITCH_ID 就是开关ID 例子里面是一号开关
开了就可以使用物品
关了就不能
作者:
chxush
时间:
2012-8-23 22:10
还有大哥 以后发帖点"发表求助" 系统会自动送悬赏100EXP的- -
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1