Skip to content

Commit

Permalink
Merge pull request #6777 from vtcifer/advisory_check_of_gear_for_wands
Browse files Browse the repository at this point in the history
[wand-watcher.lic] Add an advisory check of wands to ensure there is a listing in gear settings for them
  • Loading branch information
MahtraDR authored Mar 24, 2024
2 parents 61ed989 + 5148d89 commit 0ca4f14
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions wand-watcher.lic
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ class WandWatcher
/^You are in no condition to do that/]
UserVars.wand_watcher_timers = {} if !(UserVars.wand_watcher_timers) || args.reset

# check to ensure wands are defined in gear, and warn user if not
wands_not_in_gear = @wand_list.reject { |wand, _details| settings.gear.find { |item| wand =~ /#{item[:adjective]}\s*#{item[:name]}/i } }
if wands_not_in_gear.size > 0
message = "To minimize the possibility that items that you hold in your hands could be lost they should be listed in your `gear:`. The following wands are not listed in your `gear:` settings:"
message += "\n - #{wands_not_in_gear.collect { |k, _v| k }.join("\n - ")}"
message += "\nIf you need assistance with this, please ask in the lich discord (listed in #{$clean_lich_char}links) for help."
message += "\n\n---This check is *advisory* for now, but will become mandatory in the near future.---"
DRC.message(message)
pause 10
end

# Don't allow users to make foolish mistakes, always prevent use during go2/burgle
@no_use_scripts << 'go2'
@no_use_scripts << 'burgle'
Expand Down

0 comments on commit 0ca4f14

Please sign in to comment.