Fix logic bug in the beast's sleep schedule
This commit is contained in:
parent
c085561157
commit
c78859bae3
1 changed files with 7 additions and 5 deletions
|
|
@ -423,7 +423,7 @@ class BHB(Friendly):
|
|||
|
||||
(minute, hour, tod, season) = self.location.get_time()
|
||||
|
||||
if hour >= wake_hour and hour < sleep_hour and minute > 6:
|
||||
if hour >= wake_hour and hour < sleep_hour:
|
||||
self.db.is_awake = True
|
||||
else:
|
||||
self.db.is_awake = False
|
||||
|
|
@ -445,10 +445,12 @@ class BHB(Friendly):
|
|||
elif minute == 3:
|
||||
msg = f"The {noun} lets loose a big yawn."
|
||||
|
||||
if self.db.is_awake and self.location == self.global_search('The Cave'):
|
||||
self.execute_cmd("leave")
|
||||
elif not self.db.is_awake and self.location == self.global_search('Meadow'):
|
||||
self.execute_cmd("cave")
|
||||
meadow = self.global_search("mp05")
|
||||
cave = self.global_search("mp07")
|
||||
if self.db.is_awake and self.location != meadow:
|
||||
self.move_to(meadow, move_type="traverse")
|
||||
elif not self.db.is_awake and self.location != cave:
|
||||
self.move_to(cave, move_type="traverse")
|
||||
|
||||
if msg and self.location:
|
||||
self.location.msg_contents(msg)
|
||||
|
|
|
|||
Loading…
Reference in a new issue