Detect being forced to wake up
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user