Project1

标题: 怎么判定一个角色是否使用了某技能 [打印本页]

作者: 玄月    时间: 2009-5-29 03:52
标题: 怎么判定一个角色是否使用了某技能
比如说阿尔东斯使用了螺旋斩之后 @H = 1 [LINE]1,#dddddd[/LINE]版务信息:本贴由楼主自主结贴~
作者: sizz123    时间: 2009-5-29 04:12
最常见的自然是变量带公共事件了.我再看看有没有其他方法
作者: 后知后觉    时间: 2009-5-29 04:15
if @active_battler.is_a?(Game_Actor)
if @active_battler.id ==他的ID
if @active_battler.current_action.kind == 1 and
  @active_battler.current_action.skill_id == 那个技能的ID
@H = 1
end
end
end
在Scene_Battle 4 找个地方插入
是在步骤1还是步骤2 忘记了 反正是在给 @active_battler赋值之后
作者: ★_茄孓    时间: 2009-5-29 04:16
如果只是特别判断的话,在Scene_Battle 4
  1.   #--------------------------------------------------------------------------
  2.   # ● 生成特技行动结果
  3.   #--------------------------------------------------------------------------
  4.   def make_skill_action_result
  5.     # 获取特技
  6.     @skill = $data_skills[@active_battler.current_action.skill_id]
  7.     # 如果不是强制行动
  8.     unless @active_battler.current_action.forcing
  9.       # 因为 SP 耗尽而无法使用的情况下
  10.       unless @active_battler.skill_can_use?(@skill.id)
  11.         # 清除强制行动对像的战斗者
  12.         $game_temp.forcing_battler = nil
  13.         # 移至步骤 1
  14.         @phase4_step = 1
  15.         return
  16.       end
  17.     end
  18.     # 消耗 SP
  19.     @active_battler.sp -= @skill.sp_cost
  20.     # 刷新状态窗口
  21.     @status_window.refresh
  22.     # 在帮助窗口显示特技名
  23.     @help_window.set_text(@skill.name, 1)
  24.     # 设置动画 ID
  25.     @animation1_id = @skill.animation1_id
  26.     @animation2_id = @skill.animation2_id
  27.     # 设置公共事件 ID
  28.     @common_event_id = @skill.common_event_id
  29.     # 设置对像侧战斗者
  30.     set_target_battlers(@skill.scope)
  31.     # 应用特技效果
  32.     for target in @target_battlers
  33.       target.skill_effect(@active_battler, @skill)
  34.     end
  35.   end
复制代码

在这判断就可以了吧!
修改如下:
  1. #--------------------------------------------------------------------------
  2.   # ● 生成特技行动结果
  3.   #--------------------------------------------------------------------------
  4.   def make_skill_action_result
  5.     # 获取特技
  6.     @skill = $data_skills[@active_battler.current_action.skill_id]
  7.     if @active_battler.is_a?(Game_Actor)
  8.     if @active_battler.id == 1 and # 自己要判断哪个角色的ID
  9.        @skill.id == 1 # 自己要判断的哪个技能ID
  10.        @h = 0
  11.     end
  12.     end
  13.     # 如果不是强制行动
  14.     unless @active_battler.current_action.forcing
  15.       # 因为 SP 耗尽而无法使用的情况下
  16.       unless @active_battler.skill_can_use?(@skill.id)
  17.         # 清除强制行动对像的战斗者
  18.         $game_temp.forcing_battler = nil
  19.         # 移至步骤 1
  20.         @phase4_step = 1
  21.         return
  22.       end
  23.     end
  24.     # 消耗 SP
  25.     @active_battler.sp -= @skill.sp_cost
  26.     # 刷新状态窗口
  27.     @status_window.refresh
  28.     # 在帮助窗口显示特技名
  29.     @help_window.set_text(@skill.name, 1)
  30.     # 设置动画 ID
  31.     @animation1_id = @skill.animation1_id
  32.     @animation2_id = @skill.animation2_id
  33.     # 设置公共事件 ID
  34.     @common_event_id = @skill.common_event_id
  35.     # 设置对像侧战斗者
  36.     set_target_battlers(@skill.scope)
  37.     # 应用特技效果
  38.     for target in @target_battlers
  39.       target.skill_effect(@active_battler, @skill)
  40.     end
  41.   end
复制代码
[LINE]1,#dddddd[/LINE]系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1