Sha256: c4ffeeb60bfa57b8a23c1fa8e729454131198f5e5d211782d2dd3a52c094f646

Contents?: true

Size: 1.26 KB

Versions: 25

Compression:

Stored size: 1.26 KB

Contents

# lib/gemwarrior/entities/items/tree.rb
# Entity::Item::Tree

require_relative '../item'

module Gemwarrior
  class Tree < Item
    def initialize
      super

      self.name         = 'tree'
      self.name_display = 'Tree'
      self.description  = 'A mighty representation of nature, older than your father\'s father\'s second great-uncle.'
    end
    
    def use(world)
      if self.used_again
        puts 'The tree, its trunk, and the hole in its side all seem fairly unremarkable to you now.'

        return { type: nil, data: nil }
      elsif self.used
        self.used_again = true

        Audio.play_synth(:uncover_secret)

        puts 'Looking further into the small opening in the trunk your eye catches the light glinting off a few small metallic objects.'

        cur_loc = world.location_by_name('forest-southeast')
        cur_loc.items.push(Bullet.new)
        cur_loc.items.push(Bullet.new)
        cur_loc.items.push(Bullet.new)

        return { type: nil, data: nil }
      else
        self.used = true

        puts 'Taking a passing glance into the only hole in the tree big enough for anything to exist inside, you don\'t quite see anything of value.'

        { type: nil, data: nil }
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
gemwarrior-0.15.20 lib/gemwarrior/entities/items/tree.rb
gemwarrior-0.15.19 lib/gemwarrior/entities/items/tree.rb
gemwarrior-0.15.18 lib/gemwarrior/entities/items/tree.rb
gemwarrior-0.15.17 lib/gemwarrior/entities/items/tree.rb
gemwarrior-0.15.16 lib/gemwarrior/entities/items/tree.rb
gemwarrior-0.15.15 lib/gemwarrior/entities/items/tree.rb
gemwarrior-0.15.14 lib/gemwarrior/entities/items/tree.rb
gemwarrior-0.15.13 lib/gemwarrior/entities/items/tree.rb
gemwarrior-0.15.12 lib/gemwarrior/entities/items/tree.rb
gemwarrior-0.15.11 lib/gemwarrior/entities/items/tree.rb
gemwarrior-0.15.10 lib/gemwarrior/entities/items/tree.rb
gemwarrior-0.15.9 lib/gemwarrior/entities/items/tree.rb
gemwarrior-0.15.8 lib/gemwarrior/entities/items/tree.rb
gemwarrior-0.15.7 lib/gemwarrior/entities/items/tree.rb
gemwarrior-0.15.6 lib/gemwarrior/entities/items/tree.rb
gemwarrior-0.15.5 lib/gemwarrior/entities/items/tree.rb
gemwarrior-0.15.4 lib/gemwarrior/entities/items/tree.rb
gemwarrior-0.15.3 lib/gemwarrior/entities/items/tree.rb
gemwarrior-0.15.2 lib/gemwarrior/entities/items/tree.rb
gemwarrior-0.15.1 lib/gemwarrior/entities/items/tree.rb