Skip to content

Commit

Permalink
Merge pull request #6915 from urbaj-dr/patch-27
Browse files Browse the repository at this point in the history
  • Loading branch information
MahtraDR authored Sep 6, 2024
2 parents 5830c69 + cca1f2e commit 8b425f0
Showing 1 changed file with 22 additions and 0 deletions.
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

0 comments on commit 8b425f0

Please sign in to comment.