Class: Gemwarrior::Item
- Defined in:
- lib/gemwarrior/entities/item.rb
Direct Known Subclasses
Apple, ArenaDoor, Armor, Bed, Bookcase, Bullet, Chest, Couch, Cup, Dehumidifier, Feather, FloorTile, Flower, Herb, Hut, Keystone, Ladder, Letter, Map, MassiveDoor, Pedestal, Pond, Rope, SandJewel, SmallHole, Snowman, SparklyThing, Stonemite, Tent, Throne, Tree, Waterfall, Weapon
Instance Attribute Summary collapse
-
#is_armor ⇒ Object
Returns the value of attribute is_armor.
-
#is_weapon ⇒ Object
Returns the value of attribute is_weapon.
-
#use(world) ⇒ Object
readonly
Returns the value of attribute use.
Attributes inherited from Entity
#consumable, #describe, #description, #display_shopping_cart, #equippable, #equipped, #name, #name_display, #number_of_uses, #takeable, #talkable, #useable, #useable_battle, #used, #used_again
Instance Method Summary collapse
- #describe_detailed ⇒ Object
-
#initialize ⇒ Item
constructor
A new instance of Item.
Methods inherited from Entity
Constructor Details
#initialize ⇒ Item
Returns a new instance of Item.
13 14 15 16 17 18 |
# File 'lib/gemwarrior/entities/item.rb', line 13 def initialize super self.is_armor = false self.is_weapon = false end |
Instance Attribute Details
#is_armor ⇒ Object
Returns the value of attribute is_armor.
8 9 10 |
# File 'lib/gemwarrior/entities/item.rb', line 8 def is_armor @is_armor end |
#is_weapon ⇒ Object
Returns the value of attribute is_weapon.
8 9 10 |
# File 'lib/gemwarrior/entities/item.rb', line 8 def is_weapon @is_weapon end |
#use(world) ⇒ Object (readonly)
Returns the value of attribute use.
11 12 13 |
# File 'lib/gemwarrior/entities/item.rb', line 11 def use @use end |
Instance Method Details
#describe_detailed ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/gemwarrior/entities/item.rb', line 24 def describe_detailed desc_text = "\"#{name_display}\"\n".colorize(:yellow) desc_text << "(#{name})\n".colorize(:green) desc_text << "#{description}\n".colorize(:white) desc_text << "ARMOR? #{is_armor}\n".colorize(:white) desc_text << "WEAPON? #{is_weapon}\n".colorize(:white) desc_text << "TAKEABLE? #{takeable}\n".colorize(:white) desc_text << "USEABLE? #{useable}\n".colorize(:white) desc_text << "TALKABLE? #{talkable}\n".colorize(:white) desc_text << "CONSUMABLE? #{consumable}\n".colorize(:white) desc_text << "EQUIPPABLE? #{equippable}\n".colorize(:white) desc_text << "EQUIPPED? #{equipped}\n".colorize(:white) desc_text << "USED? #{used}\n".colorize(:white) desc_text << "USED AGAIN? #{used_again}\n".colorize(:white) desc_text << "USES LEFT? #{number_of_uses}\n".colorize(:white) unless number_of_uses.nil? desc_text end |