class Oakdex::Battle::StatusConditions::Burn

Represents Burn status condition

Public Instance Methods

after_turn(turn) click to toggle source
# File lib/oakdex/battle/status_conditions/burn.rb, line 6
def after_turn(turn)
  return if pokemon.fainted?
  turn.battle.add_to_log('damage_by_burn',
                         pokemon.trainer.name,
                         pokemon.name, hp_by_turn)
  pokemon.change_hp_by(hp_by_turn)
end
damage_modifier(move_execution) click to toggle source
Calls superclass method
# File lib/oakdex/battle/status_conditions/burn.rb, line 14
def damage_modifier(move_execution)
  move_execution.move.category == 'physical' ? 0.5 : super
end

Private Instance Methods

hp_by_turn() click to toggle source
# File lib/oakdex/battle/status_conditions/burn.rb, line 20
def hp_by_turn
  [-(pokemon.hp / 16).to_i, -1].min
end