#======================================================================# #======================================================================# # #*****************# Control del clima script V 1.1 permite # # #*** By Falcao ***# controlar el tiempo al antojo del usuario # # #*****************# con unos simples comandos # # RMXP # # mundodeluxe.mforos.com Credits to: Falcao # #======================================================================# module FalClima #----------------------------------------------------------------------- # Mapas en los cuales los efectos de clima no tendran efecto, util al # entrar a una casa detener la lluvia, poner el ID del mapa entre los # corchetes separando cada ID con una coma. MapIDisable = [ ] #----------------------------------------------------------------------- end #----------------------------------------------------------------------- # * Intrucciones # # Para agregarlo a sus proyectos, solo copiar y pegar en un nuevo bloque # encima de main. # # utilizar las sigientes lineas de codigo desde el comando llamar script # del evento. # # $clima.lluvia * Empieza a llover # $clima.tormenta * Empieza una tormenta electrica # $clima.nieve * Empieza a nevar # $clima.nieve_tormenta * Se viene una tormenta de nieve # $clima.normal * REGRESA TODO A LA NORMALIDAD # # # Para hacer un ciclo de lluvia, como en la vida real incluyendo # precipitacion por momentos, tormenta, nublado, sol utilizar # el sigiente codigo # # $clima.temporal * Ciclo de lluvia temporal como la vida real # $clima.temporal_romper * Rompe el ciclo y todo se vuelve normal # # Nota: Cada efecto de clima viene con efecto sonoro, niebla, cambios # de color de pantalla. #------------------------------------------------------------------------- class Clima attr_accessor :type attr_accessor :wait attr_accessor :counter attr_accessor :fase attr_accessor :restore attr_accessor :ciclo attr_accessor :check def initialize @type = 0 @wait = 0 @counter = 0 @fase = 0 @restore = false @ciclo = false @check = false end def lluvia normal $game_screen.weather(1, 6,20) $game_screen.start_tone_change(Tone.new(-68, -68, -68, 0), 20) $game_system.bgs_play(RPG::AudioFile.new("005-Rain01", 100, 100)) $game_map.fog_name = "001-Fog01" $game_map.fog_opacity = 40 $game_map.fog_sx = 4 $game_map.fog_sy = 3 @type = 1 end def tormenta normal $game_screen.weather(2, 9,20) $game_screen.start_tone_change(Tone.new(-68, -68, -68, 0), 20) $game_system.bgs_play(RPG::AudioFile.new("006-Rain02", 100, 100)) $game_map.fog_name = "001-Fog01" $game_map.fog_opacity = 40 $game_map.fog_sx = 6 $game_map.fog_sy = 3 @type = 2 end def nieve normal $game_screen.weather(3, 4,20) $game_screen.start_tone_change(Tone.new(15, 15, 15, 15), 20) $game_system.bgs_play(RPG::AudioFile.new("002-Wind02", 100, 100)) $game_map.fog_name = "001-Fog01" $game_map.fog_opacity = 10 $game_map.fog_sx = 6 $game_map.fog_sy = 3 @type = 3 end def nieve_tormenta normal $game_screen.weather(3, 9,20) $game_screen.start_tone_change(Tone.new(30, 30, 30, 25), 20) $game_system.bgs_play(RPG::AudioFile.new("003-Wind03", 100, 100)) $game_map.fog_name = "001-Fog01" $game_map.fog_opacity = 15 $game_map.fog_sx = 10 $game_map.fog_sy = 4 @type = 4 end def temporal normal $game_screen.start_tone_change(Tone.new(-68, -68, -68, 0), 220) $game_system.se_play(RPG::AudioFile.new("061-Thunderclap01", 100, 100)) $game_screen.start_flash(Color.new(255, 255, 255, 255), 15) $game_map.fog_name = "001-Fog01" $game_map.fog_opacity = 14 $game_map.fog_sx = 6 $game_map.fog_sy = 3 @ciclo = true @type = 5 end def temporal_romper normal @ciclo = false @fase = 0 end def cloudy normal $game_screen.start_tone_change(Tone.new(-68, -68, -68, 0), 20) $game_map.fog_name = "001-Fog01" $game_map.fog_opacity = 10 $game_map.fog_sx = 10 $game_map.fog_sy = 4 end def sun normal $game_screen.start_tone_change(Tone.new(0, 0, 0, 0), 20) $game_screen.weather(0, 0,20) Audio.bgs_fade(800) $game_map.fog_name = "" end def house $game_screen.start_tone_change(Tone.new(0, 0, 0, 0), 20) $game_screen.weather(0, 0,20) Audio.bgs_fade(800) $game_map.fog_name = "" @wait = 0 end def normal $game_screen.start_tone_change(Tone.new(0, 0, 0, 0), 20) $game_screen.weather(0, 0,20) Audio.bgs_fade(800) $game_map.fog_name = "" @type = 0 @wait = 0 @counter = 0 @restore = false $game_player.refresh end end class Scene_Map alias falcao_Wmap_update update def update case $clima.type when 1 lluvia_type when 2 tormenta_type when 3 nieve_type when 4 nieve_tormenta_type end if $clima.ciclo == true $clima.counter += 1 case $clima.fase when 0; if $clima.counter == 400 $clima.lluvia; $clima.fase = 1 end when 1; if $clima.counter == 700 $clima.tormenta; $clima.fase = 2 end when 2; if $clima.counter == 500 * 2 $clima.lluvia; $clima.fase = 3 end when 3; if $clima.counter == 700 * 2 $clima.cloudy; $clima.fase = 4 end when 4; if $clima.counter == 500 $clima.sun; $clima.fase = 5 end when 5; if $clima.counter == 800 * 2 $clima.fase = 0; $clima.temporal end end end if $clima.check == true if FalClima::MapIDisable.include?($game_map.map_id) $clima.house; $clima.check = false $clima.ciclo = false else case $clima.type when 1; $clima.lluvia when 2; $clima.tormenta when 3; $clima.nieve when 4; $clima.nieve_tormenta when 5; $clima.temporal end end $clima.check = false end falcao_Wmap_update end def lluvia_type $clima.wait += 1 if $clima.wait == 270 $game_system.se_play(RPG::AudioFile.new("061-Thunderclap01", 100, 100)) $game_screen.start_flash(Color.new(255, 255, 255, 255), 15) $clima.wait = 0 end end def tormenta_type $clima.wait += 1 if $clima.wait == 200 $game_system.se_play(RPG::AudioFile.new("061-Thunderclap01", 100, 100)) $game_screen.start_flash(Color.new(255, 255, 255, 255), 15) $clima.wait = 0 end end def nieve_type $clima.wait += 1 if $clima.restore == false if $clima.wait > 200 $game_map.fog_opacity += 1 if $game_map.fog_opacity > 70 $clima.wait = 0 $clima.restore = true end end if $clima.restore == true $game_map.fog_opacity -= 1 if $game_map.fog_opacity < 15 $clima.restore = false end end end def nieve_tormenta_type $clima.wait += 1 if $clima.restore == false if $clima.wait > 150 $game_map.fog_opacity += 0.5 if $game_map.fog_opacity > 100 $clima.wait = 0 $clima.restore = true end end if $clima.restore == true $game_map.fog_opacity -= 2 if $game_map.fog_opacity < 20 $clima.restore = false end end end alias falcaoW_transfer_player transfer_player def transfer_player $clima.check = true falcaoW_transfer_player end end class Scene_Title alias falcao_weather_main main def main $clima = Clima.new falcao_weather_main end alias falcao_weather_command command_new_game def command_new_game $clima = Clima.new falcao_weather_command end end class Scene_Save alias falcao_write_data write_save_data def write_save_data(file) falcao_write_data(file) Marshal.dump($clima, file) end end class Scene_Load alias falcao_read_data read_save_data def read_save_data(file) falcao_read_data(file) $clima = Marshal.load(file) end end