使用道具 举报
class Scene_Battle WEAPON_DRAIN_SP = 0.2 #-------------------------------------------------------------------------- # ● 设置角色指令窗口 #-------------------------------------------------------------------------- def phase3_setup_command_window if @active_battler.weapon_id == 1 && @active_battler.sp < (@active_battler.maxsp * WEAPON_DRAIN_SP).round @actor_command_window.disable_item(0) else @actor_command_window.draw_item(0, @actor_command_window.normal_color) end # 同伴指令窗口无效化 @party_command_window.active = false @party_command_window.visible = false # 角色指令窗口无效化 @actor_command_window.active = true @actor_command_window.visible = true # 设置角色指令窗口的位置 @actor_command_window.x = @actor_index * 160 # 设置索引为 0 @actor_command_window.index = 0 end #-------------------------------------------------------------------------- # ● 刷新画面 (角色命令回合 : 基本命令) #-------------------------------------------------------------------------- def update_phase3_basic_command # 按下 B 键的情况下 if Input.trigger?(Input::B) # 演奏取消 SE $game_system.se_play($data_system.cancel_se) # 转向前一个角色的指令输入 phase3_prior_actor return end # 按下 C 键的情况下 if Input.trigger?(Input::C) # 角色指令窗口光标位置分之 case @actor_command_window.index when 0 # 攻击 if @active_battler.weapon_id != 1 || @active_battler.sp >= (@active_battler.maxsp * WEAPON_DRAIN_SP).round # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 设置行动 @active_battler.current_action.kind = 0 @active_battler.current_action.basic = 0 # 开始选择敌人 start_enemy_select else # 演奏无效 SE $game_system.se_play($data_system.buzzer_se) end when 1 # 特技 # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 设置行动 @active_battler.current_action.kind = 1 # 开始选择特技 start_skill_select when 2 # 防御 # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 设置行动 @active_battler.current_action.kind = 0 @active_battler.current_action.basic = 1 # 转向下一位角色的指令输入 phase3_next_actor when 3 # 物品 # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 设置行动 @active_battler.current_action.kind = 2 # 开始选择物品 start_item_select end return end end #-------------------------------------------------------------------------- # ● 生成基本行动结果 #-------------------------------------------------------------------------- def make_basic_action_result # 攻击的情况下 if @active_battler.current_action.basic == 0 # 设置攻击 ID @animation1_id = @active_battler.animation1_id @animation2_id = @active_battler.animation2_id # 行动方的战斗者是敌人的情况下 if @active_battler.is_a?(Game_Enemy) if @active_battler.restriction == 3 target = $game_troop.random_target_enemy elsif @active_battler.restriction == 2 target = $game_party.random_target_actor else index = @active_battler.current_action.target_index target = $game_party.smooth_target_actor(index) end end # 行动方的战斗者是角色的情况下 if @active_battler.is_a?(Game_Actor) if @active_battler.restriction == 3 target = $game_party.random_target_actor elsif @active_battler.restriction == 2 target = $game_troop.random_target_enemy else index = @active_battler.current_action.target_index target = $game_troop.smooth_target_enemy(index) end if @active_battler.weapon_id == 1 @active_battler.sp -= (@active_battler.maxsp * WEAPON_DRAIN_SP).round end end # 设置对像方的战斗者序列 @target_battlers = [target] # 应用通常攻击效果 for target in @target_battlers target.attack_effect(@active_battler) end return end # 防御的情况下 if @active_battler.current_action.basic == 1 # 帮助窗口显示"防御" @help_window.set_text($data_system.words.guard, 1) return end # 逃跑的情况下 if @active_battler.is_a?(Game_Enemy) and @active_battler.current_action.basic == 2 # 帮助窗口显示"逃跑" @help_window.set_text("逃跑", 1) # 逃跑 @active_battler.escape return end # 什么也不做的情况下 if @active_battler.current_action.basic == 3 # 清除强制行动对像的战斗者 $game_temp.forcing_battler = nil # 移至步骤 1 @phase4_step = 1 return end end end
以下引用失去的记忆于2009-5-19 7:46:16的发言: LS的 按照你这样改的话! 敌人攻击可能会出错。。 因为敌人没有武器。。。。 而@active_battler是敌人和角色通用的! P:新手间接,错了不要骂我哦
以下引用鲔鱼吐司于2009-5-19 10:58:43的发言: 唯一美中不足的地方就是 如果1號角色裝備該武器且沒有SP了(攻擊指令刷灰) 我的2號角色攻擊指令也會刷灰 但是2號角色還是可以攻擊 ^ ^||
class Window_Command < Window_Selectable attr_accessor :item # 剩下的內容..... end
if @active_battler.weapon_id == 1 && @active_battler.sp < (@active_battler.maxsp * WEAPON_DRAIN_SP).round @actor_command_window.disable_item(0) @actor_command_window.refresh else @actor_command_window.item[0] = nil end
本版积分规则 发表回复 回帖并转播 回帖后跳转到最后一页
Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.