Class: Gemwarrior::Item

Inherits:
Entity
  • Object
show all
Defined in:
lib/gemwarrior/entities/item.rb

Instance Attribute Summary collapse

Attributes inherited from Entity

#description, #name

Instance Method Summary collapse

Methods inherited from Entity

#status

Instance Attribute Details

#atk_hiObject

Returns the value of attribute atk_hi.



8
9
10
# File 'lib/gemwarrior/entities/item.rb', line 8

def atk_hi
  @atk_hi
end

#atk_loObject

Returns the value of attribute atk_lo.



8
9
10
# File 'lib/gemwarrior/entities/item.rb', line 8

def atk_lo
  @atk_lo
end

#equippableObject

Returns the value of attribute equippable.



8
9
10
# File 'lib/gemwarrior/entities/item.rb', line 8

def equippable
  @equippable
end

#equippedObject

Returns the value of attribute equipped.



8
9
10
# File 'lib/gemwarrior/entities/item.rb', line 8

def equipped
  @equipped
end

#reuseObject

Returns the value of attribute reuse.



8
9
10
# File 'lib/gemwarrior/entities/item.rb', line 8

def reuse
  @reuse
end

#takeableObject

Returns the value of attribute takeable.



8
9
10
# File 'lib/gemwarrior/entities/item.rb', line 8

def takeable
  @takeable
end

#use(inventory = nil) ⇒ Object

Returns the value of attribute use.



8
9
10
# File 'lib/gemwarrior/entities/item.rb', line 8

def use
  @use
end

#useableObject

Returns the value of attribute useable.



8
9
10
# File 'lib/gemwarrior/entities/item.rb', line 8

def useable
  @useable
end

Instance Method Details

#describeObject



21
22
23
24
25
26
27
28
29
# File 'lib/gemwarrior/entities/item.rb', line 21

def describe
  status_text =  name.upcase.colorize(:green)
  status_text << "\n#{description} \n".colorize(:white)
  status_text << "ATTACK: #{atk_lo.to_s.rjust(2)}-#{atk_hi.to_s.rjust(2)} ".colorize(:white) unless atk_lo.nil?
  status_text << "TAKEABLE? #{takeable} ".colorize(:white)
  status_text << "USEABLE? #{useable} ".colorize(:white)
  status_text << "EQUIPPABLE? #{equippable} ".colorize(:white)
  status_text << "\n"
end