Class: Core::Game::Constitution
Instance Method Summary collapse
-
#initialize ⇒ Constitution
constructor
A new instance of Constitution.
-
#update(char) ⇒ Object
this should only be called when needed.
Constructor Details
#initialize ⇒ Constitution
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 |