Class: PFM::PokemonBattler::DamageHistory

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

Overview

Class defining an history of damages took

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(damage, launcher, move, ko) ⇒ DamageHistory

Create a new Damage History

Parameters:



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

def initialize(damage, launcher, move, ko)
  @turn = $game_temp.battle_turn
  @damage = damage
  @launcher = launcher
  @move = move
  @ko = ko
end

Instance Attribute Details

#damageInteger (readonly)

Get the amount of damage took

Returns:



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

def damage
  @damage
end

#koBoolean (readonly)

Get if the Pokemon was knocked out

Returns:

  • (Boolean)


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

def ko
  @ko
end

#launcherPFM::PokemonBattler? (readonly)

Get the launcher that cause the damages

Returns:



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

def launcher
  @launcher
end

#moveBattle::Move? (readonly)

Get the move that cause the damages

Returns:



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

def move
  @move
end

#turnInteger (readonly)

Get the turn when it was used

Returns:



7
8
9
# File 'scripts/01600 Alpha 25 Battle Engine/00100 PokemonBattler/01100 DamageHistory.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)


42
43
44
# File 'scripts/01600 Alpha 25 Battle Engine/00100 PokemonBattler/01100 DamageHistory.rb', line 42

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

#last_turn?Boolean

Tell if the move was used during last turn

Returns:

  • (Boolean)


36
37
38
# File 'scripts/01600 Alpha 25 Battle Engine/00100 PokemonBattler/01100 DamageHistory.rb', line 36

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