Class: PFM::PokemonBattler::MoveHistory

Inherits:
Object
  • Object
show all
Defined in:
scripts/01600 Alpha 25 Battle Engine/00100 PokemonBattler/01000 MoveHistory.rb

Overview

Class defining an history of move use

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(move, targets, attack_order) ⇒ MoveHistory

Create a new Move History

Parameters:



25
26
27
28
29
30
31
# File 'scripts/01600 Alpha 25 Battle Engine/00100 PokemonBattler/01000 MoveHistory.rb', line 25

def initialize(move, targets, attack_order)
  @original_move = move
  @move = move.dup
  @turn = $game_temp.battle_turn
  @targets = targets
  @attack_order = attack_order
end

Instance Attribute Details

#attack_orderInteger (readonly)

Get the attack order of the Pokemon

Returns:



19
20
21
# File 'scripts/01600 Alpha 25 Battle Engine/00100 PokemonBattler/01000 MoveHistory.rb', line 19

def attack_order
  @attack_order
end

#moveBattle::Move (readonly)

Get the move that was used

Returns:



10
11
12
# File 'scripts/01600 Alpha 25 Battle Engine/00100 PokemonBattler/01000 MoveHistory.rb', line 10

def move
  @move
end

#original_moveBattle::Move (readonly)

Get the actual move object that was used

Returns:



16
17
18
# File 'scripts/01600 Alpha 25 Battle Engine/00100 PokemonBattler/01000 MoveHistory.rb', line 16

def original_move
  @original_move
end

#targetsArray<PFM::PokemonBattler> (readonly)

Get the target that were affected by the move

Returns:



13
14
15
# File 'scripts/01600 Alpha 25 Battle Engine/00100 PokemonBattler/01000 MoveHistory.rb', line 13

def targets
  @targets
end

#turnInteger (readonly)

Get the turn when it was used

Returns:



7
8
9
# File 'scripts/01600 Alpha 25 Battle Engine/00100 PokemonBattler/01000 MoveHistory.rb', line 7

def turn
  @turn
end

Instance Method Details

#current_turn?Boolean

Tell if the move was used during the current turn

Returns:

  • (Boolean)


41
42
43
# File 'scripts/01600 Alpha 25 Battle Engine/00100 PokemonBattler/01000 MoveHistory.rb', line 41

def current_turn?
  return @turn == $game_temp.battle_turn
end

#db_symbolSymbol

Get the db_symbol of the move

Returns:

  • (Symbol)


47
48
49
# File 'scripts/01600 Alpha 25 Battle Engine/00100 PokemonBattler/01000 MoveHistory.rb', line 47

def db_symbol
  return @move.db_symbol
end

#last_turn?Boolean

Tell if the move was used during last turn

Returns:

  • (Boolean)


35
36
37
# File 'scripts/01600 Alpha 25 Battle Engine/00100 PokemonBattler/01000 MoveHistory.rb', line 35

def last_turn?
  return @turn == $game_temp.battle_turn - 1
end