Module: Battle::Effects::Mechanics::OutOfReach

Included in:
OutOfReachBase
Defined in:
docs/5_Battle_06_Effects_01_Mechanics.rb

Overview

Make the pokemon out of reach

Requirement

  • Call initialize_out_of_reach

Constant Summary collapse

MOVES_PAUSED =

List of move that must be paused when user is asleep/frozen/flinched

%i[freeze_shock geomancy ice_burn razor_wind skull_bash sky_attack solar_beam electro_shot]

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#moveBattle::Move (readonly)

Get the move the Pokemon has to use

Returns:



137
138
139
# File 'docs/5_Battle_06_Effects_01_Mechanics.rb', line 137

def move
  @move
end

Instance Method Details

#can_hit_while_out_of_reach?(move) ⇒ 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?

Parameters:

Returns:

  • (Boolean)


162
163
# File 'docs/5_Battle_06_Effects_01_Mechanics.rb', line 162

def can_hit_while_out_of_reach?(move)
end

#initialize_out_of_reach(pokemon, move, exceptions, counter = 2)

Init the mechanic

Parameters:

  • pokemon (PFM::PokemonBattler)
  • move (Battle::Move)
  • exceptions (Array<Symbol>)

    move that hit the target while out of reach

  • counter (Integer) (defaults to: 2)

    number of turn the user is out_of_reach



143
144
# File 'docs/5_Battle_06_Effects_01_Mechanics.rb', line 143

def initialize_out_of_reach(pokemon, move, exceptions, counter = 2)
end

#interrupted?(user) ⇒ Boolean

Function that tells us if we should interrupt the move or not

Parameters:

Returns:

  • (Boolean)


157
158
# File 'docs/5_Battle_06_Effects_01_Mechanics.rb', line 157

def interrupted?(user)
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

Parameters:

Returns:

  • (Boolean)

    if the target is evading the move



170
171
# File 'docs/5_Battle_06_Effects_01_Mechanics.rb', line 170

def on_move_prevention_target(user, target, move)
end

#out_of_reach?Boolean Also known as: oor_out_of_reach?

Tell if the effect make the pokemon out reach

Returns:

  • (Boolean)


147
148
# File 'docs/5_Battle_06_Effects_01_Mechanics.rb', line 147

def out_of_reach?
end

#update_counter

Function that updates the counter of the effect



151
152
# File 'docs/5_Battle_06_Effects_01_Mechanics.rb', line 151

def update_counter
end