Class: Gemwarrior::Waterfall

Inherits:
Item show all
Defined in:
lib/gemwarrior/entities/items/waterfall.rb

Instance Attribute Summary

Attributes inherited from Item

#is_armor, #is_weapon

Attributes inherited from Entity

#consumable, #describe, #describe_detailed, #description, #display_shopping_cart, #equippable, #equipped, #name, #name_display, #number_of_uses, #takeable, #talkable, #useable, #useable_battle, #used, #used_again

Instance Method Summary collapse

Methods inherited from Item

#describe_detailed

Methods inherited from Entity

#puts

Constructor Details

#initializeWaterfall

Returns a new instance of Waterfall.



8
9
10
11
12
13
14
# File 'lib/gemwarrior/entities/items/waterfall.rb', line 8

def initialize
  super

  self.name         = 'waterfall'
  self.name_display = 'Waterfall'
  self.description  = 'Gallons of murky, sparkling water fall downward from an unknown spot in the sky, ending in a pool on the ground, yet never overflowing.'
end

Instance Method Details

#use(world) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/gemwarrior/entities/items/waterfall.rb', line 16

def use(world)
  puts 'You stretch out your hand and touch the waterfall. It stings you with its cold and forceful gushing. Your hand is now wet and rougher than before. In time, it will dry.'
  
  dmg = rand(0..1)
  
  puts '>> You lose a hit point.'.colorize(:red) if dmg > 0
  
  { type: 'dmg', data: dmg }
end