Project1

标题: RPGXP 有没有办法让一号角色不进入战斗?? [打印本页]

作者: 1243852    时间: 2014-7-25 15:17
标题: RPGXP 有没有办法让一号角色不进入战斗??
就是说,进入战斗后,从第二个角色开始算。第一个角色永远不进入战斗。
作者: 芯☆淡茹水    时间: 2014-7-25 15:36
未测试
  1. class Game_Actor < Game_Battler
  2.    #--------------------------------------------------------------------------
  3.   def index
  4.     return $game_party.actors.index(self) - 1
  5.   end
  6. end
  7. #==============================================================================
  8. class Scene_Battle
  9.   #--------------------------------------------------------------------------
  10.   def make_action_orders
  11.     # 初始化序列 @action_battlers
  12.     @action_battlers = []
  13.     # 添加敌人到 @action_battlers 序列
  14.     for enemy in $game_troop.enemies
  15.       @action_battlers.push(enemy)
  16.     end
  17.     # 添加角色到 @action_battlers 序列
  18.     for actor in $game_party.actors
  19.       next if $game_party.actors.index(actor) == 0
  20.       @action_battlers.push(actor)
  21.     end
  22.     # 确定全体的行动速度
  23.     for battler in @action_battlers
  24.       battler.make_action_speed
  25.     end
  26.     # 按照行动速度从大到小排列
  27.     @action_battlers.sort! {|a,b|
  28.       b.current_action.speed - a.current_action.speed }
  29.   end
  30. end
  31. #=============================================================================
  32. class Spriteset_Battle
  33.   #--------------------------------------------------------------------------
  34.   def update
  35.     # 刷新角色的活动块 (对应角色的替换)
  36.     @actor_sprites[0].battler = $game_party.actors[1]
  37.     @actor_sprites[1].battler = $game_party.actors[2]
  38.     @actor_sprites[2].battler = $game_party.actors[3]
  39.     @actor_sprites[3].battler = $game_party.actors[4]
  40.     # 战斗背景的文件名与现在情况有差异的情况下
  41.     if @battleback_name != $game_temp.battleback_name
  42.       @battleback_name = $game_temp.battleback_name
  43.       if @battleback_sprite.bitmap != nil
  44.         @battleback_sprite.bitmap.dispose
  45.       end
  46.       @battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
  47.       @battleback_sprite.src_rect.set(0, 0, 640, 320)
  48.     end
  49.     # 刷新战斗者的活动块
  50.     for sprite in @enemy_sprites + @actor_sprites
  51.       sprite.update
  52.     end
  53.     # 刷新天气图形
  54.     @weather.type = $game_screen.weather_type
  55.     @weather.max = $game_screen.weather_max
  56.     @weather.update
  57.     # 刷新图片活动块
  58.     for sprite in @picture_sprites
  59.       sprite.update
  60.     end
  61.     # 刷新计时器活动块
  62.     @timer_sprite.update
  63.     # 设置画面的色调与震动位置
  64.     @viewport1.tone = $game_screen.tone
  65.     @viewport1.ox = $game_screen.shake
  66.     # 设置画面的闪烁色
  67.     @viewport4.color = $game_screen.flash_color
  68.     # 刷新显示端口
  69.     @viewport1.update
  70.     @viewport2.update
  71.     @viewport4.update
  72.   end
  73. end
复制代码





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