Class: Battle::Logic::StatusChangeHandler
- Inherits:
-
ChangeHandlerBase
- Object
- ChangeHandlerBase
- Battle::Logic::StatusChangeHandler
- Includes:
- Hooks
- Defined in:
- docs/5_Battle_04_Logic.rb
Overview
Handler responsive of answering properly status changes requests
Constant Summary collapse
- STATUS_APPLY_METHODS =
List of method to call in order to apply the status on the Pokemon
{poison: :status_poison, toxic: :status_toxic, confusion: :status_confuse, sleep: :status_sleep, freeze: :status_frozen, paralysis: :status_paralyze, burn: :status_burn, cure: :cure, flinch: :apply_flinch}
- STATUS_APPLY_MESSAGE =
List of message ID when applying a status
{poison: 234, toxic: 237, confusion: 345, sleep: 306, freeze: 288, paralysis: 273, burn: 255}
- STATUS_APPLY_ANIMATION =
List of animation ID when applying a status
{poison: 470, toxic: 477, confusion: 475, sleep: 473, freeze: 474, paralysis: 471, burn: 472, flinch: 476}
Instance Attribute Summary
Attributes inherited from ChangeHandlerBase
#logic, #pre_checked_effects, #scene
Class Method Summary collapse
-
.register_post_status_change_hook(reason) {|handler, status, target, launcher, skill| ... }
Function that registers a post_status_change hook.
-
.register_status_prevention_hook(reason) {|handler, status, target, launcher, skill| ... }
Function that registers a status_prevention hook.
Instance Method Summary collapse
-
#status_appliable?(status, target, launcher = nil, skill = nil) ⇒ Boolean
Function telling if a status can be applyied.
-
#status_change(status, target, launcher = nil, skill = nil, message_overwrite: nil)
Function that actually change the status.
-
#status_change_with_process(status, target, launcher = nil, skill = nil, message_overwrite: nil)
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
#initialize, #prevent_change, #process_prevention_reason, #reset_prevention_reason
Constructor Details
This class inherits a constructor from Battle::Logic::ChangeHandlerBase
Class Method Details
.register_post_status_change_hook(reason) {|handler, status, target, launcher, skill| ... }
Function that registers a post_status_change hook
1015 1016 |
# File 'docs/5_Battle_04_Logic.rb', line 1015 def register_post_status_change_hook(reason) end |
.register_status_prevention_hook(reason) {|handler, status, target, launcher, skill| ... }
Function that registers a status_prevention hook
1006 1007 |
# File 'docs/5_Battle_04_Logic.rb', line 1006 def register_status_prevention_hook(reason) end |
Instance Method Details
#status_appliable?(status, target, launcher = nil, skill = nil) ⇒ Boolean
Thing that prevents the status from being applyied should be defined using :status_prevention Hook.
Function telling if a status can be applyied
974 975 |
# File 'docs/5_Battle_04_Logic.rb', line 974 def status_appliable?(status, target, launcher = nil, skill = nil) end |
#status_change(status, target, launcher = nil, skill = nil, message_overwrite: nil)
Function that actually change the status
982 983 |
# File 'docs/5_Battle_04_Logic.rb', line 982 def status_change(status, target, launcher = nil, skill = nil, message_overwrite: nil) end |
#status_change_with_process(status, target, launcher = nil, skill = nil, message_overwrite: nil)
Function that test if the change is possible and perform the change if so
989 990 |
# File 'docs/5_Battle_04_Logic.rb', line 989 def status_change_with_process(status, target, launcher = nil, skill = nil, message_overwrite: nil) end |