Class: Gemwarrior::Item
- Defined in:
- lib/gemwarrior/entities/item.rb
Direct Known Subclasses
Apple, ArenaDoor, ArenaMaster, Bed, Couch, Cup, Dagger, Dehumidifier, Feather, FloorTile, Flower, Gun, Herb, Keystone, Ladder, Letter, Map, MassiveDoor, Opalaser, Pedestal, Pond, Rope, SmallHole, Snowman, SparklyThing, Stalactite, Stone, Stonemite, Tent, Throne, Tree, Waterfall
Instance Attribute Summary collapse
-
#atk_hi ⇒ Object
Returns the value of attribute atk_hi.
-
#atk_lo ⇒ Object
Returns the value of attribute atk_lo.
-
#consumable ⇒ Object
Returns the value of attribute consumable.
-
#equippable ⇒ Object
Returns the value of attribute equippable.
-
#equipped ⇒ Object
Returns the value of attribute equipped.
-
#takeable ⇒ Object
Returns the value of attribute takeable.
-
#use(inventory = nil) ⇒ Object
Returns the value of attribute use.
-
#useable ⇒ Object
Returns the value of attribute useable.
-
#used ⇒ Object
Returns the value of attribute used.
Attributes inherited from Entity
Instance Method Summary collapse
Methods inherited from Entity
Instance Attribute Details
#atk_hi ⇒ Object
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_lo ⇒ Object
Returns the value of attribute atk_lo.
8 9 10 |
# File 'lib/gemwarrior/entities/item.rb', line 8 def atk_lo @atk_lo end |
#consumable ⇒ Object
Returns the value of attribute consumable.
8 9 10 |
# File 'lib/gemwarrior/entities/item.rb', line 8 def consumable @consumable end |
#equippable ⇒ Object
Returns the value of attribute equippable.
8 9 10 |
# File 'lib/gemwarrior/entities/item.rb', line 8 def equippable @equippable end |
#equipped ⇒ Object
Returns the value of attribute equipped.
8 9 10 |
# File 'lib/gemwarrior/entities/item.rb', line 8 def equipped @equipped end |
#takeable ⇒ Object
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 |
#useable ⇒ Object
Returns the value of attribute useable.
8 9 10 |
# File 'lib/gemwarrior/entities/item.rb', line 8 def useable @useable end |
#used ⇒ Object
Returns the value of attribute used.
8 9 10 |
# File 'lib/gemwarrior/entities/item.rb', line 8 def used @used end |
Instance Method Details
#describe ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/gemwarrior/entities/item.rb', line 22 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 |