Detect being forced to wake up

This commit is contained in:
2021-04-25 00:59:43 +00:00
parent d69f9cf09e
commit 650398255b
2 changed files with 5 additions and 2 deletions

View File

@@ -164,13 +164,16 @@ class SleepWithBedStates:
def sleep_bed(self):
w = self.g.world
p = utils.pint(self.g.pos)
threats = w.find_threats(p, 10)
if threats:
print('Waking up due to threats:')
print(threats)
self.g.game.leave_bed()
self.state = self.cleanup
elif self.g.correction_count:
print('Forcefully woke up')
self.state = self.collect_bed
elif self.g.time < 100:
print('Woke up time')
self.state = self.break_bed