#============================= # CMS MADE BY PREFIX # FOR THE USE OF NECRILE ONLY # NO SUPPORT FOR ANYOTHER USER # v 1.0 #============================= #_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ # \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ # /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ #============================================================================== # ** Scene_Save #------------------------------------------------------------------------------ # This class performs save screen processing. #============================================================================== class Scene_Save < Scene_File #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super("Which file would you like to save to?") end #-------------------------------------------------------------------------- # * Decision Processing #-------------------------------------------------------------------------- def on_decision(filename) # Play save SE $game_system.se_play($data_system.save_se) # Write save data file = File.open(filename, "wb") write_save_data(file) file.close # If called from event if $game_temp.save_calling # Clear save call flag $game_temp.save_calling = false # Switch to map screen $scene = Scene_Map.new return end # Switch to menu screen $scene = Scene_Menu.new end #-------------------------------------------------------------------------- # * Cancel Processing #-------------------------------------------------------------------------- def on_cancel # Play cancel SE $game_system.se_play($data_system.cancel_se) # If called from event if $game_temp.save_calling # Clear save call flag $game_temp.save_calling = false # Switch to map screen $scene = Scene_Map.new return end # Switch to menu screen $scene = Scene_Menu.new end #-------------------------------------------------------------------------- # * Write Save Data # file : write file object (opened) #-------------------------------------------------------------------------- def write_save_data(file) # Make character data for drawing save file characters = [] for i in 0...$game_party.actors.size actor = $game_party.actors[i] characters.push([actor.character_name, actor.character_hue]) end # Write character data for drawing save file Marshal.dump(characters, file) # Wrire frame count for measuring play time Marshal.dump(Graphics.frame_count, file) # Increase save count by 1 $game_system.save_count += 1 # Save magic number # (A random value will be written each time saving with editor) $game_system.magic_number = $data_system.magic_number # Write each type of game object Marshal.dump($game_system, file) Marshal.dump($game_switches, file) Marshal.dump($game_variables, file) Marshal.dump($game_self_switches, file) Marshal.dump($game_screen, file) Marshal.dump($game_actors, file) Marshal.dump($game_party, file) Marshal.dump($game_troop, file) Marshal.dump($game_map, file) Marshal.dump($game_player, file) end end #============================================================================== # ** Scene_File #------------------------------------------------------------------------------ # This is a superclass for the save screen and load screen. #============================================================================== class Scene_File #-------------------------------------------------------------------------- # * Object Initialization # help_text : text string shown in the help window #-------------------------------------------------------------------------- def initialize(help_text) @help_text = help_text end #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main @spriteset = Sprite.new @spriteset.bitmap = RPG::Cache.title($data_system.title_name) # Make help window @help_window = Window_Help.new @help_window.set_text(@help_text) # Make save file window @savefile_windows = [] for i in 0..3 @savefile_windows.push(Window_SaveFile.new(i, make_filename(i))) end # Select last file to be operated @file_index = $game_temp.last_file_index @savefile_windows[@file_index].selected = true # Execute transition Graphics.transition # Main loop loop do # Update game screen Graphics.update # Update input information Input.update # Frame update update # Abort loop if screen is changed if $scene != self break end end # Prepare for transition Graphics.freeze # Dispose of windows @spriteset.dispose @help_window.dispose for i in @savefile_windows i.dispose end end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update windows @spriteset.update @help_window.update for i in @savefile_windows i.update end # If C button was pressed if Input.trigger?(Input::C) # Call method: on_decision (defined by the subclasses) on_decision(make_filename(@file_index)) $game_temp.last_file_index = @file_index return end # If B button was pressed if Input.trigger?(Input::B) # Call method: on_cancel (defined by the subclasses) on_cancel return end # If the down directional button was pressed if Input.repeat?(Input::DOWN) # If the down directional button pressed down is not a repeat, # or cursor position is more in front than 3 if Input.trigger?(Input::DOWN) or @file_index < 3 # Play cursor SE $game_system.se_play($data_system.cursor_se) # Move cursor down @savefile_windows[@file_index].selected = false @file_index = (@file_index + 1) % 4 @savefile_windows[@file_index].selected = true return end end # If the up directional button was pressed if Input.repeat?(Input::UP) # If the up directional button pressed down is not a repeat、 # or cursor position is more in back than 0 if Input.trigger?(Input::UP) or @file_index > 0 # Play cursor SE $game_system.se_play($data_system.cursor_se) # Move cursor up @savefile_windows[@file_index].selected = false @file_index = (@file_index + 3) % 4 @savefile_windows[@file_index].selected = true return end end end #-------------------------------------------------------------------------- # * Make File Name # file_index : save file index (0-3) #-------------------------------------------------------------------------- def make_filename(file_index) return "Save#{file_index + 1}.rxdata" end end #============================================================================== # ** Scene_End #------------------------------------------------------------------------------ # This class performs game end screen processing. #============================================================================== class Scene_End #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main @spriteset = Sprite.new @spriteset.bitmap = RPG::Cache.title($data_system.title_name) # Make command window s1 = "To Title" s2 = "Shutdown" s3 = "Cancel" @command_window = Window_Command.new(192, [s1, s2, s3]) @command_window.x = 320 - @command_window.width / 2 @command_window.y = 240 - @command_window.height / 2 # Execute transition Graphics.transition # Main loop loop do # Update game screen Graphics.update # Update input information Input.update # Frame Update update # Abort loop if screen is changed if $scene != self break end end # Prepare for transition Graphics.freeze # Dispose of window @spriteset.dispose @command_window.dispose # If switching to title screen if $scene.is_a?(Scene_Title) # Fade out screen Graphics.transition Graphics.freeze end end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update command window @command_window.update # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Switch to menu screen $scene = Scene_Menu.new return end # If C button was pressed if Input.trigger?(Input::C) # Branch by command window cursor position case @command_window.index when 0 # to title command_to_title when 1 # shutdown command_shutdown when 2 # quit command_cancel end return end end #-------------------------------------------------------------------------- # * Process When Choosing [To Title] Command #-------------------------------------------------------------------------- def command_to_title # Play decision SE $game_system.se_play($data_system.decision_se) # Fade out BGM, BGS, and ME Audio.bgm_fade(800) Audio.bgs_fade(800) Audio.me_fade(800) # Switch to title screen $scene = Scene_Title.new end #-------------------------------------------------------------------------- # * Process When Choosing [Shutdown] Command #-------------------------------------------------------------------------- def command_shutdown # Play decision SE $game_system.se_play($data_system.decision_se) # Fade out BGM, BGS, and ME Audio.bgm_fade(800) Audio.bgs_fade(800) Audio.me_fade(800) # Shutdown $scene = nil end #-------------------------------------------------------------------------- # * Process When Choosing [Cancel] Command #-------------------------------------------------------------------------- def command_cancel # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to menu screen $scene = Scene_Menu.new end end #============================================================================== # ** Scene_Load #------------------------------------------------------------------------------ # This class performs load screen processing. #============================================================================== class Scene_Load < Scene_File #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize # Remake temporary object $game_temp = Game_Temp.new # Timestamp selects new file $game_temp.last_file_index = 0 latest_time = Time.at(0) for i in 0..3 filename = make_filename(i) if FileTest.exist?(filename) file = File.open(filename, "r") if file.mtime > latest_time latest_time = file.mtime $game_temp.last_file_index = i end file.close end end super("Which file would you like to load?") end #-------------------------------------------------------------------------- # * Decision Processing #-------------------------------------------------------------------------- def on_decision(filename) # If file doesn't exist unless FileTest.exist?(filename) # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Play load SE $game_system.se_play($data_system.load_se) # Read save data file = File.open(filename, "rb") read_save_data(file) file.close # Restore BGM and BGS $game_system.bgm_play($game_system.playing_bgm) $game_system.bgs_play($game_system.playing_bgs) # Update map (run parallel process event) $game_map.update # Switch to map screen $scene = Scene_Map.new end #-------------------------------------------------------------------------- # * Cancel Processing #-------------------------------------------------------------------------- def on_cancel # Play cancel SE $game_system.se_play($data_system.cancel_se) # Switch to title screen $scene = Scene_Menu.new end #-------------------------------------------------------------------------- # * Read Save Data # file : file object for reading (opened) #-------------------------------------------------------------------------- def read_save_data(file) # Read character data for drawing save file characters = Marshal.load(file) # Read frame count for measuring play time Graphics.frame_count = Marshal.load(file) # Read each type of game object $game_system = Marshal.load(file) $game_switches = Marshal.load(file) $game_variables = Marshal.load(file) $game_self_switches = Marshal.load(file) $game_screen = Marshal.load(file) $game_actors = Marshal.load(file) $game_party = Marshal.load(file) $game_troop = Marshal.load(file) $game_map = Marshal.load(file) $game_player = Marshal.load(file) # If magic number is different from when saving # (if editing was added with editor) if $game_system.magic_number != $data_system.magic_number # Load map $game_map.setup($game_map.map_id) $game_player.center($game_player.x, $game_player.y) end # Refresh party members $game_party.refresh end end #_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ # \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ # /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ #============================================================================== # ** Window_Gold #------------------------------------------------------------------------------ # This window displays amount of Currency. #============================================================================== class Window_Gold < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 160, 64) self.contents = Bitmap.new(width - 32, height - 32) refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = system_color self.contents.draw_text(0, 5, 120, 32, $data_system.words.gold + ": " + $game_party.gold.to_s) end end #_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ # \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ # /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ #============================================================================== # ** Window_Variables #------------------------------------------------------------------------------ # Displays variables 100 - 120 #============================================================================== # class Window_Variables < Window_Base def initialize super(5, 74, 355, 401) self.contents = Bitmap.new(width - 32, height - 32) refresh end def refresh self.contents.clear self.contents.draw_text(0, 10, 320, 32, "TextHere: " + $game_variables[100].to_s) self.contents.draw_text(0, 42, 320, 32, "TextHere: " + $game_variables[101].to_s) self.contents.draw_text(0, 74, 320, 32, "TextHere: " + $game_variables[102].to_s) self.contents.draw_text(0, 106, 320, 32, "TextHere: " + $game_variables[103].to_s) self.contents.draw_text(0, 138, 320, 32, "TextHere: " + $game_variables[104].to_s) self.contents.draw_text(0, 170, 320, 32, "TextHere: " + $game_variables[105].to_s) self.contents.draw_text(0, 202, 320, 32, "TextHere: " + $game_variables[106].to_s) self.contents.draw_text(0, 234, 320, 32, "TextHere: " + $game_variables[107].to_s) self.contents.draw_text(0, 266, 320, 32, "TextHere: " + $game_variables[108].to_s) self.contents.draw_text(0, 298, 320, 32, "TextHere: " + $game_variables[109].to_s) self.contents.draw_text(170, 10, 320, 32, "TextHere: " + $game_variables[110].to_s) self.contents.draw_text(170, 42, 320, 32, "TextHere: " + $game_variables[111].to_s) self.contents.draw_text(170, 74, 320, 32, "TextHere: " + $game_variables[112].to_s) self.contents.draw_text(170, 106, 320, 32, "TextHere: " + $game_variables[113].to_s) self.contents.draw_text(170, 138, 320, 32, "TextHere: " + $game_variables[114].to_s) self.contents.draw_text(170, 170, 320, 32, "TextHere: " + $game_variables[115].to_s) self.contents.draw_text(170, 202, 320, 32, "TextHere: " + $game_variables[116].to_s) self.contents.draw_text(170, 234, 320, 32, "TextHere: " + $game_variables[117].to_s) self.contents.draw_text(170, 266, 320, 32, "TextHere: " + $game_variables[118].to_s) self.contents.draw_text(170, 298, 320, 32, "TextHere: " + $game_variables[119].to_s) self.contents.draw_text(170, 298, 320, 32, "TextHere: " + $game_variables[120].to_s) end end #_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ # \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ # /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ #============================================================================== # ** Window_Menucommand #------------------------------------------------------------------------------ # Command Window For CMS #============================================================================== class Window_Menucommand < Window_Selectable def initialize super(5, 5, 630, 64) self.contents = Bitmap.new(width - 32, height - 32) @item_max = 4 @column_max = 4 @commands = ["Save", "Load", "Prayers", "Exit"] refresh self.index = 0 end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear for i in 0...@item_max draw_item(i) end end #-------------------------------------------------------------------------- # * Draw Item # index : item number #-------------------------------------------------------------------------- def draw_item(index) x = 4 + index * 157.5 self.contents.draw_text(x, 0, 128, 32, @commands[index]) end end #_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ # \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ # /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ #============================================================================== # ** Window_Base #------------------------------------------------------------------------------ # Slight Change So Bars Are Supported #============================================================================== class Window_Base < Window def draw_actor_battler(actor, x, y) bitmap = RPG::Cache.battler(actor.character_name, actor.character_hue) src_rect = Rect.new(0, 0, 640, 480) self.contents.blt(0,0, bitmap, src_rect) end def draw_normal_barz(x, y, type, length, thick, e1, e2, c1 = Color.new(153,238,153,255), c2 = Color.new(0,0,0,255)) if type == "horizontal" width = length height = thick self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255, 255)) self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255)) w = width * e1 / e2 for i in 0..height r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a)) end elsif type == "vertical" width = thick height = length self.contents.fill_rect(x-1, y - 1, width+3, height + 2, Color.new(255, 255, 255, 255)) self.contents.fill_rect(x, y, width+1, height , Color.new(0, 0, 0, 255)) h = height * e1 / e2 for i in 0..width r = c1.red + (c2.red - c1.red) * (width -i)/width + 0 * i/width g = c1.green + (c2.green - c1.green) * (width -i)/width + 0 * i/width b = c1.blue + (c2.blue - c1.blue) * (width -i)/width + 0 * i/width a = c1.alpha + (c2.alpha - c1.alpha)* (width -i)/width + 255 * i/width self.contents.fill_rect(x+i, y, 1, h, Color.new(r, g, b, a)) end end end def draw_actor_barz(actor,x, y, type, length, thick, e1, e2, c1 = Color.new(255,0,0,255), c2 = Color.new(0,0,0,255)) if type == "horizontal" width = length height = thick self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255, 255)) self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255)) w = width * e1 / e2 for i in 0..height r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a)) end elsif type == "vertical" width = thick height = length self.contents.fill_rect(x-1, y - 1, width+3, height + 2, Color.new(255, 255, 255, 255)) self.contents.fill_rect(x, y, width+1, height , Color.new(0, 0, 0, 255)) h = height * e1 / e2 for i in 0..width r = c1.red + (c2.red - c1.red) * (width -i)/width + 0 * i/width g = c1.green + (c2.green - c1.green) * (width -i)/width + 0 * i/width b = c1.blue + (c2.blue - c1.blue) * (width -i)/width + 0 * i/width a = c1.alpha + (c2.alpha - c1.alpha)* (width -i)/width + 255 * i/width self.contents.fill_rect(x+i, y, 1, h, Color.new(r, g, b, a)) end end end end #_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ # \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ # /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ #============================================================================== # ** Window_MenuStatus #------------------------------------------------------------------------------ # This window displays party member status on the menu screen. #============================================================================== class Window_MenuStatus < Window_Selectable #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 270, 250) self.contents = Bitmap.new(width - 32, height - 32) @selected_player = $game_actors[1] refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear @item_max = $game_party.actors.size for i in 0...$game_party.actors.size x = 0 y = i * 0 actor = $game_party.actors[0] self.contents.font.size = 22 self.contents.font.color = system_color draw_normal_barz(1, 60, "horizontal", 230, 15, $game_actors[1].hp.to_i, $game_actors[1].maxhp.to_i, Color.new (225, 0, 0, 225)) draw_normal_barz(1, 116, "horizontal", 230, 15, $game_actors[1].sp.to_i, $game_actors[1].maxsp.to_i, Color.new (0,0,255,255)) self.contents.font.color = normal_color self.contents.draw_text(100, -5, 320, 32, @selected_player.name.to_s + ":") self.contents.draw_text(0, 73, 320, 32, @selected_player.hp.to_s + " / " + @selected_player.maxhp.to_s + " Hp") self.contents.draw_text(0, 129, 320, 32, @selected_player.sp.to_s + " / " + @selected_player.maxsp.to_s + " Sp") self.contents.draw_text(170, -5, 320, 32, @selected_player.class_name) end end #-------------------------------------------------------------------------- # * Cursor Rectangle Update #-------------------------------------------------------------------------- def update_cursor_rect if @index < 0 self.cursor_rect.empty else self.cursor_rect.set(0, @index * 116, self.width - 32, 96) end end end #_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ # \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ # /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ #============================================================================== # ** Scene_Menu #------------------------------------------------------------------------------ # The Menu #============================================================================== class Scene_Menu # Pose Names POSES = ['down','left','right','up'] # Number of Frames Per Pose FRAMES = 4 #-------------------------------------------------------------------------- # * Object Initialization # menu_index : command cursor's initial position #-------------------------------------------------------------------------- def initialize(menu_index = 0) @menu_index = menu_index end #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main # Make command window @sprite = Sprite_ActorCharGraphic.new($game_actors[1], 395, 85, 10, 0, 'left') @sprite.animate = true @spriteset = Sprite.new @spriteset.bitmap = RPG::Cache.title($data_system.title_name) @command_window = Window_Menucommand.new @command_window.index = @menu_index # If number of party members is 0 if $game_party.actors.size == 0 # Disable items, skills, equipment, and status @command_window.disable_item(0) @command_window.disable_item(1) @command_window.disable_item(2) @command_window.disable_item(3) end # If save is forbidden if $game_system.save_disabled # Disable save @command_window.disable_item(4) end # Make status window @status_window = Window_MenuStatus.new @status_window.x = 640 - @status_window.width - 5 @status_window.y = @command_window.height + 10 # Make gold window @gold_window = Window_Gold.new @gold_window.x = 640 - @status_window.width - 5 @gold_window.y = @command_window.height + @status_window.height + 15 @gold_window.width = @status_window.width @gold_window.height = 480 - 64 - 250 - 20 @variable_window = Window_Variables.new # Execute transition Graphics.transition # Main loop loop do # Update game screen Graphics.update # Update input information Input.update # Frame update update # Abort loop if screen is changed if $scene != self break end end # Prepare for transition Graphics.freeze # Dispose of windows @sprite.dispose @spriteset.dispose @variable_window.dispose @command_window.dispose @gold_window.dispose @status_window.dispose end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update windows @spriteset.update @sprite.update @variable_window.update @command_window.update @gold_window.update @status_window.update # If command window is active: call update_command if @command_window.active update_command return end # If status window is active: call update_status if @status_window.active update_status return end end #-------------------------------------------------------------------------- # * Frame Update (when command window is active) #-------------------------------------------------------------------------- def update_command # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Switch to map screen $scene = Scene_Map.new return end # If C button was pressed if Input.trigger?(Input::C) # Branch by command window cursor position case @command_window.index when 0 # save # Play decision SE $game_system.se_play($data_system.decision_se) $scene = Scene_Save.new when 1 # load # Play decision SE $game_system.se_play($data_system.decision_se) $scene = Scene_Load.new when 2 # exit # Play decision SE $game_system.se_play($data_system.decision_se) $scene = Scene_Quests.new when 3 # exit # Play decision SE $game_system.se_play($data_system.decision_se) $scene = Scene_End.new end return end end end