#ÆÄƼ ±³Ã¼ # #°£ÀÌÀÇ ÆÄƼ ¹Ù²ã ³Ö°í ½ºÅ©¸³Æ®ÀÔ´Ï´Ù. #½ºÀ­Ä¡ÀÇ °Í on off À¸·Î ¹Ù²ã ³Ö°í °¡ºÎ¸¦ Á¶ÀÛÇÒ ¼ö ÀÖ½À´Ï´Ù. #±×¸®°í , Á¦¿ÜÇÏ°í ½ÍÁö ¾ÊÀº ¿¢ÅÍÀÇ ¼³Á¤µµ °¡´É. # #¾îµð±îÁö³ª , ¿¢ÅÍÀÇ °¡ÀÔ°ú ÀÌÅ»ÀÇ ±â´É ¹Û¿¡ ¾ø±â ¶§¹®¿¡ »ç¿ëÇϱ⠾î·Á¿ïÁöµµ ¸ð¸¨´Ï´Ù. #°£ÀÌ ½ºÅ×ÀÌÅͽº Ç¥½Ã¿¡ ´ëÀÀÇß½À´Ï´Ù. #A¹öÆ°À¸·Î ½ºÅ×ÀÌÅͽºÀÇ Ç¥½Ã , ºñÇ¥½Ã¸¦ º¯°æÇÒ ¼ö ÀÖ½À´Ï´Ù. # #¡Ü¼³Á¤ ¹æ¹ý¹ý #¡¤ÃÖ´ë ÆÄƼ °¡ÀÔ Àοø¼ö # ¹Ù·Î ¾Æ·¡ÀÇ °Í @party_max = 4 ÀÇ ºÎºÐÀ» º¯°æ , Åë»óÀº4. # #¡¤ÃÖÀú ÆÄƼ °¡ÀÔ Àοø¼ö(ÃÖÀú ¼±ÅÃÇØ¾ß ÇÏ´Â Àοø¼ö) # ¹Ù·Î ¾Æ·¡ÀÇ °Í @party_min = 1 ÀÇ ºÎºÐÀ» º¯°æ , Ãʱâ·Î´Â ¿ì¼±1À¸·Î ¼³Á¤. # #¡¤°­Á¦ °¡ÀÔ ¿¢ÅÍ(Àý´ë·Î ÆÄƼ¿¡ µé¾î°¡´Â ¿¢ÅÍ) # ¹Ù·Î ¾Æ·¡ÀÇ °Í @must_actors = [$game_actors[1]] ÀÇ ºÎºÐÀ» º¯°æ , # Ãʱâ·Î´Â ¿ì¼± ,ID1Â÷·ÊÀÇ ¿¢ÅÍ(¾Æ¸£½Ã½º)¿¡°Ô ¼³Á¤. # (¼³Á¤¿¹) # @must_actors = [$game_actors[1], $game_actors[2]] # ÀÌ°ÍÀ¸·ÎID1Â÷·Ê¿Í2Â÷·ÊÀÇ ¿¢ÅÍ°¡ °­Á¦ °¡ÀÔ ¿¢ÅÍ·Î ¼³Á¤µË´Ï´Ù. # # µ¡ºÙ¿©¼­ , À̺¥Æ® Ä¿¸àµåÀÇ ¡¸½ºÅ©¸³Æ®¡¹·Î # $game_party.must_actors = [$game_actors[1]] # µîÀ¸·Î , °ÔÀÓÁßÀ¸·Î ¼³Á¤ °¡´ÉÇÕ´Ï´Ù. (ÃÖ´ë ÃÖÀú Àοø¼ö¶óµçÁöµµ ÀÌ¿Í °°ÀÌ °¡´É) # #¡¤ÆÄƼ °¡ÀÔ °¡ºÎ ÆÇÁ¤ # class Window_Party_Select ÀÇ °Í party_in_menber À¸·Î ¼³Á¤ÇØ ÀÖ½À´Ï´Ù. # (¼³Á¤¿¹) # menber.push($game_actors[1]) # menber.push($game_actors[2]) if $game_switches[1] # # ÀÌ°ÍÀ¸·Î ,ID1Â÷·ÊÀÇ ¿¢ÅÍ(¾Æ¸£½Ã½º)´Â »ó½Ã °¡ÀÔ °¡´ÉÇØ # ID2Â÷·ÊÀÇ ¿¢ÅÍ(´©±¸´ø°¡? )(Àº)´Â °ÔÀÓ ½ºÀ­Ä¡ÀÇ1Â÷·Ê°¡ON¶§ # °¡ÀÔ °¡´ÉÇØÁý´Ï´Ù. # # Ãʱ⼳Á¤¿¡¼­´Â ,ID1Â÷·Ê´Â »ó½Ã °¡ÀÔ °¡´ÉÇØ , # ID2-8Â÷·Ê´Â °¢°¢ , °ÔÀÓ ½ºÀ­Ä¡1-7Â÷·Ê°¡ON¶§ # °¡ÀÔ °¡´ÉÇÏ°Ô ¼³Á¤µÇ¾î ÀÖ½À´Ï´Ù. class Game_Party attr_accessor :party_max attr_accessor :party_min attr_accessor :must_actors alias party_select_initialize initialize def initialize party_select_initialize @party_max = 8 @party_min = 1 @must_actors = [] end end class Window_Party_Select < Window_Selectable #-------------------------------------------------------------------------- # ¡Ü ¿ÀºêÁ§Æ® ÃʱâÈ­ #-------------------------------------------------------------------------- def initialize super(0, 96, 640, 384) @party_in_ok_menber = party_in_menber @item_max = party_in_menber.size @column_max = 4 self.contents = Bitmap.new(width - 32, row_max * 88) self.index = 0 refresh end #-------------------------------------------------------------------------- # ¡Ü ¿¢ÅÍÀÇ Ãëµæ #-------------------------------------------------------------------------- def menber return @party_in_ok_menber[self.index] end #-------------------------------------------------------------------------- # ¡Ü ÆÄƼin°¡´ÉÇÑ ¸â¹ö Ãëµæ #-------------------------------------------------------------------------- def party_in_menber menber = [] menber.push($game_actors[1]) menber.push($game_actors[2]) if $game_switches[15] menber.push($game_actors[3]) if $game_switches[16] menber.push($game_actors[4]) if $game_switches[17] menber.push($game_actors[5]) if $game_switches[18] menber.push($game_actors[6]) if $game_switches[19] menber.push($game_actors[7]) if $game_switches[20] menber.push($game_actors[8]) if $game_switches[21] return menber end #-------------------------------------------------------------------------- # ¡Ü ¸®ÇÁ·¹½¬ #-------------------------------------------------------------------------- def refresh self.contents.clear for i in 0...@party_in_ok_menber.size draw_menber(i) end end #-------------------------------------------------------------------------- # ¡Ü ¿¢ÅÍ ¹¦È­ #-------------------------------------------------------------------------- def draw_menber(index) actor = @party_in_ok_menber[index] x = 4 + index % @column_max * (640 / @column_max) y = index / @column_max * 88 if $game_party.must_actors.include?(actor) color = text_color(3) opacity = 255 elsif $game_party.actors.include?(actor) color = normal_color opacity = 255 else color = disabled_color opacity = 128 end self.contents.font.color = color self.contents.draw_text(x, y, 120, 32, actor.name) bitmap = RPG::Cache.character(actor.character_name, actor.character_hue) cw = bitmap.width / 4 ch = bitmap.height / 4 src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x+32 - cw / 2, y+64+16 - ch, bitmap, src_rect, opacity) end #-------------------------------------------------------------------------- # ¡Ü Çà ¼öÀÇ Ãëµæ #-------------------------------------------------------------------------- def row_max # Ç׸ñ¼ö¿Í ·Ä¼ö·ÎºÎÅÍ Çà¼ö¸¦ »êÃâ return (@item_max + @column_max - 1) / @column_max end #-------------------------------------------------------------------------- # ¡Ü ¼±µÎÀÇ ÇàÀÇ Ãëµæ #-------------------------------------------------------------------------- def top_row # À©µµ¿ì ³»¿ëÀÇ Àü¼Û¿ø Y ÁÂÇ¥¸¦ ,1 ÇàÀÇ ³ôÀÌ 32 ·Î ³ª´©´Â return self.oy / 88 end #-------------------------------------------------------------------------- # ¡Ü ¼±µÎÀÇ ÇàÀÇ ¼³Á¤ # row : ¼±µÎ¿¡ Ç¥½ÃÇÏ´Â Çà #-------------------------------------------------------------------------- def top_row=(row) # row ÀÌ 0 ¹Ì¸¸ÀÇ °æ¿ì´Â 0 ¿¡ ¼öÁ¤ if row < 0 row = 0 end # row ÀÌ row_max - 1 ÃÊ°úÀÇ °æ¿ì´Â row_max - 1 ¿¡ ¼öÁ¤ if row > row_max - 1 row = row_max - 1 if row < 0 row = 0 end end # row ¿¡ 1 ÇàÀÇ ³ôÀÌ 32 ¸¦ °É¾î À©µµ¿ì ³»¿ëÀÇ Àü¼Û¿ø Y ÁÂÇ¥·Î ÇÏ´Â self.oy = row * 88 end #-------------------------------------------------------------------------- # ¡Ü 1 ÆäÀÌÁö¿¡ Ç¥½ÃÇÒ ¼ö ÀÖ´Â Çà¼öÀÇ Ãëµæ #-------------------------------------------------------------------------- def page_row_max # À©µµ¿ìÀÇ ³ôÀ̷κÎÅÍ , ÇÁ·¹ÀÓÀÇ ³ôÀÌ 32 ¸¦ ´ç°Ü ,1 ÇàÀÇ ³ôÀÌ 32 ·Î ³ª´©´Â return (self.height - 32) / 88 end #-------------------------------------------------------------------------- # ¡Ü Ä¿¼­ÀÇ ±¸Çü °»½Å #-------------------------------------------------------------------------- def update_cursor_rect if @index < 0 self.cursor_rect.empty return end # ÇöÀçÀÇ ÇàÀ» Ãëµæ 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 # Ä¿¼­ÀÇ ÆøÀ» °è»ê cursor_width = 512 / @column_max # Ä¿¼­ÀÇ ÁÂÇ¥¸¦ °è»ê x = @index % @column_max * (cursor_width + 32)#(640 / @column_max) y = @index / @column_max * 88 - self.oy # Ä¿¼­ÀÇ ±¸ÇüÀ» °»½Å self.cursor_rect.set(x, y, cursor_width, 32) end end class Window_Party_Select_Menber < Window_Base #-------------------------------------------------------------------------- # ¡Ü ¿ÀºêÁ§Æ® ÃʱâÈ­ #-------------------------------------------------------------------------- def initialize super(0, 0, 640, 96) self.contents = Bitmap.new(width - 32, height - 32) refresh end #-------------------------------------------------------------------------- # ¡Ü ¸®ÇÁ·¹½¬ #-------------------------------------------------------------------------- def refresh self.contents.clear for i in 0...$game_party.actors.size draw_menber(i) end end #-------------------------------------------------------------------------- # ¡Ü ¿¢ÅÍ ¹¦È­ #-------------------------------------------------------------------------- def draw_menber(index) actor = $game_party.actors[index] x = 4 + index * (640 / $game_party.party_max) y = 0 draw_actor_graphic(actor, x+32, y+48+8) end end class Window_Party_Select_Menber_Status < Window_Base #-------------------------------------------------------------------------- # ¡Ü ¿ÀºêÁ§Æ® ÃʱâÈ­ #-------------------------------------------------------------------------- def initialize super(0, 288, 640, 192) self.contents = Bitmap.new(width - 32, height - 32) self.visible = false end #-------------------------------------------------------------------------- # ¡Ü ¸®ÇÁ·¹½¬ #-------------------------------------------------------------------------- def refresh(actor) self.contents.clear draw_actor_name(actor, 4, 0) draw_actor_class(actor, 4 + 144, 0) draw_actor_level(actor, 4, 32) draw_actor_state(actor, 4 + 72, 32) draw_actor_hp(actor, 4, 64, 172) draw_actor_sp(actor, 4, 96, 172) draw_actor_parameter(actor, 218, 32, 0) draw_actor_parameter(actor, 218, 64, 1) draw_actor_parameter(actor, 218, 96, 2) draw_actor_parameter(actor, 430, 32, 3) draw_actor_parameter(actor, 430, 64, 4) draw_actor_parameter(actor, 430, 96, 5) draw_actor_parameter(actor, 430, 128, 6) end end class Scene_Party_in #-------------------------------------------------------------------------- # ¡Ü ¸ÞÀΠó¸® #-------------------------------------------------------------------------- def main @main_window = Window_Party_Select.new @menber_window = Window_Party_Select_Menber.new @status_window = Window_Party_Select_Menber_Status.new @status_window.opacity = 192 @status_window.z += 10 @show_index = 0 # Æ®¶õÁö¼Ç ½ÇÇà Graphics.transition # ¸ÞÀÎ ·çÇÁ loop do # °ÔÀÓ È­¸éÀ» °»½Å Graphics.update # ÀÔ·Â Á¤º¸¸¦ °»½Å Input.update # ÇÁ·¹ÀÓ °»½Å update # È­¸éÀÌ ¹Ù²î¸é(ÀÚ) ·çÇÁ¸¦ Áß´Ü if $scene != self break end end # Æ®¶õÁö¼Ç Áغñ Graphics.freeze # À©µµ¿ì¸¦ Çعæ @main_window.dispose @menber_window.dispose @status_window.dispose end #-------------------------------------------------------------------------- # ¡Ü ÇÁ·¹ÀÓ °»½Å #-------------------------------------------------------------------------- def update # Ä¿¸àµå À©µµ¿ì¸¦ °»½Å @main_window.update if @status_window.visible and @show_index != @main_window.index status_window_position @status_window.refresh(@main_window.menber) @show_index = @main_window.index end # B ¹öÆ°ÀÌ ¹Ð·ÈÀ» °æ¿ì if Input.trigger?(Input::B) if $game_party.actors.size < $game_party.party_min # ¹öÀú SE ¸¦ ¿¬ÁÖ $game_system.se_play($data_system.buzzer_se) return end # ĵ½½ SE À» ¿¬ÁÖ $game_system.se_play($data_system.cancel_se) # ¸Þ´º È­¸éÀ¸·Î ÀüȯÇÏ°í $scene = Scene_Map.new return end # C ¹öÆ°ÀÌ ¹Ð·ÈÀ» °æ¿ì if Input.trigger?(Input::C) if $game_party.must_actors.include?(@main_window.menber) # ¹öÀú SE ¸¦ ¿¬ÁÖ $game_system.se_play($data_system.buzzer_se) return end if $game_party.actors.include?(@main_window.menber) $game_party.remove_actor(@main_window.menber.id) else if $game_party.actors.size == $game_party.party_max # ¹öÀú SE ¸¦ ¿¬ÁÖ $game_system.se_play($data_system.buzzer_se) return end $game_party.add_actor(@main_window.menber.id) end # °áÁ¤ SE À» ¿¬ÁÖ $game_system.se_play($data_system.decision_se) @main_window.refresh @menber_window.refresh return end # A ¹öÆ°ÀÌ ¹Ð·ÈÀ» °æ¿ì if Input.trigger?(Input::A) # °áÁ¤ SE À» ¿¬ÁÖ $game_system.se_play($data_system.decision_se) if @status_window.visible @status_window.visible = false else status_window_position @status_window.refresh(@main_window.menber) @status_window.visible = true @show_index = @main_window.index end return end end def status_window_position if @main_window.cursor_rect.y < 176 @status_window.y = 288 else @status_window.y = 96 end end end