#============================================================================== # ¡á Game_Actor #------------------------------------------------------------------------------ # ¡¡«¢«¯«¿?ªòÐ⪦«¯«é«¹ªÇª¹¡£ª³ªÎ«¯«é«¹ªÏ Game_Actors «¯«é«¹ ($game_actors) # ªÎ?Ý»ªÇÞÅéĪµªì¡¢Game_Party «¯«é«¹ ($game_party) ª«ªéªâ?ðΪµªìªÞª¹¡£ #============================================================================== class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # ¡Ü «Ð«È«ë?Øü X ñ¨øöªÎö¢Ôð #-------------------------------------------------------------------------- alias :screen_x_original :screen_x def screen_x # «Ñ?«Æ«£?ªÎ?ªÓâ÷ª«ªé X ñ¨øöªòͪߩª·ªÆÚ÷ª¹ if $game_temp.in_battle return screen_x_original else if self.index != nil return (self.index / 2 + 1) * 128 + (self.index % 2) * 264 else return 0 end end end #-------------------------------------------------------------------------- # ¡Ü «Ð«È«ë?Øü Y ñ¨øöªÎö¢Ôð #-------------------------------------------------------------------------- alias :screen_y_original :screen_y def screen_y if $game_temp.in_battle return screen_y_original else return 360 +(self.index / 2) * 104 end end end #============================================================================== # ¡á Window_Help #------------------------------------------------------------------------------ # ¡¡«¹«­«ëªä«¢«¤«Æ«àªÎ?Ù¥¡¢«¢«¯«¿?ªÎ«¹«Æ?«¿«¹ªÊªÉªòøúãƪ¹ªë«¦«£«ó«É«¦ªÇª¹¡£ #============================================================================== class Window_Help2 < Window_Base #-------------------------------------------------------------------------- # ¡Ü «ª«Ö«¸«§«¯«ÈôøÑ¢ûù #-------------------------------------------------------------------------- def initialize super(20, 42, 600, 64) self.contents = Bitmap.new(width - 32, height - 32) self.z = 6110 self.back_opacity = 192 end #-------------------------------------------------------------------------- # ¡Ü «Æ«­«¹«ÈàâïÒ # text : «¦«£«ó«É«¦ªËøúãƪ¹ªëÙþí®Öª # align : «¢«é«¤«ó«á«ó«È (0..ñ§?ª¨¡¢1..ñéäç?ª¨¡¢2..éÓ?ª¨) #-------------------------------------------------------------------------- def set_text(text, align = 0) # «Æ«­«¹«ÈªÈ«¢«é«¤«ó«á«ó«ÈªÎᴪʪ¯ªÈªâìéÛ°ª¬îñüÞªÈêުêƪ¤ªëíÞùê if text != @text or align != @align # «Æ«­«¹«Èªòî¢ÙÚ? self.contents.clear self.contents.font.color = normal_color self.contents.draw_text(4, 0, self.width - 40, 32, text, align) @text = text @align = align @actor = nil end self.visible = true end #-------------------------------------------------------------------------- # ¡Ü «¢«¯«¿?àâïÒ # actor : «¹«Æ?«¿«¹ªòøúãƪ¹ªë«¢«¯«¿? #-------------------------------------------------------------------------- def set_actor(actor) if actor != @actor self.contents.clear draw_actor_name(actor, 0, 0) draw_actor_state(actor, 144, 0, 100) draw_actor_hp(@actor, 256, 0) draw_actor_sp(@actor, 424, 0) @actor = actor @text = nil self.visible = true end end #-------------------------------------------------------------------------- # ¡Ü «¨«Í«ß?àâïÒ # enemy : Ù£îñªÈ«¹«Æ?«Èªòøúãƪ¹ªë«¨«Í«ß? #-------------------------------------------------------------------------- def set_enemy(enemy) text = enemy.name state_text = make_battler_state_text(enemy, 112, false) if state_text != "" text += " " + state_text end set_text(text, 1) end end #============================================================================== # ¡á Window_Base #------------------------------------------------------------------------------ # ¡¡«²?«àñéªÎª¹ªÙªÆªÎ«¦«£«ó«É«¦ªÎ«¹?«Ñ?«¯«é«¹ªÇª¹¡£ #============================================================================== class Window_Base < Window #-------------------------------------------------------------------------- # ¡Ü Ù£îñªÎÙÚ? # actor : «¢«¯«¿? # x : ÙÚ?à» X ñ¨øö # y : ÙÚ?à» Y ñ¨øö #-------------------------------------------------------------------------- def draw_actor_name(actor, x, y) self.contents.font.color = normal_color self.contents.draw_text(x, y, 120, 32, actor.name) end #-------------------------------------------------------------------------- # ¡Ü «¯«é«¹ªÎÙÚ? # actor : «¢«¯«¿? # x : ÙÚ?à» X ñ¨øö # y : ÙÚ?à» Y ñ¨øö #-------------------------------------------------------------------------- def draw_actor_class(actor, x, y) self.contents.font.color = normal_color self.contents.draw_text(x, y, 120, 32, actor.class_name) end #-------------------------------------------------------------------------- # ¡Ü «°«é«Õ«£«Ã«¯ªÎÙÚ? # actor : «¢«¯«¿? # x : ÙÚ?à» X ñ¨øö # y : ÙÚ?à» Y ñ¨øö #-------------------------------------------------------------------------- def draw_actor_battler(actor, x, y) bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue) cw = bitmap.width / 2 ch = bitmap.height self.contents.blt(x - cw, y - ch, bitmap, bitmap.rect, 208) end #-------------------------------------------------------------------------- # ¡Ü «¢«¤«Æ«àÙ£ªÎÙÚ? # item : «¢«¤«Æ«à # x : ÙÚ?à» X ñ¨øö # y : ÙÚ?à» Y ñ¨øö #-------------------------------------------------------------------------- def draw_item_name(item, x, y, width = 240) if item == nil return end bitmap = RPG::Cache.icon(item.icon_name) self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24)) self.contents.font.color = normal_color self.contents.draw_text(x + 28, y, width - 28, 32, item.name) end end #============================================================================== # ¡á Window_Command2 #------------------------------------------------------------------------------ # ¡¡ìéÚõîܪʫ³«Þ«ó«ÉàÔ?ªòú¼ª¦«¦«£«ó«É«¦ªÇª¹¡£ #============================================================================== class Window_MenuCommand < Window_Selectable #-------------------------------------------------------------------------- # ¡Ü «ª«Ö«¸«§«¯«ÈôøÑ¢ûù # width : «¦«£«ó«É«¦ªÎøë # commands : «³«Þ«ó«ÉÙþí®ÖªªÎÛÕÖª #-------------------------------------------------------------------------- def initialize(width, commands) # «³«Þ«ó«ÉªÎËÁ?ª«ªé«¦«£«ó«É«¦ªÎÍÔªµªòß©õó super(0, 0, width, 160) @item_max = commands.size @commands = commands @column_max = 2 self.contents = Bitmap.new(width - 32, height - 32) refresh self.index = 0 end #-------------------------------------------------------------------------- # ¡Ü «ê«Õ«ì«Ã«·«å #-------------------------------------------------------------------------- def refresh self.contents.clear for i in 0...@item_max draw_item(i, normal_color) end end #-------------------------------------------------------------------------- # ¡Ü ««?«½«ëªÎÏ»û¡ÌÚãæ #-------------------------------------------------------------------------- def update_cursor_rect if @index < 0 self.cursor_rect.empty else self.cursor_rect.set((index % 2) * 128, 32 * (index / 2), 128, 32) end end #-------------------------------------------------------------------------- # ¡Ü ú£ÙͪÎÙÚ? # index : ú£ÙÍÛã? # color : Ùþí®ßä #-------------------------------------------------------------------------- def draw_item(index, color) self.contents.font.color = color rect = Rect.new(4 + (index % 2) * 128, 32 * (index / 2), 128, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) self.contents.draw_text(rect, @commands[index]) end #-------------------------------------------------------------------------- # ¡Ü ú£ÙͪÎÙí?ûù # index : ú£ÙÍÛã? #-------------------------------------------------------------------------- def disable_item(index) draw_item(index, disabled_color) end end #============================================================================== # ¡á Window_MenuStatus #------------------------------------------------------------------------------ # ¡¡«á«Ë«å??ØüªÇ«Ñ?«Æ«£«á«ó«Ð?ªÎ«¹«Æ?«¿«¹ªòøúãƪ¹ªë«¦«£«ó«É«¦ªÇª¹¡£ #============================================================================== class Window_MenuStatus < Window_Selectable #-------------------------------------------------------------------------- # ¡Ü ÍëËÒ«¤«ó«¹«¿«ó«¹?? #-------------------------------------------------------------------------- attr_accessor :out_window # úÞ«¦«£«ó«É«¦ #-------------------------------------------------------------------------- # ¡Ü «ª«Ö«¸«§«¯«ÈôøÑ¢ûù #-------------------------------------------------------------------------- def initialize super(40, 0, 560, 480) self.z = 6100 self.opacity = 0 self.back_opacity = 0 @out_window = Window_Base.new(40, 220, 560, 240) @out_window.z = 6100 @out_window.back_opacity = 192 @column_max = 2 self.contents = Bitmap.new(width - 32, height - 32) refresh self.active = false self.index = -1 end #-------------------------------------------------------------------------- # ¡Ü ú°Û¯ #-------------------------------------------------------------------------- def dispose @out_window.dispose super end #-------------------------------------------------------------------------- # ¡Ü «ê«Õ«ì«Ã«·«å #-------------------------------------------------------------------------- def refresh self.contents.clear @item_max = $game_party.actors.size for i in 0...$game_party.actors.size x = (i % 2) * 264 y = (i / 2) * 104 + 220 actor = $game_party.actors[i] draw_actor_battler(actor, x + (2 - i / 2) * 88, y + 104) draw_actor_name(actor, x + 12, y) draw_actor_class(actor, x + 132, y) draw_actor_level(actor, x + 12, y + 24) draw_actor_state(actor, x + 12, y + 48, 100) draw_actor_exp(actor, x + 30, y + 72) draw_actor_hp(actor, x + 108, y + 24) draw_actor_sp(actor, x + 108, y + 48) end end #-------------------------------------------------------------------------- # ¡Ü ««?«½«ëªÎÏ»û¡ÌÚãæ #-------------------------------------------------------------------------- def update_cursor_rect if @index < 0 if @index == -2 self.cursor_rect.set(0, 220, 528, 208) elsif @index < -2 self.cursor_rect.set(((@index + 10) % 2) * 264, ((@index + 10) / 2) * 104 + 220, 264, 104) else self.cursor_rect.empty end else self.cursor_rect.set((@index % 2) * 264, (@index / 2) * 104 + 220, 264, 104) end end #-------------------------------------------------------------------------- # ¡Ü «Õ«ì?«àÌÚãæ #-------------------------------------------------------------------------- def update @out_window.update super end end #============================================================================== # ¡á Scene_Menu #------------------------------------------------------------------------------ # ¡¡«á«Ë«å??ØüªÎ?×âªòú¼ª¦«¯«é«¹ªÇª¹¡£ #============================================================================== class Scene_Menu #-------------------------------------------------------------------------- # ¡Ü ÍëËÒ«¤«ó«¹«¿«ó«¹?? #-------------------------------------------------------------------------- attr_accessor :menu # úÞ«¦«£«ó«É«¦ attr_accessor :command_window # «³«Þ«ó«É«¦«£«ó«É«¦ attr_accessor :status_window # «¿?«²«Ã«È«¦«£«ó«É«¦ #-------------------------------------------------------------------------- # ¡Ü «ª«Ö«¸«§«¯«ÈôøÑ¢ûù # menu_index : «³«Þ«ó«ÉªÎ««?«½«ëôøÑ¢êÈöÇ #-------------------------------------------------------------------------- def initialize(menu_index = 0) @menu_index = menu_index end #-------------------------------------------------------------------------- # ¡Ü «á«¤«ó?×â #-------------------------------------------------------------------------- def main # «¹«×«é«¤«È«»«Ã«ÈªòíÂà÷ @spriteset = Spriteset_Map.new # «³«Þ«ó«É«¦«£«ó«É«¦ªòíÂà÷ s1 = $data_system.words.item s2 = $data_system.words.skill s3 = $data_system.words.equip s4 = "ij¸¯Á¤º¸" s5 = "ÀúÀåÇϱâ" s6 = "ºÒ·¯¿À±â" s7 = "Á¾·á" @command_window = Window_MenuCommand.new(288, [s1, s2, s3, s4, s5, s6, s7]) @command_window.index = @menu_index @command_window.x = 40 @command_window.y = 20 @command_window.z = 6100 @command_window.back_opacity = 192 # «Ñ?«Æ«£ìÑ?ª¬ 0 ìѪÎíÞùê if $game_party.actors.size == 0 # «¢«¤«Æ«à¡¢«¹«­«ë¡¢?Ýá¡¢«¹«Æ?«¿«¹ªòÙí?ûù @command_window.disable_item(0) @command_window.disable_item(1) @command_window.disable_item(2) @command_window.disable_item(3) end # «»?«ÖÐ×ò­ªÎíÞùê if $game_system.save_disabled # «»?«ÖªòÙí?ªËª¹ªë @command_window.disable_item(4) end # «´?«ë«É«¦«£«ó«É«¦ªòíÂà÷ @time_window = Window_PlayTime.new @time_window.x = 440 #È­¸é»ó¿¡ ¶ß´ÂâÀÇ xÁÂÇ¥ @time_window.y = 76 #È­¸é»ó¿¡ ¶ß´ÂâÀÇ yÁÂÇ¥ @time_window.z = 6100 @time_window.back_opacity = 192 @time_window.visible = true @gold_window = Window_Gold.new @gold_window.x = 440 @gold_window.y = 20 @gold_window.z = 6100 @gold_window.back_opacity = 192 # «¹«Æ?«¿«¹«¦«£«ó«É«¦ªòíÂà÷ @status_window = Window_MenuStatus.new @menu = nil # «È«é«ó«¸«·«ç«ó?ú¼ Graphics.transition # «á«¤«ó«ë?«× loop do # «²?«à?ØüªòÌÚãæ Graphics.update # ìýÕôï×ÜêòÌÚãæ Input.update # «Õ«ì?«àÌÚãæ update if @menu != nil @menu.update end # ?Øüª¬ï·ªêôðªïªÃª¿ªé«ë?«×ªòñé? if $scene != self break end end # «È«é«ó«¸«·«ç«óñÞÝá Graphics.freeze # «¹«×«é«¤«È«»«Ã«Èªòú°Û¯ @spriteset.dispose # «¦«£«ó«É«¦ªòú°Û¯ @command_window.dispose @gold_window.dispose @status_window.dispose @time_window.visible = false end #-------------------------------------------------------------------------- # ¡Ü «Õ«ì?«àÌÚãæ #-------------------------------------------------------------------------- def update # «¦«£«ó«É«¦ªòÌÚãæ @command_window.update @gold_window.update @status_window.update @time_window.update # «³«Þ«ó«É«¦«£«ó«É«¦ª¬«¢«¯«Æ«£«ÖªÎíÞùê: update_command ªòû¼ªÖ if @command_window.active and @menu == nil update_command return end # «¹«Æ?«¿«¹«¦«£«ó«É«¦ª¬«¢«¯«Æ«£«ÖªÎíÞùê: update_status ªòû¼ªÖ if @status_window.active and @menu == nil update_status return end end #-------------------------------------------------------------------------- # ¡Ü «Õ«ì?«àÌÚãæ («³«Þ«ó«É«¦«£«ó«É«¦ª¬«¢«¯«Æ«£«ÖªÎíÞùê) #-------------------------------------------------------------------------- def update_command # B «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::B) # «­«ã«ó«»«ë SE ªòæÑñ´ $game_system.se_play($data_system.cancel_se) # «Þ«Ã«×?ØüªËï·ªêô𪨠$scene = Scene_Map.new return end # C «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::C) # «Ñ?«Æ«£ìÑ?ª¬ 0 ìѪǡ¢«»?«Ö¡¢«²?«àðûÖõì¤èâªÎ«³«Þ«ó«ÉªÎíÞùê if $game_party.actors.size == 0 and @command_window.index < 4 # «Ö«¶? SE ªòæÑñ´ $game_system.se_play($data_system.buzzer_se) return end # «³«Þ«ó«É«¦«£«ó«É«¦ªÎ««?«½«ëêÈöǪÇÝÂÐ÷ case @command_window.index when 0 # «¢«¤«Æ«à Input.update # ̽ïÒ SE ªòæÑñ´ $game_system.se_play($data_system.decision_se) # «¢«¤«Æ«à?ØüªËï·ªêô𪨠@menu = Scene_Item.new when 1 # «¹«­«ë # ̽ïÒ SE ªòæÑñ´ $game_system.se_play($data_system.decision_se) # «¹«Æ?«¿«¹«¦«£«ó«É«¦ªò«¢«¯«Æ«£«ÖªËª¹ªë @command_window.active = false @status_window.active = true @status_window.index = 0 when 2 # ?Ýá # ̽ïÒ SE ªòæÑñ´ $game_system.se_play($data_system.decision_se) # «¹«Æ?«¿«¹«¦«£«ó«É«¦ªò«¢«¯«Æ«£«ÖªËª¹ªë @command_window.active = false @status_window.active = true @status_window.index = 0 when 3 # «¹«Æ?«¿«¹ # ̽ïÒ SE ªòæÑñ´ $game_system.se_play($data_system.decision_se) # «¹«Æ?«¿«¹«¦«£«ó«É«¦ªò«¢«¯«Æ«£«ÖªËª¹ªë @command_window.active = false @status_window.active = true @status_window.index = 0 when 4 # «»?«Ö # «»?«ÖÐ×ò­ªÎíÞùê if $game_system.save_disabled # «Ö«¶? SE ªòæÑñ´ $game_system.se_play($data_system.buzzer_se) return end Input.update # ̽ïÒ SE ªòæÑñ´ $game_system.se_play($data_system.decision_se) # «»?«Ö?ØüªËï·ªêô𪨠@menu = Scene_Save.new when 5 # «í?«É Input.update # ̽ïÒ SE ªòæÑñ´ $game_system.se_play($data_system.decision_se) # «»?«Ö?ØüªËï·ªêô𪨠@menu = Scene_Load.new when 6 # «²?«àðûÖõ # ̽ïÒ SE ªòæÑñ´ $game_system.se_play($data_system.decision_se) # «²?«àðûÖõ?ØüªËï·ªêô𪨠$scene = Scene_End.new end return end end #-------------------------------------------------------------------------- # ¡Ü «Õ«ì?«àÌÚãæ («¹«Æ?«¿«¹«¦«£«ó«É«¦ª¬«¢«¯«Æ«£«ÖªÎíÞùê) #-------------------------------------------------------------------------- def update_status # B «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::B) # «­«ã«ó«»«ë SE ªòæÑñ´ $game_system.se_play($data_system.cancel_se) # «³«Þ«ó«É«¦«£«ó«É«¦ªò«¢«¯«Æ«£«ÖªËª¹ªë @command_window.active = true @status_window.active = false @status_window.index = -1 return end # C «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::C) # «³«Þ«ó«É«¦«£«ó«É«¦ªÎ««?«½«ëêÈöǪÇÝÂÐ÷ case @command_window.index when 1 # «¹«­«ë # ª³ªÎ«¢«¯«¿?ªÎú¼ÔÑð¤ùÚª¬ 2 ì¤ß¾ªÎíÞùê if $game_party.actors[@status_window.index].restriction >= 2 # «Ö«¶? SE ªòæÑñ´ $game_system.se_play($data_system.buzzer_se) return end Input.update # ̽ïÒ SE ªòæÑñ´ $game_system.se_play($data_system.decision_se) # «¹«­«ë?ØüªËï·ªêô𪨠@menu = Scene_Skill.new(@status_window.index) when 2 # ?Ýá Input.update # ̽ïÒ SE ªòæÑñ´ $game_system.se_play($data_system.decision_se) # ?Ýá?ØüªËï·ªêô𪨠@menu = Scene_Equip.new(@status_window.index) when 3 # «¹«Æ?«¿«¹ Input.update # ̽ïÒ SE ªòæÑñ´ $game_system.se_play($data_system.decision_se) # «¹«Æ?«¿«¹?ØüªËï·ªêô𪨠@menu = Scene_Status.new(@status_window.index) end return end end end #============================================================================== # ¡á Window_Item #------------------------------------------------------------------------------ # ¡¡«¢«¤«Æ«à?Øü¡¢«Ð«È«ë?ØüªÇ¡¢á¶ò¥«¢«¤«Æ«àªÎìé?ªòøúãƪ¹ªë«¦«£«ó«É«¦ªÇª¹¡£ #============================================================================== class Window_Item < Window_Selectable #-------------------------------------------------------------------------- # ¡Ü «ª«Ö«¸«§«¯«ÈôøÑ¢ûù #-------------------------------------------------------------------------- def initialize super(20, 106, 600, 320) self.index = 0 self.back_opacity = 192 @column_max = 2 # ??ñéªÎíÞùêªÏ«¦«£«ó«É«¦ªò?ØüñéäçªØì¹ÔѪ·¡¢Úâ÷âÙ¥ªËª¹ªë if $game_temp.in_battle self.x = 0 self.y = 64 self.width = 640 self.height = 256 else self.z = 6110 end refresh end #-------------------------------------------------------------------------- # ¡Ü ú£ÙͪÎÙÚ? # index : ú£ÙÍÛã? #-------------------------------------------------------------------------- def draw_item(index) item = @data[index] case item when RPG::Item number = $game_party.item_number(item.id) when RPG::Weapon number = $game_party.weapon_number(item.id) when RPG::Armor number = $game_party.armor_number(item.id) end if item.is_a?(RPG::Item) and $game_party.item_can_use?(item.id) self.contents.font.color = normal_color else self.contents.font.color = disabled_color end if $game_temp.in_battle x = 4 + index % 2 * (288 + 32) y = index / 2 * 32 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) bitmap = RPG::Cache.icon(item.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 212, 32, item.name, 0) self.contents.draw_text(x + 240, y, 16, 32, ":", 1) self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2) else x = 4 + index % 2 * 284 y = index / 2 * 32 rect = Rect.new(x, y, 280, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) bitmap = RPG::Cache.icon(item.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 208, 32, item.name, 0) self.contents.draw_text(x + 236, y, 16, 32, ":", 1) self.contents.draw_text(x + 252, y, 24, 32, number.to_s, 2) end end #-------------------------------------------------------------------------- # ¡Ü ««?«½«ëªÎÏ»û¡ÌÚãæ #-------------------------------------------------------------------------- def update_cursor_rect if $game_temp.in_battle super else # úÞÎú¼ªòö¢Ôð 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 if @index < 0 self.cursor_rect.empty else self.cursor_rect.set((index % 2) * 284, @index / @column_max * 32 - self.oy, 284, 32) end end end end #============================================================================== # ¡á Scene_Item #------------------------------------------------------------------------------ # ¡¡«¢«¤«Æ«à?ØüªÎ?×âªòú¼ª¦«¯«é«¹ªÇª¹¡£ #============================================================================== class Scene_Item #-------------------------------------------------------------------------- # ¡Ü «ª«Ö«¸«§«¯«ÈôøÑ¢ûù #-------------------------------------------------------------------------- def initialize # «Ø«ë«×«¦«£«ó«É«¦¡¢«¢«¤«Æ«à«¦«£«ó«É«¦ªòíÂà÷ @help_window = Window_Help2.new @item_window = Window_Item.new # «Ø«ë«×«¦«£«ó«É«¦ªò?Ö§Üõª± @item_window.help_window = @help_window $scene.command_window.active = false end #-------------------------------------------------------------------------- # ¡Ü ú°Û¯ #-------------------------------------------------------------------------- def dispose # «¦«£«ó«É«¦ªòú°Û¯ @help_window.dispose @item_window.dispose $scene.menu = nil $scene.command_window.active = true end #-------------------------------------------------------------------------- # ¡Ü «Õ«ì?«àÌÚãæ #-------------------------------------------------------------------------- def update # «¦«£«ó«É«¦ªòÌÚãæ @help_window.update @item_window.update # «¢«¤«Æ«à«¦«£«ó«É«¦ª¬«¢«¯«Æ«£«ÖªÎíÞùê: update_item ªòû¼ªÖ if @item_window.active update_item return end # «¿?«²«Ã«È«¦«£«ó«É«¦ª¬«¢«¯«Æ«£«ÖªÎíÞùê: update_target ªòû¼ªÖ if $scene.status_window.active update_target return end end #-------------------------------------------------------------------------- # ¡Ü «Õ«ì?«àÌÚãæ («¢«¤«Æ«à«¦«£«ó«É«¦ª¬«¢«¯«Æ«£«ÖªÎíÞùê) #-------------------------------------------------------------------------- def update_item # B «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::B) # «­«ã«ó«»«ë SE ªòæÑñ´ $game_system.se_play($data_system.cancel_se) dispose return end # C «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::C) # «¢«¤«Æ«à«¦«£«ó«É«¦ªÇúÞî¤àÔ?ªµªìªÆª¤ªë«Ç?«¿ªòö¢Ôð @item = @item_window.item # ÞÅéÄ«¢«¤«Æ«àªÇªÏªÊª¤íÞùê unless @item.is_a?(RPG::Item) # «Ö«¶? SE ªòæÑñ´ $game_system.se_play($data_system.buzzer_se) return end # ÞÅéĪǪ­ªÊª¤íÞùê unless $game_party.item_can_use?(@item.id) # «Ö«¶? SE ªòæÑñ´ $game_system.se_play($data_system.buzzer_se) return end # ̽ïÒ SE ªòæÑñ´ $game_system.se_play($data_system.decision_se) # ?ÍýÛô?ª¬Ú«Û°ªÎíÞùê if @item.scope >= 3 # «¿?«²«Ã«È«¦«£«ó«É«¦ªò«¢«¯«Æ«£«Öûù @item_window.active = false $scene.status_window.z = 6120 $scene.status_window.out_window.z = 6120 $scene.status_window.active = true # ?ÍýÛô? (??/îï?) ªË?ª¸ªÆ««?«½«ëêÈöǪòàâïÒ if @item.scope == 4 || @item.scope == 6 $scene.status_window.index = -2 else $scene.status_window.index = 0 end # ?ÍýÛô?ª¬Ú«Û°ì¤èâªÎíÞùê else # «³«â«ó«¤«Ù«ó«È ID ª¬êó?ªÎíÞùê if @item.common_event_id > 0 # «³«â«ó«¤«Ù«ó«Èû¼ªÓõóª·åøå³ $game_temp.common_event_id = @item.common_event_id # «¢«¤«Æ«àªÎÞÅéÄãÁ SE ªòæÑñ´ $game_system.se_play(@item.menu_se) # á¼ÙÄù¡ªÎíÞùê if @item.consumable # ÞÅéĪ·ª¿«¢«¤«Æ«àªò 1 Êõªéª¹ $game_party.lose_item(@item.id, 1) # «¢«¤«Æ«à«¦«£«ó«É«¦ªÎú£Ùͪòî¢ÙÚ? @item_window.draw_item(@item_window.index) end # «Þ«Ã«×?ØüªËï·ªêô𪨠dispose $scene = Scene_Map.new return end end return end end #-------------------------------------------------------------------------- # ¡Ü «Õ«ì?«àÌÚãæ («¿?«²«Ã«È«¦«£«ó«É«¦ª¬«¢«¯«Æ«£«ÖªÎíÞùê) #-------------------------------------------------------------------------- def update_target # B «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::B) # «­«ã«ó«»«ë SE ªòæÑñ´ $game_system.se_play($data_system.cancel_se) # «¢«¤«Æ«àï·ªìªÊªÉªÇÞÅéĪǪ­ªÊª¯ªÊªÃª¿íÞùê unless $game_party.item_can_use?(@item.id) # «¢«¤«Æ«à«¦«£«ó«É«¦ªÎ?黪òî¢íÂà÷ @item_window.refresh end # «¿?«²«Ã«È«¦«£«ó«É«¦ªòá¼ËÛ @item_window.active = true $scene.status_window.index = -1 $scene.status_window.z = 6100 $scene.status_window.out_window.z = 6100 $scene.status_window.active = false return end # C «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::C) # «¢«¤«Æ«àªòÞŪ¤ï·ªÃª¿íÞùê if $game_party.item_number(@item.id) == 0 # «Ö«¶? SE ªòæÑñ´ $game_system.se_play($data_system.buzzer_se) return end # «¿?«²«Ã«Èª¬îï?ªÎíÞùê if $scene.status_window.index < 0 # «Ñ?«Æ«£îï?ªË«¢«¤«Æ«àªÎÞÅéÄ?ÍýªòîêéÄ used = false for i in $game_party.actors used |= i.item_effect(@item) end end # «¿?«²«Ã«Èª¬??ªÎíÞùê if $scene.status_window.index >= 0 # «¿?«²«Ã«ÈªÎ«¢«¯«¿?ªË«¢«¤«Æ«àªÎÞÅéÄ?ÍýªòîêéÄ target = $game_party.actors[$scene.status_window.index] used = target.item_effect(@item) end # «¢«¤«Æ«àªòÞŪê¿íÞùê if used # «¢«¤«Æ«àªÎÞÅéÄãÁ SE ªòæÑñ´ $game_system.se_play(@item.menu_se) # á¼ÙÄù¡ªÎíÞùê if @item.consumable # ÞÅéĪ·ª¿«¢«¤«Æ«àªò 1 Êõªéª¹ $game_party.lose_item(@item.id, 1) # «¢«¤«Æ«à«¦«£«ó«É«¦ªÎú£Ùͪòî¢ÙÚ? @item_window.draw_item(@item_window.index) end # «¿?«²«Ã«È«¦«£«ó«É«¦ªÎ?黪òî¢íÂà÷ $scene.status_window.refresh # îïØþªÎíÞùê if $game_party.all_dead? # «²?«à«ª?«Ð??ØüªËï·ªêô𪨠dispose $scene = Scene_Gameover.new return end # «³«â«ó«¤«Ù«ó«È ID ª¬êó?ªÎíÞùê if @item.common_event_id > 0 # «³«â«ó«¤«Ù«ó«Èû¼ªÓõóª·åøå³ $game_temp.common_event_id = @item.common_event_id # «Þ«Ã«×?ØüªËï·ªêô𪨠dispose $scene = Scene_Map.new return end end # «¢«¤«Æ«àªòÞŪïªÊª«ªÃª¿íÞùê unless used # «Ö«¶? SE ªòæÑñ´ $game_system.se_play($data_system.buzzer_se) end return end end end #============================================================================== # ¡á Window_SkillStatus #------------------------------------------------------------------------------ # ¡¡«¹«­«ë?ØüªÇ¡¢«¹«­«ëÞÅéÄíºªÎ«¹«Æ?«¿«¹ªòøúãƪ¹ªë«¦«£«ó«É«¦ªÇª¹¡£ #============================================================================== class Window_SkillStatus < Window_Base #-------------------------------------------------------------------------- # ¡Ü «ª«Ö«¸«§«¯«ÈôøÑ¢ûù # actor : «¢«¯«¿? #-------------------------------------------------------------------------- def initialize(actor) super(20, 106, 600, 64) self.contents = Bitmap.new(width - 32, height - 32) self.z = 6110 self.back_opacity = 192 @actor = actor refresh end #-------------------------------------------------------------------------- # ¡Ü «ê«Õ«ì«Ã«·«å #-------------------------------------------------------------------------- def refresh self.contents.clear draw_actor_name(@actor, 4, 0) draw_actor_state(@actor, 148, 0, 100) draw_actor_hp(@actor, 260, 0) draw_actor_sp(@actor, 420, 0) end end #============================================================================== # ¡á Window_Skill #------------------------------------------------------------------------------ # ¡¡«¹«­«ë?Øü¡¢«Ð«È«ë?ØüªÇ¡¢ÞÅéĪǪ­ªë«¹«­«ëªÎìé?ªòøúãƪ¹ªë«¦«£«ó«É«¦ªÇª¹¡£ #============================================================================== class Window_Skill < Window_Selectable #-------------------------------------------------------------------------- # ¡Ü «ª«Ö«¸«§«¯«ÈôøÑ¢ûù # actor : «¢«¯«¿? #-------------------------------------------------------------------------- def initialize(actor) super(20, 170, 600, 256) self.back_opacity = 192 self.index = 0 @actor = actor @column_max = 2 # ??ñéªÎíÞùêªÏ«¦«£«ó«É«¦ªò?ØüñéäçªØì¹ÔѪ·¡¢Úâ÷âÙ¥ªËª¹ªë if $game_temp.in_battle self.x = 0 self.y = 64 self.width = 640 self.height = 256 else self.z = 6110 end refresh end #-------------------------------------------------------------------------- # ¡Ü ú£ÙͪÎÙÚ? # index : ú£ÙÍÛã? #-------------------------------------------------------------------------- def draw_item(index) skill = @data[index] if @actor.skill_can_use?(skill.id) self.contents.font.color = normal_color else self.contents.font.color = disabled_color end if $game_temp.in_battle x = 4 + index % 2 * (288 + 32) y = index / 2 * 32 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) bitmap = RPG::Cache.icon(skill.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0) self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2) else x = 4 + index % 2 * 284 y = index / 2 * 32 rect = Rect.new(x, y, 280, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) bitmap = RPG::Cache.icon(skill.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 200, 32, skill.name, 0) self.contents.draw_text(x + 228, y, 48, 32, skill.sp_cost.to_s, 2) end end #-------------------------------------------------------------------------- # ¡Ü «Ø«ë«×«Æ«­«¹«ÈÌÚãæ #-------------------------------------------------------------------------- def update_help @help_window.set_text(self.skill == nil ? "" : self.skill.description) end #-------------------------------------------------------------------------- # ¡Ü ««?«½«ëªÎÏ»û¡ÌÚãæ #-------------------------------------------------------------------------- def update_cursor_rect if $game_temp.in_battle super else # úÞÎú¼ªòö¢Ôð 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 if @index < 0 self.cursor_rect.empty else self.cursor_rect.set((index % 2) * 284, @index / @column_max * 32 - self.oy, 284, 32) end end end end #============================================================================== # ¡á Scene_Skill #------------------------------------------------------------------------------ # ¡¡«¹«­«ë?ØüªÎ?×âªòú¼ª¦«¯«é«¹ªÇª¹¡£ #============================================================================== class Scene_Skill #-------------------------------------------------------------------------- # ¡Ü «ª«Ö«¸«§«¯«ÈôøÑ¢ûù # actor_index : «¢«¯«¿?«¤«ó«Ç«Ã«¯«¹ #-------------------------------------------------------------------------- def initialize(actor_index = 0, equip_index = 0) @actor_index = actor_index # «¢«¯«¿?ªòö¢Ôð @actor = $game_party.actors[@actor_index] # «Ø«ë«×«¦«£«ó«É«¦¡¢«¹«Æ?«¿«¹«¦«£«ó«É«¦¡¢«¹«­«ë«¦«£«ó«É«¦ªòíÂà÷ @help_window = Window_Help2.new @status_window = Window_SkillStatus.new(@actor) @skill_window = Window_Skill.new(@actor) @skill_window.z = 6110 @skill_window.back_opacity = 160 # «Ø«ë«×«¦«£«ó«É«¦ªò?Ö§Üõª± @skill_window.help_window = @help_window $scene.command_window.active = false $scene.status_window.active = false end #-------------------------------------------------------------------------- # ¡Ü ú°Û¯ #-------------------------------------------------------------------------- def dispose # «¦«£«ó«É«¦ªòú°Û¯ @help_window.dispose @status_window.dispose @skill_window.dispose $scene.menu = nil $scene.status_window.index = -1 $scene.command_window.active = true end #-------------------------------------------------------------------------- # ¡Ü «Õ«ì?«àÌÚãæ #-------------------------------------------------------------------------- def update # «¦«£«ó«É«¦ªòÌÚãæ @help_window.update @status_window.update @skill_window.update # «¹«­«ë«¦«£«ó«É«¦ª¬«¢«¯«Æ«£«ÖªÎíÞùê: update_skill ªòû¼ªÖ if @skill_window.active update_skill return end # «¿?«²«Ã«È«¦«£«ó«É«¦ª¬«¢«¯«Æ«£«ÖªÎíÞùê: update_target ªòû¼ªÖ if $scene.status_window.active update_target return end end #-------------------------------------------------------------------------- # ¡Ü «Õ«ì?«àÌÚãæ («¹«­«ë«¦«£«ó«É«¦ª¬«¢«¯«Æ«£«ÖªÎíÞùê) #-------------------------------------------------------------------------- def update_skill # B «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::B) # «­«ã«ó«»«ë SE ªòæÑñ´ $game_system.se_play($data_system.cancel_se) # «á«Ë«å??ØüªËï·ªêô𪨠dispose return end # C «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::C) # «¹«­«ë«¦«£«ó«É«¦ªÇúÞî¤àÔ?ªµªìªÆª¤ªë«Ç?«¿ªòö¢Ôð @skill = @skill_window.skill # ÞÅéĪǪ­ªÊª¤íÞùê if @skill == nil or not @actor.skill_can_use?(@skill.id) # «Ö«¶? SE ªòæÑñ´ $game_system.se_play($data_system.buzzer_se) return end # ̽ïÒ SE ªòæÑñ´ $game_system.se_play($data_system.decision_se) # ?ÍýÛô?ª¬Ú«Û°ªÎíÞùê if @skill.scope >= 3 # «¿?«²«Ã«È«¦«£«ó«É«¦ªò«¢«¯«Æ«£«Öûù @skill_window.active = false $scene.status_window.z = 6120 $scene.status_window.out_window.z = 6120 $scene.status_window.active = true # ?ÍýÛô? (??/îï?) ªË?ª¸ªÆ««?«½«ëêÈöǪòàâïÒ if @skill.scope == 4 || @skill.scope == 6 $scene.status_window.index = -2 elsif @skill.scope == 7 $scene.status_window.index = @actor_index - 10 else $scene.status_window.index = 0 end # ?ÍýÛô?ª¬Ú«Û°ì¤èâªÎíÞùê else # «³«â«ó«¤«Ù«ó«È ID ª¬êó?ªÎíÞùê if @skill.common_event_id > 0 # «³«â«ó«¤«Ù«ó«Èû¼ªÓõóª·åøå³ $game_temp.common_event_id = @skill.common_event_id # «¹«­«ëªÎÞÅéÄãÁ SE ªòæÑñ´ $game_system.se_play(@skill.menu_se) # SP á¼Þ¨ @actor.sp -= @skill.sp_cost # ÊÀ«¦«£«ó«É«¦ªÎ?黪òî¢íÂà÷ @status_window.refresh @skill_window.refresh $scene.status_window.refresh # «Þ«Ã«×?ØüªËï·ªêô𪨠dispose return end end return end # R «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::R) # ««?«½«ë SE ªòæÑñ´ $game_system.se_play($data_system.cursor_se) # ó­ªÎ«¢«¯«¿?ªØ @actor_index += 1 @actor_index %= $game_party.actors.size @actor = $game_party.actors[@actor_index] dispose $scene.status_window.index = @actor.index $scene.menu = Scene_Skill.new(@actor.index) return end # L «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::L) # ««?«½«ë SE ªòæÑñ´ $game_system.se_play($data_system.cursor_se) # îñªÎ«¢«¯«¿?ªØ @actor_index += $game_party.actors.size - 1 @actor_index %= $game_party.actors.size @actor = $game_party.actors[@actor_index] dispose $scene.status_window.index = @actor.index $scene.menu = Scene_Skill.new(@actor.index) return end end #-------------------------------------------------------------------------- # ¡Ü «Õ«ì?«àÌÚãæ («¿?«²«Ã«È«¦«£«ó«É«¦ª¬«¢«¯«Æ«£«ÖªÎíÞùê) #-------------------------------------------------------------------------- def update_target # B «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::B) # «­«ã«ó«»«ë SE ªòæÑñ´ $game_system.se_play($data_system.cancel_se) # «¿?«²«Ã«È«¦«£«ó«É«¦ªòá¼ËÛ @skill_window.active = true $scene.status_window.index = @actor.index $scene.status_window.z = 6100 $scene.status_window.out_window.z = 6100 $scene.status_window.active = false return end # C «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::C) # SP ï·ªìªÊªÉªÇÞÅéĪǪ­ªÊª¯ªÊªÃª¿íÞùê unless @actor.skill_can_use?(@skill.id) # «Ö«¶? SE ªòæÑñ´ $game_system.se_play($data_system.buzzer_se) return end # «¿?«²«Ã«Èª¬îï?ªÎíÞùê if $scene.status_window.index == -2 # «Ñ?«Æ«£îï?ªË«¹«­«ëªÎÞÅéÄ?ÍýªòîêéÄ used = false for i in $game_party.actors used |= i.skill_effect(@actor, @skill) end end # «¿?«²«Ã«Èª¬ÞÅéÄíºªÎíÞùê if $scene.status_window.index < -2 # «¿?«²«Ã«ÈªÎ«¢«¯«¿?ªË«¹«­«ëªÎÞÅéÄ?ÍýªòîêéÄ target = $game_party.actors[$scene.status_window.index + 10] used = target.skill_effect(@actor, @skill) end # «¿?«²«Ã«Èª¬??ªÎíÞùê if $scene.status_window.index >= 0 # «¿?«²«Ã«ÈªÎ«¢«¯«¿?ªË«¹«­«ëªÎÞÅéÄ?ÍýªòîêéÄ target = $game_party.actors[$scene.status_window.index] used = target.skill_effect(@actor, @skill) end # «¹«­«ëªòÞŪê¿íÞùê if used # «¹«­«ëªÎÞÅéÄãÁ SE ªòæÑñ´ $game_system.se_play(@skill.menu_se) # SP á¼Þ¨ @actor.sp -= @skill.sp_cost # ÊÀ«¦«£«ó«É«¦ªÎ?黪òî¢íÂà÷ @status_window.refresh @skill_window.refresh $scene.status_window.refresh # îïØþªÎíÞùê if $game_party.all_dead? # «²?«à«ª?«Ð??ØüªËï·ªêô𪨠$scene = Scene_Gameover.new return end # «³«â«ó«¤«Ù«ó«È ID ª¬êó?ªÎíÞùê if @skill.common_event_id > 0 # «³«â«ó«¤«Ù«ó«Èû¼ªÓõóª·åøå³ $game_temp.common_event_id = @skill.common_event_id # «Þ«Ã«×?ØüªËï·ªêô𪨠$scene = Scene_Map.new return end end # «¹«­«ëªòÞŪïªÊª«ªÃª¿íÞùê unless used # «Ö«¶? SE ªòæÑñ´ $game_system.se_play($data_system.buzzer_se) end return end end end #============================================================================== # ¡á Window_Status #------------------------------------------------------------------------------ # ¡¡«¹«Æ?«¿«¹?ØüªÇøúãƪ¹ªë¡¢«Õ«ëÞÂ?ªÎ«¹«Æ?«¿«¹«¦«£«ó«É«¦ªÇª¹¡£ #============================================================================== class Window_Status < Window_Base #-------------------------------------------------------------------------- # ¡Ü «ª«Ö«¸«§«¯«ÈôøÑ¢ûù # actor : «¢«¯«¿? #-------------------------------------------------------------------------- def initialize(actor) super(20, 40, 600, 400) self.z = 6110 self.contents = Bitmap.new(width - 32, height - 32) self.back_opacity = 192 @actor = actor refresh end #-------------------------------------------------------------------------- # ¡Ü «ê«Õ«ì«Ã«·«å #-------------------------------------------------------------------------- def refresh self.contents.clear draw_actor_graphic(@actor, 44, 96) draw_actor_battler(@actor, 426, 368) draw_actor_name(@actor, 24, 0) draw_actor_class(@actor, 24 + 144, 0) draw_actor_level(@actor, 320, 16) draw_actor_state(@actor, 320, 48) draw_actor_hp(@actor, 68, 32, 172) draw_actor_sp(@actor, 68, 64, 172) draw_actor_parameter(@actor, 68, 112, 0) draw_actor_parameter(@actor, 68, 144, 1) draw_actor_parameter(@actor, 68, 176, 2) draw_actor_parameter(@actor, 68, 224, 3) draw_actor_parameter(@actor, 68, 256, 4) draw_actor_parameter(@actor, 68, 288, 5) draw_actor_parameter(@actor, 68, 320, 6) self.contents.font.color = system_color self.contents.draw_text(304, 96, 80, 32, "EXP") self.contents.draw_text(304, 128, 80, 32, "NEXT") self.contents.font.color = normal_color self.contents.draw_text(304 + 80, 96, 84, 32, @actor.exp_s, 2) self.contents.draw_text(304 + 80, 128, 84, 32, @actor.next_rest_exp_s, 2) self.contents.font.color = system_color self.contents.draw_text(304, 176, 96, 32, "Àåºñ") draw_item_name($data_weapons[@actor.weapon_id], 304 + 16, 208) draw_item_name($data_armors[@actor.armor1_id], 304 + 16, 240) draw_item_name($data_armors[@actor.armor2_id], 304 + 16, 272) draw_item_name($data_armors[@actor.armor3_id], 304 + 16, 304) draw_item_name($data_armors[@actor.armor4_id], 304 + 16, 336) end end #============================================================================== # ¡á Scene_Status #------------------------------------------------------------------------------ # ¡¡«¹«Æ?«¿«¹?ØüªÎ?×âªòú¼ª¦«¯«é«¹ªÇª¹¡£ #============================================================================== class Scene_Status #-------------------------------------------------------------------------- # ¡Ü «ª«Ö«¸«§«¯«ÈôøÑ¢ûù # actor_index : «¢«¯«¿?«¤«ó«Ç«Ã«¯«¹ #-------------------------------------------------------------------------- def initialize(actor_index = 0, equip_index = 0) @actor_index = actor_index # «¢«¯«¿?ªòö¢Ôð @actor = $game_party.actors[@actor_index] # «¹«Æ?«¿«¹«¦«£«ó«É«¦ªòíÂà÷ @status_window = Window_Status.new(@actor) $scene.command_window.active = false $scene.status_window.active = false end #-------------------------------------------------------------------------- # ¡Ü ú°Û¯ #-------------------------------------------------------------------------- def dispose # «¦«£«ó«É«¦ªòú°Û¯ @status_window.dispose $scene.menu = nil $scene.status_window.index = -1 $scene.command_window.active = true end #-------------------------------------------------------------------------- # ¡Ü «Õ«ì?«àÌÚãæ #-------------------------------------------------------------------------- def update # B «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::B) # «­«ã«ó«»«ë SE ªòæÑñ´ $game_system.se_play($data_system.cancel_se) # «á«Ë«å??ØüªËï·ªêô𪨠dispose return end # R «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::RIGHT) or Input.trigger?(Input::R) # ««?«½«ë SE ªòæÑñ´ $game_system.se_play($data_system.cursor_se) # ó­ªÎ«¢«¯«¿?ªØ @actor_index += 1 @actor_index %= $game_party.actors.size @actor = $game_party.actors[@actor_index] dispose # ܬªÎ«¹«Æ?«¿«¹?ØüªËï·ªêô𪨠$scene.status_window.index = @actor.index $scene.menu = Scene_Status.new(@actor.index) return end # L «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::LEFT) or Input.trigger?(Input::L) # ««?«½«ë SE ªòæÑñ´ $game_system.se_play($data_system.cursor_se) # îñªÎ«¢«¯«¿?ªØ @actor_index += $game_party.actors.size - 1 @actor_index %= $game_party.actors.size @actor = $game_party.actors[@actor_index] dispose # ܬªÎ«¹«Æ?«¿«¹?ØüªËï·ªêô𪨠$scene.status_window.index = @actor.index $scene.menu = Scene_Status.new(@actor.index) return end end end #============================================================================== # ¡á Window_EquipLeft #------------------------------------------------------------------------------ # ¡¡?Ýá?ØüªÇ¡¢«¢«¯«¿?ªÎ«Ñ«é«á?«¿?ûùªòøúãƪ¹ªë«¦«£«ó«É«¦ªÇª¹¡£ #============================================================================== class Window_EquipLeft < Window_Base #-------------------------------------------------------------------------- # ¡Ü «ª«Ö«¸«§«¯«ÈôøÑ¢ûù # actor : «¢«¯«¿? #-------------------------------------------------------------------------- def initialize(actor) super(20, 106, 264, 192) self.z = 6110 self.back_opacity = 192 self.contents = Bitmap.new(width - 32, height - 32) @actor = actor refresh end #-------------------------------------------------------------------------- # ¡Ü «ê«Õ«ì«Ã«·«å #-------------------------------------------------------------------------- def refresh self.contents.clear draw_actor_graphic(@actor, 28, 64) draw_actor_name(@actor, 52, 0) draw_actor_level(@actor, 68, 32) draw_actor_parameter(@actor, 4, 64, 0) draw_actor_parameter(@actor, 4, 96, 1) draw_actor_parameter(@actor, 4, 128, 2) if @new_atk != nil self.contents.font.color = system_color self.contents.draw_text(160, 64, 40, 32, "¡æ", 1) self.contents.font.color = normal_color self.contents.draw_text(192, 64, 36, 32, @new_atk.to_s, 2) end if @new_pdef != nil self.contents.font.color = system_color self.contents.draw_text(160, 96, 40, 32, "¡æ", 1) self.contents.font.color = normal_color self.contents.draw_text(192, 96, 36, 32, @new_pdef.to_s, 2) end if @new_mdef != nil self.contents.font.color = system_color self.contents.draw_text(160, 128, 40, 32, "¡æ", 1) self.contents.font.color = normal_color self.contents.draw_text(192, 128, 36, 32, @new_mdef.to_s, 2) end end end #============================================================================== # ¡á Window_EquipRight #------------------------------------------------------------------------------ # ¡¡?Ýá?ØüªÇ¡¢«¢«¯«¿?ª¬úÞî¤?Ý᪷ªÆª¤ªë«¢«¤«Æ«àªòøúãƪ¹ªë«¦«£«ó«É«¦ªÇª¹¡£ #============================================================================== class Window_EquipRight < Window_Selectable #-------------------------------------------------------------------------- # ¡Ü «ª«Ö«¸«§«¯«ÈôøÑ¢ûù # actor : «¢«¯«¿? #-------------------------------------------------------------------------- def initialize(actor) super(284, 106, 336, 192) self.z = 6110 self.back_opacity = 192 self.contents = Bitmap.new(width - 32, height - 32) @actor = actor refresh self.index = 0 end #-------------------------------------------------------------------------- # ¡Ü «ê«Õ«ì«Ã«·«å #-------------------------------------------------------------------------- def refresh self.contents.clear @data = [] @data.push($data_weapons[@actor.weapon_id]) @data.push($data_armors[@actor.armor1_id]) @data.push($data_armors[@actor.armor2_id]) @data.push($data_armors[@actor.armor3_id]) @data.push($data_armors[@actor.armor4_id]) @item_max = @data.size self.contents.font.color = system_color self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon) self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1) self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2) self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3) self.contents.draw_text(5, 32 * 4, 92, 32, $data_system.words.armor4) draw_item_name(@data[0], 92, 32 * 0, 202) draw_item_name(@data[1], 92, 32 * 1, 202) draw_item_name(@data[2], 92, 32 * 2, 202) draw_item_name(@data[3], 92, 32 * 3, 202) draw_item_name(@data[4], 92, 32 * 4, 202) end end #============================================================================== # ¡á Window_EquipItem #------------------------------------------------------------------------------ # ¡¡?Ýá?ØüªÇ¡¢?Ýá?ÌÚªÎý¦ÜͪȪʪ뫢«¤«Æ«àªÎìé?ªòøúãƪ¹ªë«¦«£«ó«É«¦ªÇª¹¡£ #============================================================================== class Window_EquipItem < Window_Selectable #-------------------------------------------------------------------------- # ¡Ü «ª«Ö«¸«§«¯«ÈôøÑ¢ûù # actor : «¢«¯«¿? # equip_type : ?ÝáÝ»êÈ (0¢¦3) #-------------------------------------------------------------------------- def initialize(actor, equip_type) super(20, 298, 600, 128) self.z = 6110 self.back_opacity = 192 @actor = actor @equip_type = equip_type @column_max = 2 refresh self.active = false self.index = -1 end #-------------------------------------------------------------------------- # ¡Ü ú£ÙͪÎÙÚ? # index : ú£ÙÍÛã? #-------------------------------------------------------------------------- def draw_item(index) item = @data[index] x = 4 + index % 2 * 281 y = index / 2 * 32 case item when RPG::Weapon number = $game_party.weapon_number(item.id) when RPG::Armor number = $game_party.armor_number(item.id) end bitmap = RPG::Cache.icon(item.icon_name) self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24)) self.contents.font.color = normal_color self.contents.draw_text(x + 28, y, 208, 32, item.name, 0) self.contents.draw_text(x + 236, y, 16, 32, ":", 1) self.contents.draw_text(x + 252, y, 24, 32, number.to_s, 2) end #-------------------------------------------------------------------------- # ¡Ü ««?«½«ëªÎÏ»û¡ÌÚãæ #-------------------------------------------------------------------------- def update_cursor_rect if $game_temp.in_battle super else # úÞÎú¼ªòö¢Ôð 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 if @index < 0 self.cursor_rect.empty else self.cursor_rect.set((index % 2) * 284, @index / @column_max * 32 - self.oy, 284, 32) end end end end #============================================================================== # ¡á Scene_Equip #------------------------------------------------------------------------------ # ¡¡?Ýá?ØüªÎ?×âªòú¼ª¦«¯«é«¹ªÇª¹¡£ #============================================================================== class Scene_Equip #-------------------------------------------------------------------------- # ¡Ü «ª«Ö«¸«§«¯«ÈôøÑ¢ûù # actor_index : «¢«¯«¿?«¤«ó«Ç«Ã«¯«¹ # equip_index : ?Ý᫤«ó«Ç«Ã«¯«¹ #-------------------------------------------------------------------------- def initialize(actor_index = 0, equip_index = 0) @actor_index = actor_index @equip_index = equip_index # «¢«¯«¿?ªòö¢Ôð @actor = $game_party.actors[@actor_index] # «¦«£«ó«É«¦ªòíÂà÷ @help_window = Window_Help2.new @left_window = Window_EquipLeft.new(@actor) @right_window = Window_EquipRight.new(@actor) @item_window1 = Window_EquipItem.new(@actor, 0) @item_window2 = Window_EquipItem.new(@actor, 1) @item_window3 = Window_EquipItem.new(@actor, 2) @item_window4 = Window_EquipItem.new(@actor, 3) @item_window5 = Window_EquipItem.new(@actor, 4) # «Ø«ë«×«¦«£«ó«É«¦ªò?Ö§Üõª± @right_window.help_window = @help_window @item_window1.help_window = @help_window @item_window2.help_window = @help_window @item_window3.help_window = @help_window @item_window4.help_window = @help_window @item_window5.help_window = @help_window # ««?«½«ëêÈöǪòàâïÒ @right_window.index = @equip_index $scene.command_window.active = false $scene.status_window.active = false refresh end #-------------------------------------------------------------------------- # ¡Ü ú°Û¯ #-------------------------------------------------------------------------- def dispose # «¦«£«ó«É«¦ªòú°Û¯ @help_window.dispose @left_window.dispose @right_window.dispose @item_window1.dispose @item_window2.dispose @item_window3.dispose @item_window4.dispose @item_window5.dispose $scene.menu = nil $scene.status_window.index = -1 $scene.command_window.active = true end #-------------------------------------------------------------------------- # ¡Ü «ê«Õ«ì«Ã«·«å #-------------------------------------------------------------------------- def refresh # «¢«¤«Æ«à«¦«£«ó«É«¦ªÎʦãÊ?÷¾àâïÒ @item_window1.visible = (@right_window.index == 0) @item_window2.visible = (@right_window.index == 1) @item_window3.visible = (@right_window.index == 2) @item_window4.visible = (@right_window.index == 3) @item_window5.visible = (@right_window.index == 4) # úÞî¤?ÝáñéªÎ«¢«¤«Æ«àªòö¢Ôð item1 = @right_window.item # úÞΫ¢«¤«Æ«à«¦«£«ó«É«¦ªò @item_window ªËàâïÒ case @right_window.index when 0 @item_window = @item_window1 when 1 @item_window = @item_window2 when 2 @item_window = @item_window3 when 3 @item_window = @item_window4 when 4 @item_window = @item_window5 end # «é«¤«È«¦«£«ó«É«¦ª¬«¢«¯«Æ«£«ÖªÎíÞùê if @right_window.active # ?Ýá?ÌÚý­ªÎ«Ñ«é«á?«¿ªòá¼ËÛ @left_window.set_new_parameters(nil, nil, nil) end # «¢«¤«Æ«à«¦«£«ó«É«¦ª¬«¢«¯«Æ«£«ÖªÎíÞùê if @item_window.active # úÞî¤àÔ?ñéªÎ«¢«¤«Æ«àªòö¢Ôð item2 = @item_window.item # ?Ýáªò?ÌÚ last_hp = @actor.hp last_sp = @actor.sp @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id) # ?Ýá?ÌÚý­ªÎ«Ñ«é«á?«¿ªòö¢Ôð new_atk = @actor.atk new_pdef = @actor.pdef new_mdef = @actor.mdef # ?Ýáªò?ª¹ @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id) @actor.hp = last_hp @actor.sp = last_sp # «ì«Õ«È«¦«£«ó«É«¦ªËÙÚ? @left_window.set_new_parameters(new_atk, new_pdef, new_mdef) end end #-------------------------------------------------------------------------- # ¡Ü «Õ«ì?«àÌÚãæ #-------------------------------------------------------------------------- def update # «¦«£«ó«É«¦ªòÌÚãæ @left_window.update @right_window.update @item_window.update refresh # «é«¤«È«¦«£«ó«É«¦ª¬«¢«¯«Æ«£«ÖªÎíÞùê: update_right ªòû¼ªÖ if @right_window.active update_right return end # «¢«¤«Æ«à«¦«£«ó«É«¦ª¬«¢«¯«Æ«£«ÖªÎíÞùê: update_item ªòû¼ªÖ if @item_window.active update_item return end end #-------------------------------------------------------------------------- # ¡Ü «Õ«ì?«àÌÚãæ («é«¤«È«¦«£«ó«É«¦ª¬«¢«¯«Æ«£«ÖªÎíÞùê) #-------------------------------------------------------------------------- def update_right # B «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::B) # «­«ã«ó«»«ë SE ªòæÑñ´ $game_system.se_play($data_system.cancel_se) # «á«Ë«å??ØüªËï·ªêô𪨠dispose return end # C «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::C) # ?ÝáͳïÒªÎíÞùê if @actor.equip_fix?(@right_window.index) # «Ö«¶? SE ªòæÑñ´ $game_system.se_play($data_system.buzzer_se) return end # ̽ïÒ SE ªòæÑñ´ $game_system.se_play($data_system.decision_se) # «¢«¤«Æ«à«¦«£«ó«É«¦ªò«¢«¯«Æ«£«Öûù @right_window.active = false @item_window.active = true @item_window.index = 0 return end # R «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::RIGHT) or Input.trigger?(Input::R) # ««?«½«ë SE ªòæÑñ´ $game_system.se_play($data_system.cursor_se) # ó­ªÎ«¢«¯«¿?ªØ @actor_index += 1 @actor_index %= $game_party.actors.size @actor = $game_party.actors[@actor_index] dispose # ܬªÎ?Ýá?ØüªËï·ªêô𪨠$scene.status_window.index = @actor.index $scene.menu = Scene_Equip.new(@actor_index, @right_window.index) return end # L «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::LEFT) or Input.trigger?(Input::L) # ««?«½«ë SE ªòæÑñ´ $game_system.se_play($data_system.cursor_se) # îñªÎ«¢«¯«¿?ªØ @actor_index += $game_party.actors.size - 1 @actor_index %= $game_party.actors.size @actor = $game_party.actors[@actor_index] dispose # ܬªÎ?Ýá?ØüªËï·ªêô𪨠$scene.status_window.index = @actor.index $scene.menu = Scene_Equip.new(@actor_index, @right_window.index) return end end #-------------------------------------------------------------------------- # ¡Ü «Õ«ì?«àÌÚãæ («¢«¤«Æ«à«¦«£«ó«É«¦ª¬«¢«¯«Æ«£«ÖªÎíÞùê) #-------------------------------------------------------------------------- def update_item # B «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::B) # «­«ã«ó«»«ë SE ªòæÑñ´ $game_system.se_play($data_system.cancel_se) # «é«¤«È«¦«£«ó«É«¦ªò«¢«¯«Æ«£«Öûù @right_window.active = true @item_window.active = false @item_window.index = -1 return end # C «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::C) # ?Ýá SE ªòæÑñ´ $game_system.se_play($data_system.equip_se) # «¢«¤«Æ«à«¦«£«ó«É«¦ªÇúÞî¤àÔ?ªµªìªÆª¤ªë«Ç?«¿ªòö¢Ôð item = @item_window.item # ?Ýáªò?ÌÚ @actor.equip(@right_window.index, item == nil ? 0 : item.id) # «é«¤«È«¦«£«ó«É«¦ªò«¢«¯«Æ«£«Öûù @right_window.active = true @item_window.active = false @item_window.index = -1 # «é«¤«È«¦«£«ó«É«¦¡¢«¢«¤«Æ«à«¦«£«ó«É«¦ªÎ?黪òî¢íÂà÷ @right_window.refresh @item_window.refresh $scene.status_window.refresh return end end end #============================================================================== # ¡á Scene_Title #------------------------------------------------------------------------------ # ¡¡«¿«¤«È«ë?ØüªÎ?×âªòú¼ª¦«¯«é«¹ªÇª¹¡£ #============================================================================== class Scene_Title #-------------------------------------------------------------------------- # ¡Ü ÍëËÒ«¤«ó«¹«¿«ó«¹?? #-------------------------------------------------------------------------- attr_accessor :menu # úÞ«¦«£«ó«É«¦ attr_accessor :command_window # «³«Þ«ó«É«¦«£«ó«É«¦ #-------------------------------------------------------------------------- # ¡Ü «ª«Ö«¸«§«¯«ÈôøÑ¢ûù #-------------------------------------------------------------------------- def initialize @menu = nil end #-------------------------------------------------------------------------- # ¡Ü «Õ«ì?«àÌÚãæ #-------------------------------------------------------------------------- alias :update_original :update def update update_original if @menu != nil @menu.update end end #-------------------------------------------------------------------------- # ¡Ü «³«Þ«ó«É : «³«ó«Æ«£«Ë«å? #-------------------------------------------------------------------------- def command_continue if @menu != nil return end # «³«ó«Æ«£«Ë«å?ª¬Ùí?ªÎíÞùê unless @continue_enabled # «Ö«¶? SE ªòæÑñ´ $game_system.se_play($data_system.buzzer_se) return end Input.update # ̽ïÒ SE ªòæÑñ´ $game_system.se_play($data_system.decision_se) # «í?«É?ØüªËï·ªêô𪨠@menu = Scene_Load.new end #-------------------------------------------------------------------------- # ¡Ü «³«Þ«ó«É : «·«ã«Ã«È«À«¦«ó #-------------------------------------------------------------------------- def command_shutdown # ̽ïÒ SE ªòæÑñ´ $game_system.se_play($data_system.decision_se) # BGM¡¢BGS¡¢ME ªò«Õ«§?«É«¢«¦«È Audio.bgm_fade(800) Audio.bgs_fade(800) Audio.me_fade(800) # «·«ã«Ã«È«À«¦«ó $scene = nil end #-------------------------------------------------------------------------- # ¡Ü ??«Æ«¹«È #-------------------------------------------------------------------------- def battle_test # «Ç?«¿«Ù?«¹ (??«Æ«¹«ÈéÄ) ªò«í?«É $data_actors = load_data("Data/BT_Actors.rxdata") $data_classes = load_data("Data/BT_Classes.rxdata") $data_skills = load_data("Data/BT_Skills.rxdata") $data_items = load_data("Data/BT_Items.rxdata") $data_weapons = load_data("Data/BT_Weapons.rxdata") $data_armors = load_data("Data/BT_Armors.rxdata") $data_enemies = load_data("Data/BT_Enemies.rxdata") $data_troops = load_data("Data/BT_Troops.rxdata") $data_states = load_data("Data/BT_States.rxdata") $data_animations = load_data("Data/BT_Animations.rxdata") $data_tilesets = load_data("Data/BT_Tilesets.rxdata") $data_common_events = load_data("Data/BT_CommonEvents.rxdata") $data_system = load_data("Data/BT_System.rxdata") # «×«ì«¤ãÁÊàͪö´éĪΫիì?«à«««¦«ó«Èªò«ê«»«Ã«È Graphics.frame_count = 0 # ÊÀðú«²?«à«ª«Ö«¸«§«¯«ÈªòíÂà÷ $game_temp = Game_Temp.new $game_system = Game_System.new $game_switches = Game_Switches.new $game_variables = Game_Variables.new $game_self_switches = Game_SelfSwitches.new $game_screen = Game_Screen.new $game_actors = Game_Actors.new $game_party = Game_Party.new $game_troop = Game_Troop.new $game_map = Game_Map.new $game_player = Game_Player.new # ??«Æ«¹«ÈéĪΫÑ?«Æ«£ªò«»«Ã«È«¢«Ã«× $game_party.setup_battle_test_members # «È«ë?«× ID¡¢Ô±ñËʦÒö«Õ«é«°¡¢«Ð«È«ë«Ð«Ã«¯ªòàâïÒ $game_temp.battle_troop_id = $data_system.test_troop_id $game_temp.battle_can_escape = true $game_map.battleback_name = $data_system.battleback_name # «Ð«È«ëËÒã· SE ªòæÑñ´ $game_system.se_play($data_system.battle_start_se) # «Ð«È«ë BGM ªòæÑñ´ $game_system.bgm_play($game_system.battle_bgm) # «Ð«È«ë?ØüªËï·ªêô𪨠$scene = Scene_Battle.new end end #============================================================================== # ¡á Window_SaveFile #------------------------------------------------------------------------------ # ¡¡«»?«Ö?ØüªªªèªÓ«í?«É?ØüªÇøúãƪ¹ªë¡¢«»?«Ö«Õ«¡«¤«ëªÎ«¦«£«ó«É«¦ªÇª¹¡£ #============================================================================== class Window_SaveFile < Window_Base #-------------------------------------------------------------------------- # ¡Ü ÍëËÒ«¤«ó«¹«¿«ó«¹?? #-------------------------------------------------------------------------- attr_reader :filename # «Õ«¡«¤«ëÙ£ attr_reader :selected # àÔ??÷¾ #-------------------------------------------------------------------------- # ¡Ü «ª«Ö«¸«§«¯«ÈôøÑ¢ûù # file_index : «»?«Ö«Õ«¡«¤«ëªÎ«¤«ó«Ç«Ã«¯«¹ (0¢¦3) # filename : «Õ«¡«¤«ëÙ£ #-------------------------------------------------------------------------- def initialize(file_index, filename) super(file_index % 2 * 320, 106 + file_index / 2 * 104, 320, 104) self.contents = Bitmap.new(width - 32, height - 32) self.z = 6110 self.back_opacity = 192 @file_index = file_index @filename = "Save#{@file_index + 1}.rxdata" @time_stamp = Time.at(0) @file_exist = FileTest.exist?(@filename) if @file_exist file = File.open(@filename, "r") @time_stamp = file.mtime @characters = Marshal.load(file) @frame_count = Marshal.load(file) @game_system = Marshal.load(file) @game_switches = Marshal.load(file) @game_variables = Marshal.load(file) @total_sec = @frame_count / Graphics.frame_rate file.close end refresh @selected = false end #-------------------------------------------------------------------------- # ¡Ü «ê«Õ«ì«Ã«·«å #-------------------------------------------------------------------------- def refresh self.contents.clear # «Õ«¡«¤«ëÛã?ªòÙÚ? self.contents.font.color = normal_color name = "¼¼À̺ê ÆÄÀÏ #{@file_index + 1}" self.contents.draw_text(4, 0, 600, 32, name) @name_width = contents.text_size(name).width # «»?«Ö«Õ«¡«¤«ëª¬ðí¹ªëíÞùê if @file_exist # «­«ã«é«¯«¿?ªòÙÚ? for i in 0...@characters.size bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1]) cw = bitmap.rect.width / 4 ch = bitmap.rect.height / 4 src_rect = Rect.new(0, 0, cw, ch) x = 160 - @characters.size * 32 + i * 64 - cw / 2 self.contents.blt(x, 68 - ch, bitmap, src_rect) end # «×«ì«¤ãÁÊàªòÙÚ? hour = @total_sec / 60 / 60 min = @total_sec / 60 % 60 sec = @total_sec % 60 time_string = sprintf("%02d:%02d:%02d", hour, min, sec) self.contents.font.color = normal_color self.contents.draw_text(4, 8, 280, 32, time_string, 2) # «¿«¤«à«¹«¿«ó«×ªòÙÚ? self.contents.font.color = normal_color time_string = @time_stamp.strftime("%Y/%m/%d %H:%M") self.contents.draw_text(4, 40, 280, 32, time_string, 2) end end #-------------------------------------------------------------------------- # ¡Ü àÔ??÷¾ªÎàâïÒ # selected : ã檷ª¤àÔ??÷¾ (true=àÔ? false=ÞªàÔ?) #-------------------------------------------------------------------------- def selected=(selected) @selected = selected update_cursor_rect end #-------------------------------------------------------------------------- # ¡Ü ««?«½«ëªÎÏ»û¡ÌÚãæ #-------------------------------------------------------------------------- def update_cursor_rect if @selected self.cursor_rect.set(0, 0, @name_width + 8, 32) else self.cursor_rect.empty end end end #============================================================================== # ¡á Scene_File #------------------------------------------------------------------------------ # ¡¡«»?«Ö?ØüªªªèªÓ«í?«É?ØüªÎ«¹?«Ñ?«¯«é«¹ªÇª¹¡£ #============================================================================== class Scene_File #-------------------------------------------------------------------------- # ¡Ü «ª«Ö«¸«§«¯«ÈôøÑ¢ûù # help_text : «Ø«ë«×«¦«£«ó«É«¦ªËøúãƪ¹ªëÙþí®Öª #-------------------------------------------------------------------------- def initialize(help_text) @help_text = help_text # «Ø«ë«×«¦«£«ó«É«¦ªòíÂà÷ @help_window = Window_Help2.new @help_window.set_text(@help_text) # «»?«Ö«Õ«¡«¤«ë«¦«£«ó«É«¦ªòíÂà÷ @savefile_windows = [] for i in 0..5 @savefile_windows.push(Window_SaveFile.new(i, make_filename(i))) end # õÌý­ªËðÃíª·ª¿«Õ«¡«¤«ëªòàÔ? @file_index = $game_temp.last_file_index @savefile_windows[@file_index].selected = true # «á«Ë«å?ª«ªéû¼ªÓõ󪵪ìªÆª¤ªëíÞùê unless $game_temp.save_calling $scene.command_window.active = false end end #-------------------------------------------------------------------------- # ¡Ü ú°Û¯ #-------------------------------------------------------------------------- def dispose # «¦«£«ó«É«¦ªòú°Û¯ @help_window.dispose for i in @savefile_windows i.dispose end # «á«Ë«å?ª«ªéû¼ªÓõ󪵪ìªÆª¤ªëíÞùê unless $game_temp.save_calling $scene.menu = nil $scene.command_window.active = true end end #-------------------------------------------------------------------------- # ¡Ü «á«¤«ó?×â #-------------------------------------------------------------------------- def main # «¹«×«é«¤«È«»«Ã«ÈªòíÂà÷ @spriteset = Spriteset_Map.new # õÌý­ªËðÃíª·ª¿«Õ«¡«¤«ëªòàÔ? @file_index = $game_temp.last_file_index @savefile_windows[@file_index].selected = true # «È«é«ó«¸«·«ç«ó?ú¼ Graphics.transition(0) # «á«¤«ó«ë?«× loop do # «²?«à?ØüªòÌÚãæ Graphics.update # ìýÕôï×ÜêòÌÚãæ Input.update # «Õ«ì?«àÌÚãæ update @spriteset.update # ?Øüª¬ï·ªêôðªïªÃª¿ªé«ë?«×ªòñé? if $scene != self break end end # «È«é«ó«¸«·«ç«óñÞÝá Graphics.freeze # «¹«×«é«¤«È«»«Ã«Èªòú°Û¯ @spriteset.dispose end #-------------------------------------------------------------------------- # ¡Ü «Õ«ì?«àÌÚãæ #-------------------------------------------------------------------------- def update # «¦«£«ó«É«¦ªòÌÚãæ @help_window.update for i in @savefile_windows i.update end # C «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::C) # «á«½«Ã«É on_decision (?ã¯à»ªÇïÒëù) ªòû¼ªÖ on_decision(make_filename(@file_index)) $game_temp.last_file_index = @file_index return end # B «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::B) # «á«½«Ã«É on_cancel (?ã¯à»ªÇïÒëù) ªòû¼ªÖ on_cancel return end # Û°ú¾«Ü«¿«óªÎù»ª¬ä㪵ªìª¿íÞùê if Input.repeat?(Input::DOWN) # Û°ú¾«Ü«¿«óªÎù»ªÎäãù»?÷¾ª¬«ê«Ô?«ÈªÇªÊª¤íÞùê if Input.trigger?(Input::DOWN) or @file_index < 4 # ««?«½«ë SE ªòæÑñ´ $game_system.se_play($data_system.cursor_se) # ««?«½«ëªòù»ªËì¹ÔÑ @savefile_windows[@file_index].selected = false @file_index = (@file_index + 2) % 6 @savefile_windows[@file_index].selected = true return end end # Û°ú¾«Ü«¿«óªÎß¾ª¬ä㪵ªìª¿íÞùê if Input.repeat?(Input::UP) # Û°ú¾«Ü«¿«óªÎß¾ªÎäãù»?÷¾ª¬«ê«Ô?«ÈªÇªÊª¤íÞùê if Input.trigger?(Input::UP) or @file_index > 1 # ««?«½«ë SE ªòæÑñ´ $game_system.se_play($data_system.cursor_se) # ««?«½«ëªòß¾ªËì¹ÔÑ @savefile_windows[@file_index].selected = false @file_index = (@file_index - 2) % 6 @savefile_windows[@file_index].selected = true return end end # Û°ú¾«Ü«¿«óªÎéÓª¬ä㪵ªìª¿íÞùê if Input.repeat?(Input::RIGHT) # Û°ú¾«Ü«¿«óªÎéÓªÎäãù»?÷¾ª¬«ê«Ô?«ÈªÇªÊª¤íÞùê if Input.trigger?(Input::RIGHT) or @file_index < 5 # ««?«½«ë SE ªòæÑñ´ $game_system.se_play($data_system.cursor_se) # ««?«½«ëªòéÓªËì¹ÔÑ @savefile_windows[@file_index].selected = false @file_index = (@file_index + 1) % 6 @savefile_windows[@file_index].selected = true return end end # Û°ú¾«Ü«¿«óªÎñ§ª¬ä㪵ªìª¿íÞùê if Input.repeat?(Input::LEFT) # Û°ú¾«Ü«¿«óªÎñ§ªÎäãù»?÷¾ª¬«ê«Ô?«ÈªÇªÊª¤íÞùê if Input.trigger?(Input::LEFT) or @file_index > 0 # ««?«½«ë SE ªòæÑñ´ $game_system.se_play($data_system.cursor_se) # ««?«½«ëªòñ§ªËì¹ÔÑ @savefile_windows[@file_index].selected = false @file_index = (@file_index - 1) % 6 @savefile_windows[@file_index].selected = true return end end end #-------------------------------------------------------------------------- # ¡Ü «Õ«¡«¤«ëÙ£ªÎíÂà÷ # file_index : «»?«Ö«Õ«¡«¤«ëªÎ«¤«ó«Ç«Ã«¯«¹ (0¢¦3) #-------------------------------------------------------------------------- def make_filename(file_index) return "Save#{file_index + 1}.rxdata" end end #============================================================================== # ¡á Scene_Save #------------------------------------------------------------------------------ # ¡¡«»?«Ö?ØüªÎ?×âªòú¼ª¦«¯«é«¹ªÇª¹¡£ #============================================================================== class Scene_Save < Scene_File #-------------------------------------------------------------------------- # ¡Ü «ª«Ö«¸«§«¯«ÈôøÑ¢ûù #-------------------------------------------------------------------------- def initialize super("¾î´À°ÍÀ» ÀúÀå ÇϽðٽÀ´Ï±î?") end #-------------------------------------------------------------------------- # ¡Ü ̽ïÒãÁªÎ?×â #-------------------------------------------------------------------------- def on_decision(filename) # «»?«Ö SE ªòæÑñ´ $game_system.se_play($data_system.save_se) dispose # «»?«Ö«Ç?«¿ªÎßöª­?ªß file = File.open(filename, "wb") write_save_data(file) file.close # «¤«Ù«ó«Èª«ªéû¼ªÓõ󪵪ìªÆª¤ªëíÞùê if $game_temp.save_calling # «»?«Öû¼ªÓõóª·«Õ«é«°ªò«¯«ê«¢ $game_temp.save_calling = false # «Þ«Ã«×?ØüªËï·ªêô𪨠$scene = Scene_Map.new return end end #-------------------------------------------------------------------------- # ¡Ü «­«ã«ó«»«ëãÁªÎ?×â #-------------------------------------------------------------------------- def on_cancel # «­«ã«ó«»«ë SE ªòæÑñ´ $game_system.se_play($data_system.cancel_se) dispose # «¤«Ù«ó«Èª«ªéû¼ªÓõ󪵪ìªÆª¤ªëíÞùê if $game_temp.save_calling # «»?«Öû¼ªÓõóª·«Õ«é«°ªò«¯«ê«¢ $game_temp.save_calling = false # «Þ«Ã«×?ØüªËï·ªêô𪨠$scene = Scene_Map.new return end end end #============================================================================== # ¡á Scene_Load #------------------------------------------------------------------------------ # ¡¡«í?«É?ØüªÎ?×âªòú¼ª¦«¯«é«¹ªÇª¹¡£ #============================================================================== class Scene_Load < Scene_File #-------------------------------------------------------------------------- # ¡Ü «ª«Ö«¸«§«¯«ÈôøÑ¢ûù #-------------------------------------------------------------------------- def initialize # «Æ«ó«Ý«é«ê«ª«Ö«¸«§«¯«Èªòî¢íÂà÷ $game_temp = Game_Temp.new # «¿«¤«à«¹«¿«ó«×ª¬õÌãæªÎ«Õ«¡«¤«ëªòàÔ? $game_temp.last_file_index = 0 latest_time = Time.at(0) for i in 0..5 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("¾î´À°ÍÀ» ºÒ·¯¿À°Ô ÇÒ°Í ÀԴϱî?") end #-------------------------------------------------------------------------- # ¡Ü ̽ïÒãÁªÎ?×â #-------------------------------------------------------------------------- def on_decision(filename) # «Õ«¡«¤«ëª¬ðí·ªÊª¤íÞùê unless FileTest.exist?(filename) # «Ö«¶? SE ªòæÑñ´ $game_system.se_play($data_system.buzzer_se) return end dispose # «í?«É SE ªòæÑñ´ $game_system.se_play($data_system.load_se) # «»?«Ö«Ç?«¿ªÎßöª­?ªß file = File.open(filename, "rb") read_save_data(file) file.close # BGM¡¢BGS ªòÜÖ? $game_system.bgm_play($game_system.playing_bgm) $game_system.bgs_play($game_system.playing_bgs) # «Þ«Ã«×ªòÌÚãæ (?Öª«¤«Ù«ó«È?ú¼) $game_map.update # «Þ«Ã«×?ØüªËï·ªêô𪨠$scene = Scene_Map.new end #-------------------------------------------------------------------------- # ¡Ü «­«ã«ó«»«ëãÁªÎ?×â #-------------------------------------------------------------------------- def on_cancel # «­«ã«ó«»«ë SE ªòæÑñ´ $game_system.se_play($data_system.cancel_se) dispose end end #============================================================================== # ¡á Scene_End #------------------------------------------------------------------------------ # ¡¡«²?«àðûÖõ?ØüªÎ?×âªòú¼ª¦«¯«é«¹ªÇª¹¡£ #============================================================================== class Scene_End #-------------------------------------------------------------------------- # ¡Ü «á«¤«ó?×â #-------------------------------------------------------------------------- def main # «³«Þ«ó«É«¦«£«ó«É«¦ªòíÂà÷ s1 = "¡ºÅ¸ ÀÌ Æ²¡»" s2 = "¡º°ÔÀÓ Á¾·á¡»" s3 = "¡º±×¸¸ µÐ´Ù¡»" @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 # «È«é«ó«¸«·«ç«ó?ú¼ Graphics.transition # «á«¤«ó«ë?«× loop do # «²?«à?ØüªòÌÚãæ Graphics.update # ìýÕôï×ÜêòÌÚãæ Input.update # «Õ«ì?«àÌÚãæ update # ?Øüª¬ï·ªêôðªïªÃª¿ªé«ë?«×ªòñé? if $scene != self break end end # «È«é«ó«¸«·«ç«óñÞÝá Graphics.freeze # «¦«£«ó«É«¦ªòú°Û¯ @command_window.dispose # «¿«¤«È«ë?ØüªËï·ªêôðª¨ñéªÎíÞùê if $scene.is_a?(Scene_Title) # ?Øüªò«Õ«§?«É«¢«¦«È Graphics.transition Graphics.freeze end end #-------------------------------------------------------------------------- # ¡Ü «Õ«ì?«àÌÚãæ #-------------------------------------------------------------------------- def update # «³«Þ«ó«É«¦«£«ó«É«¦ªòÌÚãæ @command_window.update # B «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::B) # «­«ã«ó«»«ë SE ªòæÑñ´ $game_system.se_play($data_system.cancel_se) # «á«Ë«å??ØüªËï·ªêô𪨠$scene = Scene_Menu.new(6) return end # C «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::C) # «³«Þ«ó«É«¦«£«ó«É«¦ªÎ««?«½«ëêÈöǪÇÝÂÐ÷ case @command_window.index when 0 # «¿«¤«È«ëªØ command_to_title when 1 # «·«ã«Ã«È«À«¦«ó command_shutdown when 2 # ªäªáªë command_cancel end return end end #-------------------------------------------------------------------------- # ¡Ü «³«Þ«ó«É [«¿«¤«È«ëªØ] àÔ?ãÁªÎ?×â #-------------------------------------------------------------------------- def command_to_title # ̽ïÒ SE ªòæÑñ´ $game_system.se_play($data_system.decision_se) # BGM¡¢BGS¡¢ME ªò«Õ«§?«É«¢«¦«È Audio.bgm_fade(800) Audio.bgs_fade(800) Audio.me_fade(800) # «¿«¤«È«ë?ØüªËï·ªêô𪨠$scene = Scene_Title.new end #-------------------------------------------------------------------------- # ¡Ü «³«Þ«ó«É [«·«ã«Ã«È«À«¦«ó] àÔ?ãÁªÎ?×â #-------------------------------------------------------------------------- def command_shutdown # ̽ïÒ SE ªòæÑñ´ $game_system.se_play($data_system.decision_se) # BGM¡¢BGS¡¢ME ªò«Õ«§?«É«¢«¦«È Audio.bgm_fade(800) Audio.bgs_fade(800) Audio.me_fade(800) # «·«ã«Ã«È«À«¦«ó $scene = nil end #-------------------------------------------------------------------------- # ¡Ü «³«Þ«ó«É [ªäªáªë] àÔ?ãÁªÎ?×â #-------------------------------------------------------------------------- def command_cancel # ̽ïÒ SE ªòæÑñ´ $game_system.se_play($data_system.decision_se) # «á«Ë«å??ØüªËï·ªêô𪨠$scene = Scene_Menu.new(6) end end