class Jewel

Class to interact with gems overwriting Gem is a bad idea

Attributes

quality[RW]
value[RW]

Public Instance Methods

appraise() click to toggle source
# File lib/Olib/objects/jewel.rb, line 6
def appraise
  result = dothistimeout "appraise ##{@id}", 3, /#{Olib::Dictionary.gems[:appraise].values.join('|')}/
  case result
    when Olib::Dictionary.gems[:appraise][:gemshop]
      # handle gemshop appraisal
      @value = $1.to_i
    when Olib::Dictionary.gems[:appraise][:player]
      @value = $3.to_i
      @quality = $2
    when Olib::Dictionary.gems[:appraise][:failure]
      waitrt?
      self.appraise
    else
      respond result
      Client.notify "Error during gem appraisal"
  end
end
normalized_name() click to toggle source
# File lib/Olib/objects/jewel.rb, line 24
def normalized_name
  Olib::Dictionary.gems[:singularize].call(@name)
end
sell() click to toggle source
# File lib/Olib/objects/jewel.rb, line 28
def sell
  result = take
  fput "sell ##{@id}" if result =~ Olib::Dictionary.get[:success]
end