Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ephemeron option to sanowret-crystal #6915

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions sanowret-crystal.lic
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ class SanowretCrystal
@no_use_scripts = settings.sanowret_no_use_scripts
@no_use_rooms = settings.sanowret_no_use_rooms
@force_exhale = args.exhale || settings.sanowret_force_exhale
@ephemeron = settings.ephemeron
UserVars.ephemera_last_use = Time.now() - 7200 if UserVars.ephemera_last_use.nil? && @ephemeron
check_ephemera if args.run
check_crystal if args.run
passive unless args.run
end
Expand Down Expand Up @@ -74,8 +77,27 @@ class SanowretCrystal
end
end

def check_ephemera
return unless @ephemeron
return if Time.now() - UserVars.ephemera_last_use <= 7200
return if DRSkill.getxp('Arcana') >= 25
return if @no_use_scripts.any? { |name| Script.running?(name) }

case DRC.bput("ephemeron manifest #{@ephemeron}", /^You raise a hand to your neck, calling through your crystalline fibril/, /^That is not an ephemeron currently in your collection/, /^That is not a known ephemeron/, /^Try as you might, your imagination alone cannot conjure such mental figments/, /^You should stop practicing /)
when /^You raise a hand to your neck, calling through your crystalline fibril/
UserVars.ephemera_last_use = Time.now()
pause 5 # Make sure there's enough time for EXP to pulse before considering whether to use a sanowret crystal
when /^That is not an ephemeron currently in your collection/, /^That is not a known ephemeron/, /^Try as you might, your imagination alone cannot conjure such mental figments/
DRC.message("Could not manifest your specified ephemeron: #{@ephemeron}. Please check your YAML setting for 'ephemeron:'.")
@ephemeron = false
when /^You should stop practicing/
UserVars.ephemera_last_use = Time.now() - 7200 + 120
end
end

def passive
loop do
check_ephemera
check_crystal
pause 10
end
Expand Down
Loading