#==============================================================================
# ** Math
#------------------------------------------------------------------------------
# This module holds Math related nonsense which I am extending.
#==============================================================================
module Math
class << self
#------------------------------------------------------------------------
# * Distance Between Two 2D points
# pt1 : first 2D point
# pt2 : second 2D point
#------------------------------------------------------------------------
def distance(pt1, pt2)
return hypot(pt1[0] - pt2[0], pt1[1] - pt2[1])
end
#------------------------------------------------------------------------
# * Alias Methods
#------------------------------------------------------------------------
alias dist distance
end
end
#==============================================================================
# ** Math_Vector3
#------------------------------------------------------------------------------
# This class only holds the information of a 3D Vector along with a few
# helpful methods for using the class. (!No Cross Product!)
#==============================================================================
class Math_Vector3
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :x, :y, :z
#--------------------------------------------------------------------------
# * Object Initialization
# x : the x component of the vector.
# y : the y component of the vector.
# z : the z component of the vector.
#--------------------------------------------------------------------------
def initialize(x = 0.0, y = 0.0, z = 0.0)
@x, @y, @z = x.to_f, y.to_f, z.to_f
end
#--------------------------------------------------------------------------
# * Magnitude
#--------------------------------------------------------------------------
def magnitude
return Math.sqrt((@x * @x) + (@y * @y) + (@z * @z))
end
#--------------------------------------------------------------------------
# * Multiply (Dot Product/Scalar)
# multiply : the polymorphized object being multiplied with self.
#--------------------------------------------------------------------------
def *(multiply)
return scale(multiply) if multiply.is_a?(Numeric)
return dot(multiply) if multiply.is_a?(Math_Vector3)
end
#--------------------------------------------------------------------------
# * Addition
# add : the vector being added to self.
#--------------------------------------------------------------------------
def +(add)
return Math_Vector3.new(@x + add.x, @y + add.y, @z + add.z)
end
#--------------------------------------------------------------------------
# * Subtraction
# add : the vector being taken away from self.
#--------------------------------------------------------------------------
def -(sub)
return Math_Vector3.new(@x - sub.x, @y - sub.y, @z - sub.z)
end
#--------------------------------------------------------------------------
# * Scale
# scalar : the multiplier applied to the vector.
#--------------------------------------------------------------------------
def scale(scalar)
return Math_Vector3.new(@x * scalar, @y * scalar, @z * scalar)
end
#--------------------------------------------------------------------------
# * Dot Product
# vec : the vector you are dotting with.
#--------------------------------------------------------------------------
def dot(vec)
return ((@x * vec.x) + (@y * vec.y) + (@z * vec.z))
end
#--------------------------------------------------------------------------
# * Returns Normalized Math_Vector3
#--------------------------------------------------------------------------
def normalize
mag = magnitude
return Math_Vector3.new(@x / mag, @y / mag, @z / mag)
end
#--------------------------------------------------------------------------
# * Normalizes Calling Math_Vector3
#--------------------------------------------------------------------------
def normalize!
mag = magnitude
@x /= mag
@y /= mag
@z /= mag
end
#--------------------------------------------------------------------------
# * Returns Array of Math_Vector3
#--------------------------------------------------------------------------
def to_a
return [@x, @y, @z]
end
#--------------------------------------------------------------------------
# * Get Component
# index : the index of the component you want.
#--------------------------------------------------------------------------
def [](index)
case index
when 0
return @x
when 1
return @y
when 2
return @z
end
end
#--------------------------------------------------------------------------
# * Set Component
# index : the index of the component you want to change.
# value : the new value of the component.
#--------------------------------------------------------------------------
def []=(index, value)
case index
when 0
@x = value.to_f
when 1
@y = value.to_f
when 2
@z = value.to_f
end
end
#--------------------------------------------------------------------------
# * Compare
# vec : the vec you are comparing against.
#--------------------------------------------------------------------------
def ==(vec)
return false unless vec.is_a?(Math_Vector3)
return true if (vec.x == self.x && vec.y == self.y && vec.z == self.z)
return false
end
#--------------------------------------------------------------------------
# * Alias Methods
#--------------------------------------------------------------------------
alias_method :length, :magnitude
end
#==============================================================================
# ** Sprite_Float
#------------------------------------------------------------------------------
# A sprite class with Float based location and movement.
#==============================================================================
class Sprite_Float < Sprite
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :slide
attr_reader :active,
:sliding
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(viewport = nil)
super(viewport)
@fx = @fy = @fz = 0.0
@fopacity = 255.0
@slide = false
@sliding = false
@active = true
end
#--------------------------------------------------------------------------
# * Slide
# x : the x coordinate to go to.
# y : the y coordinate to go to.
# frames : the number of frames to get to the destination.
# opacity : the ending opacity when it reaches its destination.
#--------------------------------------------------------------------------
def slide(x, y, z, frames, opacity = 255)
@slide = true
@vec = Math_Vector3.new(@to_x = x.to_f, @to_y = y.to_f, @to_z = z.to_f) -
Math_Vector3.new(@or_x = self.x, @or_y = self.y, @or_z = self.z)
@vec = @vec.scale(1 / frames.to_f)
@delta_opacity = (opacity - self.opacity) / frames.to_f
@sliding = true
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super()
# If the user has called slide once. We will do more work.
if @slide
# If the sprite is active meaning if it isn't at the destination
# keep moving it.
if @active && @sliding
unless Math.dist([self.x, self.y], [@to_x, @to_y]) > 1.0
@sliding = false
return
end
@sliding = true
self.x += @vec.x
self.y += @vec.y
self.z += @vec.z
self.opacity += @delta_opacity
elsif !@active && @sliding
unless Math.dist([self.x, self.y], [@or_x, @or_y]) > 1.0
@sliding = false
return
end
@sliding = true
self.x -= @vec.x
self.y -= @vec.y
self.z -= @vec.z
self.opacity -= @delta_opacity
end
end
end
#--------------------------------------------------------------------------
# * Set X
# x : the new x coordinate
#--------------------------------------------------------------------------
def x=(x)
super(@fx = x.to_f)
end
#--------------------------------------------------------------------------
# * Set Y
# y : the new y coordinate
#--------------------------------------------------------------------------
def y=(y)
super(@fy = y.to_f)
end
#--------------------------------------------------------------------------
# * Set Z
# z : the new z coordinate
#--------------------------------------------------------------------------
def z=(z)
super(@fz = z.to_f)
end
#--------------------------------------------------------------------------
# * Get X
#--------------------------------------------------------------------------
def x
return @fx
end
#--------------------------------------------------------------------------
# * Get Y
#--------------------------------------------------------------------------
def y
return @fy
end
#--------------------------------------------------------------------------
# * Get Z
#--------------------------------------------------------------------------
def z
return @fz
end
#--------------------------------------------------------------------------
# * Set Active
# active : the active flag.
#--------------------------------------------------------------------------
def active=(active)
@active = active
@sliding = true
end
#--------------------------------------------------------------------------
# * Set (X/Y) Zoom
#--------------------------------------------------------------------------
def zoom=(zoom)
self.zoom_x = self.zoom_y = zoom
end
end
#==============================================================================
# ** Musashi_Command
#------------------------------------------------------------------------------
# Simple command menu with rectangular options displayed in reverse step
# manner.
#==============================================================================
class Musashi_Command
#--------------------------------------------------------------------------
# * Constant Variables
#--------------------------------------------------------------------------
Frames_Anim = 400
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :opening, :closing, :index, :x, :y, :z, :width, :height, :active
#--------------------------------------------------------------------------
# * Object Initialization
# commands : the commands you want to see.
# index : the index of the option you want to look at.
# spacing : the spacing between each command.
#--------------------------------------------------------------------------
def initialize(commands, index = 0, spacing = 5)
@commands = commands
@spacing = spacing
@bar_width = 144
@bar_height = Window_Base::WLH
@go_to = Window_MonoStatus::Window_Width - 2
@offset = 10
@sprites = []
@commands.each_index do |i|
@sprites << Sprite_Float.new
@sprites[i].bitmap = Bitmap.new(@bar_width - (i * 8), @bar_height)
rect = @sprites[i].bitmap.rect
@sprites[i].bitmap.fill_rect(rect, Color.new(0, 0, 0))
rect.x = rect.y = 1
rect.width -= 2
rect.height -= 2
@sprites[i].bitmap.gradient_fill_rect(rect, Color.new(120, 120, 120),
Color.new(180, 180, 180))
@sprites[i].bitmap.draw_text(5, 1, rect.width - 5, @bar_height - 2,
@commands[i])
@sprites[i].x = 0
@sprites[i].y = (@bar_height * i) + (@spacing * i) + @offset
@sprites[i].z = 255
@sprites[i].opacity = 0
@sprites[i].slide(@sprites[i].x + @go_to, @sprites[i].y, @sprites[i].z, 10)
@sprites[i].active = false
i += 1
end
@active = false
@height, @width = @sprites.last.y - @sprites[0].y, 144
@opening = @closing = false
@cursor_anim_frames = Frames_Anim
@anim_index = 0
self.index = index
self.openness = 255
end
#--------------------------------------------------------------------------
# * Set Cursor Image
# image_dir : the image of the cursor's directory.
# image_dir : the filename of the cursor's image.
#--------------------------------------------------------------------------
def cursor(image_dir, image_names)
@cursor_image_dir = image_dir
@cursor_image_names = image_names
@cursor = Sprite.new
@cursor.bitmap = Cache.load_bitmap(image_dir, image_names.first)
@cursor.oy = (@cursor.bitmap.height >> 1)
@cursor.visible = false
end
#--------------------------------------------------------------------------
# * Update Cursor
#--------------------------------------------------------------------------
def update_cursor
return if @cursor.nil?
@cursor_anim_frames -= 1
if @cursor_anim_frames == 0
@cursor_anim_frames = Frames_Anim
@anim_index += 1
@anim_index = 0 if @anim_index == @cursor_image_names.size
@cursor.bitmap = Cache.load_bitmap(@cursor_image_dir,
@cursor_image_names[@anim_index])
end
@cursor.opacity = @sprites[@index].opacity
@cursor.x = @sprites[@index].bitmap.width + @sprites[@index].x
@cursor.y = (@bar_height * @index) + (@spacing * @index) + @offset +
(@bar_height >> 1)
@cursor.z = @sprites[@index].z
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
if @opening
self.openness = 255
@opening = false
elsif @closing
self.openness = 0
@closing = false
end
@sprites.each { |sprite| update_cursor; sprite.update }
if @active
if Input.trigger?(Input::UP)
Sound.play_cursor
self.index -= 1
elsif Input.trigger?(Input::DOWN)
Sound.play_cursor
self.index += 1
end
end
end
#--------------------------------------------------------------------------
# * Set Active
# active : the active flag.
#--------------------------------------------------------------------------
def active=(active)
@active = active
@sprites.each { |sprite| sprite.active = active }
@cursor.visible = active
end
#--------------------------------------------------------------------------
# * Set Index
# index : the index.
#--------------------------------------------------------------------------
def index=(index)
if @index != index
@index = index
@index = 0 if @index == @commands.size
@index = @commands.size - 1 if @index < 0
update_cursor
end
end
#--------------------------------------------------------------------------
# * Set X
# x : the x coordinate of the musashi command object.
#--------------------------------------------------------------------------
def x=(x)
@x = x
@sprites.each do |sprite|
sprite.x = x
sprite.slide(sprite.x + @go_to, sprite.y, sprite.z, 10)
end
end
#--------------------------------------------------------------------------
# * Set Y
# x : the y coordinate of the musashi command object.
#--------------------------------------------------------------------------
def y=(y)
@y = y
@sprites.each_index do |i|
@sprites[i].y = (@bar_height * i) + (@spacing * i)
@sprites[i].slide(@sprites[i].x + @go_to, @sprites[i].y, @sprites[i].z,
10)
end
end
#--------------------------------------------------------------------------
# * Set Z
# x : the z coordinate of the musashi command object.
#--------------------------------------------------------------------------
def z=(z)
@z = z
@sprites.each do |sprite|
sprite.z = z
sprite.slide(sprite.x + @go_to, sprite.y, sprite.z, 10)
end
end
#--------------------------------------------------------------------------
# * Set Openness
# openness : the new openness of the window.
#--------------------------------------------------------------------------
def openness=(openness)
@openness = [[openness, 255].min, 0].max
end
#--------------------------------------------------------------------------
# * Get Moving
#--------------------------------------------------------------------------
def moving?
return @sprites[0].sliding
end
#--------------------------------------------------------------------------
# * Open Musashi Command
#--------------------------------------------------------------------------
def open
@opening = true if self.openness < 255
@closing = false
end
#--------------------------------------------------------------------------
# * Close Musashi Command
#--------------------------------------------------------------------------
def close
@closing = true if self.openness > 0
@opening = false
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
def dispose
@sprites.each do |sprite|
sprite.bitmap.dispose
sprite.dispose
end
unless @cursor.nil?
@cursor.bitmap.dispose
@cursor.dispose
end
end
end
#==============================================================================
# ** Window_MonoStatus
#------------------------------------------------------------------------------
# This window displays the party leaders information only.
#==============================================================================
class Window_MonoStatus < Window_Base
#--------------------------------------------------------------------------
# * Constant Variables
#--------------------------------------------------------------------------
Window_Width = 180
Window_Height = 250
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, Window_Width, Window_Height)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_face($game_party.members[0], ((width - 32) >> 1) - (96 >> 1),
0)
draw_actor_name($game_party.members[0], 2, 98)
draw_actor_class($game_party.members[0], 2, 98 + WLH)
draw_actor_level($game_party.members[0], 90, 98 + WLH * 1)
draw_actor_hp($game_party.members[0], 2, 98 + WLH * 2, width - 36)
draw_actor_mp($game_party.members[0], 2, 98 + WLH * 3, width - 36)
draw_currency_value($game_party.gold, 2, 98 + WLH * 4, width - 36)
end
end
#==============================================================================
# ** Window_PartyStatus
#------------------------------------------------------------------------------
# This window displays the party members' status.
#==============================================================================
class Window_PartyStatus < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
# actor : the actor who's information you are trying to draw.
# x : the x coordinate of the window you
#--------------------------------------------------------------------------
def initialize
super(0, 0, 96 * 3 + 32, 200)
self.opacity = 0
refresh
end
#--------------------------------------------------------------------------
# * Draw Level
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_level(actor, x, y, width)
self.contents.font.color = system_color
self.contents.draw_text(x, y, width, WLH, Vocab::level_a)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, width, WLH, actor.level, 2)
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
starting_x = [192, 96, 0]
for i in 1...$game_party.members.size
actor = $game_party.members[i]
next if actor.nil?
self.contents.font.size = 12
draw_actor_name(actor, starting_x[i - 1] + 2, 0)
draw_actor_class(actor, starting_x[i - 1] + (96 >> 1), 0)
draw_actor_face(actor, starting_x[i - 1], WLH - 2)
draw_actor_level(actor, starting_x[i - 1] + 2, WLH + 88, 92)
draw_actor_hp(actor, starting_x[i - 1] + 2, 96 + WLH + 4, 92)
draw_actor_mp(actor, starting_x[i - 1] + 2, 96 + WLH + 19, 92)
end
end
end
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
# This class handles the party. It includes information on amount of gold
# and items. The instance of this class is referenced by $game_party.
#==============================================================================
class Game_Party < Game_Unit
attr_accessor :actors
end
#==============================================================================
# ** Window_Order
#------------------------------------------------------------------------------
# This window displays the party members' status.
#==============================================================================
class Window_Order < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
# width : window width
#--------------------------------------------------------------------------
def initialize(width)
super(0, 0, width, $game_party.members.size * WLH + 32)
self.active = false
self.index = 0
@column_max = 1
@item_max = $game_party.members.size
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
$game_party.members.each_index do |i|
draw_item(i)
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : the index of the item you want to redraw.
#--------------------------------------------------------------------------
def draw_item(item_index)
y = item_index * WLH
rect = Rect.new(0, y, width - 32, WLH)
self.contents.clear_rect(rect)
self.contents.draw_text(rect, $game_party.members[item_index].name, 1)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
last_index = @index
super
if Input.trigger?(Input::C)
Sound.play_decision
@moving = !@moving
end
if @index != last_index
if @moving
moving_actor = $game_party.actors[last_index]
swap_actor = $game_party.actors[@index]
$game_party.actors[last_index] = swap_actor
$game_party.actors[@index] = moving_actor
self.refresh
end
#Sound.play_cursor
end
end
#--------------------------------------------------------------------------
# * Set Active
# active : the active flag.
#--------------------------------------------------------------------------
def active=(active)
super(active)
@moving = false
end
end
#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
# This class handles maps. It includes scrolling and passage determination
# functions. The instance of this class is referenced by $game_map.
#==============================================================================
class Game_Map
attr_reader :map
end
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs the menu screen processing.
#==============================================================================
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# * Constant Variables
#--------------------------------------------------------------------------
System_String = 'System'
System_Strings = [
'Bestiary',
'Order',
'Save',
'Load',
'Quit'
]
Cursor_Dir = 'graphics/cursors/'
Cursor_Imgs = [
'cursor1',
'cursor2',
]
Reduce_Sound_To = 70
#--------------------------------------------------------------------------
# * Create Command Window !OVERRIDE!
#--------------------------------------------------------------------------
def create_command_window
@command_window = Musashi_Command.new([Vocab::item, Vocab::skill,
Vocab::equip, Vocab::status, System_String,Vocab::game_end],
@menu_index, 18)
@command_window.cursor(Cursor_Dir, Cursor_Imgs)
@command_window.active = true
@command_system = Musashi_Command.new(System_Strings, 0, 18)
@command_system.cursor(Cursor_Dir, Cursor_Imgs)
end
#--------------------------------------------------------------------------
# * Start processing !OVERRIDE!
#--------------------------------------------------------------------------
def start
super
create_menu_background
create_command_window
unless RPG::BGM.last.nil?
@old_volume = RPG::BGM.last.volume
RPG::BGM.last.volume = Reduce_Sound_To
RPG::BGM.last.play
end
@actor_index = 0
@cursor_timer = Musashi_Command::Frames_Anim
@cursor_anim = 0
@actor_cursor = Sprite.new
@actor_cursor.bitmap = Cache.load_bitmap(Cursor_Dir,
Cursor_Imgs[@cursor_anim])
@actor_cursor.visible = false
@actor_cursor.z = 256
@status = Window_MonoStatus.new
@status.z = 256
@party_status = Window_PartyStatus.new
@party_status.x = 544 - @party_status.width + 16
@party_status.y = 416 - @party_status.height + 16
@command_order = Window_Order.new(Window_MonoStatus::Window_Width)
@command_order.z = 888
@command_order.y = @status.height
@command_order.visible = @command_order.active = false
end
#--------------------------------------------------------------------------
# * Termination Processing !OVERRIDE!
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@command_window.dispose
@command_system.dispose
@command_order.dispose
@status.dispose
@party_status.dispose
@actor_cursor.bitmap.dispose
@actor_cursor.dispose
unless RPG::BGM.last.nil?
RPG::BGM.last.volume = @old_volume
RPG::BGM.last.play
end
$game_player.set_graphic($game_party.members[0].character_name,
$game_party.members[0].character_index)
end
#--------------------------------------------------------------------------
# * Frame Update !OVERRIDE!
#--------------------------------------------------------------------------
def update
super
update_menu_background
@command_window.update
@command_system.update
if @command_window.active && !@command_window.moving?
update_command_selection
elsif @command_system.active && !@command_system.moving?
update_system_selection
elsif @command_order.active
update_order_selection
elsif !@command_window.active && !@command_system.active &&
!@command_order.active
update_actor_selection
end
end
#--------------------------------------------------------------------------
# * Start Actor Selection !OVERRIDE!
#--------------------------------------------------------------------------
def start_actor_selection
@actor_cursor.visible = true
@command_window.active = false
@cursor_timer = Musashi_Command::Frames_Anim >> 3
@cursor_anim = 0
@actor_index = 0
end
#--------------------------------------------------------------------------
# * End Actor Selection !OVERRIDE!
#--------------------------------------------------------------------------
def end_actor_selection
@actor_cursor.visible = false
@command_window.active = true
@actor_index = 0
end
#--------------------------------------------------------------------------
# * Update Actor Selection !OVERRIDE!
#--------------------------------------------------------------------------
def update_actor_selection
@cursor_timer -= 1
if @cursor_timer == 0
@cursor_timer = Musashi_Command::Frames_Anim >> 3
@cursor_anim += 1
@cursor_anim = 0 if @cursor_anim == Cursor_Imgs.size
@actor_cursor.bitmap = Cache.load_bitmap(Cursor_Dir,
Cursor_Imgs[@cursor_anim])
end
if Input.trigger?(Input::LEFT)
@actor_index -= 1
@actor_index = $game_party.members.size - 1 if @actor_index < 0
elsif Input.trigger?(Input::RIGHT)
@actor_index += 1
@actor_index = 0 if @actor_index == $game_party.members.size
end
case @actor_index
when 0
@actor_cursor.x = 108
@actor_cursor.y = 10
when 1
@actor_cursor.x = 518
@actor_cursor.y = 266
when 2
@actor_cursor.x = 422
@actor_cursor.y = 266
when 3
@actor_cursor.x = 326
@actor_cursor.y = 266
end
if Input.trigger?(Input::B)
Sound.play_cancel
end_actor_selection
elsif Input.trigger?(Input::C)
Sound.play_decision
case @command_window.index
when 1 # Skill
$scene = Scene_Skill.new(@actor_index)
when 2 # Equipment
$scene = Scene_Equip.new(@actor_index)
when 3 # Status
$scene = Scene_Status.new(@actor_index)
end
end
end
#--------------------------------------------------------------------------
# * Update Command Selection !OVERRIDE!
#--------------------------------------------------------------------------
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # Item
$scene = Scene_Item.new
when 1, 2, 3 # Skill, Equipment, Status
start_actor_selection
when 4 # Save
@command_window.active = false
@command_system.active = true
when 5 # End Game
$scene = Scene_End.new
end
end
end
#--------------------------------------------------------------------------
# * Update Order Selection
#--------------------------------------------------------------------------
def update_order_selection
if Input.trigger?(Input::B)
Sound.play_cancel
@command_order.active = @command_order.visible = false
@command_system.active = true
@status.refresh
@party_status.refresh
end
@command_order.update
end
#--------------------------------------------------------------------------
# * Update System Selection
#--------------------------------------------------------------------------
def update_system_selection
if Input.trigger?(Input::B)
Sound.play_cancel
@command_window.active = true
@command_system.active = false
elsif Input.trigger?(Input::C)
case @command_system.index
when 0 # Bestiary
$scene = Scene_Bestiary.new
when 1 # Order
@command_system.active = false
@command_order.visible = @command_order.active = true
when 2 # Save
$scene = Scene_File.new(true, false, false)
when 3 # Load
$scene = Scene_File.new(false, false, false)
when 4 # Quit
$scene = nil
end
end
end
end
class Scene_Skill < Scene_Base
#--------------------------------------------------------------------------
# * Alias Methods
#--------------------------------------------------------------------------
alias mush_cms_sceneskill_start start
alias mush_cms_sceneskill_terminate terminate
#--------------------------------------------------------------------------
# * Start processing !ALIAS!
#--------------------------------------------------------------------------
def start
unless RPG::BGM.last.nil?
@old_volume = RPG::BGM.last.volume
RPG::BGM.last.volume = Scene_Menu::Reduce_Sound_To
RPG::BGM.last.play
end
mush_cms_sceneskill_start
end
#--------------------------------------------------------------------------
# * Termination Processing !ALIAS!
#--------------------------------------------------------------------------
def terminate
mush_cms_sceneskill_terminate
unless RPG::BGM.last.nil?
RPG::BGM.last.volume = @old_volume
RPG::BGM.last.play
end
end
end
class Scene_Item < Scene_Base
#--------------------------------------------------------------------------
# * Alias Methods
#--------------------------------------------------------------------------
alias mush_cms_sceneskill_start start
alias mush_cms_sceneskill_terminate terminate
#--------------------------------------------------------------------------
# * Start processing !ALIAS!
#--------------------------------------------------------------------------
def start
unless RPG::BGM.last.nil?
@old_volume = RPG::BGM.last.volume
RPG::BGM.last.volume = Scene_Menu::Reduce_Sound_To
RPG::BGM.last.play
end
mush_cms_sceneskill_start
end
#--------------------------------------------------------------------------
# * Termination Processing !ALIAS!
#--------------------------------------------------------------------------
def terminate
mush_cms_sceneskill_terminate
unless RPG::BGM.last.nil?
RPG::BGM.last.volume = @old_volume
RPG::BGM.last.play
end
end
end
class Scene_Status < Scene_Base
#--------------------------------------------------------------------------
# * Alias Methods
#--------------------------------------------------------------------------
alias mush_cms_scenestatus_start start
alias mush_cms_scenestatus_terminate terminate
#--------------------------------------------------------------------------
# * Start processing !ALIAS!
#--------------------------------------------------------------------------
def start
unless RPG::BGM.last.nil?
@old_volume = RPG::BGM.last.volume
RPG::BGM.last.volume = Scene_Menu::Reduce_Sound_To
RPG::BGM.last.play
end
mush_cms_scenestatus_start
end
#--------------------------------------------------------------------------
# * Termination Processing !ALIAS!
#--------------------------------------------------------------------------
def terminate
mush_cms_scenestatus_terminate
unless RPG::BGM.last.nil?
RPG::BGM.last.volume = @old_volume
RPG::BGM.last.play
end
end
end
class Scene_Equip < Scene_Base
#--------------------------------------------------------------------------
# * Alias Methods
#--------------------------------------------------------------------------
alias mush_cms_scenequip_start start
alias mush_cms_scenequip_terminate terminate
#--------------------------------------------------------------------------
# * Start processing !ALIAS!
#--------------------------------------------------------------------------
def start
unless RPG::BGM.last.nil?
@old_volume = RPG::BGM.last.volume
RPG::BGM.last.volume = Scene_Menu::Reduce_Sound_To
RPG::BGM.last.play
end
mush_cms_scenequip_start
end
#--------------------------------------------------------------------------
# * Termination Processing !ALIAS!
#--------------------------------------------------------------------------
def terminate
mush_cms_scenequip_terminate
unless RPG::BGM.last.nil?
RPG::BGM.last.volume = @old_volume
RPG::BGM.last.play
end
end
end
class Scene_File < Scene_Base
#--------------------------------------------------------------------------
# * Alias Methods
#--------------------------------------------------------------------------
alias mush_cms_scenefile_start start
alias mush_cms_scenefile_terminate terminate
#--------------------------------------------------------------------------
# * Start processing !ALIAS!
#--------------------------------------------------------------------------
def start
mush_cms_scenefile_start
unless @from_title
unless RPG::BGM.last.nil?
@old_volume = RPG::BGM.last.volume
RPG::BGM.last.volume = Scene_Menu::Reduce_Sound_To
RPG::BGM.last.play
end
end
end
#--------------------------------------------------------------------------
# * Termination Processing !ALIAS!
#--------------------------------------------------------------------------
def terminate
mush_cms_scenefile_terminate
unless @from_title
unless RPG::BGM.last.nil?
RPG::BGM.last.volume = @old_volume
RPG::BGM.last.play
end
end
end
end