diff --git a/sanowret-crystal.lic b/sanowret-crystal.lic index a0c9d6a014..ec23ec091b 100644 --- a/sanowret-crystal.lic +++ b/sanowret-crystal.lic @@ -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 @@ -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