Descrizione
Si capisce dal titolo...ciclo giorno e notte
Autore
GAM...con mie modifiche al solito
Istruzioni per l'uso
Al posto di Sprite_Timer metti questo script:
Spoiler
#==================================================================== # ** Sprite_Clock #------------------------------------------------------------------- # This sprite is used to display the clock. It observes the $game_system # class and automatically changes sprite conditions. # Compiled by GAM modificato da Friday #================================================== class Sprite_Timer < Sprite #----------------------------------------------------------------- # * Object Initialization #----------------------------------------------------------------- def initialize super self.bitmap = Bitmap.new(88, 48) self.bitmap.font.name = \"Arial\" #Replace with whatever font you want self.bitmap.font.size = 32 self.x = 640 - self.bitmap.width self.y = 0 self.z = 500 update end #----------------------------------------------------------------- # * Dispose #----------------------------------------------------------------- def dispose if self.bitmap != nil self.bitmap.dispose end super end #----------------------------------------------------------------- # * Frame Update #----------------------------------------------------------------- def update super self.visible = true if Graphics.frame_count / Graphics.frame_rate != @total_sec @total_sec = Graphics.frame_count / Graphics.frame_rate # mod this line to change speed of clock $min = @total_sec / 60 % 24 @sec = @total_sec % 60 if $min == 00 $night = 1 $game_variables[3]+=1 end if $min == 12 $night = 2 end #---------------------------------------------------------------- # Inside/Outside # Day / Night # mod these for different tones, faster/slower tones, # or more tones #---------------------------------------------------------------- if $game_switches[1] #==true $game_screen.start_tone_change(Tone.new(0,0,0), 5) else if $min < 5 $game_screen.start_tone_change(Tone.new(-170,-170,68), 20) elsif $min >= 5 and $min < 7 $game_screen.start_tone_change(Tone.new(-51,-102,-102), 20) elsif $min >= 7 and $min < 9 $game_screen.start_tone_change(Tone.new(0,-51,-68), 20) elsif $min >= 9 and $min < 18 $game_screen.start_tone_change(Tone.new(0,0,0), 20) elsif $min >= 18 and $min < 21 $game_screen.start_tone_change(Tone.new(-34,-68,-119), 20) elsif $min >= 21 $game_screen.start_tone_change(Tone.new(-170,-170,68), 20) end end #---------------------------------------------------------------- # Am / Pm # #---------------------------------------------------------------- if $night == 2 ampm = \" PM\" mins = $min - 12 $day = 0 else ampm = \" AM\" mins = $min end #---------------------------------------------------------------- # Makes the clock more clock looking # #---------------------------------------------------------------- if $min == 0 or $min == 12 mins = 12 end if $min == 10 clock = sprintf(\"d:d\", mins, @sec) elsif $min == 11 clock = sprintf(\"d:d\", mins, @sec) elsif $min == 12 clock = sprintf(\"d:d\", mins, @sec) else clock = sprintf(\"d:d\", mins, @sec) end clock += ampm $clock = clock # Clear window contents self.bitmap.clear if $clock != nil text = clock # Draw clock self.bitmap.font.color.set(255, 255, 255) self.bitmap.draw_text(self.bitmap.rect, text, 1) @timer = clock end end end end
Poi sostituite Window_PlayTime con questo, dovrebbe sostituire il menù \"Play time\" con il menù \"World Clock\".
Spoiler
class Window_PlayTime < Window_Base #----------------------------------------------------------------- # * Object Initialization #----------------------------------------------------------------- def initialize super(0, 0, 160, 96) self.contents = Bitmap.new(width - 32, height - 32) refresh end #----------------------------------------------------------------- # * Refresh #----------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = system_color self.contents.draw_text(4, 0, 120, 32, \"World Clock\") @total_sec = Graphics.frame_count / Graphics.frame_rate $min = @total_sec / 60 % 24 @sec = @total_sec % 60 if $min == 00 $night = 1 $day =+ 1 end if $min == 12 $night = 2 end if $night == 2 ampm = \" PM\" mins = $min - 12 else ampm = \" AM\" mins = $min end if $min == 0 or $min == 12 mins = 12 end if $min == 10 clock = sprintf(\"d:d\", mins, @sec) elsif $min == 11 clock = sprintf(\"d:d\", mins, @sec) elsif $min == 12 clock = sprintf(\"d:d\", mins, @sec) else clock = sprintf(\"d:d\", mins, @sec) end clock += ampm self.contents.font.color = normal_color self.contents.draw_text(4, 32, 120, 32, clock, 2) $clock = clock end #----------------------------------------------------------------- # * Frame Update #----------------------------------------------------------------- def update super if Graphics.frame_count / Graphics.frame_rate != @total_sec refresh end end end
Modificato da Guardian of Irael, 27 March 2013 - 15:53 PM.