Class: Oakdex::Battle::StatusConditions::Burn

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

Overview

Represents Burn 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, #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/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) ⇒ Object



14
15
16
# File 'lib/oakdex/battle/status_conditions/burn.rb', line 14

def damage_modifier(move_execution)
  move_execution.move.category == 'physical' ? 0.5 : super
end