查看: 1519|回复: 0

[已经过期] 求好心人教一下怎麼回傳這個腳本

[复制链接]
梦石
0
星屑
2116
在线时间
950 小时
注册时间
2015-7-16
回帖
692

开拓者

发表于 2016-1-1 21:43:20 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
如題
由於在這裡發問的關於XAS改回火車行走列隊以及控制主角走速的問題並沒有得到解決
於是我想出了回傳數值這招,想請教該如何回傳base_move_speed以及dash_move_speed的值
用這個土方法來改主角跑速
  1. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  2. #■ BATTLER - MOVE SPEED
  3. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■


  4. #==============================================================================
  5. # ■ Game_Character
  6. #==============================================================================
  7. class Game_Character < Game_CharacterBase
  8.   
  9.   include XAS_BA
  10.   attr_accessor :base_move_speed
  11.   attr_accessor :dash_move_speed
  12.   attr_accessor :move_speed
  13.   
  14. #--------------------------------------------------------------------------
  15. # ● Initialize
  16. #--------------------------------------------------------------------------  
  17.   alias x_move_speed_initialize initialize
  18.   def initialize
  19.       @base_move_speed = BASE_MOVE_SPEED
  20.       @dash_move_speed = 0
  21.       x_move_speed_initialize
  22.   end  

  23. #--------------------------------------------------------------------------
  24. # ● update_battler_move_speed
  25. #--------------------------------------------------------------------------
  26.   def update_battler_move_speed
  27.       @dash_move_speed = @dash_active ? DASH_MOVE_SPEED : 0
  28.       sp1 = @base_move_speed
  29.       sp2 = @dash_move_speed
  30.       sp3 = self.battler.state_move_speed
  31.       @move_speed = (sp1 + sp2 + sp3)
  32.   end
  33.   
  34. #--------------------------------------------------------------------------
  35. # ● Update Animation
  36. #--------------------------------------------------------------------------      
  37.   def update_animation
  38.       super
  39.       update_force_move_routine_move
  40.   end
  41.    
  42. #--------------------------------------------------------------------------
  43. # ● Update Force Move Routine Move
  44. #--------------------------------------------------------------------------        
  45.   def update_force_move_routine_move
  46.       return if @force_action == ""
  47.       return if @move_route == nil
  48.       command = @move_route.list[@move_route_index]
  49.       return if command == nil
  50.       if command.code == ROUTE_PLAY_SE   
  51.          params = command.parameters
  52.          params[0].play
  53.          advance_move_route_index
  54.       end   
  55.   end

  56. #--------------------------------------------------------------------------
  57. # ● Update Routine Move
  58. #--------------------------------------------------------------------------      
  59. alias x_update_routine_move update_routine_move
  60. def update_routine_move
  61.      return if @force_action_times > 0
  62.      x_update_routine_move
  63. end

  64. #--------------------------------------------------------------------------
  65. # ● Can Cancel Move Type Custom
  66. #--------------------------------------------------------------------------   
  67.   alias x_move_speed_process_move_command process_move_command
  68.   def process_move_command(command)
  69.       return if can_cancel_move_type_custom?(command)
  70.       params = command.parameters
  71.       x_move_speed_process_move_command(command)
  72.       if command.code == ROUTE_CHANGE_SPEED and @battler != nil and
  73.          self.is_a?(Game_Event)
  74.          @base_move_speed = params[0]
  75.       end        
  76.   end
  77.   
  78. #--------------------------------------------------------------------------
  79. # ● Can Cancel Move Type Custom
  80. #--------------------------------------------------------------------------   
  81.   def can_cancel_move_type_custom?(command)
  82.       return true if command == nil
  83.       return true if @force_action_times > 0
  84.       return false
  85.   end  
  86.   
  87. end  
复制代码
[神性领域扩张:扩张神性领域]
说了等于没说.
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部