#============================================================================== # ¡á Scene_Menu #------------------------------------------------------------------------------ # ¡¡¸Þ´º È­¸éÀÇ Ã³¸®¸¦ ½Ç½ÃÇϴ Ŭ·¡½ºÀÔ´Ï´Ù. #============================================================================== class Scene_Menu #-------------------------------------------------------------------------- # ¡Ü ¿ÀºêÁ§Æ® ÃʱâÈ­ # menu_index : Ä¿¸àµåÀÇ Ä¿¼­ Ãʱâ À§Ä¡ #-------------------------------------------------------------------------- def initialize(menu_index = 0) @menu_index = menu_index end #-------------------------------------------------------------------------- # ¡Ü ¸ÞÀΠó¸® #-------------------------------------------------------------------------- def main # Ä¿¸àµå À©µµ¿ì¸¦ ÀÛ¼º s1 = $data_system.words.item s2 = $data_system.words.skill s3 = $data_system.words.equip s4 = "½ºÅ×ÀÌÅͽº" s5 = "¼¼À̺ê" s6 = "°ÔÀÓ Á¾·á" @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6]) @command_window.index = @menu_index # ÆÄƼ Àοø¼ö°¡ 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 # Ç÷¹ÀÌ ½Ã°£ À©µµ¿ì¸¦ ÀÛ¼º @playtime_window = Window_PlayTime.new @playtime_window.x = 0 @playtime_window.y = 224 # º¸¼ö À©µµ¿ì¸¦ ÀÛ¼º @steps_window = Window_Steps.new @steps_window.x = 0 @steps_window.y = 320 # °ñµå À©µµ¿ì¸¦ ÀÛ¼º @gold_window = Window_Gold.new @gold_window.x = 0 @gold_window.y = 416 # ½ºÅ×ÀÌÅͽº À©µµ¿ì¸¦ ÀÛ¼º @status_window = Window_MenuStatus.new @status_window.x = 160 @status_window.y = 0 # Æ®¶õÁö¼Ç ½ÇÇà Graphics.transition # ¸ÞÀÎ ·çÇÁ loop do # °ÔÀÓ È­¸éÀ» °»½Å Graphics.update # ÀÔ·Â Á¤º¸¸¦ °»½Å Input.update # ÇÁ·¹ÀÓ °»½Å update # È­¸éÀÌ ¹Ù²î¸é ·çÇÁ¸¦ Áß´Ü if $scene != self break end end # Æ®¶õÁö¼Ç Áغñ Graphics.freeze # À©µµ¿ì¸¦ Çعæ @command_window.dispose @playtime_window.dispose @steps_window.dispose @gold_window.dispose @status_window.dispose end #-------------------------------------------------------------------------- # ¡Ü ÇÁ·¹ÀÓ °»½Å #-------------------------------------------------------------------------- def update # À©µµ¿ì¸¦ °»½Å @command_window.update @playtime_window.update @steps_window.update @gold_window.update @status_window.update # Ä¿¸àµå À©µµ¿ì°¡ ¾×ƼºêÀÇ °æ¿ì: update_command ¸¦ ºÎ¸¥´Ù if @command_window.active update_command return end # ½ºÅ×ÀÌÅͽº À©µµ¿ì°¡ ¾×ƼºêÀÇ °æ¿ì: update_status ¸¦ ºÎ¸¥´Ù if @status_window.active 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 # ¾ÆÀÌÅÛ # °áÁ¤ SE ¸¦ ¿¬ÁÖ $game_system.se_play($data_system.decision_se) # ¾ÆÀÌÅÛ È­¸éÀ¸·Î ÀüȯÇØ $scene = 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 # °áÁ¤ SE ¸¦ ¿¬ÁÖ $game_system.se_play($data_system.decision_se) # ¼¼À̺ê È­¸éÀ¸·Î ÀüȯÇØ $scene = Scene_Save.new when 5 # °ÔÀÓ Á¾·á # °áÁ¤ 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 # °áÁ¤ SE ¸¦ ¿¬ÁÖ $game_system.se_play($data_system.decision_se) # ½ºÅ³ È­¸éÀ¸·Î ÀüȯÇØ $scene = Scene_Skill.new(@status_window.index) when 2 # Àåºñ # °áÁ¤ SE ¸¦ ¿¬ÁÖ $game_system.se_play($data_system.decision_se) # Àåºñ È­¸éÀ¸·Î ÀüȯÇØ $scene = Scene_Equip.new(@status_window.index) when 3 # ½ºÅ×ÀÌÅͽº # °áÁ¤ SE ¸¦ ¿¬ÁÖ $game_system.se_play($data_system.decision_se) # ½ºÅ×ÀÌÅͽº È­¸éÀ¸·Î ÀüȯÇØ $scene = Scene_Status.new(@status_window.index) end return end end end #============================================================================== # ¡á Window_Help #------------------------------------------------------------------------------ # ¡¡½ºÅ³À̳ª ¾ÆÀÌÅÛÀÇ ¼³¸í, ¾×ÅÍÀÇ ½ºÅ×ÀÌÅͽºµîÀ» Ç¥½ÃÇÏ´Â À©µµ¿ìÀÔ´Ï´Ù. #============================================================================== class Window_Help < Window_Base #-------------------------------------------------------------------------- # ¡Ü ¿ÀºêÁ§Æ® ÃʱâÈ­ #-------------------------------------------------------------------------- def initialize super(0, 0, 640, 64) self.contents = Bitmap.new(width - 32, height - 32) end #-------------------------------------------------------------------------- # ¡Ü ÅؽºÆ® ¼³Á¤ # text : À©µµ¿ì¿¡ Ç¥½ÃÇÏ´Â ¹®ÀÚ¿­ # align : alignment (0..¿ÞÂÊ °¡Áö·±È÷ ÇØ 1..centering, 2..¿À¸¥ÂʸÂÃã) #-------------------------------------------------------------------------- def set_text(text, align = 0) # ÅؽºÆ®¿Í alignmentÀÇ Àû¾îµµ ÇÑÆíÀÌ Àüȸ¿Í ´Ù¸¥ °æ¿ì 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, 4, 0) draw_actor_state(actor, 140, 0) draw_actor_hp(actor, 284, 0) draw_actor_sp(actor, 460, 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