Method: Creature#initialize

Defined in:
lib/terminal_hero/classes/creature.rb

#initialize(name, coords, stats, health_lost, level, avatar) ⇒ Creature

Returns a new instance of Creature.



10
11
12
13
14
15
16
17
18
# File 'lib/terminal_hero/classes/creature.rb', line 10

def initialize(name, coords, stats, health_lost, level, avatar)
  @name = name
  @level = level
  @stats = Utils.depth_two_clone(stats)
  @max_hp = calc_max_hp
  @current_hp = @max_hp - health_lost
  @coords = coords
  @avatar = avatar
end