#==============================================================================
# ** Party Arrange
#------------------------------------------------------------------------------
# Author: Dargor
# Requested by: Chessplayer
# Version 1.2
# 20/09/2007
#==============================================================================
# * Note
#------------------------------------------------------------------------------
# - This script requires the Commands Manager script.
#==============================================================================
#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
# This class handles data surrounding the system. Backround music, etc.
# is managed here as well. Refer to "$game_system" for the instance of
# this class.
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :arrange_disabled # party menu forbidden
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias dargor_arrange_commands_initialize initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
dargor_arrange_commands_initialize
@arrange_disabled = false
end
end
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
# This window displays party member status on the menu screen.
#==============================================================================
class Window_MenuStatus
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh(where=nil)
# Clear the window
self.contents.clear
# If an actor's position is changing, draw a dark grey rectangle
if where != nil
# Set the y position
y = where*116
# Set the rectangle color
color = Color.new(65,65,65,200)
# Draw the rectangle
self.contents.fill_rect(0,y,480,96,color)
end
# Set the maximum number of actors in the party
@item_max = $game_party.actors.size
# Draw actors informations (above the rectangle)
for i in 0...$game_party.actors.size
x = 64
y = i * 116
actor = $game_party.actors[i]
draw_actor_graphic(actor, x - 40, y + 80)
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 144, y)
draw_actor_state(actor, x + 90, y + 32)
draw_actor_hp(actor, x + 236, y + 32)
draw_actor_sp(actor, x + 236, y + 64)
end
end
end
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs menu screen processing.
#==============================================================================
class Scene_Menu
#--------------------------------------------------------------------------
# * Alias listing
#--------------------------------------------------------------------------
alias party_arrange_set_commands_access set_commands_access
alias party_arrange_update update
alias party_arrange_update_command update_command
alias party_arrange_update_status update_status
#--------------------------------------------------------------------------
# * Set Commands Access
#--------------------------------------------------------------------------
def set_commands_access
# Call the original method
party_arrange_set_commands_access
# Disable party command if $game_system.arrange_disabled is true
if $game_system.arrange_disabled or $game_party.actors.size == 0
@command_window.disable_item("Arrange")
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Add the "Party" commande once
@command_window.add_command("Arrange")
# Call the original update method
party_arrange_update
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
def update_command
# Call the original update command method
party_arrange_update_command
# Assign @command_window.index to it strings
command = @commands[@command_window.index]
# If C button is pressed
if Input.trigger?(Input::C)
case command
# When "Party" is selected
when "Arrange"
# If party command is disabled
if $game_system.arrange_disabled
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
@checker = 0
@command_window.active = false
@status_window.active = true
@status_window.index = 0
end
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when status window is active)
#--------------------------------------------------------------------------
def update_status
# Call the original update status method
party_arrange_update_status
# Assign @command_window.index to it strings
command = @commands[@command_window.index]
# If B button is pressed
if Input.trigger?(Input::B)
@status_window.refresh
end
# If C button is pressed
if Input.trigger?(Input::C)
case command
# When "Party" is selected
when "Arrange"
# Play decision SE
$game_system.se_play($data_system.decision_se)
if @checker == 0
# If selected actor is not dead, prepare the changes,
# display a selection box
unless $game_party.actors[@status_window.index].dead?
@changer = $game_party.actors[@status_window.index]
@where = @status_window.index
@status_window.refresh(@where)
$game_player.refresh
@checker = 1
else
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
else
# If selected actor is not dead, change its position
unless $game_party.actors[@status_window.index].dead?
$game_party.actors[@where] = $game_party.actors[@status_window.index]
$game_party.actors[@status_window.index] = @changer
@checker = 0
@status_window.refresh
$game_player.refresh
else
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
end
end
return
end
end
end