Class: Lich::Gemstone::Bounty
- Inherits:
-
Object
- Object
- Lich::Gemstone::Bounty
- Defined in:
- documented/gemstone/bounty.rb,
documented/gemstone/bounty/task.rb,
documented/gemstone/bounty/parser.rb
Overview
Represents a bounty in the Lich game.
This class is responsible for parsing bounty descriptions and extracting relevant task information.
Defined Under Namespace
Constant Summary collapse
- KNOWN_TASKS =
Parser::TASK_MATCHERS.keys
Class Method Summary collapse
-
.current ⇒ Task
Retrieves the current bounty task.
-
.lnet(person) ⇒ Task?
Retrieves bounty information for a specified person from LNet.
- .task ⇒ Object
Class Method Details
.current ⇒ Task
Retrieves the current bounty task.
17 18 19 |
# File 'documented/gemstone/bounty.rb', line 17 def self.current Task.new(Parser.parse(checkbounty)) end |
.lnet(person) ⇒ Task?
Note:
Returns nil if no bounty information is available.
Retrieves bounty information for a specified person from LNet.
If the person is found, a new Task is created with the bounty data.
31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'documented/gemstone/bounty.rb', line 31 def self.lnet(person) if (target_info = LNet.get_data(person.dup, 'bounty')) Task.new(Parser.parse(target_info)) else if target_info == false text = "No one on LNet with a name like #{person}" else text = "Empty response from LNet for bounty from #{person}\n" end Lich::Messaging.msg("warn", text) nil end end |
.task ⇒ Object
21 22 23 |
# File 'documented/gemstone/bounty.rb', line 21 def self.task current end |