Class: Battle::Actions::Flee

Inherits:
Base show all
Defined in:
docs/5_Battle_05_Actions.rb

Overview

Class describing the Flee action

Constant Summary collapse

PRIORITY_ROAMING_FLEE =

Constant telling the priority applied to a Fleeing action for a Roaming Pokemon

Returns:

  • (Integer)
-7
# Give the comparison result for a Roaming Pokemon
# @param attack [Attack] other action
# @return [Integer]
# @note Based on Gen 5 mechanism as Gen 6 mechanism isn't a real Roaming feature
# In Gen 5, a Roaming Pokemon trying to escape has a Priority of -7

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#valid?

Constructor Details

#initialize(scene, target) ⇒ Flee

Create a new flee action

Parameters:



187
188
# File 'docs/5_Battle_05_Actions.rb', line 187

def initialize(scene, target)
end

Instance Attribute Details

#targetPFM::PokemonBattler (readonly)

Get the pokemon trying to flee

Returns:



183
184
185
# File 'docs/5_Battle_05_Actions.rb', line 183

def target
  @target
end

Instance Method Details

#<=>(other) ⇒ Integer

Compare this action with another

Parameters:

  • other (Base)

    other action

Returns:

  • (Integer)


192
193
# File 'docs/5_Battle_05_Actions.rb', line 192

def <=>(other)
end

#execute(from_scene = false)

Execute the action

Parameters:

  • from_scene (Boolean) (defaults to: false)

    if the action was triggered during the player choice



206
207
# File 'docs/5_Battle_05_Actions.rb', line 206

def execute(from_scene = false)
end

#roaming_comparison_result(attack) ⇒ Integer

Note:

Based on Gen 5 mechanism as Gen 6 mechanism isn’t a real Roaming feature

Give the comparison result for a Roaming Pokemon In Gen 5, a Roaming Pokemon trying to escape has a Priority of -7

Parameters:

  • attack (Attack)

    other action

Returns:

  • (Integer)


202
203
# File 'docs/5_Battle_05_Actions.rb', line 202

def roaming_comparison_result(attack)
end