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

#move ⇒ Battle::Move (readonly)

Get the move the Pokemon has to use

Returns:



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

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)


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

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



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

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)


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

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



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

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)


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

def out_of_reach?
end

#update_counter

Function that updates the counter of the effect



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

def update_counter
end