Module: Battle::Effects::Mechanics::OutOfReach
- Included in:
- OutOfReachBase
- Defined in:
- scripts/01600 Alpha 25 Battle Engine/04000 Effects/00001 Mechanics/00100 OutOfReach.rb
Overview
Make the pokemon out of reach
*Requirement*
-
Call initialize_out_of_reach
Instance Method Summary collapse
-
#can_hit_while_out_of_reach?(name) ⇒ Boolean
(also: #oor_can_hit_while_out_of_reach?)
Check if the attack can hit the pokemon.
-
#initialize_out_of_reach(pokemon, exceptions)
Init the mechanic.
-
#on_move_prevention_target(user, target, move) ⇒ Boolean
(also: #oor_on_move_prevention_target)
Function called when we try to check if the target evades the move.
-
#out_of_reach? ⇒ Boolean
(also: #oor_out_of_reach?)
Tell if the effect make the pokemon out reach.
Instance Method Details
#can_hit_while_out_of_reach?(name) ⇒ Boolean Also known as: oor_can_hit_while_out_of_reach?
Check if the attack can hit the pokemon. Should be called after testing out_of_reach?
27 28 29 |
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00001 Mechanics/00100 OutOfReach.rb', line 27 def can_hit_while_out_of_reach?(name) return @oor_exceptions.include?(name) end |
#initialize_out_of_reach(pokemon, exceptions)
Init the mechanic
12 13 14 15 |
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00001 Mechanics/00100 OutOfReach.rb', line 12 def initialize_out_of_reach(pokemon, exceptions) @oor_pokemon = pokemon @oor_exceptions = exceptions end |
#on_move_prevention_target(user, target, move) ⇒ Boolean Also known as: oor_on_move_prevention_target
Function called when we try to check if the target evades the move
37 38 39 40 41 42 43 |
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00001 Mechanics/00100 OutOfReach.rb', line 37 def on_move_prevention_target(user, target, move) return false if target != @oor_pokemon result = !can_hit_while_out_of_reach?(move.db_symbol) move.scene.(parse_text_with_pokemon(19, 213, target)) if result return result end |
#out_of_reach? ⇒ Boolean Also known as: oor_out_of_reach?
Tell if the effect make the pokemon out reach
19 20 21 |
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00001 Mechanics/00100 OutOfReach.rb', line 19 def out_of_reach? return true end |