Ciao a tutti ragazzi ^^
Dopo un lungo periodo di pausa ho finalemente ripreso a Makerare.. Solo che adesso ho un piccolo problemino e spero che possiate aiutarmi ^^
Praticamente molti di voi conosceranno lo script: "Yanfly Engine Melody - Main Menu Melody" e "KGC_LargeParty"..
Oltre a questi due script, un membro di un forum (Kentaro) mi ha cortesemente modificato il primo script elencato precedentemente per poter renderlo compatibile con un suo script per creare il Sistema Cristallium di FFXIII..
Solo che ho riscontrato un piccolo problema che spero possiate risolvere ^^
Questo problemimo consiste nel richiamare le mappe del Cristallium dallo script:
# YEM patch to Ken_ECS # by ken, 2014 # # richiesto da paolos97 (rpgmkr.net) # inserire sotto YEM modificato #============================================================================== # Setup principale #============================================================================== module Ken_config # Voce che compare nel menu MENU_TXT = "Crystarium" # Quando ti trasferisci nella mappa del crystarium vuoi che la musica e gli # effetti sonori cessino (e poi riprendano una volta ritornati nella mappa)? # true: si; false: no STOP_BGM = true STOP_SFX = true # Vuoi cambiare la grafica del personaggio quando entri nella mappa crystarium? # true: si; false: no CHANGE_GRAPHIC = true # Se sopra è true, imposta il nome del file da utilizzare come cursore. CURSOR_SPRITE = "$Cursor" # Qui viene definito il cuore del sistema. Per ogni personaggio si imposta # una mappa, una posizione con coordinate (x,y) e una direzione; quando si # seleziona il personaggio nel menu, ci si trasporta in una mappa personale per # ciascun personaggio, dove si possono comprare le skills e/o migliorare i # parametri. # Per prima cosa, impostare l'ID della mappa: compare nella barra in fondo # all'editor, oppure cliccando con il tasto destro sopra la mappa nella barra # in alto. Abbinare l'ID del personaggio con l'ID della mappa. # NB! L'ID personaggi si trova nel primo tab del database (Actors), ma nota # che qui comincia con ZERO e non con UNO. TO_MAP_ID ={ #ID pg => ID mappa 0 => 2, # Ralph 1 => 3, # Ulrika } # Non rimuovere! # Ora imposta le coordinate (x,y) dove vuoi che arrivi il personaggio. # Coordinata X TO_MAP_X ={ #ID pg => coordinate X 0 => 2, # Ralph 1 => 7, # Ulrika } # Non rimuovere! # Coordinata Y TO_MAP_Y ={ #ID pg => coordinate Y 0 => 2, # Ralph 1 => 1, # Ulrika } # Non rimuovere! # Infine la direzione. # Direzione: 8 = su, 6 = destra, 2 = giù, 4 = sinistra TO_MAP_FACING ={ #ID pg => direzione 0 => 6, # Ralph 1 => 2, # Ulrika } # Non rimuovere! # Vuoi che ci sia un fadeout quando selezioni la voce dal menu? true: si, false: no FADEOUT = true # Se true, quanto deve durare il fadeout? default: 60 FADEOUT_TIME = 60 # Vuoi mostrare un testo quando compare la mappa crystarium? Il testo include # il nome del pg ed i suoi punti crystarium. True: si, false: no SHOW_TEXT = true # Se true, scrivi il testo da mostrare SHOWN_TEXT = "Sistema Crystarium" # Se true, che tipo di finestra usi? # 2 = nessuna, 1 = dimished, 0 = normal window SHOWN_TEXT_BACK = 1 # Se true, dove posizioni la finestra? # 2 = bottom, 1 = middle, 0 = top SHOWN_TEXT_POS = 1 end #============================================================================== # ** Game_Character #------------------------------------------------------------------------------ # This class deals with characters. It's used as a superclass of the # Game_Player and Game_Event classes. #============================================================================== class Game_Character #-------------------------------------------------------------------------- # * Step Anime On #-------------------------------------------------------------------------- def step_anime_true @step_anime = true end #-------------------------------------------------------------------------- # * Step Anime Off #-------------------------------------------------------------------------- def step_anime_false @step_anime = false end end #============================================================================== # ** Game_Interpreter #------------------------------------------------------------------------------ # An interpreter for executing event commands. This class is used within the # Game_Map, Game_Troop, and Game_Event classes. #============================================================================== class Game_Interpreter #-------------------------------------------------------------------------- # * Jump Back To Map #-------------------------------------------------------------------------- def jump_back_to_map map_id = $crystarium_map_id x = $crystarium_x y = $crystarium_y direction = $crystarium_facing $game_player.reserve_transfer(map_id, x, y, direction) $scene = Scene_Map.new Graphics.fadeout(60) $game_player.perform_transfer $game_system.menu_disabled = false if Ken_config::CHANGE_GRAPHIC $game_player.set_graphic($stored_graphic_file, $stored_graphic_index) $game_player.step_anime_false end $game_temp.map_bgm.play $game_temp.map_bgs.play end end #============================================================================== # ** Scene_Map #------------------------------------------------------------------------------ # This class performs the map screen processing. #============================================================================== class Scene_Map < Scene_Base #-------------------------------------------------------------------------- # * Switch to Menu Screen #-------------------------------------------------------------------------- alias ken_call_menu call_menu def call_menu $crystarium_map_id = $game_map.map_id $crystarium_x = $game_player.x $crystarium_y = $game_player.y $crystarium_facing = $game_player.direction $game_temp.map_bgm = RPG::BGM.last $game_temp.map_bgs = RPG::BGS.last ken_call_menu #run original method end end #============================================================================== # ** Scene_Menu #------------------------------------------------------------------------------ # This class performs the menu screen processing. #============================================================================== class Scene_Menu < Scene_Base #-------------------------------------------------------------------------- # * Jump To Crystarium Map #-------------------------------------------------------------------------- def jump_to_crystarium_map(actor_index) # configura le informazioni per trasferire nella mappa map_id = Ken_config::TO_MAP_ID[actor_index] x = Ken_config::TO_MAP_X[actor_index] y = Ken_config::TO_MAP_Y[actor_index] direction = Ken_config::TO_MAP_FACING[actor_index] # imposta la mappa di destinazione $game_player.reserve_transfer(map_id, x, y, direction) # cambia la scena $scene = Scene_Map.new # opzione: fadeout? if Ken_config::FADEOUT Graphics.fadeout(Ken_config::FADEOUT_TIME) end # effettua il trasferimento $game_player.perform_transfer # disabilita l'accesso al menu $game_system.menu_disabled = true # opzione: nessuna musica? if Ken_config::STOP_BGM RPG::BGM.stop end # opzione: nessun effetto? if Ken_config::STOP_SFX RPG::BGS.stop end # opzione: usa la grafica del cursore? if Ken_config::CHANGE_GRAPHIC $stored_graphic_file = $game_player.character_name $stored_graphic_index = $game_player.character_index $game_player.set_graphic(Ken_config::CURSOR_SPRITE, 0) $game_player.step_anime_true end # if Ken_config::SHOW_TEXT text_header = Ken_config::SHOWN_TEXT text_actor = $game_actors[actor_index+1].name text_exit = "Premi SHIFT per uscire." text_seecp = "Premi A per vedere i CP del personaggio." $game_message.background = Ken_config::SHOWN_TEXT_BACK $game_message.position = Ken_config::SHOWN_TEXT_POS $game_message.texts.push(text_header) $game_message.texts.push(text_actor) $game_message.texts.push(text_exit) $game_message.texts.push(text_seecp) Graphics.wait(10) end end # end
Come potete notare non c'è nulla di sbagliato solo che quando vado a cambiare la formazione del Party, e magari l'attore numero 1 e un alleato e non più leader, se il menbro numero 3 è diventato leader, lo script mi manda nel cristallium del membro numero 1 e quindi non posso andare avanti.. potete per favore aiutarmi? ^^
(Lascio gli altri 2 script in spoiler)
(Yanfly Engine Melody - Main Menu Melody)
#=============================================================================== # # Yanfly Engine Melody - Main Menu Melody # Last Date Updated: 2011.12.09 # Level: Normal, Hard, Lunatic # # This script allows for menu item reordering along with importing in custom # script scenes with ease so that there becomes little need to change the base # menu script in order to add in a few items. This is a YEM version of the # popular KGC Custom Menu Command. No credits will be taken on part of my own # behalf for the work KGC did. All I merely did was use it to extend the # capabilities of adding in common events, imported commands, and beefed up # engine efficiency. # #=============================================================================== # Updates # ----------------------------------------------------------------------------- # o 2010.06.13 - Bugfix regarding imported commands and common events. # o 2010.05.15 - Conversion to Yanfly Engine Melody. # o 2011.12.09 - Update Melody 1.01. (Resize Screen) #=============================================================================== # Instructions # ----------------------------------------------------------------------------- # To install this script, open up your script editor and copy/paste this script # to an open slot below ▼ Materials but above ▼ Main. Considering the special # nature of this script, it is highly recommended that you place this script # above all non-core scripts. Remember to save. # # Scroll down and edit the module as you see fitting for your game. # # ----------------------------------------------------------------------------- # Debug Shortcuts - Only during $TEST and $BTEST mode # ----------------------------------------------------------------------------- # During testplay mode, pressing F5 while the main menu is active will fill # all party members' HP and MP to full. #=============================================================================== $imported = {} if $imported == nil $imported["MainMenuMelody"] = true module YEM module MENU #=========================================================================== # Section I. Menu Commands # ------------------------------------------------------------------------- # Adjust the following hash to modify which commands will appear where. Use # the following table to input in the commands as you see fit. # # :items ............Default Item Menu # :skill ............Default Skill Menu # :equip ............Default Equip menu # :status ...........Default Status Menu # :save .............Default Save Menu # :system ...........Default Game End Menu # # For those that have imported KGC scripts. # # :kgc_largeparty ...Requires KGC's Large Party # :kgc_apviewer .....Requires KGC's Equip Learn Skill # :kgc_skillcp ......Requires KGC's Skill CP System # :kgc_difficulty ...Requires KGC's Battle Difficulty # :kgc_distribute ...Requires KGC's Distribute Parameter # :kgc_enemyguide ...Requires KGC's Enemy Guide # :kgc_outline ......Requires KGC's Outline # # For those who are still attached to the YERD scripts. # # :yerd_classchange .Requires YERD Subclass Selection System # :yerd_learnskill ..Requires YERD Subclass Selection System # :yerd_equipslots ..Requires YERD Equip Skill Slots # :yerd_bestiary ....Requires YERD Bestiary + Scanned Enemy #=========================================================================== MENU_COMMANDS =[ # Follow the instructions above. :items, # Default Item Menu :status, # Default Status Menu :skill, # Default Skill Menu :crystarium, #ken :equip, # Default Equip menu :event2, # Common Event :save, # Default Save Menu :system, # Default Game End Menu ] # Do not remove this. # This will determine whether or not your menu uses icons. USE_ICONS = true # If you're using icons, adjust the following hash to bind the right icons # to the right command. MENU_ICONS ={ # If an icon is not present, it will use the unused icon. :unused => 176, :items => 144, :skill => 159, :crystarium => 201, #ken :equip => 44, :status => 137, :save => 149, :system => 134, } # Do not remove this. # This is the maximum number of rows to be displayed before the command # box will be cut off. MAX_ROWS = 10 # Set the alignment for the text in your menu. By default, alignment is 0. # 0..Left Align, 1..Center Align, 2..Right Align ALIGN = 0 # Setting this to true will cause the menu to shift to the right side of # the screen while moving the party status window over to the left side. MENU_RIGHT_SIDE = true # If this is set to true, the menu will not obscure the map until actor # selection is required. Events on the map will be frozen in place. ON_SCREEN_MENU = true #=========================================================================== # Section II.A. Custom Menu Command - Lunatic Mode - Common Events # ------------------------------------------------------------------------- # For those who would like to launch command events from the main menu, # modify this hash here to fit your liking. Then, add in the newly added # method to the MENU_COMMANDS array above. # # HideSw - This is the hide switch. Set to nil to not use a switch. # DisbSw - This is the disable switch. Set to nil to not use a switch. # Debug? - This item will only appear if it's $TEST mode. # CEvent - This is the common event that will launch. # Icon - This is the icon used if the option is given. # Title - This is the text that will appear. #=========================================================================== COMMON_EVENTS ={ # Follow the instructions above. # Method => [HideSw, DisbSw, Debug?, CEvent, Icon, Title Name] :event1 => [ nil, nil, true, 11, 101, "Debug"], :event2 => [ nil, nil, false, 12, 117, "Camp"], } # Do not remove this. #=========================================================================== # Section II.B. Custom Menu Command - Lunatic Mode - Imported Commands # ------------------------------------------------------------------------- # The following is what KGC originally was going to have in his script but # was actually missing it in his publicized script. This will regain # functionality and also lift the "limit" of only 100 extra commands. The # following will explain how to set up the individual options. # # HideSw - Switch used to hide the command. Set to nil if not used. # DisbSw - Switch used to disable the command. Set to nil if not used. # Actor? - Does this select an actor. Set to true if it does. # Icon - Determines what icon will be used for this item. # Title - The title text that appears for the event. # Scene - The scene used to launch the respective scene. # # Note that this does not automatically detect what will and will not # disable the command ingame. You must understand and create a work # around with them (if they do disable the commands) with switches. # After binding your imported commands, go back to MENU_COMMANDS and # insert the proper command ID at the proper location. #=========================================================================== IMPORTED_COMMANDS ={ # Follow the instructions above. # Method => [HideSw, DisbSw, Actor?, Icon, Title Name, Scene Name.new] :quests => [ 8, 9, false, 99, "Quests", "Scene_Quest"], :faction => [ 10, 11, false, 100, "Factions", "Scene_Factions"], :row => [ nil, nil, false, 101, "Rows", "Scene_Row"], :record => [ nil, nil, false, 102, "Records", "Scene_Record"], :craft => [ nil, nil, false, 103, "Crafting", "Scene_Crafting"], } # Do not remove this. #=========================================================================== # Section III.A. Multi Variable Window # ------------------------------------------------------------------------- # Imported straight from Scene Menu ReDux, this alters the gold window at # the bottom to display variables, time, steps, etc. This window appears # at the bottom of the screen. #=========================================================================== USE_MULTI_VARIABLE_WINDOW = true # Variables will be shown in this order. Use 0 to show gold. Adjust the # following information as seen necessary. VARIABLES_SHOWN = [-5, -1, -2, 0] VARIABLES_ICONS = true VARIABLES_HASH ={ # Note that value zero must exist. # VarID => [Icon, Text] -5 => [ 153, "Map"], -2 => [ 48, "Steps"], -1 => [ 188, "Time"], 0 => [ 205, "Gold"], 1 => [ 200, "Jewels"], }# Do not remove this. end # MENU end # YEM #=============================================================================== # Editting anything past this point may potentially result in causing computer # damage, incontinence, explosion of user's head, coma, death, and/or halitosis. # Therefore, edit at your own risk. #=============================================================================== #=============================================================================== # Scene_Menu #=============================================================================== class Scene_Menu < Scene_Base #-------------------------------------------------------------------------- # new method: create_command_list #-------------------------------------------------------------------------- def create_command_list vocab = [] commands = [] icons = [] index_list = {} YEM::MENU::MENU_COMMANDS.each_with_index { |c,i| case c when :items index_list[:items] = commands.size vocab.push(Vocab.item) when :skill # Skills index_list[:skill] = commands.size vocab.push(Vocab.skill) when :crystarium #ken index_list[:crystarium] = commands.size #ken vocab.push(Ken_config::MENU_TXT) #ken when :equip # Equip index_list[:equip] = commands.size vocab.push(Vocab.equip) when :status # Status index_list[:status] = commands.size vocab.push(Vocab.status) when :save # Save index_list[:save] = commands.size vocab.push(Vocab.save) when :system # System index_list[:system] = commands.size vocab.push(Vocab.game_end) #----- KGC Imported Scripts ----- when :kgc_largeparty # KGC's Large Party next unless $imported["LargeParty"] index_list[:partyform] = commands.size @__command_partyform_index = commands.size vocab.push(Vocab.partyform) when :kgc_apviewer # KGC's AP Viewer next unless $imported["EquipLearnSkill"] index_list[:ap_viewer] = commands.size @__command_ap_viewer_index = commands.size vocab.push(Vocab.ap_viewer) when :kgc_skillcp # KGC's CP Skill System next unless $imported["SkillCPSystem"] index_list[:set_battle_skill] = commands.size @__command_set_battle_skill_index = commands.size vocab.push(Vocab.set_battle_skill) when :kgc_difficulty # KGC's Battle Difficulty next unless $imported["BattleDifficulty"] index_list[:set_difficulty] = commands.size @__command_set_difficulty_index = commands.size vocab.push(KGC::BattleDifficulty.get[:name]) when :kgc_distribute # KGC's Distribute Parameter next unless $imported["DistributeParameter"] index_list[:distribute_parameter] = commands.size @__command_distribute_parameter_index = commands.size vocab.push(Vocab.distribute_parameter) when :kgc_enemyguide # KGC's Enemy Guide next unless $imported["EnemyGuide"] index_list[:enemy_guide] = commands.size @__command_enemy_guide_index = commands.size vocab.push(Vocab.enemy_guide) when :kgc_outline # KGC's Outline next unless $imported["Outline"] index_list[:outline] = commands.size @__command_outline_index = commands.size vocab.push(Vocab.outline) #----- YERD Imported Scripts ----- when :yerd_classchange # Yanfly Subclass Class Change next unless $imported["SubclassSelectionSystem"] next unless YE::SUBCLASS::MENU_CLASS_CHANGE_OPTION next unless $game_switches[YE::SUBCLASS::ENABLE_CLASS_CHANGE_SWITCH] index_list[:classchange] = commands.size @command_class_change = commands.size vocab.push(YE::SUBCLASS::MENU_CLASS_CHANGE_TITLE) when :yerd_learnskill # Yanfly Subclass Learn Skill next unless $imported["SubclassSelectionSystem"] next unless YE::SUBCLASS::USE_JP_SYSTEM and YE::SUBCLASS::LEARN_SKILL_OPTION next unless $game_switches[YE::SUBCLASS::ENABLE_LEARN_SKILLS_SWITCH] index_list[:learnskill] = commands.size @command_learn_skill = commands.size vocab.push(YE::SUBCLASS::LEARN_SKILL_TITLE) when :yerd_equipslots # Yanfly Equip Skill System next unless $imported["EquipSkillSlots"] next unless $game_switches[YE::EQUIPSKILL::ENABLE_SLOTS_SWITCH] index_list[:equipskill] = commands.size @command_equip_skill = commands.size vocab.push(YE::EQUIPSKILL::MENU_TITLE) when :yerd_bestiary # Yanfly Bestiary next unless $imported["DisplayScannedEnemy"] next unless $game_switches[YE::MENU::MONSTER::BESTIARY_SWITCH] index_list[:bestiary] = commands.size @command_bestiary = commands.size vocab.push(YE::MENU::MONSTER::BESTIARY_TITLE) else # ---- Custom Commands ---- if YEM::MENU::COMMON_EVENTS.include?(c) common_event = YEM::MENU::COMMON_EVENTS[c] next if !$TEST and common_event[2] next if common_event[0] != nil and $game_switches[common_event[0]] index_list[c] = commands.size vocab.push(common_event[5]) elsif YEM::MENU::IMPORTED_COMMANDS.include?(c) command_array = YEM::MENU::IMPORTED_COMMANDS[c] next if command_array[0] != nil and $game_switches[command_array[0]] index_list[c] = commands.size vocab.push(command_array[4]) else; next end end commands.push(c) icons.push(menu_icon(c)) } # YEM::MENU::MENU_COMMANDS.each_with_index $game_temp.menu_command_index = index_list @menu_array = [vocab, commands, icons] end #-------------------------------------------------------------------------- # new method: menu_icon #-------------------------------------------------------------------------- def menu_icon(command) if YEM::MENU::MENU_ICONS.include?(command) return YEM::MENU::MENU_ICONS[command] elsif YEM::MENU::COMMON_EVENTS.include?(command) return YEM::MENU::COMMON_EVENTS[command][4] elsif YEM::MENU::IMPORTED_COMMANDS.include?(command) return YEM::MENU::IMPORTED_COMMANDS[command][3] else return YEM::MENU::MENU_ICONS[:unused] end end #-------------------------------------------------------------------------- # overwrite method: create_command_window #-------------------------------------------------------------------------- def create_command_window create_command_list @command_window = Window_MenuCommand.new(@menu_array) @command_window.height = [@command_window.height, YEM::MENU::MAX_ROWS * 24 + 32].min @command_window.index = [@menu_index, @menu_array[0].size - 1].min end #-------------------------------------------------------------------------- # overwrite method: update_command_selection #-------------------------------------------------------------------------- def update_command_selection if Input.trigger?(Input::B) check_debug_enable Sound.play_cancel $scene = Scene_Map.new elsif $TEST and Input.trigger?(Input::F5) # Debug Refresh Party Sound.play_recovery for member in $game_party.members member.hp += member.maxhp member.mp += member.maxmp end @status_window.refresh elsif Input.trigger?(Input::C) command = @command_window.method case command when :items # Item Command Sound.play_decision $scene = Scene_Item.new when :skill, :equip, :status # Skill, Equip, and Status Commands Sound.play_decision start_actor_selection when :crystarium #ken Sound.play_decision #ken start_actor_selection #ken when :save # Save Command if $game_system.save_disabled Sound.play_buzzer else Sound.play_decision $game_temp.menu_command_index[:save] $scene = Scene_File.new(true, false, false) end when :system # System Command Sound.play_decision $scene = Scene_End.new else # Custom Commands if YEM::MENU::COMMON_EVENTS.include?(command) array = YEM::MENU::COMMON_EVENTS[command] if array[1] != nil and $game_switches[array[1]] Sound.play_buzzer else Sound.play_decision $game_temp.common_event_id = array[3] $scene = Scene_Map.new end elsif YEM::MENU::IMPORTED_COMMANDS.include?(command) array = YEM::MENU::IMPORTED_COMMANDS[command] if array[1] != nil and $game_switches[array[1]] Sound.play_buzzer else Sound.play_decision if array[2] start_actor_selection else $scene = eval(array[5] + ".new") end end end end # if case check end # end if end # end update_command_selection #-------------------------------------------------------------------------- # overwrite method: update_actor_selection #-------------------------------------------------------------------------- def update_actor_selection if Input.trigger?(Input::B) Sound.play_cancel end_actor_selection @status_window.close if YEM::MENU::ON_SCREEN_MENU elsif $TEST and Input.trigger?(Input::F5) # Debug Refresh Party Sound.play_recovery for member in $game_party.members member.hp += member.maxhp member.mp += member.maxmp end @status_window.refresh elsif Input.trigger?(Input::C) $game_party.last_actor_index = @status_window.index Sound.play_decision command = @command_window.method case command when :skill # Skill Command $scene = Scene_Skill.new(@status_window.index) when :crystarium #ken jump_to_crystarium_map(@status_window.index) #ken when :equip # Equip Command $scene = Scene_Equip.new(@status_window.index) when :status # Status Command $scene = Scene_Status.new(@status_window.index) else # Custom Commands if YEM::MENU::IMPORTED_COMMANDS.include?(command) array = YEM::MENU::IMPORTED_COMMANDS[command] $scene = eval(array[5] + ".new(@status_window.index)") end end end end #-------------------------------------------------------------------------- # overwrite method: start #-------------------------------------------------------------------------- def start super create_menu_background create_command_window if YEM::MENU::USE_MULTI_VARIABLE_WINDOW @gold_window = Window_MultiVariableWindow.new else @gold_window = Window_Gold.new(0, 360) end @status_window = Window_MenuStatus.new(160, 0) @right_side = YEM::MENU::MENU_RIGHT_SIDE if YEM::MENU::ON_SCREEN_MENU @gold_window.y = @command_window.height @status_window.openness = 0 @right_side = true if $game_player.screen_x <= 176 @right_side = false if $game_player.screen_x >= 368 $game_temp.on_screen_menu = false end if @right_side @status_window.x = 0 @command_window.x = @status_window.width @gold_window.x = @status_window.width end end #-------------------------------------------------------------------------- # alias method: start_actor_selection #-------------------------------------------------------------------------- alias start_actor_selection_mmz start_actor_selection unless $@ def start_actor_selection if YEM::MENU::ON_SCREEN_MENU @status_window.open end start_actor_selection_mmz end #-------------------------------------------------------------------------- # new method: create_menu_background #-------------------------------------------------------------------------- if YEM::MENU::ON_SCREEN_MENU def create_menu_background @menuback_sprite = Spriteset_Map.new end end end # Scene_Menu #============================================================================== # Imported from KGC's Custom Menu Command # to improve compatibility amongst KGC scripts #============================================================================== $imported["CustomMenuCommand"] = true class Game_Temp attr_accessor :menu_command_index attr_accessor :next_scene_actor_index attr_accessor :on_screen_menu alias initialize_KGC_CustomMenuCommand initialize unless $@ def initialize initialize_KGC_CustomMenuCommand @menu_command_index = {} @next_scene_actor_index = 0 end end module KGC module Commands module_function def call_item return if $game_temp.in_battle $game_temp.next_scene = :menu_item $game_temp.next_scene_actor_index = 0 $game_temp.menu_command_index = {} end def call_skill(actor_index = 0) return if $game_temp.in_battle $game_temp.next_scene = :menu_skill $game_temp.next_scene_actor_index = actor_index $game_temp.menu_command_index = {} end def call_equip(actor_index = 0) return if $game_temp.in_battle $game_temp.next_scene = :menu_equip $game_temp.next_scene_actor_index = actor_index $game_temp.menu_command_index = {} end def call_status(actor_index = 0) return if $game_temp.in_battle $game_temp.next_scene = :menu_status $game_temp.next_scene_actor_index = actor_index $game_temp.menu_command_index = {} end end end class Game_Interpreter include KGC::Commands end class Scene_Map < Scene_Base alias update_scene_change_KGC_CustomMenuCommand update_scene_change unless $@ def update_scene_change return if $game_player.moving? case $game_temp.next_scene when :menu_item call_menu_item when :menu_skill call_menu_skill when :menu_equip call_menu_equip when :menu_status call_menu_status else update_scene_change_KGC_CustomMenuCommand end end alias call_menu_mmz call_menu unless $@ def call_menu $game_temp.on_screen_menu = true if YEM::MENU::ON_SCREEN_MENU call_menu_mmz end def call_menu_item $game_temp.next_scene = nil $scene = Scene_Item.new end def call_menu_skill $game_temp.next_scene = nil $scene = Scene_Skill.new($game_temp.next_scene_actor_index) $game_temp.next_scene_actor_index = 0 end def call_menu_equip $game_temp.next_scene = nil $scene = Scene_Equip.new($game_temp.next_scene_actor_index) $game_temp.next_scene_actor_index = 0 end def call_menu_status $game_temp.next_scene = nil $scene = Scene_Status.new($game_temp.next_scene_actor_index) $game_temp.next_scene_actor_index = 0 end end class Scene_Menu < Scene_Base def check_debug_enable return unless Input.press?(Input::F5) return unless Input.press?(Input::F9) $TEST = true end end class Scene_Item < Scene_Base def return_scene if $game_temp.menu_command_index.has_key?(:items) $scene = Scene_Menu.new($game_temp.menu_command_index[:items]) else $scene = Scene_Map.new end end end class Scene_Skill < Scene_Base def return_scene if $game_temp.menu_command_index.has_key?(:skill) $scene = Scene_Menu.new($game_temp.menu_command_index[:skill]) else $scene = Scene_Map.new end end end class Scene_Equip < Scene_Base def return_scene if $game_temp.menu_command_index.has_key?(:equip) $scene = Scene_Menu.new($game_temp.menu_command_index[:equip]) else $scene = Scene_Map.new end end end class Scene_Status < Scene_Base def return_scene if $game_temp.menu_command_index.has_key?(:status) $scene = Scene_Menu.new($game_temp.menu_command_index[:status]) else $scene = Scene_Map.new end end end class Scene_File < Scene_Base alias return_scene_KGC_CustomMenuCommand return_scene unless $@ def return_scene if @from_title || @from_event return_scene_KGC_CustomMenuCommand elsif $game_temp.menu_command_index.has_key?(:save) $scene = Scene_Menu.new($game_temp.menu_command_index[:save]) else $scene = Scene_Map.new end end end class Scene_End < Scene_Base def return_scene if $game_temp.menu_command_index.has_key?(:system) $scene = Scene_Menu.new($game_temp.menu_command_index[:system]) else $scene = Scene_Map.new end end end #=============================================================================== # Game_Map #=============================================================================== class Game_Map #-------------------------------------------------------------------------- # map name #-------------------------------------------------------------------------- unless method_defined?(:map_name) def map_name data = load_data("Data/MapInfos.rvdata") text = data[@map_id].name.gsub(/\[.*\]/) { "" } return text end end end # Game_Map #=============================================================================== # Game_Actor #=============================================================================== class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # new method: now_exp #-------------------------------------------------------------------------- def now_exp return @exp - @exp_list[@level] end #-------------------------------------------------------------------------- # new method: next_exp #-------------------------------------------------------------------------- def next_exp return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0 end end # Game_Actor #=============================================================================== # Window_MultiVariableWindow #=============================================================================== class Window_MultiVariableWindow < Window_Selectable #-------------------------------------------------------------------------- # initialize #-------------------------------------------------------------------------- def initialize dh = 32 + 24 * YEM::MENU::VARIABLES_SHOWN.size dy = Graphics.height - dh super(0, dy, 160, dh) refresh end #-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh @data = [] for i in YEM::MENU::VARIABLES_SHOWN next unless YEM::MENU::VARIABLES_HASH.include?(i) @time_index = @data.size if i == -1 @data.push(i) end @item_max = @data.size create_contents for i in 0...@item_max draw_item(i) end end #-------------------------------------------------------------------------- # draw_item #-------------------------------------------------------------------------- def draw_item(index) rect = item_rect(index) sw = self.width - 32 dy = WLH * index self.contents.clear_rect(rect) i = @data[index] case i when -5 # Draw Map Name self.contents.draw_text(0, dy, sw, WLH, $game_map.map_name, 1) when -2 # Draw Steps if YEM::MENU::VARIABLES_ICONS text = $game_party.steps self.contents.draw_text(0, dy, sw-24, WLH, text, 2) draw_icon(YEM::MENU::VARIABLES_HASH[-2][0], sw-24, dy) else text = YEM::MENU::VARIABLES_HASH[-2][1] value = $game_party.steps cx = contents.text_size(text).width self.contents.font.color = normal_color self.contents.draw_text(0, dy, sw-cx-2, WLH, value, 2) self.contents.font.color = system_color self.contents.draw_text(0, dy, sw, WLH, text, 2) end when -1 # Draw Time if YEM::MENU::VARIABLES_ICONS text = game_time self.contents.draw_text(0, dy, sw-24, WLH, text, 2) draw_icon(YEM::MENU::VARIABLES_HASH[-1][0], sw-24, dy) else self.contents.font.color = normal_color text = game_time self.contents.draw_text(0, dy, sw, WLH, text, 1) end when 0 # Draw Gold if YEM::MENU::VARIABLES_ICONS text = $game_party.gold self.contents.draw_text(0, dy, sw-24, WLH, text, 2) draw_icon(YEM::MENU::VARIABLES_HASH[0][0], sw-24, dy) else draw_currency_value($game_party.gold, 4, dy, 120) end else # Draw Variables if YEM::MENU::VARIABLES_ICONS text = $game_variables[i] self.contents.draw_text(0, dy, sw-24, WLH, text, 2) draw_icon(YEM::MENU::VARIABLES_HASH[i][0], sw-24, dy) else text = YEM::MENU::VARIABLES_HASH[i][1] value = $game_variables[i] cx = contents.text_size(text).width self.contents.font.color = normal_color self.contents.draw_text(0, dy, sw-cx-2, WLH, value, 2) self.contents.font.color = system_color self.contents.draw_text(0, dy, sw, WLH, text, 2) end end end #-------------------------------------------------------------------------- # game_time #-------------------------------------------------------------------------- def game_time gametime = Graphics.frame_count / Graphics.frame_rate hours = gametime / 3600 minutes = gametime / 60 % 60 seconds = gametime % 60 result = sprintf("%d:%02d:%02d", hours, minutes, seconds) return result end #-------------------------------------------------------------------------- # update #-------------------------------------------------------------------------- if YEM::MENU::VARIABLES_SHOWN.include?(-1) def update if game_time != (Graphics.frame_count / Graphics.frame_rate) draw_item(@time_index) end super end end end # Window_MultiVariableWindow #=============================================================================== # Window_MenuCommand #=============================================================================== class Window_MenuCommand < Window_Command #-------------------------------------------------------------------------- # initialize #-------------------------------------------------------------------------- def initialize(array) @data = array[1] @icons = array[2] super(160, array[0]) end #-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh create_contents for i in 0...@item_max draw_item(i) end end #-------------------------------------------------------------------------- # method #-------------------------------------------------------------------------- def method; return @data[self.index]; end #-------------------------------------------------------------------------- # draw_item #-------------------------------------------------------------------------- def draw_item(index, enabled = true) rect = item_rect(index) rect.x += 4 rect.width -= 8 self.contents.clear_rect(rect) self.contents.font.color = normal_color #--- text = @commands[index] icon = @icons[index] case @data[index] when :items, :skill, :equip, :status, :kgc_apviewer, :kgc_skillcp, :kgc_distribute, :yerd_classchange, :yerd_learnskill, :yerd_equipslots enabled = ($game_party.members.size == 0 ? false : true) when :save enabled = !$game_system.save_disabled when :kgc_largeparty enabled = ($game_party.members.size == 0 ? false : true) enabled = false if !$game_party.partyform_enable? else if YEM::MENU::COMMON_EVENTS.include?(@data[index]) if YEM::MENU::COMMON_EVENTS[@data[index]][1] != nil switch_id = YEM::MENU::COMMON_EVENTS[@data[index]][1] enabled = !$game_switches[switch_id] end elsif YEM::MENU::IMPORTED_COMMANDS.include?(@data[index]) if YEM::MENU::IMPORTED_COMMANDS[@data[index]][1] != nil switch_id = YEM::MENU::IMPORTED_COMMANDS[@data[index]][1] enabled = !$game_switches[switch_id] end end end #--- self.contents.font.color.alpha = enabled ? 255 : 128 dx = rect.x; dy = rect.y; dw = rect.width if YEM::MENU::USE_ICONS and icon.is_a?(Integer) draw_icon(icon, 0, dy, enabled) dx += 20; dw -= 20 end self.contents.draw_text(dx, dy, dw, WLH, text, YEM::MENU::ALIGN) end end # Window_MenuCommand #=============================================================================== # # END OF FILE # #===============================================================================
(KGC_LargeParty)
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#_/ ◆ Party Expansion & Formation - KGC_LargeParty ◆ VX ◆
#_/ ◇ Last Update: 2008/04/27 ◇
#_/ ◆ Translation by Mr. Anonymous ◆
#_/-----------------------------------------------------------------------------
#_/ This script allows you more control over the default "party" system by
#_/ removing the limitation of only having four actors to a party. These
#_/ extra actors may behave just as any other actor during battle. In addition
#_/ you may also have "standby" actors, who can be swapped out with the
#_/ current party via a "Party Formation" screen, which may optionally be
#_/ added into the main menu panel, and/or even called from pressing
#_/ a specified button while on the main menu.
#_/-----------------------------------------------------------------------------
#_/ ◆ 2008/04/27 UPDATE [KGC] ◆
#_/ Updated for KGC_CursorAnimation compatibility.
#_/=============================================================================
#_/ ◆ Instructions For Usage ◆
#_/ ◆ Script Commands ◆
#_/ These commands are used in "Script" function in the third page of event
#_/ commands under "Advanced".
#_/
#_/ * call_partyform
#_/ Calls the Party Formation screen.
#_/
#_/ * set_max_battle_member_count(Value)
#_/ Allows you to manually set the maximum amount of actors in the active
#_/ party, i.e. the amount of party members who may participate in battle.
#_/
#_/ * party_full?
#_/ Used for Conditional Branches. This allows you to determine wether the
#_/ active party is full in accordance to MAX_BATTLE_MEMBERS or the above
#_/ manual statement of set_max_battle_member_count(Value).
#_/
#_/ * permit_partyform(true/false)
#_/ Allows you to enable or disable the Party Formation screen on the main
#_/ command menu. This also actives or deactivates PARTYFORM_SWITCH.
#_/
#_/ * fix_actor(ActorID, true/false)
#_/ Allows you to fix or force an actor into remaining in the active party
#_/ and not be switched out with a standby actor. If the true/false
#_/ argument is omitted, the statement is automatically considered true.
#_/
#_/ * change_party_shift(index1, index2)
#_/ This allows you to switch an actor in the position of index1 with the
#_/ actor in the position of index2. This ignores the fix_actor function.
#_/ Also of note is that the first actor in the party actually has an
#_/ index of 0, second actor has an index of 1, and so on.
#_/
#_/ * sort_party_member(sort_type, true/false)
#_/ This allows you to manually sort the actors by replacing sort_type with
#_/ SORT_BY_ID, SORT_BY_NAME, or SORT_BY_LEVEL. If you set the second
#_/ argument to true, the sorting order is reversed. If true, it is not.
#_/ Also, if the second argument is omitted, it is automatically false.
#_/
#_/ * get_stand_by_member_ids
#_/ This aquires the arrangement of the ActorIDs of the standby actors.
#_/
#_/ * stand_by_member?(ActorID)
#_/ Used for Conditional Branches. This allows you to determine if the actor
#_/ specified is a standby party member.
#_/
#_/ * add_battle_member(ActorID, index)
#_/ Allows you to add an actor to the active party and place it in the
#_/ desired position(index). If the second argument is omitted, the actor
#_/ will automatically be placed at the end of the party. Also, if the
#_/ active party is full, the actor will not be added.
#_/
#_/ * remove_battle_member(ActorID)
#_/ Removes an actor from the active party. This cannot removed an actor
#_/ who is fixed into place using fix_actor.
#_/
#_/ * remove_all_battle_member
#_/ All actors other than fixed actors are removed from the active party.
#_/ Note that this seems to unfix fixed characters, but not remove them.
#_/ Also note that if there are no fixed actors, you must add a member
#_/ back into the active party using add_battle_member BEFORE the player
#_/ is allowed to open the menu or enter battle.
#_/
#_/ * random_launch
#_/ Randomly sorts and replaces the active party with those from the standby
#_/ party. Once again this does not effect fixed actors.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#_/ A special note from the translator: I'll be revising this translation for
#_/ a more user-friendly approach and expanded functionality explainations
#_/ when I have the time. If you don't understand something here now, fear not,
#_/ as this is only a beta translation. As such, some things may be incorrect.
#_/ however, it should work without a hitch, with the possible exception of
#_/ SHOW_STAND_BY_MEMBER_NOT_IN_BATTLE, which I still cannot figure out.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#==============================================================================#
# ★ Customization ★ #
#==============================================================================#
module KGC
module LargeParty
# ◆ Party Formation In-Game Switch ◆
# This allows you to assign an in-game Switch that allows you to enable or
# disable the Party Formation screen on the main command menu.
PARTYFORM_SWITCH = 19
# ◆ Party Formation In-Game Switch (In Combat) ◆
# This allows you to assign an in-game Switch that allows you to enable or
# disable the Party Formation screen during combat.
BATTLE_PARTYFORM_SWITCH = 19
# ◆ Default Party Formation Switch Activation Toggle ◆
# When "New Game" is selected, both party formation permission switches
# automatically become active (ON) when this is set as true.
DEFAULT_PARTYFORM_ENABLED = true
# ◆ Maximum Party Members (In Combat) ◆
# Allows you to choose how many actors may participate in a battle.
MAX_BATTLE_MEMBERS = 3
# ◆ The Party Members ◆
# Allows you to choose how many actors may be added to the party.
# *Note: Game_Party::MAX_MEMBERS Is overwritten
# When making this 100 or more, you'll receive an error.
MAX_MEMBERS = 6
# ◆ Fixed Party Member Sorting ◆
# This toggle allows you to enable/disable automatic sorting of fixed(active)
# party members.
# true = Disable automatic sorting.
# false = Enable automatic sorting.
FORBID_CHANGE_SHIFT_FIXED = false
# Standby Members Background Color
# Default: Color.new(0, 0, 0, 0)
STAND_BY_COLOR = Color.new(0, 0, 0, 128)
# ◆ Fixed Current Party Background Color
FIXED_COLOR = Color.new(255, 128, 64, 96)
# Background Color that shows when Members are selected.
SELECTED_COLOR = Color.new(64, 255, 128, 128)
# ◆ Party Formation Command Menu Selection ◆
# This allows you to change the key/button pressed in the menu screen to
# pull up the Party Formation screen without actually highlighting and
# selecting the Party Formation option.
# If this is set as nil, this function is disabled.
MENU_PARTYFORM_BUTTON = Input::A
# This toggle allows you to enable/disable the Party Formation option on the
# main command window.
# true = The option is enabled.
# false = The option is removed.
USE_MENU_PARTYFORM_COMMAND = true
# This allows you to change the text displayed for the Party Formation option
# in the main command window.
VOCAB_MENU_PARTYFORM = "Formazione"
# This toggle allows you to enable/disable the Party Formation option while
# in combat.
# This option is added under the "Run" or "Escape" command.
USE_BATTLE_PARTYFORM = true
# This allows you to change the text displayed for the Party Formation option
# while in combat under the "Run" or "Escape" command.
VOCAB_BATTLE_PARTYFORM = "Formazione"
# ◆ Party Formation Screen Character Dimensions ◆
# This allows you to change the width and height of the actors' placemarkers
# on the Party Formation Screen.
# You can rewrite this [x, y] in accordance to the size of your actor's
# walking graphic.
PARTY_FORM_CHARACTER_SIZE = [40, 48]
# This allows you to change the text of the empty slots in the Party
# Formation Screen.
BATTLE_MEMBER_BLANK_TEXT = "-"
# ◆ Party Formation Screen Member Rows ◆
# This allows you to change the amount of rows that in the "Standby"
# box.
# Adjust this value to 1 if the status window protrudes beyond the screen.
PARTY_MEMBER_WINDOW_ROW_MAX = 2
# ◆ Current Party Member Display ◆
# This toggle allows you to show/hide the current party members in the
# "Standby" box.
# true = Show them! These will be greyed out.
# false = Hide them.
SHOW_BATTLE_MEMBER_IN_PARTY = false
# This allows you to change the text displayed for empty slots on in the
# "Current Party" box.
PARTY_MEMBER_BLANK_TEXT = "-"
# ◆ Width of caption window on organization screen
CAPTION_WINDOW_WIDTH = 192
# ◆ Caption of combat member window on organization screen
BATTLE_MEMBER_CAPTION = "Formazione attuale"
if SHOW_BATTLE_MEMBER_IN_PARTY
# This allows you to change the text that appears on top of the Party
# Formation box.
# (When SHOW_BATTLE_MEMBER_IN_PARTY = true)
PARTY_MEMBER_CAPTION = "Formazione"
else
# This allows you to change the text that appears on top of the Standby
# box.
# (When SHOW_BATTLE_MEMBER_IN_PARTY = false)
PARTY_MEMBER_CAPTION = "Riserve"
end
# ◆ Width of Formation Confirmation Window ◆
CONFIRM_WINDOW_WIDTH = 320
# ◆ Vocab Strings for Formation Confirmation Window ◆
# If the order of these commands are changed or something is removed, expect
# an error.
CONFIRM_WINDOW_COMMANDS = ["Fatto", "Menu", "Annulla"]
# ◆ Equip Item Status Shop Scroll ◆
# This allows you to change the key/button HELD DOWN while using the Up and
# Down keys to scroll the attribute bonuses window (to the right) to view
# the each individual unit's attribute bonuses. KCG_HelpExtension is
# required for this function to work properly.
# If you set this to nil, this function is disabled.
SHOP_STATUS_SCROLL_BUTTON = Input::A
# ◆ Standby Members Experience Gain Percentage ◆
# If you enter 500 in this, the actual EXP gained is 50.0%
# You may also prevent standby units from gaining EXP by setting this is 0.
STAND_BY_EXP_RATE = 1000
# ◆ Standby Members Level-Up Message ◆
# This toggle allows you to enable/disable the level-up messages displayed
# for units on standby.
# true = Show level-up messages for standby units.
# false = Hide level-up messages for standby units.
SHOW_STAND_BY_LEVEL_UP = false
# ◆ Standby Members Combat Display ◆
# *Note: I cannot figure out what this actually does. It doesn't -seem- to
# work as advertised, but I could be wrong. If anyone figures out what this
# actually does, please let me know.
# true : All members are displayed during combat.
# false : Exchanged standby members are not shown.
SHOW_STAND_BY_MEMBER_NOT_IN_BATTLE = false
end
end
$imported = {} if $imported == nil
$imported["LargeParty"] = true
#==============================================================================
# □ KGC::Commands
#==============================================================================
module KGC::Commands
# メンバーのソート形式
SORT_BY_ID = 0 # ID順
SORT_BY_NAME = 1 # 名前順
SORT_BY_LEVEL = 2 # レベル順
module_function
#--------------------------------------------------------------------------
# ○ パーティ編成画面の呼び出し
#--------------------------------------------------------------------------
def call_partyform
return if $game_temp.in_battle
$game_temp.next_scene = :partyform
end
#--------------------------------------------------------------------------
# ○ 戦闘メンバー最大数を設定
# value : 人数 (省略した場合はデフォルト値を使用)
#--------------------------------------------------------------------------
def set_max_battle_member_count(value = nil)
$game_party.max_battle_member_count = value
end
#--------------------------------------------------------------------------
# ○ パーティ人数が一杯か
#--------------------------------------------------------------------------
def party_full?
return $game_party.full?
end
#--------------------------------------------------------------------------
# ○ パーティ編成可否を設定
# enabled : 有効フラグ (省略時 : true)
#--------------------------------------------------------------------------
def permit_partyform(enabled = true)
$game_switches[KGC::LargeParty::PARTYFORM_SWITCH] = enabled
end
#--------------------------------------------------------------------------
# ○ 戦闘中のパーティ編成可否を設定
# enabled : 有効フラグ (省略時 : true)
#--------------------------------------------------------------------------
def permit_battle_partyform(enabled = true)
$game_switches[KGC::LargeParty::BATTLE_PARTYFORM_SWITCH] = enabled
end
#--------------------------------------------------------------------------
# ○ アクターの固定状態を設定
# actor_id : アクター ID
# fixed : 固定フラグ (省略時 : true)
#--------------------------------------------------------------------------
def fix_actor(actor_id, fixed = true)
$game_party.fix_actor(actor_id, fixed)
end
#--------------------------------------------------------------------------
# ○ 並び替え
# メンバーの index1 番目と index2 番目を入れ替える
#--------------------------------------------------------------------------
def change_party_shift(index1, index2)
$game_party.change_shift(index1, index2)
end
#--------------------------------------------------------------------------
# ○ メンバー整列 (昇順)
# sort_type : ソート形式 (SORT_BY_xxx)
# reverse : true だと降順
#--------------------------------------------------------------------------
def sort_party_member(sort_type = SORT_BY_ID, reverse = false)
$game_party.sort_member(sort_type, reverse)
end
#--------------------------------------------------------------------------
# ○ 待機メンバーの ID を取得
#--------------------------------------------------------------------------
def get_stand_by_member_ids
result = []
$game_party.stand_by_members.each { |actor| result << actor.id }
return result
end
#--------------------------------------------------------------------------
# ○ アクターが待機メンバーか
# actor_id : アクター ID
#--------------------------------------------------------------------------
def stand_by_member?(actor_id)
return get_stand_by_member_ids.include?(actor_id)
end
#--------------------------------------------------------------------------
# ○ アクターを戦闘メンバーに加える
# actor_id : アクター ID
# index : 追加位置 (省略時は最後尾)
#--------------------------------------------------------------------------
def add_battle_member(actor_id, index = nil)
$game_party.add_battle_member(actor_id, index)
end
#--------------------------------------------------------------------------
# ○ アクターを戦闘メンバーから外す
# actor_id : アクター ID
#--------------------------------------------------------------------------
def remove_battle_member(actor_id)
$game_party.remove_battle_member(actor_id)
end
#--------------------------------------------------------------------------
# ○ 固定アクター以外を戦闘メンバーから外す
#--------------------------------------------------------------------------
def remove_all_battle_member
$game_party.all_members.each { |actor|
$game_party.remove_battle_member(actor.id)
}
end
#--------------------------------------------------------------------------
# ○ ランダム出撃
#--------------------------------------------------------------------------
def random_launch
new_battle_members = $game_party.fixed_members
candidates = $game_party.all_members - new_battle_members
num = [$game_party.max_battle_member_count - new_battle_members.size,
candidates.size].min
return if num <= 0
# ランダムに選ぶ
ary = (0...candidates.size).to_a.sort_by { rand }
ary[0...num].each { |i| new_battle_members << candidates[i] }
$game_party.set_battle_member(new_battle_members)
end
end
class Game_Interpreter
include KGC::Commands
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Vocab
#==============================================================================
module Vocab
# 「パーティ編成」コマンド名 (メニュー)
def self.partyform
return KGC::LargeParty::VOCAB_MENU_PARTYFORM
end
# 「パーティ編成」コマンド名 (戦闘)
def self.partyform_battle
return KGC::LargeParty::VOCAB_BATTLE_PARTYFORM
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ○ パーティ内インデックス取得
#--------------------------------------------------------------------------
def party_index
return $game_party.all_members.index(self)
end
#--------------------------------------------------------------------------
# ○ 戦闘メンバーか判定
#--------------------------------------------------------------------------
def battle_member?
return $game_party.battle_members.include?(self)
end
#--------------------------------------------------------------------------
# ○ 固定メンバーか判定
#--------------------------------------------------------------------------
def fixed_member?
return $game_party.fixed_members.include?(self)
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Game_Party
#==============================================================================
class Game_Party
#--------------------------------------------------------------------------
# ● 定数
#--------------------------------------------------------------------------
MAX_MEMBERS = KGC::LargeParty::MAX_MEMBERS # 最大パーティ人数
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias initialize_KGC_LargeParty initialize
def initialize
initialize_KGC_LargeParty
@max_battle_member_count = nil
@battle_member_count = 0
@fixed_actors = []
end
#--------------------------------------------------------------------------
# ○ 戦闘メンバー最大数取得
#--------------------------------------------------------------------------
def max_battle_member_count
if @max_battle_member_count == nil
return KGC::LargeParty::MAX_BATTLE_MEMBERS
else
return @max_battle_member_count
end
end
#--------------------------------------------------------------------------
# ○ 戦闘メンバー最大数変更
#--------------------------------------------------------------------------
def max_battle_member_count=(value)
if value.is_a?(Integer)
value = [value, 1].max
end
@max_battle_member_count = value
end
#--------------------------------------------------------------------------
# ○ 戦闘メンバー数取得
#--------------------------------------------------------------------------
def battle_member_count
if @battle_member_count == nil
@battle_member_count = @actors.size
end
@battle_member_count =
[@battle_member_count, @actors.size, max_battle_member_count].min
return @battle_member_count
end
#--------------------------------------------------------------------------
# ○ 戦闘メンバー数設定
#--------------------------------------------------------------------------
def battle_member_count=(value)
@battle_member_count = [[value, 0].max,
@actors.size, max_battle_member_count].min
end
#--------------------------------------------------------------------------
# ● メンバーの取得
#--------------------------------------------------------------------------
alias members_KGC_LargeParty members
def members
if $game_temp.in_battle ||
!KGC::LargeParty::SHOW_STAND_BY_MEMBER_NOT_IN_BATTLE
return battle_members
else
return members_KGC_LargeParty
end
end
#--------------------------------------------------------------------------
# ○ 全メンバーの取得
#--------------------------------------------------------------------------
def all_members
return members_KGC_LargeParty
end
#--------------------------------------------------------------------------
# ○ 戦闘メンバーの取得
#--------------------------------------------------------------------------
def battle_members
result = []
battle_member_count.times { |i| result << $game_actors[@actors[i]] }
return result
end
#--------------------------------------------------------------------------
# ○ 待機メンバーの取得
#--------------------------------------------------------------------------
def stand_by_members
return (all_members - battle_members)
end
#--------------------------------------------------------------------------
# ○ 固定メンバーの取得
#--------------------------------------------------------------------------
def fixed_members
result = []
@fixed_actors.each { |i| result << $game_actors[i] }
return result
end
#--------------------------------------------------------------------------
# ● 初期パーティのセットアップ
#--------------------------------------------------------------------------
alias setup_starting_members_KGC_LargeParty setup_starting_members
def setup_starting_members
setup_starting_members_KGC_LargeParty
self.battle_member_count = @actors.size
end
#--------------------------------------------------------------------------
# ● 戦闘テスト用パーティのセットアップ
#--------------------------------------------------------------------------
alias setup_battle_test_members_KGC_LargeParty setup_battle_test_members
def setup_battle_test_members
setup_battle_test_members_KGC_LargeParty
self.battle_member_count = @actors.size
end
#--------------------------------------------------------------------------
# ○ メンバーの新規設定
# new_member : 新しいメンバー
#--------------------------------------------------------------------------
def set_member(new_member)
@actors = []
new_member.each { |actor| @actors << actor.id }
end
#--------------------------------------------------------------------------
# ○ 戦闘メンバーの新規設定
# new_member : 新しい戦闘メンバー
#--------------------------------------------------------------------------
def set_battle_member(new_member)
new_battle_member = []
new_member.each { |actor|
@actors.delete(actor.id)
new_battle_member << actor.id
}
@actors = new_battle_member + @actors
self.battle_member_count = new_member.size
end
#--------------------------------------------------------------------------
# ○ パーティ編成を許可しているか判定
#--------------------------------------------------------------------------
def partyform_enable?
return $game_switches[KGC::LargeParty::PARTYFORM_SWITCH]
end
#--------------------------------------------------------------------------
# ○ 戦闘中のパーティ編成を許可しているか判定
#--------------------------------------------------------------------------
def battle_partyform_enable?
return false unless partyform_enable?
return $game_switches[KGC::LargeParty::BATTLE_PARTYFORM_SWITCH]
end
#--------------------------------------------------------------------------
# ○ メンバーが一杯か判定
#--------------------------------------------------------------------------
def full?
return (@actors.size >= MAX_MEMBERS)
end
#--------------------------------------------------------------------------
# ○ 固定アクターか判定
# actor_id : 判定するアクターの ID
#--------------------------------------------------------------------------
def actor_fixed?(actor_id)
return @fixed_actors.include?(actor_id)
end
#--------------------------------------------------------------------------
# ● アクターを加える
# actor_id : アクター ID
#--------------------------------------------------------------------------
alias add_actor_KGC_LargeParty add_actor
def add_actor(actor_id)
last_size = @actors.size
add_actor_KGC_LargeParty(actor_id)
if last_size < @actors.size
self.battle_member_count += 1
end
end
#--------------------------------------------------------------------------
# ○ アクターを戦闘メンバーに加える
# actor_id : アクター ID
# index : 追加位置 (省略時は最後尾)
#--------------------------------------------------------------------------
def add_battle_member(actor_id, index = nil)
return unless @actors.include?(actor_id) # パーティにいない
if index == nil
return if battle_members.include?($game_actors[actor_id]) # 出撃済み
return if battle_member_count == max_battle_member_count # 人数が最大
index = battle_member_count
end
@actors.delete(actor_id)
@actors.insert(index, actor_id)
self.battle_member_count += 1
end
#--------------------------------------------------------------------------
# ○ アクターを戦闘メンバーから外す
# actor_id : アクター ID
#--------------------------------------------------------------------------
def remove_battle_member(actor_id)
return unless @actors.include?(actor_id) # パーティにいない
return if actor_fixed?(actor_id) # 固定済み
return if stand_by_members.include?($game_actors[actor_id]) # 待機中
@actors.delete(actor_id)
@actors.push(actor_id)
self.battle_member_count -= 1
end
#--------------------------------------------------------------------------
# ○ アクターの固定状態を設定
# actor_id : アクター ID
# fixed : 固定フラグ (省略時 : false)
#--------------------------------------------------------------------------
def fix_actor(actor_id, fixed = false)
return unless @actors.include?(actor_id) # パーティにいない
if fixed
# 固定
unless @fixed_actors.include?(actor_id)
@fixed_actors << actor_id
unless battle_members.include?($game_actors[actor_id])
self.battle_member_count += 1
end
end
# 強制出撃
apply_force_launch
else
# 固定解除
@fixed_actors.delete(actor_id)
end
$game_player.refresh
end
#--------------------------------------------------------------------------
# ○ 強制出撃適用
#--------------------------------------------------------------------------
def apply_force_launch
while (fixed_members - battle_members).size > 0
# 固定状態でないメンバーを適当に持ってきて入れ替え
actor1 = stand_by_members.find { |a| @fixed_actors.include?(a.id) }
actor2 = battle_members.reverse.find { |a| !@fixed_actors.include?(a.id) }
index1 = @actors.index(actor1.id)
index2 = @actors.index(actor2.id)
@actors[index1], @actors[index2] = @actors[index2], @actors[index1]
# 戦闘メンバーが全員固定されたら戻る (無限ループ防止)
all_fixed = true
battle_members.each { |actor|
unless actor.fixed_member?
all_fixed = false
break
end
}
break if all_fixed
end
end
#--------------------------------------------------------------------------
# ○ メンバー整列 (昇順)
# sort_type : ソート形式 (SORT_BY_xxx)
# reverse : true だと降順
#--------------------------------------------------------------------------
def sort_member(sort_type = KGC::Commands::SORT_BY_ID,
reverse = false)
# バッファを準備
b_actors = battle_members
actors = all_members - b_actors
f_actors = fixed_members
# 固定キャラはソートしない
if KGC::LargeParty::FORBID_CHANGE_SHIFT_FIXED
actors -= f_actors
b_actors -= f_actors
end
# ソート
case sort_type
when KGC::Commands::SORT_BY_ID # ID順
actors.sort! { |a, b| a.id <=> b.id }
b_actors.sort! { |a, b| a.id <=> b.id }
when KGC::Commands::SORT_BY_NAME # 名前順
actors.sort! { |a, b| a.name <=> b.name }
b_actors.sort! { |a, b| a.name <=> b.name }
when KGC::Commands::SORT_BY_LEVEL # レベル順
actors.sort! { |a, b| a.level <=> b.level }
b_actors.sort! { |a, b| a.level <=> b.level }
end
# 反転
if reverse
actors.reverse!
b_actors.reverse!
end
# 固定キャラを先頭に持ってくる
if KGC::LargeParty::FORBID_CHANGE_SHIFT_FIXED
actors = f_actors + actors
b_actors = f_actors + b_actors
end
# 復帰
set_member(actors)
set_battle_member(b_actors)
apply_force_launch
$game_player.refresh
end
#--------------------------------------------------------------------------
# ○ 並び替え
# 戦闘メンバーの index1 番目と index2 番目を入れ替える
#--------------------------------------------------------------------------
def change_shift(index1, index2)
size = @actors.size
if index1 >= size || index2 >= size
return
end
buf = @actors[index1]
@actors[index1] = @actors[index2]
@actors[index2] = buf
$game_player.refresh
end
#--------------------------------------------------------------------------
# ● 戦闘用ステートの解除 (戦闘終了時に呼び出し)
#--------------------------------------------------------------------------
def remove_states_battle
for actor in all_members
actor.remove_states_battle
end
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Window_Command
#==============================================================================
class Window_Command < Window_Selectable
unless method_defined?(:add_command)
#--------------------------------------------------------------------------
# ○ コマンドを追加
# 追加した位置を返す
#--------------------------------------------------------------------------
def add_command(command)
@commands << command
@item_max = @commands.size
item_index = @item_max - 1
refresh_command
draw_item(item_index)
return item_index
end
#--------------------------------------------------------------------------
# ○ コマンドをリフレッシュ
#--------------------------------------------------------------------------
def refresh_command
buf = self.contents.clone
self.height = [self.height, row_max * WLH + 32].max
create_contents
self.contents.blt(0, 0, buf, buf.rect)
buf.dispose
end
#--------------------------------------------------------------------------
# ○ コマンドを挿入
#--------------------------------------------------------------------------
def insert_command(index, command)
@commands.insert(index, command)
@item_max = @commands.size
refresh_command
refresh
end
#--------------------------------------------------------------------------
# ○ コマンドを削除
#--------------------------------------------------------------------------
def remove_command(command)
@commands.delete(command)
@item_max = @commands.size
refresh
end
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Window_MenuStatus
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# ● 定数
#--------------------------------------------------------------------------
STATUS_HEIGHT = 96 # ステータス一人分の高さ
#--------------------------------------------------------------------------
# ● ウィンドウ内容の作成
#--------------------------------------------------------------------------
def create_contents
self.contents.dispose
self.contents = Bitmap.new(width - 32,
[height - 32, row_max * STATUS_HEIGHT].max)
end
#--------------------------------------------------------------------------
# ● 先頭の行の取得
#--------------------------------------------------------------------------
def top_row
return self.oy / STATUS_HEIGHT
end
#--------------------------------------------------------------------------
# ● 先頭の行の設定
# row : 先頭に表示する行
#--------------------------------------------------------------------------
def top_row=(row)
super(row)
self.oy = self.oy / WLH * STATUS_HEIGHT
end
#--------------------------------------------------------------------------
# ● 1 ページに表示できる行数の取得
#--------------------------------------------------------------------------
def page_row_max
return (self.height - 32) / STATUS_HEIGHT
end
#--------------------------------------------------------------------------
# ● 項目を描画する矩形の取得
# index : 項目番号
#--------------------------------------------------------------------------
def item_rect(index)
rect = super(index)
rect.height = STATUS_HEIGHT
rect.y = index / @column_max * STATUS_HEIGHT
return rect
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
@item_max = $game_party.members.size
create_contents
fill_stand_by_background
draw_member
end
#--------------------------------------------------------------------------
# ○ パーティメンバー描画
#--------------------------------------------------------------------------
def draw_member
for actor in $game_party.members
draw_actor_face(actor, 2, actor.party_index * 96 + 2, 92)
x = 104
y = actor.party_index * 96 + WLH / 2
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 120, y)
draw_actor_state(actor, x, y + WLH * 2)
draw_actor_hp(actor, x + 120, y + WLH * 1)
draw_actor_mp(actor, x + 120, y + WLH * 2)
end
end
#--------------------------------------------------------------------------
# ○ 待機メンバーの背景色を塗る
#--------------------------------------------------------------------------
def fill_stand_by_background
color = KGC::LargeParty::STAND_BY_COLOR
dy = STATUS_HEIGHT * $game_party.battle_members.size
dh = STATUS_HEIGHT * $game_party.stand_by_members.size
if dh > 0
self.contents.fill_rect(0, dy, self.width - 32, dh, color)
end
end
#--------------------------------------------------------------------------
# ● カーソルの更新
#--------------------------------------------------------------------------
def update_cursor
if @index < 0 # カーソルなし
self.cursor_rect.empty
elsif @index < @item_max # 通常
super
elsif @index >= 100 # 自分
self.cursor_rect.set(0, (@index - 100) * STATUS_HEIGHT,
contents.width, STATUS_HEIGHT)
else # 全体
self.cursor_rect.set(0, 0, contents.width, @item_max * STATUS_HEIGHT)
end
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Window_ShopStatus
#==============================================================================
class Window_ShopStatus < Window_Base
#--------------------------------------------------------------------------
# ● ウィンドウ内容の作成
#--------------------------------------------------------------------------
def create_contents
self.contents.dispose
self.contents = Bitmap.new(width - 32,
WLH * ($game_party.members.size + 1) * 2)
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Selectable
#--------------------------------------------------------------------------
# ● ウィンドウ内容の作成
#--------------------------------------------------------------------------
def create_contents
self.contents.dispose
self.contents = Bitmap.new(width - 32,
[WLH * $game_party.members.size, height - 32].max)
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
alias refresh_KGC_LargeParty refresh
def refresh
create_contents
refresh_KGC_LargeParty
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# □ Window_PartyFormCaption
#------------------------------------------------------------------------------
# パーティ編成画面でウィンドウのキャプションを表示するウィンドウです。
#==============================================================================
class Window_PartyFormCaption < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# caption : 表示するキャプション
#--------------------------------------------------------------------------
def initialize(caption = "")
super(0, 0, KGC::LargeParty::CAPTION_WINDOW_WIDTH, WLH + 32)
self.z = 1500
@caption = caption
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.draw_text(0, 0, width - 32, WLH, @caption)
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# □ Window_PartyFormMember
#------------------------------------------------------------------------------
# パーティ編成画面でメンバーを表示するウィンドウです。
#==============================================================================
class Window_PartyFormMember < Window_Selectable
#--------------------------------------------------------------------------
# ○ 定数
#--------------------------------------------------------------------------
DRAW_SIZE = KGC::LargeParty::PARTY_FORM_CHARACTER_SIZE
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :selected_index # 選択済みインデックス
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# x : ウィンドウの X 座標
# y : ウィンドウの Y 座標
# width : ウィンドウの幅
# height : ウィンドウの高さ
# spacing : 横に項目が並ぶときの空白の幅
#--------------------------------------------------------------------------
def initialize(x, y, width, height, spacing = 8)
super(x, y, width, height, spacing)
self.z = 1000
end
#--------------------------------------------------------------------------
# ● ウィンドウ内容の作成
#--------------------------------------------------------------------------
def create_contents
self.contents.dispose
self.contents = Bitmap.new(width - 32,
[height - 32, row_max * DRAW_SIZE[1]].max)
end
#--------------------------------------------------------------------------
# ● 先頭の行の取得
#--------------------------------------------------------------------------
def top_row
return self.oy / DRAW_SIZE[1]
end
#--------------------------------------------------------------------------
# ● 先頭の行の設定
# row : 先頭に表示する行
#--------------------------------------------------------------------------
def top_row=(row)
super(row)
self.oy = self.oy / WLH * DRAW_SIZE[1]
end
#--------------------------------------------------------------------------
# ● 1 ページに表示できる行数の取得
#--------------------------------------------------------------------------
def page_row_max
return (self.height - 32) / DRAW_SIZE[1]
end
#--------------------------------------------------------------------------
# ● 項目を描画する矩形の取得
# index : 項目番号
#--------------------------------------------------------------------------
def item_rect(index)
rect = super(index)
rect.width = DRAW_SIZE[0]
rect.height = DRAW_SIZE[1]
rect.y = index / @column_max * DRAW_SIZE[1]
return rect
end
#--------------------------------------------------------------------------
# ○ 選択アクター取得
#--------------------------------------------------------------------------
def actor
return @actors[self.index]
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
restore_member_list
draw_member
end
#--------------------------------------------------------------------------
# ○ メンバーリスト修復
#--------------------------------------------------------------------------
def restore_member_list
# 継承先で定義
end
#--------------------------------------------------------------------------
# ○ メンバー描画
#--------------------------------------------------------------------------
def draw_member
# 継承先で定義
end
#--------------------------------------------------------------------------
# ○ 空欄アクター描画
# index : 項目番号
#--------------------------------------------------------------------------
def draw_empty_actor(index)
# 継承先で定義
end
#--------------------------------------------------------------------------
# ○ 固定キャラ背景描画
# index : 項目番号
#--------------------------------------------------------------------------
def draw_fixed_back(index)
rect = item_rect(index)
self.contents.fill_rect(rect, KGC::LargeParty::FIXED_COLOR)
end
#--------------------------------------------------------------------------
# ○ 選択中キャラ背景描画
# index : 項目番号
#--------------------------------------------------------------------------
def draw_selected_back(index)
rect = item_rect(index)
self.contents.fill_rect(rect, KGC::LargeParty::SELECTED_COLOR)
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# □ Window_PartyFormBattleMember
#------------------------------------------------------------------------------
# パーティ編成画面で戦闘メンバーを表示するウィンドウです。
#==============================================================================
class Window_PartyFormBattleMember < Window_PartyFormMember
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :selected_index # 選択済みインデックス
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(0, 0, 64, DRAW_SIZE[1] + 32)
column_width = DRAW_SIZE[0] + @spacing
nw = [column_width * $game_party.max_battle_member_count + 32,
Graphics.width].min
self.width = nw
@item_max = $game_party.max_battle_member_count
@column_max = width / column_width
@selected_index = nil
create_contents
refresh
self.active = true
self.index = 0
end
#--------------------------------------------------------------------------
# ○ メンバーリスト修復
#--------------------------------------------------------------------------
def restore_member_list
@actors = $game_party.battle_members
end
#--------------------------------------------------------------------------
# ○ メンバー描画
#--------------------------------------------------------------------------
def draw_member
@item_max.times { |i|
actor = @actors[i]
if actor == nil
draw_empty_actor(i)
else
if i == @selected_index
draw_selected_back(i)
elsif $game_party.actor_fixed?(actor.id)
draw_fixed_back(i)
end
rect = item_rect(i)
draw_actor_graphic(actor,
rect.x + DRAW_SIZE[0] / 2,
rect.y + DRAW_SIZE[1] - 4)
end
}
end
#--------------------------------------------------------------------------
# ○ 空欄アクター描画
# index : 項目番号
#--------------------------------------------------------------------------
def draw_empty_actor(index)
rect = item_rect(index)
self.contents.font.color = system_color
self.contents.draw_text(rect, KGC::LargeParty::BATTLE_MEMBER_BLANK_TEXT, 1)
self.contents.font.color = normal_color
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# □ Window_PartyFormAllMember
#------------------------------------------------------------------------------
# パーティ編成画面で全メンバーを表示するウィンドウです。
#==============================================================================
class Window_PartyFormAllMember < Window_PartyFormMember
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(0, 0, 64, 64)
restore_member_list
@item_max = $game_party.all_members.size
# 各種サイズ計算
column_width = DRAW_SIZE[0] + @spacing
sw = [@item_max * column_width + 32, Graphics.width].min
@column_max = (sw - 32) / column_width
sh = ([@item_max - 1, 0].max / @column_max + 1) * DRAW_SIZE[1] + 32
sh = [sh, DRAW_SIZE[1] * KGC::LargeParty::PARTY_MEMBER_WINDOW_ROW_MAX + 32].min
# 座標・サイズ調整
self.y += DRAW_SIZE[1] + 32
self.width = sw
self.height = sh
create_contents
refresh
self.active = false
self.index = 0
end
#--------------------------------------------------------------------------
# ○ 選択しているアクターのインデックス取得
#--------------------------------------------------------------------------
def actor_index
return @index_offset + self.index
end
#--------------------------------------------------------------------------
# ○ メンバーリスト修復
#--------------------------------------------------------------------------
def restore_member_list
if KGC::LargeParty::SHOW_BATTLE_MEMBER_IN_PARTY
@actors = $game_party.all_members
@index_offset = 0
else
@actors = $game_party.stand_by_members
@index_offset = $game_party.battle_members.size
end
end
#--------------------------------------------------------------------------
# ○ メンバー描画
#--------------------------------------------------------------------------
def draw_member
@item_max.times { |i|
actor = @actors[i]
if actor == nil
draw_empty_actor(i)
next
end
if $game_party.actor_fixed?(actor.id)
draw_fixed_back(i)
end
rect = item_rect(i)
opacity = ($game_party.battle_members.include?(actor) ? 96 : 255)
draw_actor_graphic(actor,
rect.x + DRAW_SIZE[0] / 2,
rect.y + DRAW_SIZE[1] - 4,
opacity)
}
end
#--------------------------------------------------------------------------
# ● アクターの歩行グラフィック描画
# actor : アクター
# x : 描画先 X 座標
# y : 描画先 Y 座標
# opacity : 不透明度
#--------------------------------------------------------------------------
def draw_actor_graphic(actor, x, y, opacity = 255)
draw_character(actor.character_name, actor.character_index, x, y, opacity)
end
#--------------------------------------------------------------------------
# ● 歩行グラフィックの描画
# character_name : 歩行グラフィック ファイル名
# character_index : 歩行グラフィック インデックス
# x : 描画先 X 座標
# y : 描画先 Y 座標
# opacity : 不透明度
#--------------------------------------------------------------------------
def draw_character(character_name, character_index, x, y, opacity = 255)
return if character_name == nil
bitmap = Cache.character(character_name)
sign = character_name[/^[\!\$]./]
if sign != nil and sign.include?(')
cw = bitmap.width / 3
ch = bitmap.height / 4
else
cw = bitmap.width / 12
ch = bitmap.height / 8
end
n = character_index
src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, opacity)
end
#--------------------------------------------------------------------------
# ○ 空欄アクター描画
# index : 項目番号
#--------------------------------------------------------------------------
def draw_empty_actor(index)
rect = item_rect(index)
self.contents.font.color = system_color
self.contents.draw_text(rect, KGC::LargeParty::PARTY_MEMBER_BLANK_TEXT, 1)
self.contents.font.color = normal_color
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# □ Window_PartyFormStatus
#------------------------------------------------------------------------------
# パーティ編成画面でアクターのステータスを表示するウィンドウです。
#==============================================================================
class Window_PartyFormStatus < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(0, 0, 384, 128)
self.z = 1000
@actor = nil
refresh
end
#--------------------------------------------------------------------------
# ○ アクター設定
#--------------------------------------------------------------------------
def set_actor(actor)
if @actor != actor
@actor = actor
refresh
end
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
if @actor == nil
return
end
draw_actor_face(@actor, 0, 0)
dx = 104
draw_actor_name(@actor, dx, 0)
#~ draw_actor_hp(@actor, dx, WLH * 2)
#~ draw_actor_mp(@actor, dx, WLH * 2)
4.times { |i|
draw_actor_parameter(@actor, dx + 128, WLH * i, i, 120)
}
end
#--------------------------------------------------------------------------
# ● 能力値の描画
# actor : アクター
# x : 描画先 X 座標
# y : 描画先 Y 座標
# type : 能力値の種類 (0~3)
# width : 描画幅
#--------------------------------------------------------------------------
def draw_actor_parameter(actor, x, y, type, width = 156)
case type
when 0
# self.contents.font.color = normal_hp_color
parameter_name = Vocab::hp
# self.contents.font.color = normal_color
parameter_value = actor.hp
#~ self.contents.font.color = normal_hp_color
when 1
# self.contents.font.color = power_down_color
parameter_name = Vocab::atk
#~ self.contents.font.color = normal_color
parameter_value = actor.atk
#~ self.contents.font.color = power_down_color
when 2
parameter_name = Vocab::spi
parameter_value = actor.spi
#~ self.contents.font.color = Color.new(105, 155, 255)
#~ when 2
#~ parameter_name = Vocab::agi
#~ parameter_value = actor.agi
#~ parameter_value = sprintf("%d%%", parameter_value)
end
nw = width - 36
self.contents.draw_text(x, y, nw, WLH, parameter_name)
self.contents.font.color = normal_color
self.contents.draw_text(x + nw, y, 36, WLH, parameter_value, 2)
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# □ Window_PartyFormControl
#------------------------------------------------------------------------------
# パーティ編成画面で操作方法を表示するウィンドウです。
#==============================================================================
class Window_PartyFormControl < Window_Base
#--------------------------------------------------------------------------
# ○ 定数
#--------------------------------------------------------------------------
MODE_BATTLE_MEMBER = 0
MODE_SHIFT_CHANGE = 1
MODE_PARTY_MEMBER = 2
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(0, 0, Graphics.width - 384, 128)
self.z = 1000
@mode = MODE_BATTLE_MEMBER
refresh
end
#--------------------------------------------------------------------------
# ○ モード変更
#--------------------------------------------------------------------------
def mode=(value)
@mode = value
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
case @mode
when MODE_BATTLE_MEMBER # 戦闘メンバー
buttons = [
"A: Rimuovi",
"B: Termina",
"C: Conferma",
"X: Ordina"
]
when MODE_SHIFT_CHANGE # 並び替え
buttons = [
"B: Annulla",
"C: Conferma",
"X: Conferma"
]
when MODE_PARTY_MEMBER # パーティメンバー
buttons = [
"B: Annulla",
"C: Conferma"
]
else
return
end
buttons.each_with_index { |c, i|
self.contents.draw_text(0, WLH * i, width - 32, WLH, c)
}
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Scene_Title
#==============================================================================
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# ● 各種ゲームオブジェクトの作成
#--------------------------------------------------------------------------
alias create_game_objects_KGC_LargeParty create_game_objects
def create_game_objects
create_game_objects_KGC_LargeParty
if KGC::LargeParty::DEFAULT_PARTYFORM_ENABLED
$game_switches[KGC::LargeParty::PARTYFORM_SWITCH] = true
$game_switches[KGC::LargeParty::BATTLE_PARTYFORM_SWITCH] = true
end
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Scene_Map
#==============================================================================
class Scene_Map < Scene_Base
#--------------------------------------------------------------------------
# ● 画面切り替えの実行
#--------------------------------------------------------------------------
alias update_scene_change_KGC_LargeParty update_scene_change
def update_scene_change
return if $game_player.moving? # プレイヤーの移動中?
if $game_temp.next_scene == :partyform
call_partyform
return
end
update_scene_change_KGC_LargeParty
end
#--------------------------------------------------------------------------
# ○ パーティ編成画面への切り替え
#--------------------------------------------------------------------------
def call_partyform
$game_temp.next_scene = nil
$scene = Scene_PartyForm.new(0, Scene_PartyForm::HOST_MAP)
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Scene_Menu
#==============================================================================
class Scene_Menu < Scene_Base
if KGC::LargeParty::USE_MENU_PARTYFORM_COMMAND
#--------------------------------------------------------------------------
# ● コマンドウィンドウの作成
#--------------------------------------------------------------------------
alias create_command_window_KGC_LargeParty create_command_window
def create_command_window
create_command_window_KGC_LargeParty
return if $imported["CustomMenuCommand"]
@__command_partyform_index =
@command_window.add_command(Vocab.partyform)
@command_window.draw_item(@__command_partyform_index,
$game_party.partyform_enable?)
if @command_window.oy > 0
@command_window.oy -= Window_Base::WLH
end
@command_window.index = @menu_index
end
end
#--------------------------------------------------------------------------
# ● コマンド選択の更新
#--------------------------------------------------------------------------
alias update_command_selection_KGC_LargeParty update_command_selection
def update_command_selection
current_menu_index = @__command_partyform_index
call_partyform_flag = false
if Input.trigger?(Input::C)
case @command_window.index
when @__command_partyform_index # パーティ編成
call_partyform_flag = true
end
# パーティ編成ボタン押下
elsif KGC::LargeParty::MENU_PARTYFORM_BUTTON != nil &&
Input.trigger?(KGC::LargeParty::MENU_PARTYFORM_BUTTON)
call_partyform_flag = true
current_menu_index = @command_window.index if current_menu_index == nil
end
# パーティ編成画面に移行
if call_partyform_flag
if $game_party.members.size == 0 || !$game_party.partyform_enable?
Sound.play_buzzer
return
end
Sound.play_decision
$scene = Scene_PartyForm.new(current_menu_index)
return
end
update_command_selection_KGC_LargeParty
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Scene_Shop
#==============================================================================
unless $imported["HelpExtension"]
class Scene_Shop < Scene_Base
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias udpate_KGC_LargeParty update
def update
# スクロール判定
if !@command_window.active &&
KGC::LargeParty::SHOP_STATUS_SCROLL_BUTTON != nil &&
Input.press?(KGC::LargeParty::SHOP_STATUS_SCROLL_BUTTON)
super
update_menu_background
update_scroll_status
return
else
@status_window.cursor_rect.empty
end
udpate_KGC_LargeParty
end
#--------------------------------------------------------------------------
# ○ ステータスウィンドウのスクロール処理
#--------------------------------------------------------------------------
def update_scroll_status
# ステータスウィンドウにカーソルを表示
@status_window.cursor_rect.width = @status_window.contents.width
@status_window.cursor_rect.height = @status_window.height - 32
@status_window.update
if Input.press?(Input::UP)
@status_window.oy = [@status_window.oy - 4, 0].max
elsif Input.press?(Input::DOWN)
max_pos = [@status_window.contents.height -
(@status_window.height - 32), 0].max
@status_window.oy = [@status_window.oy + 4, max_pos].min
end
end
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# □ Scene_PartyForm
#------------------------------------------------------------------------------
# パーティ編成画面の処理を行うクラスです。
#==============================================================================
class Scene_PartyForm < Scene_Base
#--------------------------------------------------------------------------
# ○ 定数
#--------------------------------------------------------------------------
CAPTION_OFFSET = 40 # キャプションウィンドウの位置補正
HOST_MENU = 0 # 呼び出し元 : メニュー
HOST_MAP = 1 # 呼び出し元 : マップ
HOST_BATTLE = 2 # 呼び出し元 : 戦闘
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# menu_index : コマンドのカーソル初期位置
# host_scene : 呼び出し元 (0..メニュー 1..マップ 2..戦闘)
#--------------------------------------------------------------------------
def initialize(menu_index = 1, host_scene = HOST_MENU)
@menu_index = menu_index
@host_scene = host_scene
end
#--------------------------------------------------------------------------
# ● 開始処理
#--------------------------------------------------------------------------
def start
super
create_menu_background
create_windows
create_confirm_window
adjust_window_location
# 編成前のパーティを保存
@battle_actors = $game_party.battle_members.dup
@party_actors = $game_party.all_members.dup
end
#--------------------------------------------------------------------------
# ○ ウィンドウの作成
#--------------------------------------------------------------------------
def create_windows
# 編成用ウィンドウを作成
@battle_member_window = Window_PartyFormBattleMember.new
@party_member_window = Window_PartyFormAllMember.new
@status_window = Window_PartyFormStatus.new
@status_window.set_actor(@battle_member_window.actor)
# その他のウィンドウを作成
@battle_member_caption_window =
Window_PartyFormCaption.new(KGC::LargeParty::BATTLE_MEMBER_CAPTION)
@party_member_caption_window =
Window_PartyFormCaption.new(KGC::LargeParty::PARTY_MEMBER_CAPTION)
@control_window = Window_PartyFormControl.new
end
#--------------------------------------------------------------------------
# ○ 確認ウィンドウの作成
#--------------------------------------------------------------------------
def create_confirm_window
commands = KGC::LargeParty::CONFIRM_WINDOW_COMMANDS
@confirm_window =
Window_Command.new(KGC::LargeParty::CONFIRM_WINDOW_WIDTH, commands)
@confirm_window.index = 0
@confirm_window.x = (Graphics.width - @confirm_window.width) / 2
@confirm_window.y = (Graphics.height - @confirm_window.height) / 2
@confirm_window.z = 2000
@confirm_window.openness = 0
@confirm_window.active = false
end
#--------------------------------------------------------------------------
# ○ ウィンドウの座標調整
#--------------------------------------------------------------------------
def adjust_window_location
# 基準座標を計算
base_x = [@battle_member_window.width, @party_member_window.width].max
base_x = [(Graphics.width - base_x) / 2, 0].max
base_y = @battle_member_window.height + @party_member_window.height +
@status_window.height + CAPTION_OFFSET * 2
base_y = [(Graphics.height - base_y) / 2, 0].max
# 編成用ウィンドウの座標をセット
@battle_member_window.x = base_x
@battle_member_window.y = base_y + CAPTION_OFFSET
@party_member_window.x = base_x
@party_member_window.y = @battle_member_window.y +
@battle_member_window.height + CAPTION_OFFSET
@status_window.x = 0
@status_window.y = @party_member_window.y + @party_member_window.height
# その他のウィンドウの座標をセット
@battle_member_caption_window.x = [base_x - 16, 0].max
@battle_member_caption_window.y = @battle_member_window.y - CAPTION_OFFSET
@party_member_caption_window.x = [base_x - 16, 0].max
@party_member_caption_window.y = @party_member_window.y - CAPTION_OFFSET
@control_window.x = @status_window.width
@control_window.y = @status_window.y
end
#--------------------------------------------------------------------------
# ● 終了処理
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@battle_member_window.dispose
@party_member_window.dispose
@status_window.dispose
@battle_member_caption_window.dispose
@party_member_caption_window.dispose
@control_window.dispose
@confirm_window.dispose
end
#--------------------------------------------------------------------------
# ● メニュー画面系の背景作成
#--------------------------------------------------------------------------
def create_menu_background
super
@menuback_sprite.z = 500
end
#--------------------------------------------------------------------------
# ● 元の画面へ戻る
#--------------------------------------------------------------------------
def return_scene
case @host_scene
when HOST_MENU
$scene = Scene_Menu.new(@menu_index)
when HOST_MAP
$scene = Scene_Map.new
when HOST_BATTLE
$scene = Scene_Battle.new
end
$game_player.refresh
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
super
update_menu_background
update_window
if @battle_member_window.active
update_battle_member
elsif @party_member_window.active
update_party_member
elsif @confirm_window.active
update_confirm
end
end
#--------------------------------------------------------------------------
# ○ ウィンドウ更新
#--------------------------------------------------------------------------
def update_window
@battle_member_window.update
@party_member_window.update
@status_window.update
@battle_member_caption_window.update
@party_member_caption_window.update
@control_window.update
@confirm_window.update
end
#--------------------------------------------------------------------------
# ○ ウィンドウ再描画
#--------------------------------------------------------------------------
def refresh_window
@battle_member_window.refresh
@party_member_window.refresh
end
#--------------------------------------------------------------------------
# ○ フレーム更新 (戦闘メンバーウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
def update_battle_member
@status_window.set_actor(@battle_member_window.actor)
if Input.trigger?(Input::A)
if @battle_member_window.selected_index == nil # 並び替え中でない
actor = @battle_member_window.actor
# アクターを外せない場合
if actor == nil || $game_party.actor_fixed?(actor.id)
Sound.play_buzzer
return
end
# アクターを外す
Sound.play_decision
actors = $game_party.battle_members
actors.delete_at(@battle_member_window.index)
$game_party.set_battle_member(actors)
refresh_window
end
elsif Input.trigger?(Input::B)
if @battle_member_window.selected_index == nil # 並び替え中でない
# 確認ウィンドウに切り替え
Sound.play_cancel
show_confirm_window
else # 並び替え中
# 並び替え解除
Sound.play_cancel
@battle_member_window.selected_index = nil
@battle_member_window.refresh
@control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
end
elsif Input.trigger?(Input::C)
if @battle_member_window.selected_index == nil # 並び替え中でない
actor = @battle_member_window.actor
# アクターを外せない場合
if actor != nil && $game_party.actor_fixed?(actor.id)
Sound.play_buzzer
return
end
# パーティメンバーウィンドウに切り替え
Sound.play_decision
@battle_member_window.active = false
@party_member_window.active = true
@control_window.mode = Window_PartyFormControl::MODE_PARTY_MEMBER
else # 並び替え中
unless can_change_shift?(@battle_member_window.actor)
Sound.play_buzzer
return
end
# 並び替え実行
Sound.play_decision
index1 = @battle_member_window.selected_index
index2 = @battle_member_window.index
change_shift(index1, index2)
@control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
end
elsif Input.trigger?(Input::X)
# 並び替え不可能な場合
unless can_change_shift?(@battle_member_window.actor)
Sound.play_buzzer
return
end
if @battle_member_window.selected_index == nil # 並び替え中でない
# 並び替え開始
Sound.play_decision
@battle_member_window.selected_index = @battle_member_window.index
@battle_member_window.refresh
@control_window.mode = Window_PartyFormControl::MODE_SHIFT_CHANGE
else # 並び替え中
# 並び替え実行
Sound.play_decision
index1 = @battle_member_window.selected_index
index2 = @battle_member_window.index
change_shift(index1, index2)
@control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
end
end
end
#--------------------------------------------------------------------------
# ○ 並び替え可否判定
#--------------------------------------------------------------------------
def can_change_shift?(actor)
# 選択したアクターが存在しない、または並び替え不能な場合
if actor == nil ||
(KGC::LargeParty::FORBID_CHANGE_SHIFT_FIXED &&
$game_party.actor_fixed?(actor.id))
return false
end
return true
end
#--------------------------------------------------------------------------
# ○ 並び替え
#--------------------------------------------------------------------------
def change_shift(index1, index2)
# 位置を入れ替え
$game_party.change_shift(index1, index2)
# 選択済みインデックスをクリア
@battle_member_window.selected_index = nil
refresh_window
end
#--------------------------------------------------------------------------
# ○ フレーム更新 (パーティウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
def update_party_member
@status_window.set_actor(@party_member_window.actor)
if Input.trigger?(Input::B)
Sound.play_cancel
# 戦闘メンバーウィンドウに切り替え
@battle_member_window.active = true
@party_member_window.active = false
@control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
elsif Input.trigger?(Input::C)
actor = @party_member_window.actor
# アクターが戦闘メンバーに含まれる場合
if $game_party.battle_members.include?(actor)
Sound.play_buzzer
return
end
# アクターを入れ替え
Sound.play_decision
actors = $game_party.all_members
battle_actors = $game_party.battle_members
if @battle_member_window.actor != nil
actors[@party_member_window.actor_index] = @battle_member_window.actor
actors[@battle_member_window.index] = actor
$game_party.set_member(actors.compact)
end
battle_actors[@battle_member_window.index] = actor
$game_party.set_battle_member(battle_actors.compact)
refresh_window
# 戦闘メンバーウィンドウに切り替え
@battle_member_window.active = true
@party_member_window.active = false
@control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
end
end
#--------------------------------------------------------------------------
# ○ フレーム更新 (確認ウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
def update_confirm
if Input.trigger?(Input::B)
Sound.play_cancel
hide_confirm_window
elsif Input.trigger?(Input::C)
case @confirm_window.index
when 0 # 編成完了
# パーティが無効の場合
unless battle_member_valid?
Sound.play_buzzer
return
end
Sound.play_decision
return_scene
when 1 # 編成中断
Sound.play_decision
# パーティを編成前の状態に戻す
$game_party.set_member(@party_actors)
$game_party.set_battle_member(@battle_actors)
return_scene
when 2 # キャンセル
Sound.play_cancel
hide_confirm_window
end
end
end
#--------------------------------------------------------------------------
# ○ 戦闘メンバー有効判定
#--------------------------------------------------------------------------
def battle_member_valid?
return false if $game_party.battle_members.size == 0 # 戦闘メンバーが空
$game_party.battle_members.each { |actor|
return true if actor.exist? # 生存者がいればOK
}
return false
end
#--------------------------------------------------------------------------
# ○ 確認ウィンドウの表示
#--------------------------------------------------------------------------
def show_confirm_window
if @battle_member_window.active
@last_active_window = @battle_member_window
else
@last_active_window = @party_member_window
end
@battle_member_window.active = false
@party_member_window.active = false
@confirm_window.draw_item(0, battle_member_valid?)
@confirm_window.open
@confirm_window.active = true
end
#--------------------------------------------------------------------------
# ○ 確認ウィンドウの非表示
#--------------------------------------------------------------------------
def hide_confirm_window
@confirm_window.active = false
@confirm_window.close
@last_active_window.active = true
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ● メッセージ表示が終わるまでウェイト
#--------------------------------------------------------------------------
alias wait_for_message_KGC_LargeParty wait_for_message
def wait_for_message
return if @ignore_wait_for_message # メッセージ終了までのウェイトを無視
wait_for_message_KGC_LargeParty
end
#--------------------------------------------------------------------------
# ● レベルアップの表示
#--------------------------------------------------------------------------
alias display_level_up_KGC_LargeParty display_level_up
def display_level_up
@ignore_wait_for_message = true
display_level_up_KGC_LargeParty
exp = $game_troop.exp_total * KGC::LargeParty::STAND_BY_EXP_RATE / 1000
$game_party.stand_by_members.each { |actor|
if actor.exist?
actor.gain_exp(exp, KGC::LargeParty::SHOW_STAND_BY_LEVEL_UP)
end
}
@ignore_wait_for_message = false
wait_for_message
end
#--------------------------------------------------------------------------
# ● パーティコマンド選択の開始
#--------------------------------------------------------------------------
alias start_party_command_selection_KGC_LargeParty start_party_command_selection
def start_party_command_selection
if $game_temp.in_battle
@status_window.index = 0
end
start_party_command_selection_KGC_LargeParty
end
if KGC::LargeParty::USE_BATTLE_PARTYFORM
#--------------------------------------------------------------------------
# ● 情報表示ビューポートの作成
#--------------------------------------------------------------------------
alias create_info_viewport_KGC_LargeParty create_info_viewport
def create_info_viewport
create_info_viewport_KGC_LargeParty
@__command_partyform_index =
@party_command_window.add_command(Vocab.partyform_battle)
@party_command_window.draw_item(@__command_partyform_index,
$game_party.battle_partyform_enable?)
end
#--------------------------------------------------------------------------
# ● パーティコマンド選択の更新
#--------------------------------------------------------------------------
alias update_party_command_selection_KGC_LargeParty update_party_command_selection
def update_party_command_selection
if Input.trigger?(Input::C)
case @party_command_window.index
when @__command_partyform_index # パーティ編成
unless $game_party.battle_partyform_enable?
Sound.play_buzzer
return
end
Sound.play_decision
process_partyform
return
end
end
update_party_command_selection_KGC_LargeParty
end
#--------------------------------------------------------------------------
# ○ パーティ編成の処理
#--------------------------------------------------------------------------
def process_partyform
Graphics.freeze
snapshot_for_background
$scene = Scene_PartyForm.new(0, Scene_PartyForm::HOST_BATTLE)
$scene.main
$scene = self
@status_window.refresh
perform_transition
end
end
end
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#_/ The original untranslated version of this script can be found here:
# http://f44.aaa.lived...ech=large_party
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
Modificato da Paolos97, 24 May 2015 - 11:11 AM.