|
| [XP] [résolu] Scipt d'aeon + PHS | |
| Auteur | Message |
---|
Shyno19 Ninja (niveau 5)
Messages postés : 220 Date d'inscription : 21/09/2011 Jauge LPC :
| Sujet: [XP] [résolu] Scipt d'aeon + PHS Lun 7 Nov 2011 - 12:22 | |
| Bonjours J'ai trouver un script fort simpatique , un système de G-force à la maniéré d'un ff 8. Le problème est que je possède aussi un script de système PHS qui me permet de changer de combattant quand j'en posséde plus de 4. Quand j'équipe une G-force à un personnage et que je le remplace par un autre dans le phs(sans avoir déséquiper la G-force avant) et bien je peut ré équiper cette même G-force à un autre personnage(ce qui n'est pas possible normalement) et quand je remet mon 1er personnage équiper, et bien j'ai mon 1er personnag et mon 2eme personnage qui sont équiper de la même G-Force. Ma demande : Faire en sorte que quand je met mon personnage dans la réserve, la G-Force qui lui ai attribuer soit enlever automatiquement. Voici le Script de G-Force : - Code:
-
#------------------------- #----Modified Classes----- #-------------------------
class Scene_Battle attr_reader :oldhp alias esper_scenebattle_update_phase4_step2 update_phase4_step2 alias esper_scenebattle_main main def main esper_scenebattle_main if @esper_result != [] && @esper_result != nil @esper_result_window.dispose end end
def start_phase5 # Alternar para a fase 5 @esper_result = [] @phase = 5 # Reproduzir ME de fim de Batalha $game_system.me_play($game_system.battle_end_me) # Retornar para BGM de antes da Batalha ser iniciada $game_system.bgm_play($game_temp.map_bgm) # Inicializar EXP, quantidade de dinheiro e tesouros exp = 0 gold = 0 treasures = [] # Loop for enemy in $game_troop.enemies # Se o Inimigo não estiver escondido unless enemy.hidden # Adicionar a EXP e a quantidade de dinheiro obtidos exp += enemy.exp gold += enemy.gold # Determinar se aparece algum tesouro if rand(100) < enemy.treasure_prob if enemy.item_id > 0 treasures.push($data_items[enemy.item_id]) end if enemy.weapon_id > 0 treasures.push($data_weapons[enemy.weapon_id]) end if enemy.armor_id > 0 treasures.push($data_armors[enemy.armor_id]) end end end end # o Limite de tesouros é de 6 Itens treasures = treasures[0..5] # Obtendo a EXP for i in 0...$game_party.actors.size actor = $game_party.actors[i] if actor.cant_get_exp? == false last_level = actor.level actor.exp += exp if actor.level > last_level @status_window.level_up(i) end end end # Obtendo o dinheiro $game_party.gain_gold(gold) # Obtendo os tesouros for item in treasures case item when RPG::Item $game_party.gain_item(item.id, 1) when RPG::Weapon $game_party.gain_weapon(item.id, 1) when RPG::Armor $game_party.gain_armor(item.id, 1) end end for i in 0...$game_party.actors.size actor = $game_party.actors[i] esper1 = actor.esper1 esperold = esper1 if esper1 != 0 if esper1.exp >= esper1.exp_table[esper1.lvl - 1] && esper1.exp_table[esper1.lvl - 1] != 0 esper1.lvl_up for i in $game_party.espers if esper1.name == i.name $game_party.espers[$game_party.espers.index(i)] = esper1 end end @esper_result.push(esper1) end end end @result_window = Window_BattleResult.new(exp, gold, treasures,@esper_result.size) @esper_result_window = Window_EsperUp.new(@esper_result) if @esper_result != []
# Criar janela de resultado de Batalha # Definir Espera @phase5_wait_count = 100 end
def update_phase5 # Se a Espera for maior do que 0 if @phase5_wait_count > 0 # Diminuir a Espera @phase5_wait_count -= 1 # Se a Espera chegar a 0 if @phase5_wait_count == 0 # Exibir o resultado da Batalha @result_window.visible = true @esper_result_window.visible = true if @esper_result != [] # Limpar flag de fase Principal $game_temp.battle_main_phase = false # Atualizar janela de Status @status_window.refresh end return end # Se o botão C for pressionado if Input.trigger?(Input::C) # Fim da Batalha battle_end(0) end end def update_phase4_step2 $game_troop.enemies.each { |i| i.oldhp = i.hp } $game_party.actors.each { |i| i.oldhp = i.hp } esper_scenebattle_update_phase4_step2 end end
#============================================================================== # ** Scene_Menu #------------------------------------------------------------------------------ # This class performs menu screen processing. #==============================================================================
class Scene_Menu #-------------------------------------------------------------------------- # * Object Initialization # menu_index : command cursor's initial position #-------------------------------------------------------------------------- def initialize(menu_index = 0) @menu_index = menu_index end #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main # Make command window s1 = $data_system.words.item s2 = $data_system.words.skill s3 = $data_system.words.equip s4 = "Status" s5 = "Save" s6 = "Espers" s7 = "End Game" @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6,s7]) @command_window.height = 224 @command_window.index = @menu_index # If number of party members is 0 if $game_party.actors.size == 0 # Disable items, skills, equipment, and status @command_window.disable_item(0) @command_window.disable_item(1) @command_window.disable_item(2) @command_window.disable_item(3) end # If save is forbidden if $game_system.save_disabled # Disable save @command_window.disable_item(4) end # Make play time window @playtime_window = Window_PlayTime.new @playtime_window.x = 0 @playtime_window.y = 224 # Make steps window @steps_window = Window_Steps.new @steps_window.x = 0 @steps_window.y = 320 # Make gold window @gold_window = Window_Gold.new @gold_window.x = 0 @gold_window.y = 416 # Make status window @status_window = Window_MenuStatus.new @status_window.x = 160 @status_window.y = 0 # Execute transition Graphics.transition # Main loop loop do # Update game screen Graphics.update # Update input information Input.update # Frame update update # Abort loop if screen is changed if $scene != self break end end # Prepare for transition Graphics.freeze # Dispose of windows @command_window.dispose @playtime_window.dispose @steps_window.dispose @gold_window.dispose @status_window.dispose end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update windows @command_window.update @playtime_window.update @steps_window.update @gold_window.update @status_window.update # If command window is active: call update_command if @command_window.active update_command return end # If status window is active: call update_status if @status_window.active update_status return end end #-------------------------------------------------------------------------- # * Frame Update (when command window is active) #-------------------------------------------------------------------------- def update_command # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Switch to map screen $scene = Scene_Map.new return end # If C button was pressed if Input.trigger?(Input::C) # If command other than save or end game, and party members = 0 if $game_party.actors.size == 0 and @command_window.index < 4 # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Branch by command window cursor position case @command_window.index when 0 # item # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to item screen $scene = Scene_Item.new when 1 # skill # Play decision SE $game_system.se_play($data_system.decision_se) # Make status window active @command_window.active = false @status_window.active = true @status_window.index = 0 when 2 # equipment # Play decision SE $game_system.se_play($data_system.decision_se) # Make status window active @command_window.active = false @status_window.active = true @status_window.index = 0 when 3 # status # Play decision SE $game_system.se_play($data_system.decision_se) # Make status window active @command_window.active = false @status_window.active = true @status_window.index = 0 when 4 # save # If saving is forbidden if $game_system.save_disabled # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to save screen $scene = Scene_Save.new when 5 # end game # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to Espers screen $scene = Scene_Esper.new when 6 # end game # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to end game screen $scene = Scene_End.new end return end end #-------------------------------------------------------------------------- # * Frame Update (when status window is active) #-------------------------------------------------------------------------- def update_status # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Make command window active @command_window.active = true @status_window.active = false @status_window.index = -1 return end # If C button was pressed if Input.trigger?(Input::C) # Branch by command window cursor position case @command_window.index when 1 # skill # If this actor's action limit is 2 or more if $game_party.actors[@status_window.index].restriction >= 2 # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to skill screen $scene = Scene_Skill.new(@status_window.index) when 2 # equipment # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to equipment screen $scene = Scene_Equip.new(@status_window.index) when 3 # status # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to status screen $scene = Scene_Status.new(@status_window.index) end return end end end
class Window_Base def draw_actor_name(actor, x, y,color = normal_color) self.contents.font.color = color self.contents.draw_text(x, y, 120, 32, actor.name) end def draw_actor_extra_parameter(actor, x, y, type) case type when 0 parameter_value = actor.extra_atk when 1 parameter_value = actor.extra_pdef when 2 parameter_value = actor.extra_mdef when 3 parameter_value = actor.extra_str when 4 parameter_value = actor.extra_dex when 5 parameter_value = actor.extra_agi when 6 parameter_value = actor.extra_int end if parameter_value > 0 self.contents.font.color = Color.new(0,200,0) self.contents.draw_text(x + 120, y, 36, 32, "+" + parameter_value.to_s, 2) elsif parameter_value < 0 self.contents.font.color = Color.new(200,0,0) self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2) end end def draw_esper_parameter(esper, x, y, type) case type when -1 parameter_name = "Level" parameter_value = esper.lvl when 0 parameter_name = $data_system.words.atk parameter_value = esper.atk when 1 parameter_name = $data_system.words.pdef parameter_value = esper.pdef when 2 parameter_name = $data_system.words.mdef parameter_value = esper.mdef when 3 parameter_name = $data_system.words.str parameter_value = esper.str when 4 parameter_name = $data_system.words.dex parameter_value = esper.dex when 5 parameter_name = $data_system.words.agi parameter_value = esper.agi when 6 parameter_name = $data_system.words.int parameter_value = esper.int end self.contents.font.color = system_color self.contents.draw_text(x, y, 120, 32, parameter_name,1) self.contents.font.color = normal_color self.contents.draw_text(x + 80, y, 36, 32, parameter_value.to_s, 2) end def draw_esper_graphic(esper, x, y) bitmap = RPG::Cache.picture(esper.name) src_rect = Rect.new(0, 0, bitmap.width, bitmap.height) self.contents.blt(x, y, bitmap, src_rect) end def draw_esper_skills(esper, x, y) column = 0 self.contents.font.color = system_color self.contents.draw_text(x, y, 120, 32, "Skills:") self.contents.font.color = normal_color for i in esper.skill column += 32 self.contents.draw_text(x, y + column, 204, 32, $data_skills[i].name, 0) if i != 0 end end end
class Window_BattleResult < Window_Base def initialize(exp, gold, treasures,espers=0) @exp = exp @gold = gold @treasures = treasures super(160, espers*32 + 52, 320, @treasures.size * 32 + 64) self.contents = Bitmap.new(width - 32, height - 32) self.y = 160 - height / 2 if espers <= 1 self.back_opacity = 160 self.visible = false refresh end end
class Window_Skill def draw_item(index) #Duping the array is better for reading. a = ESPERS::SKILL_COLOR.dup skill = @data[index] if @actor.skill_can_use?(skill.id) #if the skill is given by the esper. if @actor.esper_skill?(skill.id) #draw in color "a". self.contents.font.color = Color.new(a[0],a[1],a[2],255) #if not... else #draw in the normal color. self.contents.font.color = normal_color end else if @actor.esper_skill?(skill.id) self.contents.font.color = Color.new(a[0],a[1],a[2],128) else self.contents.font.color = disabled_color end end x = 4 + index % 2 * (288 + 32) y = index / 2 * 32 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) bitmap = RPG::Cache.icon(skill.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0) self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2) end end
class Window_Status < Window_Base alias esper_windowstatus_refresh refresh def refresh esper_windowstatus_refresh draw_actor_extra_parameter(@actor,130, 192, 0) draw_actor_extra_parameter(@actor,130, 224, 1) draw_actor_extra_parameter(@actor,130, 256, 2) draw_actor_extra_parameter(@actor,130, 304, 3) draw_actor_extra_parameter(@actor,130, 336, 4) draw_actor_extra_parameter(@actor,130, 368, 5) draw_actor_extra_parameter(@actor,130, 400, 6) end end
class Game_Actor < Game_Battler attr_accessor :esper1 attr_accessor :esper2 attr_accessor :esper3 alias esper_gameactor_setup setup alias esper_base_str base_str alias esper_base_dex base_dex alias esper_base_agi base_agi alias esper_base_int base_int alias esper_base_atk base_atk alias esper_base_pdef base_pdef alias esper_base_mdef base_mdef def setup(actor_id) @esper1 = 0 @esper2 = 0 @esper3 = 0 esper_gameactor_setup(actor_id) end def equip_esper(esper,slot = 1) case slot when 1 @esper1 = esper when 2 @esper2 = esper when 3 @esper3 = esper end end
def base_str n = esper_base_str n += @esper1.str if @esper1 != 0 n += @esper2.str if @esper2 != 0 n += @esper3.str if @esper3 != 0 return [[n, 1].max, 999].min end def extra_str n = 0 n += @esper1.str if @esper1 != 0 n += @esper2.str if @esper2 != 0 n += @esper3.str if @esper3 != 0 return n end
def base_dex n = esper_base_dex n += @esper1.dex if @esper1 != 0 n += @esper2.dex if @esper2 != 0 n += @esper3.dex if @esper3 != 0 return [[n, 1].max, 999].min end def extra_dex n = 0 n += @esper1.dex if @esper1 != 0 n += @esper2.dex if @esper2 != 0 n += @esper3.dex if @esper3 != 0 return n end
def base_agi n = esper_base_agi n += @esper1.agi if @esper1 != 0 n += @esper2.agi if @esper2 != 0 n += @esper3.agi if @esper3 != 0 return [[n, 1].max, 999].min end def extra_agi n = 0 n += @esper1.agi if @esper1 != 0 n += @esper2.agi if @esper2 != 0 n += @esper3.agi if @esper3 != 0 return n end
def base_int n = esper_base_int n += @esper1.int if @esper1 != 0 n += @esper2.int if @esper2 != 0 n += @esper3.int if @esper3 != 0 return [[n, 1].max, 999].min end def extra_int n = 0 n += @esper1.int if @esper1 != 0 n += @esper2.int if @esper2 != 0 n += @esper3.int if @esper3 != 0 return n end def base_atk n = esper_base_atk n += @esper1.atk if @esper1 != 0 n += @esper2.atk if @esper2 != 0 n += @esper3.atk if @esper3 != 0 return n end def extra_atk n = 0 n += @esper1.atk if @esper1 != 0 n += @esper2.atk if @esper2 != 0 n += @esper3.atk if @esper3 != 0 return n end def base_pdef n = esper_base_pdef n += @esper1.pdef if @esper1 != 0 n += @esper2.pdef if @esper2 != 0 n += @esper3.pdef if @esper3 != 0 return n end def extra_pdef n = 0 n += @esper1.pdef if @esper1 != 0 n += @esper2.pdef if @esper2 != 0 n += @esper3.pdef if @esper3 != 0 return n end
def base_mdef n = esper_base_mdef n += @esper1.mdef if @esper1 != 0 n += @esper2.mdef if @esper2 != 0 n += @esper3.mdef if @esper3 != 0 return n end def extra_mdef n = 0 n += @esper1.mdef if @esper1 != 0 n += @esper2.mdef if @esper2 != 0 n += @esper3.mdef if @esper3 != 0 return n end
def remove_esper(esper = @esper1) for esper_skills in esper.skill forget_skill(esper_skills) end case esper when @esper1 @esper1 = 0 when @esper2 @esper2 = 0 when @esper3 @esper3 = 0 end end def esper_skill?(skill,esper = @esper1) if esper != 0 for i in esper.skill return true if i == skill end end return false end def skills(esper = @esper1) if esper != 0 for esper_skills in esper.skill unless esper_skills.nil? if esper_skills != 0 self.learn_skill(esper_skills) end end end end return @skills end end
class Game_Battler attr_accessor :oldhp alias esper_gameactor_skill_effect skill_effect
def skill_effect(user, skill) if user.is_a?(Game_Actor) if user.esper1 != 0 if skill.id == user.esper1.skill[0] user.esper1.add_exp end end end esper_gameactor_skill_effect(user, skill) end end
class Game_Party attr_accessor :espers alias espers_gameparty_initialize initialize def initialize espers_gameparty_initialize @espers = [] end def gain_esper(esper) @espers.push(esper) end end
#------------------------- #-----Custom Classes------ #------------------------- class Window_EsperStatus < Window_Base
def initialize(esper) super(160, 64, 480, 416) self.contents = Bitmap.new(width - 32, height - 32) @esper = esper refresh end def refresh self.contents.clear self.contents.font.size = 40 self.contents.draw_text(150, 4,180,40,@esper.name) self.contents.font.size = 22 draw_esper_graphic(@esper, 60, 100) if ESPERS::PICTURES == true draw_esper_skills(@esper, 300, 72) draw_esper_parameter(@esper, 120, 40, -1) draw_esper_parameter(@esper, 0, 72, 0) draw_esper_parameter(@esper, 0, 104, 1) draw_esper_parameter(@esper, 0, 136, 2) draw_esper_parameter(@esper, 0, 168, 3) draw_esper_parameter(@esper, 0, 200, 4) draw_esper_parameter(@esper, 0, 232, 5) draw_esper_parameter(@esper, 0, 264, 6) end end
class Window_EsperList < Window_Selectable def initialize(width, commands) super(0, 64, width, 416) @item_max = commands.size @commands = commands self.contents = Bitmap.new(width - 32, @item_max * 32) refresh self.index = 0 end def refresh self.contents.clear for i in 0...@item_max draw_item(i, normal_color) end end def draw_item(index, color) self.contents.font.color = color rect = Rect.new(4, 32 * index, self.contents.width - 8, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) if @commands[index].is_a?(String) self.contents.draw_text(rect, @commands[index]) else self.contents.draw_text(rect, @commands[index].name) end end def disable_item(index) draw_item(index, disabled_color) end def enable_item(index) draw_item(index, normal_color) end end
class Window_EsperEquip < Window_Selectable def initialize super(0, 64, 160, 50*$game_party.actors.size + 30) self.contents = Bitmap.new(width - 32, height - 32) refresh self.active = false self.index = -1 end def refresh(remove = false) self.contents.clear @item_max = $game_party.actors.size for i in 0...$game_party.actors.size x = 64 y = i * 50 actor = $game_party.actors[i] draw_actor_graphic(actor, x - 40, y + 50) if actor.esper1 == 0 || remove == true draw_actor_name(actor, x - 20, y) else draw_actor_name(actor, x - 20, y,disabled_color) end end end def update_cursor_rect if @index < 0 self.cursor_rect.empty else self.cursor_rect.set(0, @index * 50, self.width - 32, 50) end end end
class Window_EsperUp < Window_Base def initialize(espers) @espers_leveled = espers super(160, 10, 320,32 + 32*espers.size) self.contents = Bitmap.new(width - 32, height - 32) self.back_opacity = 160 self.visible = false refresh end def refresh self.contents.clear y = 0 for i in @espers_leveled self.contents.draw_text(4, y, self.width, 32,i.name + " has leveled up.") y += 32 end end end
class Window_EsperUp < Window_Base def initialize(espers) @espers_leveled = espers super(160, 10, 320,32 + 32*espers.size) self.contents = Bitmap.new(width - 32, height - 32) self.back_opacity = 160 self.visible = false refresh end def refresh self.contents.clear y = 0 for i in @espers_leveled self.contents.draw_text(4, y, self.width, 32,i.name + " has leveled up.") y += 32 end end end
class Window_Esperdummy < Window_Base def initialize(x = 160, y = 64, width = 480, height = 416) super(x, y, width, height) self.contents = Bitmap.new(width - 32, height - 32) end end
class Scene_Esper def initialize(menu_index = 0) @menu_index = menu_index end def main #array that hold the commands @esper_commands = [] #here the espers are added in the arrays for i in $game_party.espers @esper_commands.push(i) end #a dup of @esper_commands before it gets other command then espers @espers_in_commands = @esper_commands.dup #adds the non-esper text for each esper that the player do not have while @esper_commands.length < ESPERS::MAX_ESPERS @esper_commands.push(ESPERS::NO_ESPER) end #adds the remove command @esper_commands.push(ESPERS::REMOVAL) #... I don't want to comment the rest for now. @esperlist_window = Window_EsperList.new(160, @esper_commands) for i in 0...@esper_commands.length - 1 if i >= $game_party.espers.length @esperlist_window.disable_item(i) end end @help_window = Window_Help.new @help_window.set_text("Equip the selected esper") @esperlist_window.index = @menu_index @choose_actor_window = Window_EsperEquip.new @choose_actor_window.visible = false @choose_actor_window.active = false @choose_actor_window.index = @menu_index if $game_party.espers != [] @esper_window = Window_EsperStatus.new($game_party.espers[0]) else @esper_window = Window_Esperdummy.new end for i in 0...$game_party.actors.size if $game_party.actors[i].esper1 != 0 for a in 0...@espers_in_commands.size if $game_party.actors[i].esper1.name == @espers_in_commands[a].name @esperlist_window.disable_item(a) end end end end Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @esperlist_window.dispose @esper_window.dispose @choose_actor_window.dispose @help_window.dispose end def update @esperlist_window.update @esper_window.update @choose_actor_window.update @help_window.update if @esperlist_window.active update_command return end if @choose_actor_window.active update_esper return end end def update_command if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Menu.new(7) return end if Input.trigger?(Input::DOWN) || Input.trigger?(Input::UP) @esper_window.dispose if @esperlist_window.index < $game_party.espers.length @esper_window = Window_EsperStatus.new($game_party.espers[@esperlist_window.index]) @help_window.set_text("Equip the selected esper") elsif @esperlist_window.index == ESPERS::MAX_ESPERS @esper_window = Window_Esperdummy.new @help_window.set_text("Remove the equipped espers") else @esper_window = Window_Esperdummy.new @help_window.set_text("") @help_window.set_text("Equip the selected esper") end end if Input.trigger?(Input::C) if @esperlist_window.index < $game_party.espers.length for i in 0...$game_party.actors.size if $game_party.actors[i].esper1 != 0 if $game_party.actors[i].esper1.name == @espers_in_commands[@esperlist_window.index].name $game_system.se_play($data_system.buzzer_se) @help_window.set_text("This esper is already equipped") return end end end $game_system.se_play($data_system.decision_se) @esperlist_window.active = false @choose_actor_window.active = true @choose_actor_window.visible = true @choose_actor_window.refresh @help_window.set_text("Choose one character to equip the esper") @esperlist_window.visible = false elsif @esperlist_window.index == ESPERS::MAX_ESPERS $game_system.se_play($data_system.decision_se) @esperlist_window.active = false @choose_actor_window.active = true @choose_actor_window.visible = true @esperlist_window.visible = false @help_window.set_text("Choose one character to remove the esper") @choose_actor_window.refresh(true) else $game_system.se_play($data_system.buzzer_se) @help_window.set_text("You do not have this esper yet") end return end end def update_esper actor = $game_party.actors[@choose_actor_window.index] #here it updates the help window if Input.trigger?(Input::DOWN) || Input.trigger?(Input::UP) if @esperlist_window.index != ESPERS::MAX_ESPERS @help_window.set_text("Choose one character to equip the esper") else @help_window.set_text("Choose one character to remove the esper") end end if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @choose_actor_window.active = false @choose_actor_window.visible = false @esperlist_window.active = true @esperlist_window.visible = true @help_window.set_text("") return end if Input.trigger?(Input::C) if actor.esper1 == 0 && @esperlist_window.index != ESPERS::MAX_ESPERS actor.esper1 = @esper_commands[@esperlist_window.index] $game_system.se_play($data_system.decision_se) @choose_actor_window.active = false @choose_actor_window.visible = false @esperlist_window.active = true @esperlist_window.visible = true @esperlist_window.disable_item(@esperlist_window.index) elsif @esperlist_window.index == ESPERS::MAX_ESPERS && actor.esper1 != 0 $game_system.se_play($data_system.decision_se) @choose_actor_window.active = false @choose_actor_window.visible = false @esperlist_window.active = true @esperlist_window.visible = true #Now comes the esper remove thingy temp = actor.esper1 @esperlist_window.enable_item(@esper_commands.index(temp)) actor.remove_esper else $game_system.se_play($data_system.buzzer_se) if @esperlist_window.index != ESPERS::MAX_ESPERS @help_window.set_text("This character already bears one esper, remove it first") else @help_window.set_text("This character do not have an esper to be removed") end end return end end end
class Game_Esper
attr_reader :id attr_accessor :skill attr_reader :name attr_accessor :str attr_accessor :dex attr_accessor :agi attr_accessor :int attr_accessor :atk attr_accessor :pdef attr_accessor :mdef attr_reader :exp attr_accessor :lvl attr_reader :exp_table
def initialize(id,name,exp_table=[10,20,30],skill=[],str=[],dex=[], agi=[],int=[],atk=[],pdef=[],mdef=[]) @skill = [] @id = id @skill_table = skill @skill.push(@skill_table[0]) @name = name @str_table = str @dex_table = dex @agi_table = agi @int_table = int @atk_table = atk @pdef_table = pdef @mdef_table = mdef @str = @str_table[0] @dex = @dex_table[0] @agi = @agi_table[0] @int = @int_table[0] @atk = @atk_table[0] @pdef = @pdef_table[0] @mdef = @mdef_table[0] @exp_table = exp_table @exp = 0 @lvl = 1 end
def ==(other) Marshal.dump(self) == Marshal.dump(other) end
def equiped? for i in 0...$game_party.actors.size if self != 0 && $game_party.actors[i].esper1 != 0 if self.name == $game_party.actors[i].esper1.name return true end end return false end end def lvl_up self.lvl += 1 self.str = @str_table[self.lvl - 1] self.dex = @dex_table[self.lvl - 1] self.agi = @agi_table[self.lvl - 1] self.int = @int_table[self.lvl - 1] self.atk = @atk_table[self.lvl - 1] self.pdef = @pdef_table[self.lvl - 1] self.mdef = @mdef_table[self.lvl - 1] self.skill.push(@skill_table[self.lvl - 1]) end def add_exp @exp += 1 end end
PS : Si cela n'est pas possible ou si c'est trop compliqué. Je preferai avoir la liste de tout mes personnage disponible ( même ceux en reserves) au moment ou l'on peut attribuer une G-Force a une personnage(Car il ne m'affiche que les 4 personnage qui combattent). Voila voila j'espere que vous avez compris ma demande. Cordialement
Dernière édition par Shyno19 le Lun 9 Jan 2012 - 11:24, édité 1 fois |
| | | Shyno19 Ninja (niveau 5)
Messages postés : 220 Date d'inscription : 21/09/2011 Jauge LPC :
| Sujet: Re: [XP] [résolu] Scipt d'aeon + PHS Lun 7 Nov 2011 - 12:23 | |
| Double post : Voici le Script de PHS - Code:
-
# # How to use: # # To call this script, make a "Call script" command in an event. # # 1. Syntax: $scene = Scene_PartySwitcher.new # No extra feature will be applied and you can switch the party as you # wish. # # 2. Syntax: $scene = Scene_PartySwitcher.new(XXX) # You can replace XXX for 1 to remove all party members except one (either # one, who must be in the party or a random one), or replace XXX with 2, # to cause a wipe party. Wiping a party will disable the of the current # members and a NEW party of the remaining members must be formed. If you # replace it with 3, the current party configuration will be stored for a # later fast switch-back. If XXX is 10, all actors will be available for # party switching no matter if the are "not_available" or # "disabled_for_party". This feature if used by the CP Debug System. No # faceset will be used in this case for a more convenient working. # # 3. Syntax: $scene = Scene_PartySwitcher.new(XXX, 1) # You can use the XXX as described above or just set it to 0 to disable # it. Also the "1" in the syntax will reset any disabled_for_party and is # made to be used after multi-party use. # # 4. Syntax: $scene = Scene_PartySwitcher.new(XXX, YYY, ZZZ) # You can replace ZZZ with 1 to replace the party with a stored one AND # store the current or replace it with 2 to replace the party with a # stored one, but without storing the current. USE THIS ONLY IF YOU ASSUME # TO HAVE A STORED PARTY READY! You can simply test if there is a store # party by putting this code into the conditional branch script: # # $game_system.stored_party != nil # # This syntax will not open the Party Switcher and it will override the # commands XXX and YYY, so you can replace these with any number. # # 5. To activate/deactivate the option of order change only, simply use the # event command "Call Script" with following syntax: # # $game_system.order_only = true/false # # If the setting is set to true, the switcher will allow only party order # change. The same goes for battle change (if you are using the # BATTLE_SWITCH option), but the syntax is different: # # $game_system.battle_order_only = true/false # # Character faces go into the "Characters" folder and they have the same name # as the character spritesets have with _face added # # Example: # # sprite - Marlen.png # face - Marlen_face.png # # Other syntaxes: # $game_actors[ID].not_available = true/false # $game_actors[ID].disabled_for_party = true/false # $game_actors[ID].must_be_in_party = true/false # $game_actors[ID].forced_position = nil/0/1/2/... # OR # $game_party.actors[POS].not_available = true/false # $game_party.actors[POS].disabled_for_party = true/false # $game_party.actors[POS].must_be_in_party = true/false # $game_party.actors[POS].forced_position = nil/0/1/2/... # # ID - the actor's ID in the database # POS - the actor's position in the party (STARTS FROM 0, not 1!) # # not_available # - will disable the possibility of an already unlocked character to be in # the current party # # disabled_for_party # - will cause the character NOT to appear in the party switch screen at all # # must_be_in_party # - will cause the character to be automatically moved into the current party # and he also cannot be put in the reserve # # forced_position # - will enforce the player to be at a specific position in the party, set # this value to nil to disable this feature, use it in combination with # must_be_in_party and $game_party.forced_size or you might experience # bugs, # # $game_party.forced_size = nil/0/1/2/... # # Using this syntax will enforce a specific party size. The EPS won't exit # until this size is filled up or there are no more in the reserve. EPS will # automatically "correct" this number if there are not enough characters in # the reserve to fill up a party of forced_size. Set this value to nil to # disable the size requirement. Note that the actor DO NOT HAVE TO be set in # normal order without any empty position like in version 1.x. # # # Additional note: # # For your own sake, do not apply the attribute "must_be_in_party" to a # character at the same time with "not_available" or "disabled_for_party" as # this WILL disrupt your party and party switch system. Use "forced_position" # together with "must_be_in_party" to avoid bugs. Be careful when using # "forced_position" with "$game_party.forced_size". Add actors at the very # end to be sure the player can't put others after them if the "forced_size" # is smaller than the maximum party size. # # # If you find any bugs, please report them here: # http://www.chaosproject.co.nr #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#============================================================================== # module BlizzCFG #==============================================================================
module BlizzCFG
#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: # START Conficuration #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: # how many party members do you use MAX_PARTY = 4 # set to true to use facesets instead of spritesets FACESETS = false # allows a party with 0 members ALLOW_EMPTY_PARTY = false # allows switching the party in battle BATTLE_SWITCH = false # gives all other characters EXP (specify in %) EXP_RESERVE = 75 # gives "not available" characters EXP (specify in %) EXP_NOT_AVAILABLE = 0 # gives "disabled for party" characters EXP (specify in %) EXP_DISABLED_FOR_PARTY = 0 #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: # END Conficuration #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end
# recognition variable for plug-ins $easy_party_switcher = 2.41
#============================================================================== # Game_Actor #==============================================================================
class Game_Actor < Game_Battler
attr_accessor :must_be_in_party attr_accessor :disabled_for_party attr_accessor :not_available attr_accessor :forced_position alias setup_eps_later setup def setup(actor_id) setup_eps_later(actor_id) @must_be_in_party = @disabled_for_party = @not_available = false end end
#============================================================================== # Game_System #==============================================================================
class Game_System
attr_accessor :stored_party attr_accessor :order_only attr_accessor :battle_order_only alias init_eps_later initialize def initialize init_eps_later @order_only = @battle_order_only = false end end
#============================================================================== # Game_Party #==============================================================================
class Game_Party
attr_accessor :actors attr_accessor :forced_size def any_forced_position return (@actors.any? {|actor| actor != nil && actor.forced_position != nil}) end end
#============================================================================== # Window_Base #==============================================================================
class Window_Base
alias draw_actor_graphic_eps_later draw_actor_graphic def draw_actor_graphic(actor, x, y) if actor != nil && actor.character_name != '' classes = [Window_Current, Window_Reserve, Window_HelpStatus] if BlizzCFG::FACESETS && !$all_available && classes.include?(self.class) draw_actor_face_eps(actor, x, y) else if classes.include?(self.class) bitmap = RPG::Cache.character(actor.character_name, actor.character_hue) x += bitmap.width / 8 + 24 y += bitmap.height / 4 + 16 end draw_actor_graphic_eps_later(actor, x, y) end end end
def draw_actor_face_eps(actor, x, y) if $tons_version == nil || $tons_version < 3.71 || !FACE_HUE hue = 0 else hue = actor.character_hue end bitmap = RPG::Cache.character("#{actor.character_name}_face", hue) src_rect = Rect.new(0, 0, bitmap.width, bitmap.height) if actor.not_available || actor.must_be_in_party self.contents.blt(x, y, bitmap, src_rect, 128) else self.contents.blt(x, y, bitmap, src_rect) end end end
#============================================================================== # Window_BattleResult #==============================================================================
class Window_BattleResult attr_reader :exp end
#============================================================================== # Window_Current #==============================================================================
class Window_Current < Window_Selectable
def initialize super(0, 0, 240 + 32, (BlizzCFG::MAX_PARTY > 4 ? 480 : BlizzCFG::MAX_PARTY * 120)) self.contents = Bitmap.new(width - 32, 448 + (BlizzCFG::MAX_PARTY-4) * 120) @item_max = BlizzCFG::MAX_PARTY if $fontface != nil self.contents.font.name = $fontface self.contents.font.size = $fontsize elsif $defaultfonttype != nil self.contents.font.name = $defaultfonttype self.contents.font.size = $defaultfontsize end self.contents.font.size = 24 refresh self.active, self.index, self.z = false, -1, 5000 end def refresh self.contents.clear $game_party.actors.each_index {|i| if $game_party.actors[i] != nil draw_actor_graphic($game_party.actors[i], 4, i*120+4) draw_actor_name($game_party.actors[i], 152, i*120-4) draw_actor_level($game_party.actors[i], 88, i*120-4) draw_actor_hp($game_party.actors[i], 88, i*120+24) draw_actor_sp($game_party.actors[i], 88, i*120+52) end} end
def setactor(index_1, index_2) $game_party.actors[index_2], $game_party.actors[index_1] = $game_party.actors[index_1], $game_party.actors[index_2] refresh end
def getactor(index) return $game_party.actors[index] end def update_cursor_rect if @index < 0 self.cursor_rect.empty return end row = @index / @column_max self.top_row = row if row < self.top_row self.top_row = row - (page_row_max - 1) if row > top_row + (page_row_max - 1) y = (@index / @column_max) * 120 - self.oy self.cursor_rect.set(0, y, self.width - 32, 88) end
def clone_cursor row = @index / @column_max self.top_row = row if row < self.top_row self.top_row = row - (page_row_max - 1) if row > top_row + (page_row_max - 1) y = (@index / @column_max) * 120 src_rect = Rect.new(0, 0, self.width, 88) bitmap = Bitmap.new(self.width-32, 88) bitmap.fill_rect(0, 0, self.width-32, 88, Color.new(255, 255, 255, 192)) bitmap.fill_rect(2, 2, self.width-36, 84, Color.new(255, 255, 255, 80)) self.contents.blt(0, y, bitmap, src_rect, 192) end def top_row return self.oy / 116 end
def top_row=(row) self.oy = (row % row_max) * 120 end
def page_row_max return (self.height / 120) end
end
#============================================================================== # Window_Reserve #==============================================================================
class Window_Reserve < Window_Selectable attr_reader :actors def initialize(scene) super(0, 0, 368, 320) setup @column_max, rows = 3, @item_max / @column_max self.contents = Bitmap.new(width - 32, (rows >= 3 ? rows * 96 : height - 32)) if $fontface != nil self.contents.font.name = $fontface self.contents.font.size = $fontsize elsif $defaultfonttype != nil self.contents.font.name = $defaultfonttype self.contents.font.size = $defaultfontsize end self.contents.font.size = 24 self.active, self.index, self.z = false, -1, 5000 refresh if scene == Scene_Map && $game_system.order_only || scene == Scene_Battle && $game_system.battle_order_only self.opacity = 0 end end def setup @actors = [] (1...$data_actors.size).each {|i| unless $game_party.actors.include?($game_actors[i]) || $game_actors[i].disabled_for_party && !$all_available @actors.push($game_actors[i]) end} @item_max = (@actors.size + $game_party.actors.size + 3) / 3 * 3 end def refresh self.contents.clear @actors.each_index {|i| draw_actor_graphic(@actors[i], i%3*112+16, i/3*96+8)} end def getactor(index) return @actors[index] end def get_number return (@actors.find_all {|actor| actor != nil}).size if $all_available return (@actors.find_all {|actor| actor != nil && !actor.not_available}).size end def setactor(index_1, index_2) @actors[index_1], @actors[index_2] = @actors[index_2], @actors[index_1] refresh end
def setparty(index_1, index_2) @actors[index_1], $game_party.actors[index_2] = $game_party.actors[index_2], @actors[index_1] refresh end
def update_cursor_rect if @index < 0 self.cursor_rect.empty return end row = @index / @column_max self.top_row = row if row < self.top_row self.top_row = row - (page_row_max-1) if row > top_row + (page_row_max-1) x, y = (@index % @column_max)*112 + 8, (@index / @column_max)*96 - self.oy self.cursor_rect.set(x, y, 96, 96) end
def clone_cursor row = @index / @column_max self.top_row = row if row < self.top_row self.top_row = row - (page_row_max - 1) if row > top_row + (page_row_max - 1) x, y = (@index % @column_max) * 112 + 8, (@index / @column_max) * 96 src_rect = Rect.new(0, 0, 96, 96) bitmap = Bitmap.new(96, 96) bitmap.fill_rect(0, 0, 96, 96, Color.new(255, 255, 255, 192)) bitmap.fill_rect(2, 2, 92, 92, Color.new(255, 255, 255, 80)) self.contents.blt(x, y, bitmap, src_rect, 192) end def top_row return self.oy / 96 end
def top_row=(row) row = row % row_max self.oy = row * 96 end
def page_row_max return (self.height - 32) / 96 end
end #============================================================================== # Window_HelpStatus #==============================================================================
class Window_HelpStatus < Window_Base
def initialize(gotactor, scene) super(0, 0, 400 - 32, 160) self.contents = Bitmap.new(width - 32, height - 32) if $fontface != nil self.contents.font.name = $fontface self.contents.font.size = $fontsize elsif $defaultfonttype != nil self.contents.font.name = $defaultfonttype self.contents.font.size = $defaultfontsize end self.contents.font.size = 24 refresh(gotactor) self.active, self.z = false, 5000 if scene == Scene_Map && $game_system.order_only || scene == Scene_Battle && $game_system.battle_order_only self.opacity = 128 end end def refresh(actor) self.contents.clear if actor != nil self.contents.font.color = normal_color if actor.not_available && !$all_available self.contents.draw_text(8, 0, 160, 32, 'not available', 0) end draw_actor_graphic(actor, 0, 40) draw_actor_name(actor, 160, 32) draw_actor_level(actor, 96, 32) draw_actor_hp(actor, 96, 64) draw_actor_sp(actor, 96, 96) end end
end
#============================================================================== # Window_Warning #==============================================================================
class Window_Warning < Window_Base
def initialize(mode, members) super(0, 0, 320, 96) self.contents = Bitmap.new(width - 32, height - 32) if $fontface != nil self.contents.font.name = $fontface self.contents.font.size = $fontsize elsif $defaultfonttype != nil self.contents.font.name = $defaultfonttype self.contents.font.size = $defaultfontsize end self.contents.font.size = 24 self.x, self.y, self.z = 320 - width/2, 240 - height/2, 9999 self.contents.font.color = normal_color case mode when 0 self.contents.draw_text(0, 0, 288, 32, 'You need a party', 1) num = [$game_party.forced_size, members + $game_party.actors.nitems].min self.contents.draw_text(0, 32, 288, 32, "of #{num} members!", 1) when 1 self.contents.draw_text(0, 0, 288, 32, 'You cannot remove', 1) self.contents.draw_text(0, 32, 288, 32, 'the last party member!', 1) when 2 self.contents.draw_text(0, 0, 288, 32, 'At least one member', 1) self.contents.draw_text(0, 32, 288, 32, 'has to be alive!', 1) end end
end
if BlizzCFG::BATTLE_SWITCH #============================================================================== # Window_PartyCommand #==============================================================================
class Window_PartyCommand < Window_Selectable def initialize super(0, 0, 640, 64) self.contents = Bitmap.new(width - 32, height - 32) self.back_opacity = 160 @commands = ['Fight', 'Escape', 'Switch'] @item_max = @column_max = 3 draw_item(0, normal_color) draw_item(1, $game_temp.battle_can_escape ? normal_color : disabled_color) draw_item(2, normal_color) self.active, self.visible, self.index = false, false, 0 end def draw_item(index, color) self.contents.font.color = color rect = Rect.new(80 + index * 160 + 4, 0, 128 - 10, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) self.contents.draw_text(rect, @commands[index], 1) end def update_cursor_rect self.cursor_rect.set(80 + index * 160, 0, 128, 32) end def command(index = self.index) return @commands[index] end end end
#============================================================================== # Scene_PartySwitcher #==============================================================================
class Scene_PartySwitcher def initialize(wipe_party = 0, reset = 0, store = 0) @wipe_party, @store, @reset = store, reset, wipe_party @current_window_temp = @reserve_window_temp = 0 @scene_flag, @temp_window = false, '' @scene = $scene.class end def main if @store != 0 swap_parties $scene = Scene_Map.new $game_player.refresh return end @mnlay = Sprite.new @mnlay.bitmap = RPG::Cache.picture("Formation") @mnlay.z = 10 case @wipe_party when 1 then setup_forced_party when 2 then wipe_party when 3 $game_system.stored_party = $game_party.actors wipe_party when 10 then $all_available = true end if @reset == 1 (1...$data_actors.size).each {|i| $game_actors[i].not_available = false} end @current_window = Window_Current.new @current_window.index, @current_window.active = 0, true @current_window.opacity = 0 @reserve_window = Window_Reserve.new(@scene) @reserve_window.x, @reserve_window.y = 272, 160 @reserve_window.opacity = 0 @help_window = Window_HelpStatus.new(@reserve_window.getactor(0), @scene) @help_window.x = 240 + 32 @help_window.opacity = 0 Graphics.transition loop do Graphics.update Input.update update break if $scene != self end Graphics.freeze @mnlay.dispose [@current_window, @reserve_window, @help_window].each {|win| win.dispose} $game_party.actors.compact! $game_player.refresh $all_available = nil end def update check = @reserve_window.index if @reserve_window.active reserve_update @reserve_window.update end if check != @reserve_window.index if @reserve_window.active actor = @reserve_window.getactor(@reserve_window.index) elsif @current_window.active actor = @reserve_window.getactor(@reserve_window_temp) end @help_window.refresh(actor) if ['', 'Current'].include?(@temp_window) end current_update if @current_window.active if Input.trigger?(Input::B) if @scene_flag $game_system.se_play($data_system.cancel_se) @scene_flag, @temp_window = false, '' if @reserve_window.active actor = @reserve_window.getactor(@reserve_window.index) elsif @current_window.active actor = @reserve_window.getactor(@reserve_window_temp) end @help_window.refresh(actor) if ['', 'Current'].include?(@temp_window) [@current_window, @reserve_window].each {|win| win.refresh} return end if $game_party.forced_size != nil && ($game_party.forced_size < $game_party.actors.nitems || ($game_party.forced_size > $game_party.actors.nitems && @reserve_window.get_number != 0)) $game_system.se_play($data_system.buzzer_se) warning(1) return end if $game_party.actors.all? {|actor| actor == nil || actor != nil && actor.dead?} $game_system.se_play($data_system.buzzer_se) warning(2) return end $game_system.se_play($data_system.cancel_se) $scene = Scene_Menu.new(10) elsif Input.trigger?(Input::A) if $game_party.any_forced_position $game_system.se_play($data_system.buzzer_se) else $game_system.se_play($data_system.decision_se) $game_party.actors.compact! @current_window.refresh end end end def current_update @current_window.update if Input.trigger?(Input::C) actor = @current_window.getactor(@current_window.index) if actor != nil && actor.forced_position != nil $game_system.se_play($data_system.buzzer_se) else if @scene_flag switch_members else $game_system.se_play($data_system.decision_se) @scene_flag, @temp_window = true, 'Current' @temp_actor_index = @current_window.index @current_window.clone_cursor end end elsif Input.trigger?(Input::RIGHT) if @scene == Scene_Map && $game_system.order_only || @scene == Scene_Battle && $game_system.battle_order_only $game_system.se_play($data_system.buzzer_se) else $game_system.se_play($data_system.cursor_se) @current_window.active = false @reserve_window.active = true @current_window_temp = @current_window.index actor = @reserve_window.getactor(@reserve_window_temp) @current_window.index = -1 @reserve_window.index = @reserve_window_temp @help_window.refresh(actor) unless @scene_flag end end end def reserve_update if Input.trigger?(Input::C) if @scene_flag switch_members else $game_system.se_play($data_system.decision_se) @scene_flag, @temp_window = true, 'Reserve' @temp_actor_index = @reserve_window.index @reserve_window.clone_cursor end elsif @reserve_window.index % 3 == 0 && Input.repeat?(Input::LEFT) $game_system.se_play($data_system.cursor_se) @reserve_window.active = false @current_window.active = true @reserve_window_temp = @reserve_window.index @reserve_window.index = -1 @current_window.index = @current_window_temp end end def switch_members if @temp_window == 'Reserve' && @reserve_window.active @reserve_window.setactor(@temp_actor_index, @reserve_window.index) actor = @reserve_window.getactor(@reserve_window.index) @help_window.refresh(actor) end if @temp_window == 'Current' && @current_window.active @current_window.setactor(@temp_actor_index, @current_window.index) end if @temp_window == 'Reserve' && @current_window.active actor1 = @current_window.getactor(@current_window.index) actor2 = @reserve_window.getactor(@temp_actor_index) if call_warning?(@current_window.index, actor2) if actor1 != nil && actor1.must_be_in_party $game_system.se_play($data_system.buzzer_se) @scene_flag, @temp_window = false, '' actor = @reserve_window.getactor(@reserve_window_temp) [@current_window, @reserve_window].each {|win| win.refresh} @help_window.refresh(actor) return end if actor2 != nil && actor2.not_available && !$all_available $game_system.se_play($data_system.buzzer_se) @scene_flag, @temp_window = false, '' actor = @reserve_window.getactor(@reserve_window_temp) [@current_window, @reserve_window].each {|win| win.refresh} @help_window.refresh(actor) return end @reserve_window.setparty(@temp_actor_index, @current_window.index) @current_window.refresh actor = @reserve_window.getactor(@reserve_window_temp) @help_window.refresh(actor) else warning(0) end end if @temp_window == 'Current' && @reserve_window.active actor1 = @current_window.getactor(@temp_actor_index) actor2 = @reserve_window.getactor(@reserve_window.index) if call_warning?(@temp_actor_index, actor2) if actor1 != nil && actor1.must_be_in_party $game_system.se_play($data_system.buzzer_se) @scene_flag, @temp_window = false, '' actor = @reserve_window.getactor(@reserve_window.index) [@current_window, @reserve_window].each {|win| win.refresh} @help_window.refresh(actor) return end if actor2 != nil && actor2.not_available && !$all_available $game_system.se_play($data_system.buzzer_se) @scene_flag, @temp_window = false, '' actor = @reserve_window.getactor(@reserve_window.index) [@current_window, @reserve_window].each {|win| win.refresh} @help_window.refresh(actor) return end @reserve_window.setparty(@reserve_window.index, @temp_actor_index) @current_window.refresh actor = @reserve_window.getactor(@reserve_window.index) @help_window.refresh(actor) else warning(0) end end $game_system.se_play($data_system.decision_se) @scene_flag, @temp_window = false, '' end def wipe_party $game_party.actors.each {|actor| actor.not_available = true if actor != nil} setup_forced_party(true) if $game_party.actors == [] (1...$data_actors.size).each {|i| unless $game_actors[i].not_available || $game_actors[i].disabled_for_party $game_party.actors.push($game_actors[i]) return end} end end def setup_forced_party(flag = false) $game_party.actors, party = [], [] (1...$data_actors.size).each {|i| if $game_actors[i] != nil && $game_actors[i].must_be_in_party && (!$game_actors[i].disabled_for_party || flag) && !$game_actors[i].not_available party.push($game_actors[i]) end} party.clone.each {|actor| if actor.forced_position != nil $game_party.actors[actor.forced_position] = actor party.delete(actor) end} $game_party.actors.each_index {|i| $game_party.actors[i] = party.shift if $game_party.actors[i] == nil} $game_party.actors += party.compact end def swap_parties $game_party.actors.compact! temp_actors = $game_party.actors temp_actors.each {|actor| actor.not_available = true} $game_system.stored_party.compact! $game_system.stored_party.each {|actor| actor.not_available = false} $game_party.actors = $game_system.stored_party $game_system.stored_party = (@store == 1 ? temp_actors : nil) end def call_warning?(index, actor2) return (BlizzCFG::ALLOW_EMPTY_PARTY || $game_party.actors[index] == nil || actor2 != nil || $game_party.actors.nitems > 1) end def warning(type) $game_system.se_play($data_system.buzzer_se) @warning_window = Window_Warning.new(type, @reserve_window.get_number) loop do Graphics.update Input.update if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) if type > 0 [@current_window, @reserve_window].each {|win| win.refresh} @warning_window.dispose @warning_window = nil break end end end end
#============================================================================== # Scene_Battle #============================================================================== class Scene_Battle alias update_phase2_eps_later update_phase2 def update_phase2 update_phase2_eps_later if Input.trigger?(Input::C) && @party_command_window.index == 2 $game_system.se_play($data_system.decision_se) @spriteset.dispose $scene = Scene_PartySwitcher.new $scene.main $scene = self @spriteset = Spriteset_Battle.new 15.times {@spriteset.update} @status_window.refresh Graphics.transition(0) end end alias start_phase5_eps_later start_phase5 def start_phase5 start_phase5_eps_later (1...$data_actors.size).each {|i| unless $game_party.actors.include?($game_actors[i]) if $game_actors[i].not_available $game_actors[i].exp += @result_window.exp * BlizzCFG::EXP_NOT_AVAILABLE/100 elsif $game_actors[i].disabled_for_party $game_actors[i].exp += @result_window.exp * BlizzCFG::EXP_DISABLED_FOR_PARTY/100 else $game_actors[i].exp += @result_window.exp * BlizzCFG::EXP_RESERVE/100 end end} end end |
| | | Invité Invité
| Sujet: Re: [XP] [résolu] Scipt d'aeon + PHS Sam 12 Nov 2011 - 20:17 | |
| Perso vu que c'est pour XP, je ne pourrais plus trop t'aider, enfin bon, j'espère quand même que ton problème sera réglé. |
| | | Shyno19 Ninja (niveau 5)
Messages postés : 220 Date d'inscription : 21/09/2011 Jauge LPC :
| Sujet: Re: [XP] [résolu] Scipt d'aeon + PHS Jeu 17 Nov 2011 - 2:32 | |
| |
| | | Jin Ancien staffeux
Messages postés : 8557 Date d'inscription : 08/12/2010 Jauge LPC :
| Sujet: Re: [XP] [résolu] Scipt d'aeon + PHS Jeu 17 Nov 2011 - 3:13 | |
| à la limite, essaie de truquer tout ça avec un event commun. |
| | | AeronCin Chevalier (niveau 2)
Messages postés : 92 Date d'inscription : 15/08/2011 Jauge LPC :
| Sujet: Re: [XP] [résolu] Scipt d'aeon + PHS Jeu 17 Nov 2011 - 21:41 | |
| Jin', on corrige pas des problèmes de CMS et CBS scripts avec des events... |
| | | Shyno19 Ninja (niveau 5)
Messages postés : 220 Date d'inscription : 21/09/2011 Jauge LPC :
| Sujet: Re: [XP] [résolu] Scipt d'aeon + PHS Lun 9 Jan 2012 - 11:24 | |
| Le problème à été résolu grâce à un scripteur du nom de Larcange sur un autre forum qui a eu la gentillesse de m'aider voici le script refait pour que ces 2 script soit compatible. c'est le script de PHS - Code:
-
# # How to use: # # To call this script, make a "Call script" command in an event. # # 1. Syntax: $scene = Scene_PartySwitcher.new # No extra feature will be applied and you can switch the party as you # wish. # # 2. Syntax: $scene = Scene_PartySwitcher.new(XXX) # You can replace XXX for 1 to remove all party members except one (either # one, who must be in the party or a random one), or replace XXX with 2, # to cause a wipe party. Wiping a party will disable the of the current # members and a NEW party of the remaining members must be formed. If you # replace it with 3, the current party configuration will be stored for a # later fast switch-back. If XXX is 10, all actors will be available for # party switching no matter if the are "not_available" or # "disabled_for_party". This feature if used by the CP Debug System. No # faceset will be used in this case for a more convenient working. # # 3. Syntax: $scene = Scene_PartySwitcher.new(XXX, 1) # You can use the XXX as described above or just set it to 0 to disable # it. Also the "1" in the syntax will reset any disabled_for_party and is # made to be used after multi-party use. # # 4. Syntax: $scene = Scene_PartySwitcher.new(XXX, YYY, ZZZ) # You can replace ZZZ with 1 to replace the party with a stored one AND # store the current or replace it with 2 to replace the party with a # stored one, but without storing the current. USE THIS ONLY IF YOU ASSUME # TO HAVE A STORED PARTY READY! You can simply test if there is a store # party by putting this code into the conditional branch script: # # $game_system.stored_party != nil # # This syntax will not open the Party Switcher and it will override the # commands XXX and YYY, so you can replace these with any number. # # 5. To activate/deactivate the option of order change only, simply use the # event command "Call Script" with following syntax: # # $game_system.order_only = true/false # # If the setting is set to true, the switcher will allow only party order # change. The same goes for battle change (if you are using the # BATTLE_SWITCH option), but the syntax is different: # # $game_system.battle_order_only = true/false # # Character faces go into the "Characters" folder and they have the same name # as the character spritesets have with _face added # # Example: # # sprite - Marlen.png # face - Marlen_face.png # # Other syntaxes: # $game_actors[ID].not_available = true/false # $game_actors[ID].disabled_for_party = true/false # $game_actors[ID].must_be_in_party = true/false # $game_actors[ID].forced_position = nil/0/1/2/... # OR # $game_party.actors[POS].not_available = true/false # $game_party.actors[POS].disabled_for_party = true/false # $game_party.actors[POS].must_be_in_party = true/false # $game_party.actors[POS].forced_position = nil/0/1/2/... # # ID - the actor's ID in the database # POS - the actor's position in the party (STARTS FROM 0, not 1!) # # not_available # - will disable the possibility of an already unlocked character to be in # the current party # # disabled_for_party # - will cause the character NOT to appear in the party switch screen at all # # must_be_in_party # - will cause the character to be automatically moved into the current party # and he also cannot be put in the reserve # # forced_position # - will enforce the player to be at a specific position in the party, set # this value to nil to disable this feature, use it in combination with # must_be_in_party and $game_party.forced_size or you might experience # bugs, # # $game_party.forced_size = nil/0/1/2/... # # Using this syntax will enforce a specific party size. The EPS won't exit # until this size is filled up or there are no more in the reserve. EPS will # automatically "correct" this number if there are not enough characters in # the reserve to fill up a party of forced_size. Set this value to nil to # disable the size requirement. Note that the actor DO NOT HAVE TO be set in # normal order without any empty position like in version 1.x. # # # Additional note: # # For your own sake, do not apply the attribute "must_be_in_party" to a # character at the same time with "not_available" or "disabled_for_party" as # this WILL disrupt your party and party switch system. Use "forced_position" # together with "must_be_in_party" to avoid bugs. Be careful when using # "forced_position" with "$game_party.forced_size". Add actors at the very # end to be sure the player can't put others after them if the "forced_size" # is smaller than the maximum party size. # # # If you find any bugs, please report them here: # http://www.chaosproject.co.nr #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#============================================================================== # module BlizzCFG #==============================================================================
module BlizzCFG
#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: # START Conficuration #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: # how many party members do you use MAX_PARTY = 4 # set to true to use facesets instead of spritesets FACESETS = false # allows a party with 0 members ALLOW_EMPTY_PARTY = false # allows switching the party in battle BATTLE_SWITCH = false # gives all other characters EXP (specify in %) EXP_RESERVE = 50 # gives "not available" characters EXP (specify in %) EXP_NOT_AVAILABLE = 0 # gives "disabled for party" characters EXP (specify in %) EXP_DISABLED_FOR_PARTY = 0 #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: # END Conficuration #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end
# recognition variable for plug-ins $easy_party_switcher = 2.41
#============================================================================== # Game_Actor #==============================================================================
class Game_Actor < Game_Battler
attr_accessor :must_be_in_party attr_accessor :disabled_for_party attr_accessor :not_available attr_accessor :forced_position alias setup_eps_later setup def setup(actor_id) setup_eps_later(actor_id) @must_be_in_party = @disabled_for_party = @not_available = false end end
#============================================================================== # Game_System #==============================================================================
class Game_System
attr_accessor :stored_party attr_accessor :order_only attr_accessor :battle_order_only alias init_eps_later initialize def initialize init_eps_later @order_only = @battle_order_only = false end end
#============================================================================== # Game_Party #==============================================================================
class Game_Party
attr_accessor :actors attr_accessor :forced_size def any_forced_position return (@actors.any? {|actor| actor != nil && actor.forced_position != nil}) end end
#============================================================================== # Window_Base #==============================================================================
class Window_Base
alias draw_actor_graphic_eps_later draw_actor_graphic def draw_actor_graphic(actor, x, y) if actor != nil && actor.character_name != '' classes = [Window_Current, Window_Reserve, Window_HelpStatus] if BlizzCFG::FACESETS && !$all_available && classes.include?(self.class) draw_actor_face_eps(actor, x, y) else if classes.include?(self.class) bitmap = RPG::Cache.character(actor.character_name, actor.character_hue) x += bitmap.width / 8 + 24 y += bitmap.height / 4 + 16 end draw_actor_graphic_eps_later(actor, x, y) end end end
def draw_actor_face_eps(actor, x, y) if $tons_version == nil || $tons_version < 3.71 || !FACE_HUE hue = 0 else hue = actor.character_hue end bitmap = RPG::Cache.character("#{actor.character_name}_face", hue) src_rect = Rect.new(0, 0, bitmap.width, bitmap.height) if actor.not_available || actor.must_be_in_party self.contents.blt(x, y, bitmap, src_rect, 128) else self.contents.blt(x, y, bitmap, src_rect) end end end
#============================================================================== # Window_BattleResult #==============================================================================
class Window_BattleResult attr_reader :exp end
#============================================================================== # Window_Current #==============================================================================
class Window_Current < Window_Selectable
def initialize super(0, 0, 240 + 32, (BlizzCFG::MAX_PARTY > 4 ? 480 : BlizzCFG::MAX_PARTY * 120)) self.contents = Bitmap.new(width - 32, 448 + (BlizzCFG::MAX_PARTY-4) * 120) @item_max = BlizzCFG::MAX_PARTY if $fontface != nil self.contents.font.name = $fontface self.contents.font.size = $fontsize elsif $defaultfonttype != nil self.contents.font.name = $defaultfonttype self.contents.font.size = $defaultfontsize end self.contents.font.size = 24 refresh self.active, self.index, self.z = false, -1, 5000 end def refresh self.contents.clear $game_party.actors.each_index {|i| if $game_party.actors[i] != nil draw_actor_graphic($game_party.actors[i], 4, i*120+4) draw_actor_name($game_party.actors[i], 152, i*120-4) draw_actor_level($game_party.actors[i], 88, i*120-4) draw_actor_hp($game_party.actors[i], 88, i*120+24) draw_actor_sp($game_party.actors[i], 88, i*120+52) end} end
def setactor(index_1, index_2) $game_party.actors[index_2], $game_party.actors[index_1] = $game_party.actors[index_1], $game_party.actors[index_2] refresh end
def getactor(index) return $game_party.actors[index] end def update_cursor_rect if @index < 0 self.cursor_rect.empty return end row = @index / @column_max self.top_row = row if row < self.top_row self.top_row = row - (page_row_max - 1) if row > top_row + (page_row_max - 1) y = (@index / @column_max) * 120 - self.oy self.cursor_rect.set(0, y, self.width - 32, 88) end
def clone_cursor row = @index / @column_max self.top_row = row if row < self.top_row self.top_row = row - (page_row_max - 1) if row > top_row + (page_row_max - 1) y = (@index / @column_max) * 120 src_rect = Rect.new(0, 0, self.width, 88) bitmap = Bitmap.new(self.width-32, 88) bitmap.fill_rect(0, 0, self.width-32, 88, Color.new(255, 255, 255, 192)) bitmap.fill_rect(2, 2, self.width-36, 84, Color.new(255, 255, 255, 80)) self.contents.blt(0, y, bitmap, src_rect, 192) end def top_row return self.oy / 116 end
def top_row=(row) self.oy = (row % row_max) * 120 end
def page_row_max return (self.height / 120) end
end
#============================================================================== # Window_Reserve #==============================================================================
class Window_Reserve < Window_Selectable attr_reader :actors def initialize(scene) super(0, 0, 368, 320) setup @column_max, rows = 3, @item_max / @column_max self.contents = Bitmap.new(width - 32, (rows >= 3 ? rows * 96 : height - 32)) if $fontface != nil self.contents.font.name = $fontface self.contents.font.size = $fontsize elsif $defaultfonttype != nil self.contents.font.name = $defaultfonttype self.contents.font.size = $defaultfontsize end self.contents.font.size = 24 self.active, self.index, self.z = false, -1, 5000 refresh if scene == Scene_Map && $game_system.order_only || scene == Scene_Battle && $game_system.battle_order_only self.opacity = 0 end end def setup @actors = [] (1...$data_actors.size).each {|i| unless $game_party.actors.include?($game_actors[i]) || $game_actors[i].disabled_for_party && !$all_available @actors.push($game_actors[i]) end} @item_max = (@actors.size + $game_party.actors.size + 3) / 3 * 3 end def refresh self.contents.clear @actors.each_index {|i| draw_actor_graphic(@actors[i], i%3*112+16, i/3*96+8)} end def getactor(index) return @actors[index] end def get_number return (@actors.find_all {|actor| actor != nil}).size if $all_available return (@actors.find_all {|actor| actor != nil && !actor.not_available}).size end def setactor(index_1, index_2) @actors[index_1], @actors[index_2] = @actors[index_2], @actors[index_1] refresh end
def setparty(index_1, index_2) @actors[index_1], $game_party.actors[index_2] = $game_party.actors[index_2], @actors[index_1] refresh end
def update_cursor_rect if @index < 0 self.cursor_rect.empty return end row = @index / @column_max self.top_row = row if row < self.top_row self.top_row = row - (page_row_max-1) if row > top_row + (page_row_max-1) x, y = (@index % @column_max)*112 + 8, (@index / @column_max)*96 - self.oy self.cursor_rect.set(x, y, 96, 96) end
def clone_cursor row = @index / @column_max self.top_row = row if row < self.top_row self.top_row = row - (page_row_max - 1) if row > top_row + (page_row_max - 1) x, y = (@index % @column_max) * 112 + 8, (@index / @column_max) * 96 src_rect = Rect.new(0, 0, 96, 96) bitmap = Bitmap.new(96, 96) bitmap.fill_rect(0, 0, 96, 96, Color.new(255, 255, 255, 192)) bitmap.fill_rect(2, 2, 92, 92, Color.new(255, 255, 255, 80)) self.contents.blt(x, y, bitmap, src_rect, 192) end def top_row return self.oy / 96 end
def top_row=(row) row = row % row_max self.oy = row * 96 end
def page_row_max return (self.height - 32) / 96 end
end #============================================================================== # Window_HelpStatus #==============================================================================
class Window_HelpStatus < Window_Base
def initialize(gotactor, scene) super(0, 0, 400 - 32, 160) self.contents = Bitmap.new(width - 32, height - 32) if $fontface != nil self.contents.font.name = $fontface self.contents.font.size = $fontsize elsif $defaultfonttype != nil self.contents.font.name = $defaultfonttype self.contents.font.size = $defaultfontsize end self.contents.font.size = 24 refresh(gotactor) self.active, self.z = false, 5000 if scene == Scene_Map && $game_system.order_only || scene == Scene_Battle && $game_system.battle_order_only self.opacity = 128 end end def refresh(actor) self.contents.clear if actor != nil self.contents.font.color = normal_color if actor.not_available && !$all_available self.contents.draw_text(8, 0, 160, 32, 'pas disponible', 0) end draw_actor_graphic(actor, 0, 40) draw_actor_name(actor, 160, 32) draw_actor_level(actor, 96, 32) draw_actor_hp(actor, 96, 64) draw_actor_sp(actor, 96, 96) end end
end
#============================================================================== # Window_Warning #==============================================================================
class Window_Warning < Window_Base
def initialize(mode, members) super(0, 0, 320, 96) self.contents = Bitmap.new(width - 32, height - 32) if $fontface != nil self.contents.font.name = $fontface self.contents.font.size = $fontsize elsif $defaultfonttype != nil self.contents.font.name = $defaultfonttype self.contents.font.size = $defaultfontsize end self.contents.font.size = 24 self.x, self.y, self.z = 320 - width/2, 240 - height/2, 9999 self.contents.font.color = normal_color case mode when 0 self.contents.draw_text(0, 0, 288, 32, 'il faut être dans un groupe', 1) num = [$game_party.forced_size, members + $game_party.actors.nitems].min self.contents.draw_text(0, 32, 288, 32, "of #{num} members!", 1) when 1 self.contents.draw_text(0, 0, 288, 32, 'Vous ne pouvez pas supprimer', 1) self.contents.draw_text(0, 32, 288, 32, 'le dernier membre du groupe !', 1) when 2 self.contents.draw_text(0, 0, 288, 32, 'Au moins un membre', 1) self.contents.draw_text(0, 32, 288, 32, 'doit être vivant !', 1) end end
end
if BlizzCFG::BATTLE_SWITCH #============================================================================== # Window_PartyCommand #==============================================================================
class Window_PartyCommand < Window_Selectable def initialize super(0, 0, 640, 64) self.contents = Bitmap.new(width - 32, height - 32) self.back_opacity = 160 @commands = ['Combattre', 'Fuir', 'Changer'] @item_max = @column_max = 3 draw_item(0, normal_color) draw_item(1, $game_temp.battle_can_escape ? normal_color : disabled_color) draw_item(2, normal_color) self.active, self.visible, self.index = false, false, 0 end def draw_item(index, color) self.contents.font.color = color rect = Rect.new(80 + index * 160 + 4, 0, 128 - 10, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) self.contents.draw_text(rect, @commands[index], 1) end def update_cursor_rect self.cursor_rect.set(80 + index * 160, 0, 128, 32) end def command(index = self.index) return @commands[index] end end end
#============================================================================== # Scene_PartySwitcher #==============================================================================
class Scene_PartySwitcher def initialize(wipe_party = 0, reset = 0, store = 0) @wipe_party, @store, @reset = store, reset, wipe_party @current_window_temp = @reserve_window_temp = 0 @scene_flag, @temp_window = false, '' @scene = $scene.class end def main if @store != 0 swap_parties $scene = Scene_Map.new $game_player.refresh return end @mnlay = Sprite.new @mnlay.bitmap = RPG::Cache.picture("Formation") @mnlay.z = 10 case @wipe_party when 1 then setup_forced_party when 2 then wipe_party when 3 $game_system.stored_party = $game_party.actors wipe_party when 10 then $all_available = true end if @reset == 1 (1...$data_actors.size).each {|i| $game_actors[i].not_available = false} end @current_window = Window_Current.new @current_window.index, @current_window.active = 0, true @current_window.opacity = 0 @reserve_window = Window_Reserve.new(@scene) @reserve_window.x, @reserve_window.y = 272, 160 @reserve_window.opacity = 0 @help_window = Window_HelpStatus.new(@reserve_window.getactor(0), @scene) @help_window.x = 240 + 32 @help_window.opacity = 0 Graphics.transition loop do Graphics.update Input.update update break if $scene != self end Graphics.freeze @mnlay.dispose [@current_window, @reserve_window, @help_window].each {|win| win.dispose} $game_party.actors.compact! $game_player.refresh $all_available = nil end def update check = @reserve_window.index if @reserve_window.active reserve_update @reserve_window.update end if check != @reserve_window.index if @reserve_window.active actor = @reserve_window.getactor(@reserve_window.index) elsif @current_window.active actor = @reserve_window.getactor(@reserve_window_temp) end @help_window.refresh(actor) if ['', 'Current'].include?(@temp_window) end current_update if @current_window.active if Input.trigger?(Input::B) if @scene_flag $game_system.se_play($data_system.cancel_se) @scene_flag, @temp_window = false, '' if @reserve_window.active actor = @reserve_window.getactor(@reserve_window.index) elsif @current_window.active actor = @reserve_window.getactor(@reserve_window_temp) end @help_window.refresh(actor) if ['', 'Current'].include?(@temp_window) [@current_window, @reserve_window].each {|win| win.refresh} return end if $game_party.forced_size != nil && ($game_party.forced_size < $game_party.actors.nitems || ($game_party.forced_size > $game_party.actors.nitems && @reserve_window.get_number != 0)) $game_system.se_play($data_system.buzzer_se) warning(1) return end if $game_party.actors.all? {|actor| actor == nil || actor != nil && actor.dead?} $game_system.se_play($data_system.buzzer_se) warning(2) return end $game_system.se_play($data_system.cancel_se) $scene = Scene_Menu.new(10) elsif Input.trigger?(Input::A) if $game_party.any_forced_position $game_system.se_play($data_system.buzzer_se) else $game_system.se_play($data_system.decision_se) $game_party.actors.compact! @current_window.refresh end end end def current_update @current_window.update if Input.trigger?(Input::C) actor = @current_window.getactor(@current_window.index) if actor != nil && actor.forced_position != nil $game_system.se_play($data_system.buzzer_se) else if @scene_flag switch_members else $game_system.se_play($data_system.decision_se) @scene_flag, @temp_window = true, 'Current' @temp_actor_index = @current_window.index @current_window.clone_cursor end end elsif Input.trigger?(Input::RIGHT) if @scene == Scene_Map && $game_system.order_only || @scene == Scene_Battle && $game_system.battle_order_only $game_system.se_play($data_system.buzzer_se) else $game_system.se_play($data_system.cursor_se) @current_window.active = false @reserve_window.active = true @current_window_temp = @current_window.index actor = @reserve_window.getactor(@reserve_window_temp) @current_window.index = -1 @reserve_window.index = @reserve_window_temp @help_window.refresh(actor) unless @scene_flag end end end def reserve_update if Input.trigger?(Input::C) if @scene_flag switch_members else $game_system.se_play($data_system.decision_se) @scene_flag, @temp_window = true, 'Reserve' @temp_actor_index = @reserve_window.index @reserve_window.clone_cursor end elsif @reserve_window.index % 3 == 0 && Input.repeat?(Input::LEFT) $game_system.se_play($data_system.cursor_se) @reserve_window.active = false @current_window.active = true @reserve_window_temp = @reserve_window.index @reserve_window.index = -1 @current_window.index = @current_window_temp end end def switch_members if @temp_window == 'Reserve' && @reserve_window.active @reserve_window.setactor(@temp_actor_index, @reserve_window.index) actor = @reserve_window.getactor(@reserve_window.index) @help_window.refresh(actor) end if @temp_window == 'Current' && @current_window.active @current_window.setactor(@temp_actor_index, @current_window.index) end if @temp_window == 'Reserve' && @current_window.active actor1 = @current_window.getactor(@current_window.index) actor2 = @reserve_window.getactor(@temp_actor_index) if call_warning?(@current_window.index, actor2) if actor1 != nil && actor1.must_be_in_party $game_system.se_play($data_system.buzzer_se) @scene_flag, @temp_window = false, '' actor = @reserve_window.getactor(@reserve_window_temp) [@current_window, @reserve_window].each {|win| win.refresh} @help_window.refresh(actor) return end if actor2 != nil && actor2.not_available && !$all_available $game_system.se_play($data_system.buzzer_se) @scene_flag, @temp_window = false, '' actor = @reserve_window.getactor(@reserve_window_temp) [@current_window, @reserve_window].each {|win| win.refresh} @help_window.refresh(actor) return end t_actor = @current_window.getactor(@current_window.index) $game_actors[t_actor.id].remove_esper if $game_actors[t_actor.id].esper1 != 0 @reserve_window.setparty(@temp_actor_index, @current_window.index) @current_window.refresh actor = @reserve_window.getactor(@reserve_window_temp) @help_window.refresh(actor) else warning(0) end end if @temp_window == 'Current' && @reserve_window.active actor1 = @current_window.getactor(@temp_actor_index) actor2 = @reserve_window.getactor(@reserve_window.index) if call_warning?(@temp_actor_index, actor2) if actor1 != nil && actor1.must_be_in_party $game_system.se_play($data_system.buzzer_se) @scene_flag, @temp_window = false, '' actor = @reserve_window.getactor(@reserve_window.index) [@current_window, @reserve_window].each {|win| win.refresh} @help_window.refresh(actor) return end if actor2 != nil && actor2.not_available && !$all_available $game_system.se_play($data_system.buzzer_se) @scene_flag, @temp_window = false, '' actor = @reserve_window.getactor(@reserve_window.index) [@current_window, @reserve_window].each {|win| win.refresh} @help_window.refresh(actor) return end $game_actors[actor1.id].remove_esper if $game_actors[actor1.id].esper1 != 0 @reserve_window.setparty(@reserve_window.index, @temp_actor_index) @current_window.refresh actor = @reserve_window.getactor(@reserve_window.index) @help_window.refresh(actor) else warning(0) end end $game_system.se_play($data_system.decision_se) @scene_flag, @temp_window = false, '' end def wipe_party $game_party.actors.each {|actor| actor.not_available = true if actor != nil} setup_forced_party(true) if $game_party.actors == [] (1...$data_actors.size).each {|i| unless $game_actors[i].not_available || $game_actors[i].disabled_for_party $game_party.actors.push($game_actors[i]) return end} end end def setup_forced_party(flag = false) $game_party.actors, party = [], [] (1...$data_actors.size).each {|i| if $game_actors[i] != nil && $game_actors[i].must_be_in_party && (!$game_actors[i].disabled_for_party || flag) && !$game_actors[i].not_available party.push($game_actors[i]) end} party.clone.each {|actor| if actor.forced_position != nil $game_party.actors[actor.forced_position] = actor party.delete(actor) end} $game_party.actors.each_index {|i| $game_party.actors[i] = party.shift if $game_party.actors[i] == nil} $game_party.actors += party.compact end def swap_parties $game_party.actors.compact! temp_actors = $game_party.actors temp_actors.each {|actor| actor.not_available = true} $game_system.stored_party.compact! $game_system.stored_party.each {|actor| actor.not_available = false} $game_party.actors = $game_system.stored_party $game_system.stored_party = (@store == 1 ? temp_actors : nil) end def call_warning?(index, actor2) return (BlizzCFG::ALLOW_EMPTY_PARTY || $game_party.actors[index] == nil || actor2 != nil || $game_party.actors.nitems > 1) end def warning(type) $game_system.se_play($data_system.buzzer_se) @warning_window = Window_Warning.new(type, @reserve_window.get_number) loop do Graphics.update Input.update if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) if type > 0 [@current_window, @reserve_window].each {|win| win.refresh} @warning_window.dispose @warning_window = nil break end end end end
#============================================================================== # Scene_Battle #============================================================================== class Scene_Battle alias update_phase2_eps_later update_phase2 def update_phase2 update_phase2_eps_later if Input.trigger?(Input::C) && @party_command_window.index == 2 $game_system.se_play($data_system.decision_se) @spriteset.dispose $scene = Scene_PartySwitcher.new $scene.main $scene = self @spriteset = Spriteset_Battle.new 15.times {@spriteset.update} @status_window.refresh Graphics.transition(0) end end alias start_phase5_eps_later start_phase5 def start_phase5 start_phase5_eps_later (1...$data_actors.size).each {|i| unless $game_party.actors.include?($game_actors[i]) if $game_actors[i].not_available $game_actors[i].exp += @result_window.exp * BlizzCFG::EXP_NOT_AVAILABLE/100 elsif $game_actors[i].disabled_for_party $game_actors[i].exp += @result_window.exp * BlizzCFG::EXP_DISABLED_FOR_PARTY/100 else $game_actors[i].exp += @result_window.exp * BlizzCFG::EXP_RESERVE/100 end end} end end Voila voila cordialement |
| | | Contenu sponsorisé
| Sujet: Re: [XP] [résolu] Scipt d'aeon + PHS | |
| |
| | | |
Sujets similaires | |
|
| Permission de ce forum: | Vous ne pouvez pas répondre aux sujets dans ce forum
| |
| |
| |