Module: Battle::Effects::Mechanics::ForceNextMove

Included in:
Bide, Encore, ForceNextMoveBase, ForceNextMoveDisturbable, Rollout, UpRoar
Defined in:
scripts/01600 Alpha 25 Battle Engine/04000 Effects/00001 Mechanics/00100 ForceNextMove.rb

Overview

Give functions to manage a move that force the next one. Must be used in a EffectBase child class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#moveBattle::Move (readonly)

Get the move the Pokemon has to use

Returns:



8
9
10
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00001 Mechanics/00100 ForceNextMove.rb', line 8

def move
  @move
end

#targetsArray<PFM::PokemonBattler> (readonly)

Get the targets of the move

Returns:



11
12
13
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00001 Mechanics/00100 ForceNextMove.rb', line 11

def targets
  @targets
end

Instance Method Details

#action_classClass<Actions::Attack>

Get the class of the action

Returns:



30
31
32
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00001 Mechanics/00100 ForceNextMove.rb', line 30

def action_class
  Actions::Attack
end

#force_next_move?Boolean

Tell if the effect forces the next move

Returns:

  • (Boolean)


15
16
17
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00001 Mechanics/00100 ForceNextMove.rb', line 15

def force_next_move?
  return true
end

#make_actionActions::Attack

Make the Attack action that is forced by this effect

Returns:



21
22
23
24
25
26
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00001 Mechanics/00100 ForceNextMove.rb', line 21

def make_action
  raise "Failed to make effect for #{self.class}" unless @pokemon && @logic

  target = targets.first
  return action_class.new(@logic.scene, move, @pokemon, target.bank, target.position)
end