Class: RPG::Weather
- Defined in:
- scripts/00000 Dependencies/00500 Patch_RPG/00300 RPG__Weather.rb
Overview
Class that display weather
Constant Summary collapse
- SunnyTone =
Tone used to simulate the sun weather
Tone.new(90, 50, 0, 40)
- INIT_TEXTURE =
Array containing all the texture initializer in the order of the type
%i[init_rain init_rain init_zenith init_sand_storm init_snow init_fog]
- UPDATE_METHODS =
Array containing all the weather update methods in the order of the type
%i[update_rain update_rain update_zenith update_sandstorm update_snow update_fog]
- SET_TYPE_METHODS =
Methods symbols telling how to set the new type of weather according to the index
[]
- SET_TYPE_PSDK_MANAGED =
Boolean telling if the set_type is managed by PSDK or not
[]
- MAX_SPRITE =
Number of sprite to generate
61
- MAX_TOP =
Top factor of the max= adjustment (max * top / bottom)
3
- MAX_BOTTOM =
Bottom factor of the max= adjustment (max * top / bottom)
2
Instance Attribute Summary collapse
-
#max ⇒ Integer
Return the max amount of sprites.
-
#ox ⇒ Numeric
Return the origin x.
-
#oy ⇒ Numeric
Return the origin y.
-
#type ⇒ Integer
Return the weather type.
Class Method Summary collapse
-
.register_set_type(type, symbol, psdk_managed)
Register a new type= method call.
Instance Method Summary collapse
-
#dispose
Dispose the interface.
-
#initialize(viewport = nil) ⇒ Weather
constructor
Create the Weather object.
-
#update
Update the sprite display.
Constructor Details
#initialize(viewport = nil) ⇒ Weather
: type 0 = None, 1 = Rain, 2 = Sun/Zenith, 3 = Darud Sandstorm, 4 = Hail, 5 = Foggy
Create the Weather object
35 36 37 38 39 40 41 |
# File 'scripts/00000 Dependencies/00500 Patch_RPG/00300 RPG__Weather.rb', line 35 def initialize( = nil) @type = 0 @max = 0 @ox = 0 @oy = 0 init_sprites() end |
Instance Attribute Details
#max ⇒ Integer
Return the max amount of sprites
25 26 27 |
# File 'scripts/00000 Dependencies/00500 Patch_RPG/00300 RPG__Weather.rb', line 25 def max @max end |
#ox ⇒ Numeric
Return the origin x
28 29 30 |
# File 'scripts/00000 Dependencies/00500 Patch_RPG/00300 RPG__Weather.rb', line 28 def ox @ox end |
#oy ⇒ Numeric
Return the origin y
31 32 33 |
# File 'scripts/00000 Dependencies/00500 Patch_RPG/00300 RPG__Weather.rb', line 31 def oy @oy end |
#type ⇒ Integer
Return the weather type
22 23 24 |
# File 'scripts/00000 Dependencies/00500 Patch_RPG/00300 RPG__Weather.rb', line 22 def type @type end |
Class Method Details
.register_set_type(type, symbol, psdk_managed)
Register a new type= method call
325 326 327 328 |
# File 'scripts/00000 Dependencies/00500 Patch_RPG/00300 RPG__Weather.rb', line 325 def register_set_type(type, symbol, psdk_managed) SET_TYPE_METHODS[type] = symbol SET_TYPE_PSDK_MANAGED[type] = psdk_managed end |
Instance Method Details
#dispose
Dispose the interface
50 51 52 53 |
# File 'scripts/00000 Dependencies/00500 Patch_RPG/00300 RPG__Weather.rb', line 50 def dispose @sprites.each(&:dispose) @snow_bitmap&.dispose if SET_TYPE_PSDK_MANAGED[4] end |
#update
Update the sprite display
44 45 46 47 |
# File 'scripts/00000 Dependencies/00500 Patch_RPG/00300 RPG__Weather.rb', line 44 def update return if @type == 0 send(UPDATE_METHODS[@type]) end |