Class: RPG::Weather

Inherits:
Object show all
Defined in:
docs/4_Systems_003_Map_Engine.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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(viewport = nil) ⇒ Weather

Note:

: type 0 = None, 1 = Rain, 2 = Sun/Zenith, 3 = Darud Sandstorm, 4 = Hail, 5 = Foggy

Create the Weather object

Parameters:

  • viewport (Viewport) (defaults to: nil)


1843
1844
# File 'docs/4_Systems_003_Map_Engine.rb', line 1843

def initialize(viewport = nil)
end

Instance Attribute Details

#max ⇒ Integer

Return the max amount of sprites

Returns:

  • (Integer)


1833
1834
1835
# File 'docs/4_Systems_003_Map_Engine.rb', line 1833

def max
  @max
end

#ox ⇒ Numeric

Return the origin x

Returns:

  • (Numeric)


1836
1837
1838
# File 'docs/4_Systems_003_Map_Engine.rb', line 1836

def ox
  @ox
end

#oy ⇒ Numeric

Return the origin y

Returns:

  • (Numeric)


1839
1840
1841
# File 'docs/4_Systems_003_Map_Engine.rb', line 1839

def oy
  @oy
end

#type ⇒ Integer

Return the weather type

Returns:

  • (Integer)


1830
1831
1832
# File 'docs/4_Systems_003_Map_Engine.rb', line 1830

def type
  @type
end

Class Method Details

.register_set_type(type, symbol, psdk_managed)

Register a new type= method call

Parameters:

  • type (Integer) —

    the type of weather

  • symbol (Symbol) —

    if the name of the method to call

  • psdk_managed (Boolean) —

    if it's managed by PSDK (some specific code in the type= method)



1929
1930
# File 'docs/4_Systems_003_Map_Engine.rb', line 1929

def register_set_type(type, symbol, psdk_managed)
end

Instance Method Details

#dispose

Dispose the interface



1849
1850
# File 'docs/4_Systems_003_Map_Engine.rb', line 1849

def dispose
end

#update

Update the sprite display



1846
1847
# File 'docs/4_Systems_003_Map_Engine.rb', line 1846

def update
end