Class: Jewel
- Inherits:
-
Olib::Item
- Object
- Olib::Gameobj_Extender
- Olib::Item
- Jewel
- Defined in:
- lib/Olib/objects/jewel.rb
Overview
Class to interact with gems overwriting Gem is a bad idea
Constant Summary
Constants inherited from Olib::Item
Olib::Item::SOLD, Olib::Item::TYPES, Olib::Item::WORTHLESS, Olib::Item::WRONG_SHOP
Instance Attribute Summary collapse
-
#quality ⇒ Object
Returns the value of attribute quality.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Olib::Item
Attributes inherited from Olib::Gameobj_Extender
Instance Method Summary collapse
Methods inherited from Olib::Item
#==, #_drag, #_inspect, #acquire_from_shop, #action, #add, #affordable?, #analyze, #buy, #buyable?, #cost, #crawl, #define, #drop, #exists?, #give, #has?, #in, #initialize, #is?, #look, #missing?, #price, #pull, #pullable?, #read, #remove, #shake, #shop_sell, #stash, #tag, #tags, #take, #tap, #to_s, #turn, type_methods, #untag, #use, #wear, #worn?
Methods inherited from Olib::Gameobj_Extender
#__extend__, #at, #echo, #initialize
Constructor Details
This class inherits a constructor from Olib::Item
Instance Attribute Details
#quality ⇒ Object
Returns the value of attribute quality.
4 5 6 |
# File 'lib/Olib/objects/jewel.rb', line 4 def quality @quality end |
#value ⇒ Object
Returns the value of attribute value.
4 5 6 |
# File 'lib/Olib/objects/jewel.rb', line 4 def value @value end |
Instance Method Details
#appraise ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# 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 ⇒ Object
24 25 26 |
# File 'lib/Olib/objects/jewel.rb', line 24 def normalized_name Olib::Dictionary.gems[:singularize].call(@name) end |
#sell ⇒ Object
28 29 30 31 |
# File 'lib/Olib/objects/jewel.rb', line 28 def sell result = take fput "sell ##{@id}" if result =~ Olib::Dictionary.get[:success] end |