Class: PFM::PokemonBattler::DamageHistory
- 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
-
#damage ⇒ Integer
readonly
Get the amount of damage took.
-
#ko ⇒ Boolean
readonly
Get if the Pokemon was knocked out.
-
#launcher ⇒ PFM::PokemonBattler?
readonly
Get the launcher that cause the damages.
-
#move ⇒ Battle::Move?
readonly
Get the move that cause the damages.
-
#turn ⇒ Integer
readonly
Get the turn when it was used.
Instance Method Summary collapse
-
#current_turn? ⇒ Boolean
Tell if the move was used during the current turn.
-
#initialize(damage, launcher, move, ko) ⇒ DamageHistory
constructor
Create a new Damage History.
-
#last_turn? ⇒ Boolean
Tell if the move was used during last turn.
Constructor Details
#initialize(damage, launcher, move, ko) ⇒ DamageHistory
Create a new Damage History
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
#damage ⇒ Integer (readonly)
Get the amount of damage took
10 11 12 |
# File 'scripts/01600 Alpha 25 Battle Engine/00100 PokemonBattler/01100 DamageHistory.rb', line 10 def damage @damage end |
#ko ⇒ Boolean (readonly)
Get if the Pokemon was knocked out
19 20 21 |
# File 'scripts/01600 Alpha 25 Battle Engine/00100 PokemonBattler/01100 DamageHistory.rb', line 19 def ko @ko end |
#launcher ⇒ PFM::PokemonBattler? (readonly)
Get the launcher that cause the damages
13 14 15 |
# File 'scripts/01600 Alpha 25 Battle Engine/00100 PokemonBattler/01100 DamageHistory.rb', line 13 def launcher @launcher end |
#move ⇒ Battle::Move? (readonly)
Get the move that cause the damages
16 17 18 |
# File 'scripts/01600 Alpha 25 Battle Engine/00100 PokemonBattler/01100 DamageHistory.rb', line 16 def move @move end |
#turn ⇒ Integer (readonly)
Get the turn when it was used
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
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
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 |