Module: Lich::Gemstone::Currency
- Defined in:
- documented/gemstone/currency.rb
Overview
Access character currency holdings including silver, notes, and specialty scrips.
All accessor methods query Infomon's cached wealth data; use the refresh: parameter
or explicit refresh methods to send WEALTH commands to the game server.
Class Method Summary collapse
-
.aevit ⇒ Integer?
Returns the character's aevit balance, as WEALTH last reported it.
-
.blackscrip ⇒ Integer?
Returns the character's blackscrip balance, as WEALTH last reported it.
-
.bloodscrip ⇒ Integer?
Returns the character's bloodscrip balance, as WEALTH last reported it.
-
.elans ⇒ Integer?
Returns the character's elan balance, as WEALTH last reported it.
-
.ethereal_scrip ⇒ Integer?
Returns the character's ethereal scrip balance, as WEALTH last reported it.
-
.gemstone_dust ⇒ Integer?
Returns the character's gemstone dust balance, as WEALTH ALL last reported it.
-
.gigas_artifact_fragments ⇒ Integer?
Returns the character's gigas artifact fragment balance, as WEALTH ALL last reported it.
-
.gold ⇒ Integer?
Returns the character's gold balance, as WEALTH last reported it.
-
.notes(refresh: false) ⇒ Integer?
Total value of accessible bank notes, from WEALTH NOTES.
-
.raikhen ⇒ Integer?
Returns the character's raikhen balance, as WEALTH last reported it.
-
.redsteel_marks ⇒ Integer?
Returns the character's redsteel mark balance, as WEALTH RICH last reported it.
-
.refresh(all: false) ⇒ Integer?
Send WEALTH so Infomon re-reads the silver carried (WEALTH is quiet by default; LOUD is the option that echoes to the room).
-
.refresh_notes ⇒ Integer?
Send WEALTH NOTES so Infomon re-reads the note total.
-
.silver(refresh: false) ⇒ Integer?
Silver carried, as Infomon last saw it.
-
.silver_container ⇒ Integer?
Silver stored in worn containers, as WEALTH last reported it.
-
.silver_total(refresh: false) ⇒ Integer?
Carried plus container silver, the "carrying a total of" line.
-
.soul_shards ⇒ Integer?
Returns the character's soul shard balance, as WEALTH last reported it.
-
.tickets ⇒ Integer?
Returns the character's ticket balance, as WEALTH last reported it.
Class Method Details
.aevit ⇒ Integer?
Returns the character's aevit balance, as WEALTH last reported it.
126 127 128 |
# File 'documented/gemstone/currency.rb', line 126 def self.aevit Lich::Gemstone::Infomon.get('currency.aevit') end |
.blackscrip ⇒ Integer?
Returns the character's blackscrip balance, as WEALTH last reported it.
84 85 86 |
# File 'documented/gemstone/currency.rb', line 84 def self.blackscrip Lich::Gemstone::Infomon.get('currency.blackscrip') end |
.bloodscrip ⇒ Integer?
Returns the character's bloodscrip balance, as WEALTH last reported it.
91 92 93 |
# File 'documented/gemstone/currency.rb', line 91 def self.bloodscrip Lich::Gemstone::Infomon.get('currency.bloodscrip') end |
.elans ⇒ Integer?
Returns the character's elan balance, as WEALTH last reported it.
112 113 114 |
# File 'documented/gemstone/currency.rb', line 112 def self.elans Lich::Gemstone::Infomon.get('currency.elans') end |
.ethereal_scrip ⇒ Integer?
Returns the character's ethereal scrip balance, as WEALTH last reported it.
98 99 100 |
# File 'documented/gemstone/currency.rb', line 98 def self.ethereal_scrip Lich::Gemstone::Infomon.get('currency.ethereal_scrip') end |
.gemstone_dust ⇒ Integer?
Returns the character's gemstone dust balance, as WEALTH ALL last reported it.
149 150 151 |
# File 'documented/gemstone/currency.rb', line 149 def self.gemstone_dust Lich::Gemstone::Infomon.get('currency.gemstone_dust') end |
.gigas_artifact_fragments ⇒ Integer?
Returns the character's gigas artifact fragment balance, as WEALTH ALL last reported it.
141 142 143 |
# File 'documented/gemstone/currency.rb', line 141 def self.gigas_artifact_fragments Lich::Gemstone::Infomon.get('currency.gigas_artifact_fragments') end |
.gold ⇒ Integer?
Returns the character's gold balance, as WEALTH last reported it.
133 134 135 |
# File 'documented/gemstone/currency.rb', line 133 def self.gold Lich::Gemstone::Infomon.get('currency.gold') end |
.notes(refresh: false) ⇒ Integer?
Total value of accessible bank notes, from WEALTH NOTES.
54 55 56 57 |
# File 'documented/gemstone/currency.rb', line 54 def self.notes(refresh: false) refresh_notes if refresh Lich::Gemstone::Infomon.get('currency.notes') end |
.raikhen ⇒ Integer?
Returns the character's raikhen balance, as WEALTH last reported it.
105 106 107 |
# File 'documented/gemstone/currency.rb', line 105 def self.raikhen Lich::Gemstone::Infomon.get('currency.raikhen') end |
.redsteel_marks ⇒ Integer?
Returns the character's redsteel mark balance, as WEALTH RICH last reported it.
70 71 72 |
# File 'documented/gemstone/currency.rb', line 70 def self.redsteel_marks Lich::Gemstone::Infomon.get('currency.redsteel_marks') end |
.refresh(all: false) ⇒ Integer?
Send WEALTH so Infomon re-reads the silver carried (WEALTH is quiet by default; LOUD is the option that echoes to the room). The response is parsed on the game thread before hooks run, so hiding it from the front end does not hide it from Infomon.
29 30 31 32 |
# File 'documented/gemstone/currency.rb', line 29 def self.refresh(all: false) Lich::Util.issue_command(all ? 'wealth all' : 'wealth', Lich::Gemstone::Infomon::Parser::Pattern::WealthSilver, silent: true, quiet: true) Lich::Gemstone::Infomon.get('currency.silver') end |
.refresh_notes ⇒ Integer?
Send WEALTH NOTES so Infomon re-reads the note total.
62 63 64 65 |
# File 'documented/gemstone/currency.rb', line 62 def self.refresh_notes Lich::Util.issue_command('wealth notes', /^Listing accessible bank notes/, /^Total note value:/, silent: true, quiet: true) Lich::Gemstone::Infomon.get('currency.notes') end |
.silver(refresh: false) ⇒ Integer?
Silver carried, as Infomon last saw it. Infomon updates it whenever a
WEALTH or INFO response goes by, so the value is only as fresh as the
last of those; pass refresh: true to send WEALTH QUIET first.
16 17 18 19 |
# File 'documented/gemstone/currency.rb', line 16 def self.silver(refresh: false) self.refresh if refresh Lich::Gemstone::Infomon.get('currency.silver') end |
.silver_container ⇒ Integer?
Silver stored in worn containers, as WEALTH last reported it.
37 38 39 |
# File 'documented/gemstone/currency.rb', line 37 def self.silver_container Lich::Gemstone::Infomon.get('currency.silver_container') end |
.silver_total(refresh: false) ⇒ Integer?
Carried plus container silver, the "carrying a total of" line.
45 46 47 48 |
# File 'documented/gemstone/currency.rb', line 45 def self.silver_total(refresh: false) self.refresh if refresh Lich::Gemstone::Infomon.get('currency.silver_total') end |