Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions profiles/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ buff_nonspells:
dance_actions_stealth:
thanatology:
necro_force_safe_room: false
necro_safe_room_use_devour: false
necromancer_healing:
wound_level_threshold: 1 # 1 - 8
zombie:
Expand Down
32 changes: 31 additions & 1 deletion safe-room.lic
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
Documentation: https://elanthipedia.play.net/Lich_script_repository#safe-room
=end

custom_require.call(%w[common common-healing common-money common-travel drinfomon events])
custom_require.call(%w[common common-arcana common-healing common-money common-travel drinfomon events])

class SafeRoom
include DRC
include DRCH
include DRCM
include DRCT
include DRCA

def initialize
arg_definitions = [
Expand Down Expand Up @@ -40,6 +41,8 @@ class SafeRoom
hometown = town_data[settings.hometown]
wait_at_empath(hometown['npc_empath']['id'])
fix_standing
elsif settings.necro_safe_room_use_devour
devour_healing(settings)
end

give_and_take(settings.safe_room_id, settings.safe_room_give, settings.safe_room_take)
Expand All @@ -63,6 +66,33 @@ class SafeRoom
score > @health_threshold
end

def devour_healing(settings)
return unless settings.necromancer_healing['Devour']
return unless settings.thanatology['harvest_container']

walk_to(settings.safe_room)
release_invisibility
devours = count_items_in_container('material', settings.thanatology['harvest_container'])
return if devours.zero?

stow_hands
return if right_hand

while need_healing? && devours > 0
while mana < 40
echo('Waiting on mana...')
pause 10
end

result = bput("get material in my #{settings.thanatology['harvest_container']}", 'You get', 'You are already', 'What were you') unless right_hand
break if result =~ 'What were you'
cast_spell(settings.necromancer_healing['Devour'], settings)
devours -= 1 unless right_hand
end

bput("put my material in my #{settings.thanatology['harvest_container']}", 'You put', 'What were') if right_hand
end

def check_idle
return unless Flags['idle']

Expand Down
14 changes: 14 additions & 0 deletions validate.lic
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,20 @@ class DRYamlValidator
error("thanatology['ritual_type']: '#{settings.thanatology['ritual_type']}' is invalid, only [preserve, harvest, fetish, cut, dissect, consume, arise, and cycle] are supported at this time.")
end

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth adding a validator for the case in which the user has thanatology['store'] = false but necro_safe_room_use_material: true?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, good call.

def assert_that_safe_room_necro_has_valid_container(settings)
return unless settings.necro_safe_room_use_material
return if settings.necromancer_healing['Devour'] && settings.thanatology['harvest_container']

error('Safe room necromancer healing requires the use of devour listed under necromancer_healing and a harvest_container listed under thanatology.')
end

def assert_that_safe_room_necro_is_storing_material(settings)
return unless settings.necro_safe_room_use_material
return unless settings.necromancer_healing['Devour'] && settings.thanatology['store'] == false

error('Safe room necromancer healing requires material on hand to use. You are not storing material and will eventually run out. This needs to be true to be fully functional, long term.')
end

def assert_that_cyclic_training_spells_are_defined(settings)
return unless settings.cyclic_cycle_skills

Expand Down