1er script
#==============================================================================
# ■ Scene_Difficulte
#------------------------------------------------------------------------------
# Créer par Samarium (Webmaster de RPG Creative)
# Fonction : Permet de mettre un choix de difficulté des combats (facile, normal, difficile) après l'écran titre.
# Scripts modifiés (2) : Game_Enemy ; Scene_Title
# Version 1.0
# Fait le 08/09/06
#
# Pour changer les pourcentages de difficulté de combat, voir la modification de Game_Enemy.
# Ne pas oublier de remplacer "$scene = Scene_Map.new" (l. 142) dans Scene_Title par "$scene = Scene_Difficulte.new"
#
# Site officiel de ce script : http://rpgcreative.net
# Forum d'entraide : http://rpgcreative.forumpro.fr
#==============================================================================
class Scene_Difficulte
def main
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
# Nom des choix
s1 = "Facile"
s2 = "Normal"
s3 = "Difficile"
# Création des fenêtres
@command_window = Window_Command.new(192, [s1, s2, s3])
@aide_window = Window_Aide.new
@command_window.back_opacity = 160
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 288
@aide_window.x = 140
@aide_window.y = 180
@aide_window.back_opacity = 0
@aide_window.opacity = 0
$game_system.bgm_play($data_system.title_bgm)
# Audio
Audio.me_stop
Audio.bgs_stop
Graphics.transition
# Boucle de mise à jour graphique
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
# Placement des graphiques
Graphics.freeze
@command_window.dispose
@aide_window.dispose
@sprite.bitmap.dispose
@sprite.dispose
end
#--------------------------------------------------------------------------
# def update
#--------------------------------------------------------------------------
def update
# Mise à jour
@command_window.update
@aide_window.update
# appuie sur C
if Input.trigger?(Input::C)
# choix
case @command_window.index
when 0 # facile
command_facile
when 1 # normal
command_normal
when 2 # difficile
command_difficile
end
end
end
#--------------------------------------------------------------------------
# def command_facile
#--------------------------------------------------------------------------
def command_facile
$facile = true
general
end
#--------------------------------------------------------------------------
# def command_normal
#--------------------------------------------------------------------------
def command_normal
$normal = true
general
end
#--------------------------------------------------------------------------
# def command_difficile
#--------------------------------------------------------------------------
def command_difficile
$difficile = true
general
end
#--------------------------------------------------------------------------
# def general
#--------------------------------------------------------------------------
def general
# Données vers la map après le choix
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
$game_party.setup_starting_members
$game_map.setup($data_system.start_map_id)
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
$game_map.autoplay
$game_map.update
# Arrive sur la map
$scene = Scene_Map.new
end
end
# Nouvelle classe : Window_Aide ----------------------------------------------------------------------------
class Window_Aide < Window_Base
#--------------------------------------------------------------------------
# def initialize
#--------------------------------------------------------------------------
def initialize
super(0, 0, 400, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = 30 # Modifiez le nombre pou changer la taille de la phrase d'aide
refresh
end
#--------------------------------------------------------------------------
# def refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color # Mettez "normal_color" pour avoir la couleur par défaut : blanc.
self.contents.draw_text (4, 0, 400, 32, "Choisissez la difficulté des combats :") # Changez la phrase d'aide
end
end
# Fin de la classe et du script entier
2ème script :
# -------------------------Modification--------------------
@facile = 50 #Mettez ici, le pourcentage de diminution de vie et de magie du (des) monstre(s) pour le niveau facile
@difficile = 50 #Mettez ici, le pourcentage d'augmentation de vie et de magie du (des) monstre(s) pour le niveau difficile
if $facile
@hp = maxhp * @facile/100
@sp = maxsp * @facile/100
end
if $difficile
@hp = maxhp * @difficile/100 + maxhp
@sp = maxsp * @difficile/100 + maxsp
end
if $normal
@hp = maxhp
@sp = maxsp
end
# -----------------------Fin de modification--------------
Pour que le script fonctionne :
Vous devez aller dans le script "Game_Enemy" et remplacez les lignes 23 - 24 :
@hp = maxhp
@sp = maxsp
Puis allez dans le script "Scene_Title" et remplacez à la ligne 142 :
$scene = Scene_Map.newPar :
$scene = Scene_Difficulte.new