Class: Gemwarrior::Weapon
- Defined in:
- lib/gemwarrior/entities/weapon.rb
Instance Attribute Summary collapse
-
#atk_hi ⇒ Object
Returns the value of attribute atk_hi.
-
#atk_lo ⇒ Object
Returns the value of attribute atk_lo.
-
#dex_mod ⇒ Object
Returns the value of attribute dex_mod.
-
#is_weapon ⇒ Object
Returns the value of attribute is_weapon.
Attributes inherited from Item
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 ⇒ Weapon
constructor
A new instance of Weapon.
- #use(world) ⇒ Object
Methods inherited from Entity
Constructor Details
#initialize ⇒ Weapon
Returns a new instance of Weapon.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/gemwarrior/entities/weapon.rb', line 13 def initialize super self.atk_lo = 0 self.atk_hi = 0 self.dex_mod = 0 self.takeable = true self.equippable = true self.is_weapon = true end |
Instance Attribute Details
#atk_hi ⇒ Object
Returns the value of attribute atk_hi.
8 9 10 |
# File 'lib/gemwarrior/entities/weapon.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/weapon.rb', line 8 def atk_lo @atk_lo end |
#dex_mod ⇒ Object
Returns the value of attribute dex_mod.
8 9 10 |
# File 'lib/gemwarrior/entities/weapon.rb', line 8 def dex_mod @dex_mod end |
#is_weapon ⇒ Object
Returns the value of attribute is_weapon.
8 9 10 |
# File 'lib/gemwarrior/entities/weapon.rb', line 8 def is_weapon @is_weapon end |
Instance Method Details
#describe_detailed ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/gemwarrior/entities/weapon.rb', line 28 def describe_detailed desc_text = "\"#{name_display}\"\n".colorize(:yellow) desc_text << "(#{name})\n".colorize(:green) desc_text << "#{description}\n".colorize(:white) desc_text << "WEAPON? #{is_weapon}\n".colorize(:white) desc_text << "ATTACK_RANGE : #{atk_lo}-#{atk_hi}\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 |
#use(world) ⇒ Object
24 25 26 |
# File 'lib/gemwarrior/entities/weapon.rb', line 24 def use(world) 'Save the brrandishing of your weapon for battle.' end |