forked from elanthia-online/lich-5
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
345 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
module DRSpells | ||
@@known_spells = {} | ||
@@known_feats = {} | ||
@@spellbook_format = nil # 'column-formatted' or 'non-column' | ||
|
||
@@grabbing_known_spells = false | ||
|
||
# Use this to silence the initial output | ||
# of calling 'spells' command to populate our data. | ||
@@silence_known_spells_hook = false | ||
|
||
def self.active_spells | ||
XMLData.dr_active_spells | ||
end | ||
|
||
def self.known_spells | ||
@@known_spells | ||
end | ||
|
||
def self.known_feats | ||
@@known_feats | ||
end | ||
|
||
def self.slivers | ||
XMLData.dr_active_spells_slivers | ||
end | ||
|
||
def self.stellar_percentage | ||
XMLData.dr_active_spells_stellar_percentage | ||
end | ||
|
||
def self.grabbing_known_spells | ||
@@grabbing_known_spells | ||
end | ||
|
||
def self.grabbing_known_spells=(val) | ||
@@grabbing_known_spells = val | ||
end | ||
|
||
def self.spellbook_format | ||
@@spellbook_format | ||
end | ||
|
||
def self.spellbook_format=(val) | ||
@@spellbook_format = val | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
class Flags | ||
@@flags = {} | ||
@@matchers = {} | ||
|
||
def self.[](key) | ||
@@flags[key] | ||
end | ||
|
||
def self.[]=(key, value) | ||
@@flags[key] = value | ||
end | ||
|
||
def self.add(key, *matchers) | ||
@@flags[key] = false | ||
@@matchers[key] = matchers.map { |item| item.is_a?(Regexp) ? item : /#{item}/i } | ||
end | ||
|
||
def self.reset(key) | ||
@@flags[key] = false | ||
end | ||
|
||
def self.delete(key) | ||
@@matchers.delete key | ||
@@flags.delete key | ||
end | ||
|
||
def self.flags | ||
@@flags | ||
end | ||
|
||
def self.matchers | ||
@@matchers | ||
end | ||
end |