Skip to content

Commit

Permalink
Add things to do while waiting for healing
Browse files Browse the repository at this point in the history
 - performance
 - tome
Minor tweaks to tome.lic to account for being run while safe-room is running:
 - don't make posture changes (sit/stand) while safe-room is running.
  • Loading branch information
vtcifer committed Sep 4, 2024
1 parent 1d6c756 commit b6ab4b9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
6 changes: 6 additions & 0 deletions profiles/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,12 @@ force_healer_town:
safe_room_withdraw_amount: 4_000
# Amount to deposit back in back after healing (only used if force_healer_town is set)
safe_room_keep_bank_amount:
# use performance.lic while waiting for healing / being healed
# assumes you have performance setup properly
performance_while_healing: false
# use tome.lic while waiting for healing / being healed
# assumes you have tome setup properly
tome_while_healing: false

# override the repair location to use instead of hometown
force_repair_town:
Expand Down
16 changes: 16 additions & 0 deletions safe-room.lic
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ class SafeRoom
@health_threshold = settings.saferoom_health_threshold
@withdraw_amount = settings.safe_room_withdraw_amount
@keep_bank_amount = settings.safe_room_keep_bank_amount
@performance_while_healing = settings.performance_while_healing
@stop_performance_after_heal = false
@tome_while_healing = settings.tome_while_healing
@stop_tome_after_heal = false

@plant_regex = /vela'tohr (briar|bush|plant|shrub|thicket|thornbush)/

Expand Down Expand Up @@ -74,6 +78,8 @@ class SafeRoom

DRCM.ensure_copper_on_hand(@withdraw_amount, settings, hometown_name)
wait_at_empath(hometown['npc_empath']['id'])
stop_script('performance') if Script.running?('performance') && @stop_performance_after_heal
stop_script('tome') if Script.running?('tome') && @stop_tome_after_heal
DRC.fix_standing
if (settings.hometown != hometown_name)
bank_amount = DRCM.deposit_coins(0, settings, hometown_name)
Expand Down Expand Up @@ -207,6 +213,16 @@ class SafeRoom
fput("touch #{Regexp.last_match(1)}")
end

# check for safe-room idle thing to do
if @performance_while_healing && !(Script.running?('performance') || Script.running?('play'))
start_script('performance', ['noclean'])
@stop_performance_after_heal = true
end
if @tome_while_healing && !Script.running?('tome')
start_script('tome', ['active'])
@stop_tome_after_heal = true
end

if DRRoom.pcs.empty? || DRRoom.pcs_prone.empty? || Room.current.id == 8393
wait_for_healing
return
Expand Down
6 changes: 3 additions & 3 deletions tome.lic
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ class Tome
def monitor_routine
loop do
if DRSkill.getxp('Scholarship') >= @scholarship_limit && !@passive
DRC.fix_standing
DRC.fix_standing unless Script.running?('safe-room')
exit
end
Flags.reset('study-complete')
if !@passive
DRC.bput('sit', 'You sit', 'You are already sitting', 'You rise', 'While swimming?') unless sitting?
DRC.bput('sit', 'You sit', 'You are already sitting', 'You rise', 'While swimming?') unless sitting? || Script.running?('safe-room')
end

pause 10 until should_train? and DRStats.concentration == 100
Expand Down Expand Up @@ -152,7 +152,7 @@ end

before_dying do
Flags.delete('study-complete')
DRC.fix_standing
DRC.fix_standing unless Script.running?('safe-room')
DRCI.stow_item?(Tome.tome) if !Tome.tome.nil? && DRCI.in_hands?(Tome.tome)
end

Expand Down

0 comments on commit b6ab4b9

Please sign in to comment.