Skip to content

Commit

Permalink
Tweak EV healing to wait longer and catch if the plant withers before…
Browse files Browse the repository at this point in the history
… you finish

Also enable tome/performance while waiting for plant to heal you
  • Loading branch information
vtcifer committed Sep 10, 2024
1 parent 8b425f0 commit d57d41a
Showing 1 changed file with 42 additions and 17 deletions.
59 changes: 42 additions & 17 deletions safe-room.lic
Original file line number Diff line number Diff line change
Expand Up @@ -285,33 +285,58 @@ class SafeRoom
return false unless empath['name']

DRCT.walk_to empath['id']
return false unless DRRoom.pcs.include?(empath['name']) || DRRoom.room_objs.grep(@plant_regex).size > 0

unless DRRoom.pcs.include?(empath)
if /.*vela.tohr (\w+)/ =~ DRRoom.room_objs.grep(@plant_regex).to_s

if !DRRoom.pcs.include?(empath) && /.*vela.tohr (\w+)/ =~ DRRoom.room_objs.grep(@plant_regex).to_s
Flags.add('doneheal',/You sense that this particular .* has healed all that it can.$/,/^The last of your wounds knit shut/)
while /.*vela.tohr (\w+)/ =~ DRRoom.room_objs.grep(@plant_regex).to_s
fput("touch #{Regexp.last_match(1)}")
end
end

if DRRoom.pcs.include?(empath['name'])
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

120.times do
pause 5
break if Flags['doneheal']
end

if !Flags['doneheal'] || Flags['doneheal'].to_s =~ /You sense that this particular .* has healed all that it can.$/
Flags.reset('doneheal')
next
end

stop_script('performance') if Script.running?('performance') && @stop_performance_after_heal
stop_script('tome') if Script.running?('tome') && @stop_tome_after_heal

Flags.delete('doneheal')
return !need_healing?
end
elsif DRRoom.pcs.include?(empath['name'])
if empath['start_heal_action']
fput(empath['start_heal_action'])
else
fput("whisper #{empath['name']} heal")
end
fput("listen to #{empath['name']}")
end

if empath['done_healing_matches'] && empath['done_healing_matches'].is_a?(Array)
Flags.add('doneheal', *empath['done_healing_matches'], /^The last of your wounds knit shut/)
else
Flags.add('doneheal', '"Done!"', 'All set', 'not even injured', 'in good enough shape', 'All better', /^The last of your wounds knit shut/)
end
24.times do
pause 5
break if Flags['doneheal']
if empath['done_healing_matches'] && empath['done_healing_matches'].is_a?(Array)
Flags.add('doneheal',*empath['done_healing_matches'])
else
Flags.add('doneheal', '"Done!"', 'All set', 'not even injured', 'in good enough shape', 'All better')
end
24.times do
pause 5
break if Flags['doneheal']
end
Flags.delete('doneheal')
else
return false
end
Flags.delete('doneheal')

!need_healing?
end
Expand Down

0 comments on commit d57d41a

Please sign in to comment.