Class: PFM::PokemonBattler::DamageHistory

Inherits:
Object
  • Object
show all
Defined in:
docs/5_Battle_03_PokemonBattler.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:



799
800
# File 'docs/5_Battle_03_PokemonBattler.rb', line 799

def initialize(damage, launcher, move, ko)
end

Instance Attribute Details

#damage ⇒ Integer (readonly)

Get the amount of damage took

Returns:

  • (Integer)


784
785
786
# File 'docs/5_Battle_03_PokemonBattler.rb', line 784

def damage
  @damage
end

#ko ⇒ Boolean (readonly)

Get if the Pokemon was knocked out

Returns:

  • (Boolean)


793
794
795
# File 'docs/5_Battle_03_PokemonBattler.rb', line 793

def ko
  @ko
end

#launcher ⇒ PFM::PokemonBattler? (readonly)

Get the launcher that cause the damages

Returns:



787
788
789
# File 'docs/5_Battle_03_PokemonBattler.rb', line 787

def launcher
  @launcher
end

#move ⇒ Battle::Move? (readonly)

Get the move that cause the damages

Returns:



790
791
792
# File 'docs/5_Battle_03_PokemonBattler.rb', line 790

def move
  @move
end

#turn ⇒ Integer (readonly)

Get the turn when it was used

Returns:

  • (Integer)


781
782
783
# File 'docs/5_Battle_03_PokemonBattler.rb', line 781

def turn
  @turn
end

Instance Method Details

#current_turn? ⇒ Boolean

Tell if the move was used during the current turn

Returns:

  • (Boolean)


807
808
# File 'docs/5_Battle_03_PokemonBattler.rb', line 807

def current_turn?
end

#last_turn? ⇒ Boolean

Tell if the move was used during last turn

Returns:

  • (Boolean)


803
804
# File 'docs/5_Battle_03_PokemonBattler.rb', line 803

def last_turn?
end