class Game_Party
Â
 Max_Party = 5
Â
 def max_party
  return Max_Party
 end
Â
 def add_actor(actor_id)
  actor = $game_actors[actor_id]
  if not @actors.include?(actor) and $game_party.actors.size < Max_Party
   @actors.push(actor)
   $game_player.refresh
  end
 end
end
Â
Â
class Window_BattleStatus < Window_Base
Â
 def initialize
  super(0, 320, 640, 160)
  self.contents = Bitmap.new(width - 32, height - 32)
  unless $game_party.actors.size > 4
   @level_up_flags = [false, false, false, false]
  else
   @level_up_flags = []
   for i in 0...$game_party.actors.size
    @level_up_flags.push(false)
   end
  end
  refresh
 end
Â
 def refresh
  self.contents.clear
  @item_max = $game_party.actors.size
  for i in 0...$game_party.actors.size
   actor = $game_party.actors[i]
   unless $game_party.actors.size > 4
    actor_x = i * 160 + 4
   else
    actor_x = i * (120)
   end
   draw_actor_name(actor, actor_x, 0)
   draw_actor_hp(actor, actor_x, 32, 120)
   draw_actor_sp(actor, actor_x, 64, 120)
   if @level_up_flags[i]
    self.contents.font.color = normal_color
    self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
   else
    draw_actor_state(actor, actor_x, 96)
   end
  end
 end
end
Â
Â
class Game_Actor < Game_Battler
 def screen_x
  if self.index != nil
   unless $game_party.actors.size > 4
    return self.index * 160 + 80
   else
    return self.index * (640/ $game_party.actors.size) + (80/($game_party.actors.size/2))
   end
  else
   return 0
  end
 end
end
Â
Â
class Scene_Battle
 def phase3_setup_command_window
  @party_command_window.active = false
  @party_command_window.visible = false
  @actor_command_window.active = true
  @actor_command_window.visible = true
  unless $game_party.actors.size > 4
   @actor_command_window.x = @actor_index * 160
  else
   @actor_command_window.x = @actor_index * (640/$game_party.actors.size)
   if @actor_command_window.x > 480
    @actor_command_window.x = 480
   end
  end
  @actor_command_window.index = 0
 end
end
Â
class Window_MenuStatus < Window_Selectable
Â
 def initialize
  unless $game_party.actors.size > 4
   super(0, 0, 480, 480)
  else
   super(0, 0, 480, 160 * $game_party.actors.size)
  end
  self.contents = Bitmap.new(width - 32, height - 32)
  refresh
  self.active = false
  self.index = -1
 end
Â
 alias large_refresh refresh
 def refresh
  large_refresh
  self.height = 480
 end
Â
 def update_cursor_rect
  if @index < 0
   self.cursor_rect.empty
   return
  end
  row = @index / @column_max
  if row < self.top_row
   self.top_row = row
  end
  if row > self.top_row + (self.page_row_max - 1)
   self.top_row = row - (self.page_row_max - 1)
  end
  cursor_width = self.width / @column_max - 32
  x = @index % @column_max * (cursor_width + 32)
  y = @index / @column_max * 116 - self.oy
  self.cursor_rect.set(x, y, cursor_width, 96)
 end
Â
 def top_row
  return self.oy / 116
 end
Â
 def top_row=(row)
  if row < 0
   row = 0
  end
  if row > row_max - 1
   row = row_max - 1
  end
  self.oy = row * 116
 end
Â
 def page_row_max
  return 4
 end
end
Â
#==============================================================================
# ** Spriteset_Battle
#------------------------------------------------------------------------------
# Â This class brings together battle screen sprites. It's used within
# Â the Scene_Battle class.
#==============================================================================
Â
class Spriteset_Battle
 #--------------------------------------------------------------------------
 # * Public Instance Variables
 #--------------------------------------------------------------------------
 attr_reader  :viewport1         # enemy viewport
 attr_reader  :viewport2         # actor viewport
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
  # Make viewports
  @viewport1 = Viewport.new(0, 0, 640, 320)
  @viewport2 = Viewport.new(0, 0, 640, 480)
  @viewport3 = Viewport.new(0, 0, 640, 480)
  @viewport4 = Viewport.new(0, 0, 640, 480)
  @viewport2.z = 101
  @viewport3.z = 200
  @viewport4.z = 5000
  # Make battleback sprite
  @battleback_sprite = Sprite.new(@viewport1)
  # Make enemy sprites
  @enemy_sprites = []
  for enemy in $game_troop.enemies.reverse
   @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
  end
  # Make actor sprites
 Â
 Â
  @actor_sprites = []
  #@actor_sprites.push(Sprite_Battler.new(@viewport2))
  #@actor_sprites.push(Sprite_Battler.new(@viewport2))
  #@actor_sprites.push(Sprite_Battler.new(@viewport2))
  #@actor_sprites.push(Sprite_Battler.new(@viewport2))
 Â
 Â
  for i in 0...$game_party.max_party
   @actor_sprites.push(Sprite_Battler.new(@viewport2))
  end
 Â
 Â
 Â
  # Make weather
  @weather = RPG::Weather.new(@viewport1)
  # Make picture sprites
  @picture_sprites = []
  for i in 51..100
   @picture_sprites.push(Sprite_Picture.new(@viewport3,
    $game_screen.pictures[i]))
  end
  # Make timer sprite
  @timer_sprite = Sprite_Timer.new
  # Frame update
  update
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
  # Update actor sprite contents (corresponds with actor switching)
  #@actor_sprites[0].battler = $game_party.actors[0]
  #@actor_sprites[1].battler = $game_party.actors[1]
  #@actor_sprites[2].battler = $game_party.actors[2]
  #@actor_sprites[3].battler = $game_party.actors[3]
 Â
  for i in 0...$game_party.max_party
   @actor_sprites[i].battler = $game_party.actors[i]
  end
 Â
  # If battleback file name is different from current one
  if @battleback_name != $game_temp.battleback_name
   @battleback_name = $game_temp.battleback_name
   if @battleback_sprite.bitmap != nil
    @battleback_sprite.bitmap.dispose
   end
   @battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
   @battleback_sprite.src_rect.set(0, 0, 640, 320)
  end
  # Update battler sprites
  for sprite in @enemy_sprites + @actor_sprites
   sprite.update
  end
  # Update weather graphic
  @weather.type = $game_screen.weather_type
  @weather.max = $game_screen.weather_max
  @weather.update
  # Update picture sprites
  for sprite in @picture_sprites
   sprite.update
  end
  # Update timer sprite
  @timer_sprite.update
  # Set screen color tone and shake position
  @viewport1.tone = $game_screen.tone
  @viewport1.ox = $game_screen.shake
  # Set screen flash color
  @viewport4.color = $game_screen.flash_color
  # Update viewports
  @viewport1.update
  @viewport2.update
  @viewport4.update
 end
end