赞 | 5 |
VIP | 71 |
好人卡 | 22 |
积分 | 6 |
经验 | 32145 |
最后登录 | 2013-8-9 |
在线时间 | 184 小时 |
Lv2.观梦者 天仙
- 梦石
- 0
- 星屑
- 620
- 在线时间
- 184 小时
- 注册时间
- 2008-4-15
- 帖子
- 5023
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
在战斗中按 Z 键,重复上次动作,包括上次选择目标
- #重複的按鍵
- $repeat_button = Input::Z
- class Scene_Battle < Scene_Base
- alias repeat_start start
- alias repeat_update update
- alias repeat_update_actor_command_selection update_actor_command_selection
- alias repeat_update_target_enemy_selection update_target_enemy_selection
- alias repeat_update_target_actor_selection update_target_actor_selection
- alias repeat_determine_skill determine_skill
- alias repeat_determine_item determine_item
- def start
- @actor_last_action = {}
- repeat_start
- end
- def update
- unless $game_message.visible
- if Input.trigger?($repeat_button)
- return unless @actor_command_window.active
- end
- end
- repeat_update
- end
- def update_actor_command_selection
- if Input.trigger?(Input::C)
- case @actor_command_window.index
- when 0 # 攻擊
- @actor_last_action[@active_battler] = [0]
- when 2 # 防禦
- @actor_last_action[@active_battler] = [2]
- end
- elsif Input.trigger?($repeat_button)
- determine_last_action
- end
- repeat_update_actor_command_selection
- end
- def update_target_enemy_selection
- if Input.trigger?(Input::C)
- if @active_battler.action.attack?
- @actor_last_action[@active_battler] = [0, @target_enemy_window.enemy.index]
- elsif @active_battler.action.skill?
- @actor_last_action[@active_battler] = [1, @skill, @target_enemy_window.enemy.index]
- elsif @active_battler.action.item?
- @actor_last_action[@active_battler] = [3, @item, @target_enemy_window.enemy.index]
- end
- end
- repeat_update_target_enemy_selection
- end
- def update_target_actor_selection
- if Input.trigger?(Input::C)
- if @active_battler.action.attack?
- @actor_last_action[@active_battler] = [0, @target_actor_window.index]
- elsif @active_battler.action.skill?
- @actor_last_action[@active_battler] = [1, @skill, @target_actor_window.index]
- elsif @active_battler.action.item?
- @actor_last_action[@active_battler] = [3, @item, @target_actor_window.index]
- end
- end
- repeat_update_target_actor_selection
- end
- def determine_item
- @actor_last_action[@active_battler] = [1, @item]
- repeat_determine_item
- end
- def determine_skill
- @actor_last_action[@active_battler] = [1, @skill]
- repeat_determine_skill
- end
- def determine_last_action
- return if @actor_last_action[@active_battler].nil?
- case @actor_last_action[@active_battler][0]
- when 0
- @active_battler.action.set_attack
- @active_battler.action.target_index = @actor_last_action[@active_battler][1]
- when 1
- @skill = @actor_last_action[@active_battler][1]
- @active_battler.action.set_skill(@skill.id)
- if @skill.need_selection?
- @active_battler.action.target_index = @actor_last_action[@active_battler][2]
- else
- determine_skill
- end
- when 2
- @actor_last_action[@active_battler] = [2]
- @active_battler.action.set_guard
- when 3
- @item = @actor_last_action[@active_battler][1]
- @active_battler.action.set_item(@item.id)
- if @item.need_selection?
- @active_battler.action.target_index = @actor_last_action[@active_battler][2]
- else
- determine_item
- end
- else; return
- end
- @actor_command_window.active = true
- next_actor
- end
- end
复制代码
与SideView2.7相容补丁:
- =begin
- 将以下这段插在主角本的最後一个end前面
- 然後全局搜索 def select_member 在里面找到
-
- elsif Input.trigger?(Input::C)
- Sound.play_decision
- @active_battler.action.target_index = @index
-
- 插入
- set_selected_target(@index)
- =end
- def set_selected_target(i)
- if @active_battler.action.attack?
- @actor_last_action[@active_battler] = [0, i]
- elsif @active_battler.action.skill?
- @actor_last_action[@active_battler] = [1, @skill, i]
- elsif @active_battler.action.item?
- @actor_last_action[@active_battler] = [3, @item, i]
- end
- end
复制代码
要用 "R" 键的话
需要全按键脚本 |
|