Project1

标题: 如何在战斗中显示攻击的帮助 [打印本页]

作者: 美丽晨露    时间: 2012-12-23 13:31
标题: 如何在战斗中显示攻击的帮助
本帖最后由 美丽晨露 于 2012-12-23 21:05 编辑

就是角色敌人发动攻击时
会在上方弹出帮助框
“使用者发动攻击”的帮助
像使用特技一样的那个帮助
作者: Wind2010    时间: 2012-12-23 17:43
  1. class Scene_Battle
  2.   def make_basic_action_result
  3.     if @active_battler.current_action.basic == 0
  4.       @animation1_id = @active_battler.animation1_id
  5.       @animation2_id = @active_battler.animation2_id
  6.       if @active_battler.is_a?(Game_Enemy)
  7.         if @active_battler.restriction == 3
  8.           target = $game_troop.random_target_enemy
  9.         elsif @active_battler.restriction == 2
  10.           target = $game_party.random_target_actor
  11.         else
  12.           index = @active_battler.current_action.target_index
  13.           target = $game_party.smooth_target_actor(index)
  14.         end
  15.       end
  16.       if @active_battler.is_a?(Game_Actor)
  17.         if @active_battler.restriction == 3
  18.           target = $game_party.random_target_actor
  19.         elsif @active_battler.restriction == 2
  20.           target = $game_troop.random_target_enemy
  21.         else
  22.           index = @active_battler.current_action.target_index
  23.           target = $game_troop.smooth_target_enemy(index)
  24.         end
  25.       end
  26.       @help_window.set_text(@active_battler.name + "发动攻击", 1)  #只加了这句
  27.       @target_battlers = [target]
  28.       for target in @target_battlers
  29.         target.attack_effect(@active_battler)
  30.       end
  31.       return
  32.     end
  33.     if @active_battler.current_action.basic == 1
  34.       @help_window.set_text($data_system.words.guard, 1)
  35.       return
  36.     end
  37.     if @active_battler.is_a?(Game_Enemy) and
  38.        @active_battler.current_action.basic == 2
  39.       @help_window.set_text("逃跑", 1)
  40.       @active_battler.escape
  41.       return
  42.     end
  43.     if @active_battler.current_action.basic == 3
  44.       $game_temp.forcing_battler = nil
  45.       @phase4_step = 1
  46.       return
  47.     end
  48.   end
  49. end
复制代码

作者: 美丽晨露    时间: 2012-12-23 21:04
Wind2010 发表于 2012-12-23 17:43

非常感谢啊
我已经琢磨了很久了




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