Class: Battle::Logic::WeatherChangeHandler
- Inherits:
-
ChangeHandlerBase
- Object
- ChangeHandlerBase
- Battle::Logic::WeatherChangeHandler
- Includes:
- Hooks
- Defined in:
- docs/5_Battle_04_Logic.rb
Overview
Handler responsive of answering properly weather changes requests
Constant Summary collapse
- WEATHER_SYM_TO_MSG =
Mapping between weather symbol & message_id
{none: 97, rain: 88, sunny: 87, sandstorm: 89, hail: 90, fog: 91, hardsun: 271, hardrain: 269, strong_winds: 273, snow: 287}
Instance Attribute Summary
Attributes inherited from ChangeHandlerBase
#logic, #pre_checked_effects, #scene
Class Method Summary collapse
-
.register_post_weather_change_hook(reason) {|handler, weather_type, last_weather| ... }
Function that registers a on_post_weather_change hook.
-
.register_weather_prevention_hook(reason) {|handler, weather_type, last_weather| ... }
Function that registers a weather_prevention hook.
Instance Method Summary collapse
-
#initialize(logic, scene, env = $env) ⇒ WeatherChangeHandler
constructor
Create a new Weather Change Handler.
-
#weather_appliable?(weather_type) ⇒ Boolean
Function telling if a weather can be applyied.
-
#weather_change(weather_type, nb_turn)
Function that actually change the weather.
-
#weather_change_with_process(weather_type, nb_turn)
Function that test if the change is possible and perform the change if so.
Methods included from Hooks
#exec_hooks, #force_return, included, register, remove, remove_without_name
Methods inherited from ChangeHandlerBase
#prevent_change, #process_prevention_reason, #reset_prevention_reason
Constructor Details
#initialize(logic, scene, env = $env) ⇒ WeatherChangeHandler
Create a new Weather Change Handler
1432 1433 |
# File 'docs/5_Battle_04_Logic.rb', line 1432 def initialize(logic, scene, env = $env) end |
Class Method Details
.register_post_weather_change_hook(reason) {|handler, weather_type, last_weather| ... }
Function that registers a on_post_weather_change hook
1469 1470 |
# File 'docs/5_Battle_04_Logic.rb', line 1469 def register_post_weather_change_hook(reason) end |
.register_weather_prevention_hook(reason) {|handler, weather_type, last_weather| ... }
Function that registers a weather_prevention hook
1462 1463 |
# File 'docs/5_Battle_04_Logic.rb', line 1462 def register_weather_prevention_hook(reason) end |
Instance Method Details
#weather_appliable?(weather_type) ⇒ Boolean
Function telling if a weather can be applyied
1437 1438 |
# File 'docs/5_Battle_04_Logic.rb', line 1437 def weather_appliable?(weather_type) end |
#weather_change(weather_type, nb_turn)
Function that actually change the weather
1442 1443 |
# File 'docs/5_Battle_04_Logic.rb', line 1442 def weather_change(weather_type, nb_turn) end |
#weather_change_with_process(weather_type, nb_turn)
Function that test if the change is possible and perform the change if so
1447 1448 |
# File 'docs/5_Battle_04_Logic.rb', line 1447 def weather_change_with_process(weather_type, nb_turn) end |