class Gemwarrior::Creature

Attributes

atk_hi[RW]
atk_lo[RW]
defense[RW]
dexterity[RW]
face[RW]
hands[RW]
hp_cur[RW]
hp_max[RW]
inventory[RW]
level[RW]
mood[RW]
rox[RW]
speak[R]
use[R]
xp[RW]

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/gemwarrior/entities/creature.rb, line 25
def initialize
  super

  self.name         = 'creature'
  self.name_display = Formatting::upstyle(name)
  self.description  = 'A creature.'
  self.face       = 'face-y'
  self.hands      = 'handsy'
  self.mood       = 'moody'
  self.level      = 1
  self.xp         = 0
  self.hp_cur     = 10
  self.hp_max     = 10
  self.atk_lo     = 1
  self.atk_hi     = 1
  self.defense    = 1
  self.dexterity  = 1
  self.inventory  = Inventory.new
  self.rox        = 0
  self.talkable   = true
  self.used       = false
end

Public Instance Methods

describe() click to toggle source
# File lib/gemwarrior/entities/creature.rb, line 52
def describe
  desc_text = "#{description}".colorize(:white)
  desc_text << "\n"
  desc_text << "The creature has several distinguishing features, as well: face is #{face.colorize(:yellow)}, hands are #{hands.colorize(:yellow)}, and mood is, generally, #{mood.colorize(:yellow)}."
  desc_text
end
describe_detailed() click to toggle source
# File lib/gemwarrior/entities/creature.rb, line 59
def describe_detailed
  desc_text =  "\"#{name_display}\"\n".colorize(:yellow)
  desc_text << "(#{name})\n".colorize(:green)
  desc_text << "#{description}\n".colorize(:white)
  desc_text << "FACE      : #{face}\n".colorize(:white)
  desc_text << "HANDS     : #{hands}\n".colorize(:white)
  desc_text << "MOOD      : #{mood}\n".colorize(:white)
  desc_text << "LEVEL     : #{level}\n".colorize(:white)
  desc_text << "XP        : #{xp}\n".colorize(:white)
  desc_text << "HP        : #{hp_cur}/#{hp_max}\n".colorize(:white)
  desc_text << "ATK_RANGE : #{atk_lo}-#{atk_hi}\n".colorize(:white)
  desc_text << "DEFENSE   : #{defense}\n".colorize(:white)
  desc_text << "DEXTERITY : #{dexterity}\n".colorize(:white)
  desc_text << "ROX       : #{rox}\n".colorize(:white)
  desc_text << "INVENTORY : #{inventory.contents}\n".colorize(:white)
  desc_text
end