Class: Gemwarrior::Gun
- Defined in:
- lib/gemwarrior/entities/items/gun.rb
Instance Attribute Summary
Attributes inherited from Item
#atk_hi, #atk_lo, #equippable, #equipped, #reuse, #takeable, #useable
Attributes inherited from Entity
Instance Method Summary collapse
-
#initialize ⇒ Gun
constructor
A new instance of Gun.
- #use(player = nil) ⇒ Object
Methods inherited from Item
Methods inherited from Entity
Constructor Details
#initialize ⇒ Gun
Returns a new instance of Gun.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/gemwarrior/entities/items/gun.rb', line 8 def initialize self.name = 'gun' self.description = 'Pew pew goes this firearm, you suspect.' self.atk_lo = 3 self.atk_hi = 5 self.takeable = true self.useable = true self.equippable = true self.equipped = false end |
Instance Method Details
#use(player = nil) ⇒ Object
19 20 21 22 |
# File 'lib/gemwarrior/entities/items/gun.rb', line 19 def use(player = nil) puts 'You pull the trigger on the gun, but realize there are no bullets in it. So, it does not do much except cause a barely audible *click* sound.' {:type => nil, :data => nil} end |