Class: PFM::PokemonBattler::StatHistory

Inherits:
Object
  • Object
show all
Defined in:
docs/5_Battle_03_PokemonBattler.rb

Overview

Class that describes a stat change history

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stat, power, target, launcher, move) ⇒ StatHistory

Create a new Stat History

Parameters:

  • stat (Symbol) —

    :atk, :dfe, :spd, :ats, :dfs, :acc, :eva

  • power (Integer) —

    power of the stat change

  • target (PFM::PokemonBattler) —

    target of the stat change

  • launcher (PFM::PokemonBattler, nil) —

    launcher of the stat change

  • move (Battle::Move, nil) —

    move that cause the stat change



837
838
# File 'docs/5_Battle_03_PokemonBattler.rb', line 837

def initialize(stat, power, target, launcher, move)
end

Instance Attribute Details

#launcher ⇒ PFM::PokemonBattler? (readonly)

Get the launcher of the stat change

Returns:



827
828
829
# File 'docs/5_Battle_03_PokemonBattler.rb', line 827

def launcher
  @launcher
end

#move ⇒ Battle::Move? (readonly)

Get the move that cause the stat change

Returns:



830
831
832
# File 'docs/5_Battle_03_PokemonBattler.rb', line 830

def move
  @move
end

#power ⇒ Integer (readonly)

Get the power of the stat change

Returns:

  • (Integer)


821
822
823
# File 'docs/5_Battle_03_PokemonBattler.rb', line 821

def power
  @power
end

#stat ⇒ Symbol (readonly)

:atk, :dfe, :spd, :ats, :dfs, :acc, :eva

Returns:

  • (Symbol)


818
819
820
# File 'docs/5_Battle_03_PokemonBattler.rb', line 818

def stat
  @stat
end

#target ⇒ PFM::PokemonBattler (readonly)

Get the target of the stat change

Returns:



824
825
826
# File 'docs/5_Battle_03_PokemonBattler.rb', line 824

def target
  @target
end

#turn ⇒ Integer (readonly)

Get the turn when it was used

Returns:

  • (Integer)


815
816
817
# File 'docs/5_Battle_03_PokemonBattler.rb', line 815

def turn
  @turn
end

Instance Method Details

#current_turn? ⇒ Boolean

Tell if the move was used during the current turn

Returns:

  • (Boolean)


845
846
# File 'docs/5_Battle_03_PokemonBattler.rb', line 845

def current_turn?
end

#db_symbol ⇒ Symbol

Get the db_symbol of the move

Returns:

  • (Symbol)


849
850
# File 'docs/5_Battle_03_PokemonBattler.rb', line 849

def db_symbol
end

#last_turn? ⇒ Boolean

Tell if the move was used during last turn

Returns:

  • (Boolean)


841
842
# File 'docs/5_Battle_03_PokemonBattler.rb', line 841

def last_turn?
end