Class: Battle::Logic::AbilityChangeHandler
- Inherits:
-
ChangeHandlerBase
- Object
- ChangeHandlerBase
- Battle::Logic::AbilityChangeHandler
- Includes:
- Hooks
- Defined in:
- docs/5_Battle_04_Logic.rb
Overview
Handler responsive of answering properly ability changes requests
Constant Summary collapse
- CANT_OVERWRITE_ABILITIES =
List of abilities that can’t be overwritten
%i[battle_bond comatose disguise multitype power_construct rks_system schooling shields_down stance_change zen_mode gulp_missile]
- RECEIVER_CANT_COPY_ABILITIES =
List of abilities the receiver/power_of_alchemy ability can’t copy
%i[receiver power_of_alchemy trace forecast flower_gift multitype illusion wonder_guard zen_mode imposter stance_change power_construct schooling comatose shields_down disguise rks_system battle_bond gulp_missile]
- SKILL_BLOCKING_ABILITIES =
These moves fail if the target has these abilities
{entrainment: %i[truant], role_play: %i[flower_gift forecast illusion imposter power_of_alchemy receiver trace wonder_guard], simple_beam: %i[simple truant], skill_swap: %i[illusion wonder_guard], worry_seed: %i[gulp_missile]}
- ABILITY_BLOCKING_ABILITIES =
Case of a ability that fail
{mummy: %i[mummy], lingering_aroma: %i[lingering_aroma], wandering_spirit: %i[wandering_spirit], trace: %i[flower_gift forecast illusion imposter multitype stance_change trace zen_mode receiver power_of_alchemy], receiver: RECEIVER_CANT_COPY_ABILITIES, power_of_alchemy: RECEIVER_CANT_COPY_ABILITIES}
- USER_BLOCKING_ABILITIES =
Case of a move that fail if the launcher has this ability
{entrainment: %i[disguise forecast flower_gift illusion imposter power_construct power_of_alchemy receiver trace zen_mode], role_play: CANT_OVERWRITE_ABILITIES + %i[receiver power_of_alchemy]}
Instance Attribute Summary
Attributes inherited from ChangeHandlerBase
#logic, #pre_checked_effects, #scene
Class Method Summary collapse
-
.register_ability_prevention_hook(reason) {|handler, target, ability_symbol, launcher, skill| ... }
Function that registers a ability_change_prevention hook.
-
.register_post_ability_change_hook(reason) {|handler, target, ability_symbol, launcher, skill| ... }
Function that registers a post_ability_change hook.
Instance Method Summary collapse
-
#can_change_ability?(target, ability_symbol, launcher = nil, skill = nil) ⇒ Boolean
Function that tell if this is possible to change the ability of a Pokemon.
-
#change_ability(target, ability_symbol, launcher = nil, skill = nil)
Function that change the ability of a Pokemon.
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_ability_prevention_hook(reason) {|handler, target, ability_symbol, launcher, skill| ... }
Function that registers a ability_change_prevention hook
1744 1745 |
# File 'docs/5_Battle_04_Logic.rb', line 1744 def register_ability_prevention_hook(reason) end |
.register_post_ability_change_hook(reason) {|handler, target, ability_symbol, launcher, skill| ... }
Function that registers a post_ability_change hook
1754 1755 |
# File 'docs/5_Battle_04_Logic.rb', line 1754 def register_post_ability_change_hook(reason) end |
Instance Method Details
#can_change_ability?(target, ability_symbol, launcher = nil, skill = nil) ⇒ Boolean
Function that tell if this is possible to change the ability of a Pokemon
1733 1734 |
# File 'docs/5_Battle_04_Logic.rb', line 1733 def can_change_ability?(target, ability_symbol, launcher = nil, skill = nil) end |
#change_ability(target, ability_symbol, launcher = nil, skill = nil)
Function that change the ability of a Pokemon
1726 1727 |
# File 'docs/5_Battle_04_Logic.rb', line 1726 def change_ability(target, ability_symbol, launcher = nil, skill = nil) end |