Sha256: a44855b6626969a4e99031ea4ece13c74195c5f9fbcb747e1576ab5f8729ed30
Contents?: true
Size: 866 Bytes
Versions: 3
Compression:
Stored size: 866 Bytes
Contents
# lib/gemwarrior/creature.rb # Creature base class require_relative 'constants' require_relative 'inventory' module Gemwarrior class Creature attr_reader :name, :description def initialize( id, name = 'Creature', face = 'calm', hands = 'smooth', mood = 'happy', level = 1, hp_cur = 10, hp_max = 10, atk_lo = 1, atk_hi = 3, inventory = Inventory.new, rox = 1 ) @id = id @name = name @face = face @hands = hands @mood = mood @level = level @hp_cur = hp_cur @hp_max = hp_max @atk_lo = atk_lo @atk_hi = atk_hi @inventory = inventory @rox = rox end def status puts "The #{name}'s face is #{@face}, hands are #{@hands}, and general mood is #{@mood}." end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
gemwarrior-0.3.1 | lib/gemwarrior/creature.rb |
gemwarrior-0.3.0 | lib/gemwarrior/creature.rb |
gemwarrior-0.2.0 | lib/gemwarrior/creature.rb |