#==============================================================================# # ■ TempsJourNuit # # by MoussPSP Corporation # # 25/01/08 -- Version 3 # # # # License Creative Commons BY-NC # # http://creativecommons.org/licenses/by-nc/2.0/fr/ # #==============================================================================# # # # Adaptation (events compris) pour heure virtuelle : Sphinx # # # # Remerciements a Louro pour le petit (grand) coup de main # # tant au niveau script qu'event... # # # #==============================================================================# #----------------------------------------------------------------------------- # Gérer le jour et la nuit, ainsi que l'heure, la date, etc. #-----------------------------------------------------------------------------
#----------------------------------------------------------------------------- # ● Indiquer les numéros des Variables # # VarNomJour contient le nom du jour actuel en Français. # VarNuitJour définit le type de journée actuelle. # VarTempsXXXX contient ce qui est demandé avec timesys_time() # SwiExterieur définit si la map est en exterieure (true) ou pas (false) # # Vous devez mettre le numéro de la variable et non pas son contenu ! #-----------------------------------------------------------------------------
VarNoJour = 76 VarNuitJour = 77 VarTempsHeure = 78 VarTempsMinutes = 79 VarTempsSecondes = 80 VarNomJour = 81 SwiExterieur = 76
#----------------------------------------------------------------------------- # ● Définition des fonctions #-----------------------------------------------------------------------------
class Interpreter #----------------------------------------------------------------------------- # ● Fonction de définition des nouvelles musiques pour la nuit #----------------------------------------------------------------------------- def timesys_nightmusic(new_music = 0) if $game_variables[VarNuitJour] == "Nuit" Audio.bgm_play("Audio/BGM/" + new_music, 100, 100) end end #----------------------------------------------------------------------------- # ● Fonction d'obtention des heures, minutes, secondes #----------------------------------------------------------------------------- end
#----------------------------------------------------------------------------- # ● Début du Script #-----------------------------------------------------------------------------
class TempsJourNuit < Window_Base def initialize super(440, 420, 200, 60) self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 150 self.visible = false $game_switches[SwiExterieur] = true refresh end def refresh @clock = Time.new @seconde = @clock.sec * Graphics.frame_rate self.contents.clear case $game_variables[VarNoJour] when "1" jour = "Lundi" when "2" jour = "Mardi" when "3" jour = "Mercredi" when "4" jour = "Jeudi" when "5" jour = "Vendredi" when "6" jour = "Samedi" when "7" jour = "Dimanche" end $game_variables[VarNomJour] = jour #self.contents.draw_text(0, 0, 200, 24,@clock.hour.to_s + ":" + @clock.min.to_s + ":" + @clock.sec.to_s + " " +jour) @map = load_data(sprintf("Data/Map%03d.rxdata", $game_map.map_id)) #----------------------------------------------------------------------------- # Nuit : 20h > 6h du mat inclus # Matin : 7h du mat > 10h du mat inclus # Jour : 11h > 16h inclus # Soir : 17h > 19h inclus # # Variable --VarNuitJour-- # "????" = Inconnu # "Matin" = Matin # "Jour" = Jour # "Soir" = Soir # "Nuit" = Nuit #----------------------------------------------------------------------------- if $game_switches[SwiExterieur] case $game_variables[VarTempsHeure] when 0 @tone = Tone.new(-150, -150, -100, 0) $game_screen.start_tone_change(@tone,5) $game_variables[VarNuitJour] = "Nuit" when 1 @tone = Tone.new(-175, -175, -125, 0) $game_screen.start_tone_change(@tone,5) $game_variables[VarNuitJour] = "Nuit" when 2 @tone = Tone.new(-175, -175, -125, 0) $game_screen.start_tone_change(@tone,5) $game_variables[VarNuitJour] = "Nuit" when 3 @tone = Tone.new(-150, -150, -100, 0) $game_screen.start_tone_change(@tone,5) $game_variables[VarNuitJour] = "Nuit" when 4 @tone = Tone.new(-125, -125, -75, 0) $game_screen.start_tone_change(@tone,5) $game_variables[VarNuitJour] = "Nuit" when 5 @tone = Tone.new(-30, -100, -60, 0) $game_screen.start_tone_change(@tone,5) $game_variables[VarNuitJour] = "Nuit" when 6 @tone = Tone.new(55, -25, -60, 0) $game_screen.start_tone_change(@tone,5) $game_variables[VarNuitJour] = "Matin" when 7 @tone = Tone.new(45, -15, -50, 0) $game_screen.start_tone_change(@tone,5) $game_variables[VarNuitJour] = "Matin" when 8 @tone = Tone.new(34, -7, -30, 0) $game_screen.start_tone_change(@tone,5) $game_variables[VarNuitJour] = "Matin" when 9 @tone = Tone.new(22, 2, -10, 0) $game_screen.start_tone_change(@tone,5) $game_variables[VarNuitJour] = "Matin" when 10 @tone = Tone.new(10, 10, 10, 0) $game_screen.start_tone_change(@tone,5) $game_variables[VarNuitJour] = "Jour" when 11 @tone = Tone.new(20, 20, 20, 0) $game_screen.start_tone_change(@tone,5) $game_variables[VarNuitJour] = "Jour" when 12 @tone = Tone.new(30, 30, 30, 0) $game_screen.start_tone_change(@tone,5) $game_variables[VarNuitJour] = "Jour" when 13 @tone = Tone.new(40, 40, 40, 0) $game_screen.start_tone_change(@tone,5) $game_variables[VarNuitJour] = "Jour" when 14 @tone = Tone.new(40, 40, 40, 0) $game_screen.start_tone_change(@tone,5) $game_variables[VarNuitJour] = "Jour" when 15 @tone = Tone.new(30, 30, 30, 0) $game_screen.start_tone_change(@tone,5) $game_variables[VarNuitJour] = "Jour" when 16 @tone = Tone.new(20, 20, 20, 0) $game_screen.start_tone_change(@tone,5) $game_variables[VarNuitJour] = "Jour" when 17 @tone = Tone.new(10, 10, 10, 0) $game_screen.start_tone_change(@tone,5) $game_variables[VarNuitJour] = "Jour" when 18 @tone = Tone.new(22, 2, -10, 0) $game_screen.start_tone_change(@tone,5) $game_variables[VarNuitJour] = "Soir" when 19 @tone = Tone.new(34, -7, -30, 0) $game_screen.start_tone_change(@tone,5) $game_variables[VarNuitJour] = "Soir" when 20 @tone = Tone.new(45, -15, -50, 0) $game_screen.start_tone_change(@tone,5) $game_variables[VarNuitJour] = "Soir" when 21 @tone = Tone.new(35, -25, -60, 0) $game_screen.start_tone_change(@tone,5) $game_variables[VarNuitJour] = "Soir" when 22 @tone = Tone.new(-30, -100, -60, 0) $game_screen.start_tone_change(@tone,5) $game_variables[VarNuitJour] = "Nuit" when 23 @tone = Tone.new(-125, -125, -75, 0) $game_screen.start_tone_change(@tone,5) $game_variables[VarNuitJour] = "Nuit" end else @tone = Tone.new(0, 0, 0, 0) $game_screen.start_tone_change(@tone,5) $game_variables[VarNuitJour] = 0 end end def update refresh end end #----------------------------------------------------------------------------- # ● Application des tons sur la map #-----------------------------------------------------------------------------
class Scene_Map
alias old_main main def main @timesys = TempsJourNuit.new old_main @timesys.dispose end
alias old_update update def update @timesys.update old_update end
end
|