Module: Battle::Effects::Mechanics::ForceFlying
- Included in:
- Battle::Effects::MagnetRise, Telekinesis
- Defined in:
- scripts/01600 Alpha 25 Battle Engine/04000 Effects/00001 Mechanics/00100 ForceFlying.rb
Overview
Effect mechanics that make the pokemon flies When including this mechanics :
-
overwrite on_proc_message
-
overwrite on_delete_message
-
call Effects::Mechanics::ForceFlying.register_force_flying_hook in the class
Class Method Summary collapse
-
.register_force_flying_hook(reason, name)
Make to pokemon flying in grounded? test.
Instance Method Summary collapse
-
#force_flying_initialize(duration)
Create a new Pokemon tied effect.
-
#on_delete
(also: #force_flying_on_delete)
Function called when the effect has been deleted from the effects handler.
Class Method Details
.register_force_flying_hook(reason, name)
Make to pokemon flying in grounded? test
49 50 51 52 53 54 55 56 57 |
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00001 Mechanics/00100 ForceFlying.rb', line 49 def (reason, name) PFM::PokemonBattler.(reason) do |pokemon, scene| next false unless pokemon.effects.has?(name) msg = pokemon.effects.get(name).send(:on_proc_message) # Call private method scene.(msg) if msg next true end end |
Instance Method Details
#force_flying_initialize(duration)
Create a new Pokemon tied effect
12 13 14 |
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00001 Mechanics/00100 ForceFlying.rb', line 12 def (duration) self.counter = duration end |
#on_delete Also known as: force_flying_on_delete
Function called when the effect has been deleted from the effects handler
17 18 19 20 |
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00001 Mechanics/00100 ForceFlying.rb', line 17 def on_delete msg = @logic.scene.(msg) if msg end |