Method: Creature#initialize
- Defined in:
- lib/Olib/combat/creature.rb
#initialize(creature) ⇒ Creature
Returns a new instance of Creature.
71 72 73 74 75 76 77 78 79 80 |
# File 'lib/Olib/combat/creature.rb', line 71 def initialize(creature) @id = creature.id @name = creature.name @wounds = {} = ((creature.type || "").gsub(",", " ").split(" ") + (["tags"] || []) ).map(&:to_sym) TAGS.each_pair do |tag, pattern| << tag if @name =~ pattern end heal end |