-17%
Le deal à ne pas rater :
Casque de réalité virtuelle Meta Quest 2 128 Go Blanc (+29,99€ ...
249.99 € 299.99 €
Voir le deal

Aller en bas
ZangtherOld
ZangtherOld
Membre

Nombre de messages : 1711
Date d'inscription : 07/08/2009

New Game Plus Empty New Game Plus

Mer 17 Mar 2010 - 0:22
Salut a tous !!

Eh bien, voici donc mon premier "vrai" script !

New Game Plus.

L'utilité de ce script ? En fait, quand le joueur a fini le jeu, il peut donc le recommencer avec une partie avec une flopée de bonus en plus !
Quels sont les bonus ? Comment faire marcher le script ?
Une petit lecture du module vous permettra de répondre à toutes ces questions.
Tous les textes sont personnalisables.

Screenshots :
New Game Plus Ngtitle
New Game Plus Ngload
New Game Plus Ngdebut1
New Game Plus Ngdebut2

Compatibilité : Le script devrait être compatible avec les script d'écran titre custom mais pas avec les scripts modifiant les sauvegardes.

Démo : http://www.megaupload.com/?d=OPATNGZU
Instalateur de base RPG Maker VX, données non cryptée. Histoire bidon pour justifier une fin de jeu.

Changelog :
-V1 : script de base
-V1.1 : Fonction + X Or réparée
Code optimisé

LE script !!
Code:
#==============================================================================================
#==============================================================================================
#
#    New Game +, créé par Zangther
#
#==============================================================================================
#==============================================================================================
#
# Le but de ce script est d'avoir, à la fin du jeu, possibilité de le recommencer avec certains bonus.
# Liste des bonus disponibles :
#        - Régler la difficulté
#        - Regagner l'inventaire en fin de partie
#        - Regagner la fortune en fin de partie
#        - Récuperer le temps de jeu
#        - Activer le contenu supplémentaire 1
#        - Activer le contenu supplémentaire 2
#        - Gagner une grosse somme d'argent
#        - Régler les gains d'experience
#
#    Tout le texte apparaissant dans ce script est configurable dans le module. Ce qui est à modifier est en violet et
#    une paire de guillements ( ' ).
#
#    Comment utiliser ce script ?
#   
#        A la fin de votre jeu, activez l'interrupteur avec l'ID spécifié dans le module, cet ID est la constante NG.
#
#        Ensuite, lors de la sélection de nouvelle partie, une fenètre apparaitra proposant le nouveau jeu normal
#        ou le New Game Plus.
#
#        La configuration des bonus se fait aussi dans le module.
#
#==============================================================================================
# Liste des méthodes et classes modifiées ou créées
#    - RPG::BaseItem : ajouté : zang_item?, quete
#
#    - Scene_Title : modifié : start, terminate, update, command_new_game
#                              ajouté : command_ngplus, create_popup_ngplus, open_ng_window, close_ng_window, check_ng
#
#    - Scene_NewGameLoad : nouvelle scene
#
#    - Scene_NewGamePlus : nouvelle scene
#
#    - Scene_File : modifié : write_save_data, read_save_data
#
#    -  Window_NewGameTitre : nouvelle Window
#
#    -  Window_NewGamePlus : nouvelle Window
#
#    -  Window_NewGameDescription : nouvelle Window
#
#    -  Window_PopUpConfirm : nouvelle Window
#
#    -  Zang_Window_Command : nouvelle Window
#
#    - Game_Enemy : modifié : base_maxhp, base_maxmp, base_atk, base_def, base_spi, base_agi, exp
#
#    - Game_Interpreter : modifié : command_129
#
#    - Game_Party : modifié : setup_starting_members
#==============================================================================================

module ConfigurationNGP
 
  # Configuration générale :
 
    # ID de l'interrupteur à activer lors de la fin du jeu pour permettre le new game +
    NG = 1
   
    # Texte du New Game + dans l'écran titre
    NG_NomNewGame = "New Game +"
   
    # Nombre de sauvegarde maximun dans votre jeu.
    NG_MaxSaves = 4
   
    # Message pour charger les données
    NG_MessageLoad = "Charger quelle partie ?"
   
    # Musique jouée dans le menu new game +
    NG_BGM1 = "Theme1"
    # Volume
    NG_BGM2 = 100
    # Tempo
    NG_BGM3 = 100
   
    # Intitulé de la fenêtre New Game Plus
    NG_Titre = " New Game +"
   
  # Contenu :
     
      # Nom des interrupteurs dans le menu New Game +
      # On
      NG_On = "ON"
      # Off
      NG_Off = "OFF"
     
      # Difficulté
      # Nom :
      NG_Op1 = "Difficulté"
      # Description Ligne 1 & 2
      NG_Ds1_1 = "Changez le réglage de la difficulté"
      NG_Ds1_2 = "Histoire de s'amuser un peu."
      # Niveaux de difficulté
      NG_Facile = "Facile"
      NG_Normal = "Normal"
      NG_Difficile = "Difficile"
      # Réglage de la difficulté, multiplie par ce nombre
      # les caractéristiques de tous les monstres.
      NG_EasyLvl = 0.5
      NG_HardLvl = 2
      # ID de la variable dans laquelle sera stockée la difficulté
      NG_Niveau = 1
     
      # Récupérer Inventaire
      # Nom :
      NG_Op2 = "Récupérer l'inventaire"
      # Description Ligne 1 & 2
      NG_Ds2_1 = "Récupérer les objets qui étaient dans le sac"
      NG_Ds2_2 = "lors de la partie précédente"
      # Au cas ou vous ne voudriez pas qu'un objet soit récupéré, mettez <quete> dans sa boite de commentaires.
     
      # Récupérer le niveau
      # Nom :
      NG_Op3 = "Récupérer le niveau"
      # Description Ligne 1 & 2
      NG_Ds3_1 = "Récupérer les niveaux des personnages"
      NG_Ds3_2 = "à la fin de la partie précédente"
      # Récupérer le niveau si cet interupteur est activé.
      NG_RecupNiveaux = 4
     
      # Récupérer l'argent
      # Nom :
      NG_Op4 = "Récupérer l'argent"
      # Description Ligne 1 & 2
      NG_Ds4_1 = "Récupérer la fortune accumulée"
      NG_Ds4_2 = "lors de la partie précédente"
     
      # Récupérer le temps de jeu
      # Nom :
      NG_Op5 = "Récupérer le temps de jeu"
      # Description Ligne 1 & 2
      NG_Ds5_1 = "Récupérer le temps de jeu"
      NG_Ds5_2 = "de l'ancienne partie pour le fun !"
     
      # Activer le contenu suplémentaire 1
      # Nom :
      NG_Op6 = "Activer le contenu supplémentaire"
      # Description Ligne 1 & 2
      NG_Ds6_1 = "Débloque tout le contenu supplémentaire"
      NG_Ds6_2 = "Plein, plein de nouvelles choses !"
      # Activation de cet interrupteur pour signaler que le jeu
      # à été fini déjà une fois.
      NG_JeuFini1 = 2
     
      # Activer le contenu suplémentaire 2
      # Nom :
      NG_Op7 = "Activer le contenu supplémentaire 2"
      # Description Ligne 1 & 2
      NG_Ds7_1 = "Débloque tout le contenu supplémentaire"
      NG_Ds7_2 = "Plein, plein de nouvelles choses !"
      # Activation de cet interrupteur pour signaler que le jeu
      # à été fini déjà une fois.
      NG_JeuFini2 = 3
     
      # Gain d'or
      # Nom :
      NG_Op8 = "Gagner 1 M d'Or"
      # Description Ligne 1 & 2
      NG_Ds8_1 = "Don de 1 M d'Or au début du jeu"
      NG_Ds8_2 = "Une petite contribution, juste for fun"
      # Gain d'or
      NG_GainOr = 1000000
     
      # Modifier les gains d'expérience
      # Nom :
      NG_Op9 = "Modifier l'expérience"
      # Description Ligne 1 & 2
      NG_Ds9_1 = "Modifie les gains d'expérience" 
      NG_Ds9_2 = "Pour booster ou ralentir l'evolution des héros"
      # Niveau d'XP
      NG_Lent = "Lent"
      NG_Base = "Normal"
      NG_Rapide = "Rapide"
      # Réglage des evolutions d'xp, multiplie par ce nombre
      # l'xp donnée par tous les monstres.
      NG_SlowXp = 0.5
      NG_FastXp = 2
      # ID de la variable dans laquelle sera stockée l'évolution d'XP 
      NG_EvoXp = 2
     
      # Démarrer le jeu
      # Nom :
      NG_Op10 = "Commencer le jeu"
      # Description Ligne 1 & 2
      NG_Ds10_1 = "Démarre une partie avec les bonus"
      NG_Ds10_2 = "Maintenant préparez vous a revivre l'aventure !!"
      # Démarrer
      NG_Demarrer = "Commencer !"
      # Texte de confirmation
      NG_NewGame = "Commencer avec ces paramètres ?"
      # Confimation
      NG_ConfirmYes = "Oui !"
      NG_ConfirmNo = "Non!"
       
     
   
end

module NGPAutre
  # Lire les commentaires : module qui détermine que vaut le commentaire.
  QUETE        = /<(?:QUETE|quete)>/i
end # fin module


#===============================================================================
# RPG::BaseItem
#===============================================================================
class RPG::BaseItem
  #--------------------------------------------------------------------------
  # Zang_Item?
  # Là on va aller décortiquer la liste de commentaires.
  #--------------------------------------------------------------------------
  def zang_item?
    # Initialisations des variables sur false
    @quete = false
    # Découpage de la boite de commentaires
    self.note.split(/[\r\n]+/).each { |line|
      case line
      # La on vérifie au cas par cas si les valeurs dans le modules sont dans les commentaires
      # Si oui, l'interrupteur sera sur true.
      when NGPAutre::QUETE
        @quete = true
      end
    }
  end # fin def
  #--------------------------------------------------------------------------
  # Quete?
  # La on dit ce que l'attribut quete vaut.
  #--------------------------------------------------------------------------
  def quete
    # Si ça n'est pas initilalisé on lance la methode.
    zang_item? if @quete == nil
    # Et on renvoye la valeur
    return @quete
  end # fin def
end # fin class
   
#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
#  Modification de Scene_Title pour inclure l'Option NewGamePlus.
#==============================================================================

class Scene_Title < Scene_Base
 
  include ConfigurationNGP

  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  alias zang_start start
  def start
    zang_start
    create_popup_ngplus
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  alias zang_terminate terminate
  def terminate
    zang_terminate
    close_ng_window
    @NG_plus_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Open NG Window
  #--------------------------------------------------------------------------
  def open_ng_window
    @NG_plus_window.open
    begin
      @NG_plus_window.update
      Graphics.update
    end until @NG_plus_window.openness == 255
  end
  #--------------------------------------------------------------------------
  # * Close NG Window
  #--------------------------------------------------------------------------
  def close_ng_window
    @NG_plus_window.close
    begin
      @NG_plus_window.update
      Graphics.update
    end until @NG_plus_window.openness == 0
  end
  #--------------------------------------------------------------------------
  # * Création de la fenêtre de choix NG ou NG+
  #--------------------------------------------------------------------------
  def create_popup_ngplus
    if NG_NomNewGame.size >= Vocab::new_game.size
        long = NG_NomNewGame.size*10 + 20
    else
        long = Vocab::new_game.size*10 + 20
    end
    pop_x = (544 - long) / 2
    pop_y = (416 - 80) / 2
    new_game = [Vocab::new_game, NG_NomNewGame]
    @NG_plus_window = Zang_Window_Command.new(pop_x, pop_y, long, new_game, 1, 2)
    @NG_plus_window.active = false
    @NG_plus_window.visible = false
    close_ng_window
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  alias zang_update update
  def update
    if @command_window.active
      zang_update
    elsif @NG_plus_window.active
      @NG_plus_window.update
      if Input.trigger?(Input::B)
      Sound.play_cancel
      @command_window.active = true
      close_ng_window
      elsif Input.trigger?(Input::C)
        @NG_plus_window.active = false
        @NG_plus_window.visible = false
        case @NG_plus_window.index
        when 0
          zang_newgame
          close_ng_window
        when 1
          command_ngplus
          close_ng_window
        end
      end
    end
   
  end
  #--------------------------------------------------------------------------
  # * Déterminer si l'option New Game + apparait.
  #--------------------------------------------------------------------------
  def check_ng
    for i in 1..NG_MaxSaves
        return if not FileTest.exist?("Save#{i}.rvdata")
        return if @ng_dispo == true
          file = File.open("Save#{i}.rvdata", "rb")
          (1..6).each do
            trash = Marshal.load(file)
          end
          $game_switches = Marshal.load(file)
          @ng_dispo = $game_switches[NG]
          file.close
    end
      trash = nil
  end
  #--------------------------------------------------------------------------
  # * Command: New Game
  #--------------------------------------------------------------------------
  alias zang_newgame command_new_game
  def command_new_game
    check_ng
    if @ng_dispo
    @command_window.active = false
    @NG_plus_window.active = true
    @NG_plus_window.visible = true
      open_ng_window
    else
      zang_newgame
    end
  end
  #--------------------------------------------------------------------------
  # * Envoye vers la Scene_NewGameLoad
  #--------------------------------------------------------------------------
  def command_ngplus
    $scene = Scene_NewGameLoad.new
    RPG::BGM.fade(1500)
    close_command_window
    Graphics.fadeout(60)
    Graphics.wait(40)
    Graphics.frame_count = 0
    RPG::BGM.stop
  end
 
end

#==============================================================================
# ** Scene_NewGameLoad
#------------------------------------------------------------------------------
#  Nouvelle Scene, écran de chargement pour charger la partie finie.
#==============================================================================
class Scene_NewGameLoad < Scene_Base
 
  include ConfigurationNGP
  #--------------------------------------------------------------------------
  # * Start
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background
    @help_window = Window_Help.new
    create_savefile_windows
    @index = self.latest_file_index
    @help_window.set_text(NG_MessageLoad)
    @savefile_windows[@index].selected = true
  end
  #--------------------------------------------------------------------------
  # * Terminate
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @help_window.dispose
    dispose_item_windows
  end
  #--------------------------------------------------------------------------
  # * Return_scene
  #--------------------------------------------------------------------------
  def return_scene
      $scene = Scene_Title.new
  end
  #--------------------------------------------------------------------------
  # * Update
  #--------------------------------------------------------------------------
  def update
    super
    update_menu_background
    @help_window.update
    update_savefile_windows
    update_savefile_selection
  end
  #--------------------------------------------------------------------------
  # * Create Save File Window
  #--------------------------------------------------------------------------
  def create_savefile_windows
    @savefile_windows = []
    for i in 0..3
      @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
    end
    @item_max = 4
  end
  #--------------------------------------------------------------------------
  # * Dispose of Save File Window
  #--------------------------------------------------------------------------
  def dispose_item_windows
    for window in @savefile_windows
      window.dispose
    end
  end
  #--------------------------------------------------------------------------
  # * Update Save File Window
  #--------------------------------------------------------------------------
  def update_savefile_windows
    for window in @savefile_windows
      window.update
    end
  end
  #--------------------------------------------------------------------------
  # * Update Save File Selection
  #--------------------------------------------------------------------------
  def update_savefile_selection
    if Input.trigger?(Input::C)
      determine_savefile
    elsif Input.trigger?(Input::B)
      Sound.play_cancel
      return_scene
    else
      last_index = @index
      if Input.repeat?(Input::DOWN)
        cursor_down(Input.trigger?(Input::DOWN))
      end
      if Input.repeat?(Input::UP)
        cursor_up(Input.trigger?(Input::UP))
      end
      if @index != last_index
        Sound.play_cursor
        @savefile_windows[last_index].selected = false
        @savefile_windows[@index].selected = true
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Dertermine_savefile
  #--------------------------------------------------------------------------
  def determine_savefile
    if @saving
      Sound.play_save
      do_save
    else
      if @savefile_windows[@index].file_exist
        Sound.play_load
        do_load
      else
        Sound.play_buzzer
        return
      end
    end
    $game_temp.last_file_index = @index
  end
  #--------------------------------------------------------------------------
  # * Move cursor down
  #    wrap : Wraparound allowed
  #--------------------------------------------------------------------------
  def cursor_down(wrap)
    if @index < @item_max - 1 or wrap
      @index = (@index + 1) % @item_max
    end
  end
  #--------------------------------------------------------------------------
  # * Move cursor up
  #    wrap : Wraparound allowed
  #--------------------------------------------------------------------------
  def cursor_up(wrap)
    if @index > 0 or wrap
      @index = (@index - 1 + @item_max) % @item_max
    end
  end
  #--------------------------------------------------------------------------
  # * Create Filename
  #    file_index : save file index (0-3)
  #--------------------------------------------------------------------------
  def make_filename(file_index)
    return "Save#{file_index + 1}.rvdata"
  end
  #--------------------------------------------------------------------------
  # * Select File With Newest Timestamp
  #--------------------------------------------------------------------------
  def latest_file_index
    index = 0
    latest_time = Time.at(0)
    for i in 0...@savefile_windows.size
      if @savefile_windows[i].time_stamp > latest_time
        latest_time = @savefile_windows[i].time_stamp
        index = i
      end
    end
    return index
  end
  #--------------------------------------------------------------------------
  # * Do_Load
  #--------------------------------------------------------------------------
  def do_load
    # Procédure de lecture des données sauvegardées
    file = File.open(@savefile_windows[@index].filename, "rb")
    read_save_data(file)
    file.close
    # Vérification que le jeu est terminé
    new_game_dispo
    # Récupération des données nécéssaires aux bonus
    scan_inventaire
    scan_levels
    scan_gold
    scan_time
  end
  #--------------------------------------------------------------------------
  # * Read Save Data
  #--------------------------------------------------------------------------
  def read_save_data(file)
    characters          = Marshal.load(file)
    Graphics.frame_count = Marshal.load(file)
    @last_bgm            = Marshal.load(file)
    @last_bgs            = Marshal.load(file)
    $game_system        = Marshal.load(file)
    $game_message        = Marshal.load(file)
    $game_switches      = Marshal.load(file)
    $game_variables      = Marshal.load(file)
    $game_self_switches  = Marshal.load(file)
    $game_actors        = Marshal.load(file)
    $game_party          = Marshal.load(file)
    $game_troop          = Marshal.load(file)
    $game_map            = Marshal.load(file)
    $game_player        = Marshal.load(file)
    @total_sec = Graphics.frame_count / Graphics.frame_rate
    if $game_system.version_id != $data_system.version_id
      $game_map.setup($game_map.map_id)
      $game_player.center($game_player.x, $game_player.y)
    end
  end
  #---------------------------------------------------------------------------------
  # * Vérifie si le fichier est bien un save où le jeu est terminé
  # Puis envoye vers Scene_NewGamePlus
  #---------------------------------------------------------------------------------
  def new_game_dispo
    # Condition
    if $game_switches[NG]
      # Envoi vers la scene
      $scene = Scene_NewGamePlus.new
    else
      Sound.play_buzzer
      return false
    end
  end
  #--------------------------------------------------------------------------
  # * Scan de l'inventaire
  #--------------------------------------------------------------------------
  def scan_inventaire
    $zang_inventaire = $game_party.items
    $zang_inventaire_num = []
    $zang_inventaire.each do |objet|
      $zang_inventaire_num.push($game_party.item_number(objet))
    end
    $zang_equipement = []
    $game_party.members.each do |perso|
      $zang_equipement += perso.equips
    end
  end
  #--------------------------------------------------------------------------
  # * Scan des levels
  #--------------------------------------------------------------------------
  def scan_levels
    $zangther_niveaux = []
    for n in 1..999
      actor = $game_actors[n]
      next if actor == nil
      $zangther_niveaux.push($game_actors[n].level)
    end
  end
  #--------------------------------------------------------------------------
  # * Scan de la fortune
  #--------------------------------------------------------------------------
  def scan_gold
    $zang_gold = $game_party.gold
  end
  #--------------------------------------------------------------------------
  # * Scan du temps
  #--------------------------------------------------------------------------
  def scan_time
    $zangther_playtime = @total_sec
  end
 
end

#==============================================================================
# ** Scene_newGamePlus
#------------------------------------------------------------------------------
#  Nouvelle Scene, écran de sélection pour modifier les option du nouveau jeu.
#==============================================================================
class Scene_NewGamePlus < Scene_Base
  include ConfigurationNGP
  #--------------------------------------------------------------------------
  # * Start
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background
    @titre_window = Window_NewGameTitre.new
    options= [NG_Op1, NG_Op2, NG_Op3, NG_Op4, NG_Op5,
                      NG_Op6, NG_Op7, NG_Op8, NG_Op9, NG_Op10]
    @window = Window_NewGamePlus.new(544, options, 1, 9)
    @description_window = Window_NewGameDescription.new
    @window.help_window = @description_window
    create_popup_window
    create_command_windows
    opa_zero_command_windows
    Audio.bgm_play("Audio/BGM/" + NG_BGM1, NG_BGM2, NG_BGM3)
    switch_var_initilize
  end
  #--------------------------------------------------------------------------
  # * Création des commandes
  #--------------------------------------------------------------------------.
  def create_command_windows
    diff_command = [NG_Facile, NG_Normal, NG_Difficile]
    @difficulte_command_window = Zang_Window_Command.new(0, 355, 544, diff_command, 3, 1)
    @difficulte_command_window.active = false
    @difficulte_command_window.visible = false
    exp_command = [NG_Lent, NG_Base, NG_Rapide]
    @exp_command_window = Zang_Window_Command.new(0, 355, 544, exp_command, 3, 1)
    @exp_command_window.active = false
    @exp_command_window.visible = false
    yesno_command = [NG_On, NG_Off]
    @yesno_command_window = Zang_Window_Command.new(0, 355, 544, yesno_command, 2, 1)
    @yesno_command_window.active = false
    @yesno_command_window.visible = false
    demarrer = [NG_Demarrer]
    @one_command_window = Zang_Window_Command.new(0, 355, 544, demarrer, 1, 1)
    @one_command_window.active = false
    @one_command_window.visible = false
    long = NG_NewGame.size*10 + 20
    pop_x = (544 - long) / 2
    confirm_command = [NG_ConfirmYes, NG_ConfirmNo]
    @confim_command_window = Zang_Window_Command.new(pop_x, 180, long, confirm_command, 1, 2)
    @confim_command_window.active = false
    @confim_command_window.visible = false
  end
  #--------------------------------------------------------------------------
  # * Opacité des fenètre sur 0
  #--------------------------------------------------------------------------.
  def opa_zero_command_windows
    @difficulte_command_window.opacity = 0
    @exp_command_window.opacity = 0
    @yesno_command_window.opacity = 0
    @one_command_window.opacity = 0
    @confim_command_window.opacity = 0
  end
  #--------------------------------------------------------------------------
  # * Création de la fenêtre de PopUp
  #--------------------------------------------------------------------------.
  def create_popup_window
    long = NG_NewGame.size*10 + 20
    haut = 24 * 4 + 10
    pop_x = (544 - long) / 2
    pop_y = (416 - haut) / 2
    @popup_confirm_window = Window_PopUpConfirm.new(pop_x, pop_y, long, haut)
    @popup_confirm_window.set_text
    @popup_confirm_window.active = false
    @popup_confirm_window.visible = false
  end
  #--------------------------------------------------------------------------
  # * Terminate
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @window.dispose
    @titre_window.dispose
    @description_window.dispose 
    @difficulte_command_window.dispose
    @exp_command_window.dispose
    @yesno_command_window.dispose
    @one_command_window.dispose
    @confim_command_window.dispose
    @popup_confirm_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Création de la fenêtre de PopUp
  #--------------------------------------------------------------------------.
  def create_popup_window
    long = NG_NewGame.size*10 + 20
    haut = 24 * 4 + 10
    pop_x = (544 - long) / 2
    pop_y = (416 - haut) / 2
    @popup_confirm_window = Window_PopUpConfirm.new(pop_x, pop_y, long, haut)
    @popup_confirm_window.set_text
    @popup_confirm_window.active = false
    @popup_confirm_window.visible = false
  end
  #---------------------------------------------------------------------------------
  # * Initialisation des variables
  #---------------------------------------------------------------------------------   
  def switch_var_initilize
    $NG_Difficult = 2
    $NG_BoostXp = 2
    $recup_inventaire = false
    $recup_niveaux = false
    $recup_gold = false
    $recup_sorts = false
    $recup_equip = false
    $gain_gold = false
    @difficulte_command_window.index = $NG_Difficult - 1
    @exp_command_window.index = $NG_Difficult - 1
  end
  #---------------------------------------------------------------------------------
  # * Modification de l'index de yesno_command_window
  #    selon le choix de l'élément en cours
  #---------------------------------------------------------------------------------   
  def index_update
    case @window.index
      when 1
          @yesno_command_window.index = $recup_inventaire ? 0 : 1
      when 2
          @yesno_command_window.index = $recup_niveaux ? 0 : 1
      when 3
          @yesno_command_window.index = $recup_gold ? 0 : 1
      when 4
          @yesno_command_window.index = $recup_tps ? 0 : 1
      when 5
          @yesno_command_window.index = $cont_supp1 ? 0 : 1
      when 6
          @yesno_command_window.index = $cont_supp2 ? 0 : 1
      when 7
          @yesno_command_window.index = $gain_gold ? 0 : 1
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    update_menu_background
    if @window.active
      @window.update
        update_command_selection
        index_update
    elsif @difficulte_command_window.active
      @difficulte_command_window.update
      update_difficile_selection
    elsif @yesno_command_window.active
      @yesno_command_window.update
      update_yesno_selection
    elsif @exp_command_window.active
      @exp_command_window.update
      update_evo_selection
    elsif @confim_command_window.active
      @confim_command_window.update
      @popup_confirm_window.update
      update_confirm_selection
    end
    @description_window.update
        desactive_windows
        update_window_visible
  end
  #--------------------------------------------------------------------------
  # * Update Command Selection
  #--------------------------------------------------------------------------
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Title.new
    elsif Input.trigger?(Input::C)
      Sound.play_decision
      @window.active = false
        case @window.index
          when 0
            difficulte_jeu
          when 1
            recup_inventaire
          when 2
            recup_niveaux
          when 3
            recup_gold
          when 4
            recup_tpsjeu
          when 5
            contenu_suppl1
          when 6
            contenu_suppl2
          when 7
            gain_gold
          when 8
            boost_xp
          when 9
            new_game
        end
    end
  end
  #--------------------------------------------------------------------------
  # * Update Difficile Selection
  #--------------------------------------------------------------------------
  def update_difficile_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      @difficulte_command_window.active = false
      @window.active = true
    elsif Input.trigger?(Input::C)
      Sound.play_decision
      @difficulte_command_window.active = false
      @window.active = true
      case @difficulte_command_window.index
          when 0
            $NG_Difficult = 1
          when 1
            $NG_Difficult = 2
          when 2
            $NG_Difficult = 3
          end
    end
  end
  #--------------------------------------------------------------------------
  # * Update Yes/No Selection
  #--------------------------------------------------------------------------
  def update_yesno_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      @yesno_command_window.active = false
      @window.active = true
    elsif Input.trigger?(Input::C)
      Sound.play_decision
      @yesno_command_window.active = false
      @window.active = true
      case @yesno_command_window.index
          when 0
            case @yesno_switch
            when 1
              $recup_inventaire = true
            when 2
              $recup_niveaux = true
            when 3
              $recup_gold = true
            when 4
              $recup_tps = true
            when 5
              $cont_supp1 = true
            when 6
              $cont_supp2 = true
            when 7
              $gain_gold = true
              end
          when 1
            case @yesno_switch
            when 1
              $recup_inventaire = false
            when 2
              $recup_niveaux = false
            when 3
              $recup_gold = false
            when 4
              $recup_tps = false
            when 5
              $cont_supp1 = false
            when 6
              $cont_supp2 = false           
              when 7
              $gain_gold = false
              end
          end
    end
 end
  #--------------------------------------------------------------------------
  # * Update Evo Selection
  #--------------------------------------------------------------------------
  def update_evo_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      @exp_command_window.active = false
      @window.active = true
    elsif Input.trigger?(Input::C)
      Sound.play_decision
      @exp_command_window.active = false
      @window.active = true
      case @exp_command_window.index
          when 0
            $NG_BoostXp = 1
          when 1
            $NG_BoostXp = 2
          when 2
            $NG_BoostXp = 3
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Update Confirm Selection
  #--------------------------------------------------------------------------
  def update_confirm_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      @popup_confirm_window.visible = false
      @popup_confirm_window.active = false
      @confim_command_window.active = false
      @confim_command_window.visible = false
      @window.active = true
    elsif Input.trigger?(Input::C)
      Sound.play_decision
      @popup_confirm_window.visible = false
      @popup_confirm_window.active = false
      @confim_command_window.active = false
      @confim_command_window.visible = false
      case @confim_command_window.index
          when 0
            do_new_game
          when 1
            @window.active = true
          end
    end
 end
  #--------------------------------------------------------------------------
  # * Update Window Visible
  #--------------------------------------------------------------------------
  def update_window_visible
    case @window.index
        when 0
          @difficulte_command_window.visible = true
        when 1, 2, 3, 4, 5, 6, 7
          @yesno_command_window.visible = true
        when 8
          @exp_command_window.visible = true
        when 9
          @one_command_window.visible = true
    end
  end
  #--------------------------------------------------------------------------
  # * Désactiver les Window de choix.
  #--------------------------------------------------------------------------
  def desactive_windows
    @difficulte_command_window.visible = false
    @exp_command_window.visible = false
    @yesno_command_window.visible = false
    @one_command_window.visible = false
  end
  #--------------------------------------------------------------------------
  # * Réglage de la difficulté
  #--------------------------------------------------------------------------
  def difficulte_jeu
    @difficulte_command_window.active = true
  end
  #--------------------------------------------------------------------------
  # * Récupérer l'inventaire ?
  #--------------------------------------------------------------------------
    def recup_inventaire
      @yesno_switch = 1
      @yesno_command_window.active = true
      if $recup_inventaire == true
        @yesno_command_window.index = 0
      else
        @yesno_command_window.index = 1
      end
    end
  #--------------------------------------------------------------------------
  # * Récupérer les niveaux ?
  #--------------------------------------------------------------------------
    def recup_niveaux
      @yesno_switch = 2
      @yesno_command_window.active = true
      if $recup_niveaux == true
        @yesno_command_window.index = 0
      else
        @yesno_command_window.index = 1
      end
    end
  #--------------------------------------------------------------------------
  # * Récupérer l'argent ?
  #--------------------------------------------------------------------------
    def recup_gold
      @yesno_switch = 3
      @yesno_command_window.active = true
      if $recup_gold == true
        @yesno_command_window.index = 0
      else
        @yesno_command_window.index = 1
      end
    end
  #--------------------------------------------------------------------------
  # * Récupérer l'équipement ?
  #--------------------------------------------------------------------------
    def recup_tpsjeu
      @yesno_switch = 4
      @yesno_command_window.active = true
      if $recup_tps == true
        @yesno_command_window.index = 0
      else
        @yesno_command_window.index = 1
      end
    end
  #--------------------------------------------------------------------------
  # * Récupérer le temps de jeu ?
  #--------------------------------------------------------------------------
    def contenu_suppl1
      @yesno_switch = 5
      @yesno_command_window.active = true
      if $cont_supp1 == true
        @yesno_command_window.index = 0
      else
        @yesno_command_window.index = 1
      end
    end
  #--------------------------------------------------------------------------
  # * Activer contenu supplémentaire ?
  #--------------------------------------------------------------------------
    def contenu_suppl2
      @yesno_switch = 6
    @yesno_command_window.active = true
      if $cont_supp2 == true
        @yesno_command_window.index = 0
      else
        @yesno_command_window.index = 1
      end
    end       
  #--------------------------------------------------------------------------
  # * Gagner l'argent ?
  #--------------------------------------------------------------------------
    def gain_gold
      @yesno_switch = 7
      @yesno_command_window.active = true
      if $gain_gold == true
        @yesno_command_window.index = 0
      else
        @yesno_command_window.index = 1
      end
    end
  #--------------------------------------------------------------------------
  # * Réglage de l'XP
  #--------------------------------------------------------------------------
    def boost_xp
    @exp_command_window.active = true
    end
  #--------------------------------------------------------------------------
  # * Démarrer le jeu
  #--------------------------------------------------------------------------
    def new_game
      Sound.play_decision
      @popup_confirm_window.visible = true
      @popup_confirm_window.active = true
      @confim_command_window.active = true
      @confim_command_window.visible = true
    end
  #--------------------------------------------------------------------------
  # * Create Game Objects
  #--------------------------------------------------------------------------
  def create_game_objects
    $game_temp          = Game_Temp.new
    $game_message      = Game_Message.new
    $game_system        = Game_System.new
    $game_switches      = Game_Switches.new
    $game_variables    = Game_Variables.new
    $game_self_switches = Game_SelfSwitches.new
    $game_actors        = Game_Actors.new
    $game_party        = Game_Party.new
    $game_troop        = Game_Troop.new
    $game_map          = Game_Map.new
    $game_player        = Game_Player.new
  end
  #--------------------------------------------------------------------------
  # * Load Database
  #--------------------------------------------------------------------------
  def load_database
    $data_actors        = load_data("Data/Actors.rvdata")
    $data_classes      = load_data("Data/Classes.rvdata")
    $data_skills        = load_data("Data/Skills.rvdata")
    $data_items        = load_data("Data/Items.rvdata")
    $data_weapons      = load_data("Data/Weapons.rvdata")
    $data_armors        = load_data("Data/Armors.rvdata")
    $data_enemies      = load_data("Data/Enemies.rvdata")
    $data_troops        = load_data("Data/Troops.rvdata")
    $data_states        = load_data("Data/States.rvdata")
    $data_animations    = load_data("Data/Animations.rvdata")
    $data_common_events = load_data("Data/CommonEvents.rvdata")
    $data_system        = load_data("Data/System.rvdata")
    $data_areas        = load_data("Data/Areas.rvdata")
  end 
  #--------------------------------------------------------------------------
  # * Command: New Game
  #--------------------------------------------------------------------------
  def do_new_game     
    load_database
    create_game_objects
    Sound.play_decision
    $game_party.setup_starting_members            # Initial party
    $game_map.setup($data_system.start_map_id)    # Initial map position
    $game_player.moveto($data_system.start_x, $data_system.start_y)
    $game_player.refresh
    $scene = Scene_Map.new
    RPG::BGM.fade(1500)
    Graphics.fadeout(60)
    Graphics.wait(40)
    Graphics.frame_count = 0
    RPG::BGM.stop
    $game_map.autoplay
    switch_to_game
    do_bonus
  end
  #--------------------------------------------------------------------------
  # * Passe les interruteurs sur On/Off selon les choix
  #--------------------------------------------------------------------------
    def  switch_to_game
    $game_switches[NG_RecupNiveaux] = $recup_niveaux ? true : false
    $game_switches[NG_JeuFini1] = $cont_supp1 ? true : false
    $game_switches[NG_JeuFini2] = $cont_supp2 ? true : false
  end
  #--------------------------------------------------------------------------
  # * Exécute les bonus selon les choix
  #--------------------------------------------------------------------------
    def do_bonus
    get_inventaire if $recup_inventaire
    get_gold if $recup_gold
    get_time if $recup_tps
    extra_gain_gold if $gain_gold
  end
  #--------------------------------------------------------------------------
  # * Récupération : inventaire
  #--------------------------------------------------------------------------
    def get_inventaire
      for x in 0...$zang_inventaire.size
        objet = $zang_inventaire[x]
        nombre = $zang_inventaire_num[x]
        unless objet.quete
          $game_party.gain_item(objet, nombre)
        end
      end
    $zang_equipement.each do |objet|
        next if objet == nil
        unless objet.quete
          $game_party.gain_item(objet, 1)
        end
      end
  end
  #--------------------------------------------------------------------------
  # * Récupération : or
  #--------------------------------------------------------------------------
    def get_gold
    $game_party.gain_gold($zang_gold)
  end
  #--------------------------------------------------------------------------
  # * Récupération : temps
  #--------------------------------------------------------------------------
    def get_time
    total_sec = $zangther_playtime
    Graphics.frame_count = total_sec
    Graphics.frame_count *= Graphics.frame_rate
  end
  #--------------------------------------------------------------------------
  # * Gain : or
  #--------------------------------------------------------------------------
    def extra_gain_gold
    $game_party.gain_gold(NG_GainOr)
  end

end

#==============================================================================
# ** Scene_File
#------------------------------------------------------------------------------
#  This class performs the save and load screen processing.
#==============================================================================

class Scene_File < Scene_Base
  #--------------------------------------------------------------------------
  # * Write Save Data
  #    file : write file object (opened)
  #--------------------------------------------------------------------------
  alias zang_write_data write_save_data
  def write_save_data(file)
    zang_write_data(file)
    Marshal.dump($zangther_niveaux,        file)
  end
  #--------------------------------------------------------------------------
  # * Read Save Data
  #    file : file object for reading (opened)
  #--------------------------------------------------------------------------
  alias zang_read_data read_save_data
  def read_save_data(file)
    zang_read_data(file)
    $zangther_niveaux  = Marshal.load(file)
  end
end

class Window_NewGameTitre < Window_Base
 
  include ConfigurationNGP
  #--------------------------------------------------------------------------
  # * Initialisation
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 544, WLH + 32)
    set_text(NG_Titre, 1)
  end
  #--------------------------------------------------------------------------
  # * Mettre du texte
  #--------------------------------------------------------------------------
 def set_text(text, align = 0)
    if text != @text or align != @align
      self.contents.clear
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, self.width - 40, WLH, text, align)
      @text = text
      @align = align
    end
  end
 
end

#==============================================================================
# ** Window_NewGamePlus
#------------------------------------------------------------------------------
#  Window désignant les choix du new game plus.
#==============================================================================

class Window_NewGamePlus < Window_Selectable

  include ConfigurationNGP
  #--------------------------------------------------------------------------
  # * Initialisation de la Window
  #--------------------------------------------------------------------------
  def initialize(width, commands, column_max = 1, row_max = 0, spacing = 32)
    if row_max == 0
      row_max = (commands.size + column_max - 1) / column_max
    end
    super(0, WLH + 32, width, row_max * WLH + 32, spacing)
    @commands = commands
    @item_max = commands.size
    @column_max = column_max
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Refresh de la Window
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    create_contents
    for i in 0...@item_max
      draw_item(i)
    end
  end
  #--------------------------------------------------------------------------
  # * Tracer le texte de la Window
  #--------------------------------------------------------------------------
  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
    self.contents.font.color.alpha = enabled ? 255 : 128
    self.contents.draw_text(rect, @commands[index])
  end
  #--------------------------------------------------------------------------
  # * Update de Window_NewGameDescription selon
  #    l'index de Window_NewGamePlus
  #--------------------------------------------------------------------------
  def update_help
    case index
    when 0
    @help_window.set_text(NG_Ds1_1, NG_Ds1_2, 1)
    when 1
      @help_window.set_text(NG_Ds2_2, NG_Ds2_2, 1)
    when 2
      @help_window.set_text(NG_Ds3_1, NG_Ds3_2, 1)
    when 3
      @help_window.set_text(NG_Ds4_1, NG_Ds4_2, 1)
    when 4
      @help_window.set_text(NG_Ds5_1, NG_Ds5_2, 1)
    when 5
      @help_window.set_text(NG_Ds6_1, NG_Ds6_2, 1)
    when 6
      @help_window.set_text(NG_Ds7_1, NG_Ds7_2, 1)
    when 7
      @help_window.set_text(NG_Ds8_1, NG_Ds8_2, 1)
    when 8
      @help_window.set_text(NG_Ds9_1, NG_Ds9_2, 1)
    when 9
      @help_window.set_text(NG_Ds10_1, NG_Ds10_2, 1)
    end
  end
 
end
 
  class Window_NewGameDescription < Window_Base
 
  #--------------------------------------------------------------------------
  # * Initialisation
  #--------------------------------------------------------------------------
  def initialize
    h = 111
    super(0, 416-h, 544, h)
  end
  #--------------------------------------------------------------------------
  # * Tracer le texte sur 3 lignes
  #--------------------------------------------------------------------------
  def set_text(text_1, text_2, align = 0)
    if text_1 != @text_1 or text_2 !=@text_2 or align != @align
      self.contents.clear
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, self.width - 40, WLH, text_1, align)
      self.contents.draw_text(4, 24, self.width - 40, WLH, text_2, align)
      @text_1 = text_1
      @text_2 = text_2
      @align = align
    end
  end
 
end

class Window_PopUpConfirm < Window_Base
  include ConfigurationNGP
  #--------------------------------------------------------------------------
  # * Initialisation
  #--------------------------------------------------------------------------
  def initialize(pop_x, pop_y, long, haut)
    super(pop_x, pop_y, long, haut)
  end
  #--------------------------------------------------------------------------
  # * Tracer le texte
  #--------------------------------------------------------------------------
  def set_text
      self.contents.clear
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, self.width - 40, WLH, NG_NewGame, 1)
  end
 
end

#==============================================================================
# ** Window_Command
#------------------------------------------------------------------------------
#  This window deals with general command choices.
#==============================================================================

class Zang_Window_Command < Window_Selectable
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader  :commands                # command
  #--------------------------------------------------------------------------
  # * Object Initialization
  #    width      : window width
  #    commands  : command string array
  #    column_max : digit count (if 2 or more, horizontal selection)
  #    row_max    : row count (0: match command count)
  #    spacing    : blank space when items are arrange horizontally
  #--------------------------------------------------------------------------
  def initialize(x, y, width, commands, column_max = 1, row_max = 0, spacing = 32)
    if row_max == 0
      row_max = (commands.size + column_max - 1) / column_max
    end
    super(x, y, width, row_max * WLH + 32, spacing)
    @commands = commands
    @item_max = commands.size
    @column_max = column_max
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    create_contents
    for i in 0...@item_max
      draw_item(i)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #    index  : item number
  #    enabled : enabled flag. When false, draw semi-transparently.
  #--------------------------------------------------------------------------
  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
    self.contents.font.color.alpha = enabled ? 255 : 128
    self.contents.draw_text(rect, @commands[index], 1)
  end
end

#==============================================================================
# ** Game_Enemy
#------------------------------------------------------------------------------
#  This class handles enemy characters. It's used within the Game_Troop class
# ($game_troop).
#==============================================================================

class Game_Enemy < Game_Battler
 
  include ConfigurationNGP
  #--------------------------------------------------------------------------
  # * Get Basic Maximum HP
  #--------------------------------------------------------------------------
  def base_maxhp
    niveau = $game_variables[NG_Niveau]
    case niveau
    when 1
      hp = NG_EasyLvl
    when 2
      hp = 1
    when 3
      hp = NG_HardLvl
    end
    hp = hp.to_i
    hp *= enemy.maxhp
    return hp
  end
  #--------------------------------------------------------------------------
  # * Get basic Maximum MP
  #--------------------------------------------------------------------------
  def base_maxmp
    niveau = $game_variables[NG_Niveau]
    case niveau
    when 1
      mp = NG_EasyLvl
    when 2
      mp = 1
    when 3
      mp = NG_HardLvl
    end
    mp = mp.to_i
    mp *= enemy.maxmp
    return mp
  end
  #--------------------------------------------------------------------------
  # * Get Basic Attack
  #--------------------------------------------------------------------------
  def base_atk
    niveau = $game_variables[NG_Niveau]
    case niveau
    when 1
      atk = NG_EasyLvl
    when 2
      atk = 1
    when 3
      atk = NG_HardLvl
    end
    atk = atk.to_i
    atk *= enemy.atk
    return atk
  end
  #--------------------------------------------------------------------------
  # * Get Basic Defense
  #--------------------------------------------------------------------------
  def base_def
    niveau = $game_variables[NG_Niveau]
    case niveau
    when 1
      df = NG_EasyLvl
    when 2
      df = 1
    when 3
      df = NG_HardLvl
    end
    df = df.to_i
    df *= enemy.def
    return df
  end
  #--------------------------------------------------------------------------
  # * Get Basic Spirit
  #--------------------------------------------------------------------------
  def base_spi
    niveau = $game_variables[NG_Niveau]
    case niveau
    when 1
      spi = NG_EasyLvl
    when 2
      spi = 1
    when 3
      spi = NG_HardLvl
    end
    spi = spi.to_i
    spi *= enemy.spi
    return spi
  end
  #--------------------------------------------------------------------------
  # * Get Basic Agility
  #--------------------------------------------------------------------------
  def base_agi
    niveau = $game_variables[NG_Niveau]
    case niveau
    when 1
      agi = NG_EasyLvl
    when 2
      agi = 1
    when 3
      agi = NG_HardLvl
    end
    agi = agi.to_i
    agi *= enemy.agi
    return agi
  end 
  #--------------------------------------------------------------------------
  # * Get Experience
  #--------------------------------------------------------------------------
  def exp
    niveau = $game_variables[NG_Niveau]
    case niveau
    when 1
      exp = NG_SlowXp
    when 2
      exp = 1
    when 3
      exp = NG_FastXp
    end
    exp = exp.to_i
    exp *= enemy.exp
    return exp
  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
  include ConfigurationNGP
  #--------------------------------------------------------------------------
  # * Change Party Member
  #--------------------------------------------------------------------------
  alias zang_command_129 command_129
  def command_129
    zang_command_129
    actor = $game_actors[@params[0]]
    if $game_switches[NG_RecupNiveaux]
      actor.change_level($zangther_niveaux[@params[0] - 1], false)
      actor.recover_all
    end
  end
end

#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
#  This class handles the party. It includes information on amount of gold
# and items. The instance of this class is referenced by $game_party.
#==============================================================================

class Game_Party < Game_Unit
  #--------------------------------------------------------------------------
  # * Initial Party Setup
  #--------------------------------------------------------------------------
  alias zang_setup_start_members setup_starting_members
  def setup_starting_members
    zang_setup_start_members
    zang_party = $game_party.members
    if $recup_niveaux
    zang_party.each do |perso|
      zang_actor = $game_actors[perso.id]
      zang_actor.change_level($zangther_niveaux[perso.id - 1], false)
      zang_actor.recover_all
    end
    end
  end
 
end


Dernière édition par Zangther le Dim 6 Juin 2010 - 17:45, édité 3 fois
Anonymous
Invité
Invité

New Game Plus Empty Re: New Game Plus

Mer 17 Mar 2010 - 10:20
Dis moi Zang c est possible de configurer ce script pour démarrer une demo 2 avec l ancienne sauvegarde également ?
ZangtherOld
ZangtherOld
Membre

Nombre de messages : 1711
Date d'inscription : 07/08/2009

New Game Plus Empty Re: New Game Plus

Mer 17 Mar 2010 - 20:06
Hum, un système à la golden sun ?
Berka
Berka
Staffeux retraité

Nombre de messages : 1832
Age : 33
Localisation : Paris
Distinction : rubyste déglingué
9ème dan en scripting-no-jutsu

Nouveau Justine Beber ;P
Date d'inscription : 16/12/2007
http://rpgruby.olympe-network.com

New Game Plus Empty Re: New Game Plus

Mer 17 Mar 2010 - 20:45
Bon script
Mais j'ai du mal à cerner l'utilité de faire:
Code:
def update_help
    case index
    when 0
      text_difficulte
    when 1
      text_recupInv
    when 2
      text_recupNiv
    when 3
      text_recupGold
    when 4
      text_recupEquip
    when 5
      text_recupTps
    when 6
      text_contSup
    when 7
      text_gainGold
    when 8
      text_boostXp
    when 9
      text_newGame
    end
  end
  #--------------------------------------------------------------------------
  # * Description affichée pour le choix 1
  #--------------------------------------------------------------------------
  def text_difficulte
    text1 = NG_Ds1_1
    text2 =  NG_Ds1_2
    @help_window.set_text(text1, text2, 1)
  end

là où il suffirait:
Code:
def update_help
    case index
    when 0
      @help_window.set_text(NG_Ds1_1, NG_Ds1_2, 1)
    when 1
      ...
    end
end
Plus court, économie de mémoire et de temps.
ZangtherOld
ZangtherOld
Membre

Nombre de messages : 1711
Date d'inscription : 07/08/2009

New Game Plus Empty Re: New Game Plus

Sam 20 Mar 2010 - 17:03
Effectivement, a la base, il y avait bien plus de chose dans toutes les méthodes donc c'est pour cela que j'avais séparé. Je vais changer çà. merci de ton commentaire ^^

_________________________________________________

J'ai mis a jour mon script et la démo qui va avec.
Have fun.
avatar
Jakarta
Membre

Nombre de messages : 40
Age : 27
Localisation : Midi-Pyrénées
Distinction : aucune
Date d'inscription : 05/02/2009

New Game Plus Empty Re: New Game Plus

Ven 25 Juin 2010 - 20:05
Salut Pinhead, j'ai essayé ton New Game + et contrairement à ce que je pensais... c'est pas mal !
Mais moi j'utilise un écran titre quelque peu différent (pas beaucoup différent mais étant une brêle en script je serais incapable de modifier ton script moi même).

J'utilise l'écran titre style FF (script ici)

Voila voila, si tu pouvais me faire ca ce serais sympa ^^ (PS : Pourrais-tu par la même occasion m'enlever l'option "quitter" de l'écran titre FF? Merci !)

Désolé du nécropost mais je crois que c'est pas grave si la demande est constructive... Merci d'avance !
Skillo
Skillo
Staffeux retraité

Nombre de messages : 526
Age : 34
Localisation : Rennes
Distinction : J'aime ce gars :P
(by Coco')
Scripteur apprenti, futur Berka !
(par Tretian)
Membre anonyme de la communauté, caché derrière son PC
(???)
super prof de script
[Dudu']
Résident permanent de la Chat Box
[Autoproclamé]
Adepte du XDDD [Yak' Very Happy]
Fanatique hystérique de Raymond le français [Un connu]
Date d'inscription : 19/01/2008

New Game Plus Empty Re: New Game Plus

Ven 25 Juin 2010 - 20:12
Il risque pas de te répondre de si tôt, il a été banni du forum.
Tu devrai poster ta requête dans les demande de script.
Contenu sponsorisé

New Game Plus Empty Re: New Game Plus

Revenir en haut
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum