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
-
#move ⇒ Battle::Move
readonly
Get the move the Pokemon has to use.
-
#targets ⇒ Array<PFM::PokemonBattler>
readonly
Get the targets of the move.
Instance Method Summary collapse
-
#action_class ⇒ Class<Actions::Attack>
Get the class of the action.
-
#force_next_move? ⇒ Boolean
Tell if the effect forces the next move.
-
#make_action ⇒ Actions::Attack
Make the Attack action that is forced by this effect.
Instance Attribute Details
#move ⇒ Battle::Move (readonly)
Get the move the Pokemon has to use
8 9 10 |
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00001 Mechanics/00100 ForceNextMove.rb', line 8 def move @move end |
#targets ⇒ Array<PFM::PokemonBattler> (readonly)
Get the targets of the move
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_class ⇒ Class<Actions::Attack>
Get the class of the action
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
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_action ⇒ Actions::Attack
Make the Attack action that is forced by this effect
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 |