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

Included in:
Bide, Encore, ForceNextMoveBase, Rollout, UpRoar
Defined in:
docs/01600_Alpha_25_Battle_Engine_04000_Effects_00001_Mechanics.rb

Overview

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

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:



43
44
45
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects_00001_Mechanics.rb', line 43

def move
  @move
end

#targetsArray<PFM::PokemonBattler> (readonly)

Get the targets of the move

Returns:



46
47
48
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects_00001_Mechanics.rb', line 46

def targets
  @targets
end

Instance Method Details

#action_classClass<Actions::Attack>

Get the class of the action

Returns:



81
82
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects_00001_Mechanics.rb', line 81

def action_class
end

#force_next_move?Boolean

Tell if the effect forces the next move

Returns:

  • (Boolean)


56
57
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects_00001_Mechanics.rb', line 56

def force_next_move?
end

#force_next_turn_action?Boolean

Tell if the effect forces the next turn action into a Attack action

Returns:

  • (Boolean)


60
61
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects_00001_Mechanics.rb', line 60

def force_next_turn_action?
end

#interrupted?(user) ⇒ Boolean

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

Parameters:

Returns:

  • (Boolean)


73
74
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects_00001_Mechanics.rb', line 73

def interrupted?(user)
end

#make_actionActions::Attack

Make the Attack action that is forced by this effect

Returns:



77
78
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects_00001_Mechanics.rb', line 77

def make_action
end

#on_move_prevention_user(user, targets, move) ⇒ :prevent?

Function called when we try to use a move as the user (returns :prevent if user fails)

Parameters:

Returns:

  • (:prevent, nil)

    :prevent if the move cannot continue



52
53
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects_00001_Mechanics.rb', line 52

def on_move_prevention_user(user, targets, move)
end

#paused?(user) ⇒ Boolean

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

Parameters:

Returns:

  • (Boolean)


69
70
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects_00001_Mechanics.rb', line 69

def paused?(user)
end

#update_counter

Function that updates the counter of the effect



63
64
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects_00001_Mechanics.rb', line 63

def update_counter
end