Class: Core::Game::Constitution

Inherits:
Object
  • Object
show all
Defined in:
lib/game/constitution.rb

Instance Method Summary collapse

Constructor Details

#initializeConstitution

Returns a new instance of Constitution.



36
37
38
# File 'lib/game/constitution.rb', line 36

def initialize
  @wounds = []
end

Instance Method Details

#update(char) ⇒ Object

this should only be called when needed



40
41
42
43
44
45
46
# File 'lib/game/constitution.rb', line 40

def update(char)
  str = char.strength
  dmg = 0
  @wounds.each { |w|
    dmg += w.severity * w.location_factor
  }
end