Class: Oakdex::Battle::StatusConditions::Poison

Inherits:
NonVolatile show all
Defined in:
lib/oakdex/battle/status_conditions/poison.rb

Overview

Represents Poison status condition

Instance Attribute Summary

Attributes inherited from Base

#pokemon

Instance Method Summary collapse

Methods inherited from NonVolatile

#after_fainted

Methods inherited from Base

#after_fainted, #after_received_damage, #after_switched_out, #before_turn, #damage_modifier, #initialize, #prevents_move?, #stat_modifier

Constructor Details

This class inherits a constructor from Oakdex::Battle::StatusConditions::Base

Instance Method Details

#after_turn(turn) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/oakdex/battle/status_conditions/poison.rb', line 6

def after_turn(turn)
  return if pokemon.fainted?
  turn.battle.add_to_log('damage_by_poison',
                         pokemon.trainer.name,
                         pokemon.name, hp_by_turn)
  pokemon.change_hp_by(hp_by_turn)
end