class Spriteset_Weather
#-----------------------------------------------------------------------------
# How to use :
# Decide which variabled ID that determine which region ID gonna handle the
# weather effect below
#-----------------------------------------------------------------------------
Weather_VarID = 99
#-----------------------------------------------------------------------------
# Then, set the variable ID to region ID. For example, if you want to show
# snow weather in region 1, set variable 99 value to 1. If you set it back to
# 0, then snow weather will be displayed everywhere
#-----------------------------------------------------------------------------
def screen_to_world(sprite)
return sprite.visible = true if $game_variables[Weather_VarID] == 0
x_map = (sprite.x - sprite.ox + $game_map.display_x * 32)/32
y_map = (sprite.y - sprite.oy + $game_map.display_y * 32)/32
world_visible(sprite, x_map.floor, y_map.floor)
end
def world_visible(spr, x, y)
if $game_map.region_id(x, y) == $game_variables[Weather_VarID]
spr.visible = true
else
spr.visible = false
end
end
alias theo_regweather_update_snow update_sprite_snow
def update_sprite_snow(sprite)
theo_regweather_update_snow(sprite)
screen_to_world(sprite)
end
alias theo_regweathen_new_particle create_new_particle
def create_new_particle(sprite)
theo_regweathen_new_particle(sprite)
screen_to_world(sprite) if @type == :snow
end
end