Fix logic bug in the beast's sleep schedule

This commit is contained in:
Howard Abrams 2025-04-15 11:57:24 -07:00
parent c085561157
commit c78859bae3

View file

@ -423,7 +423,7 @@ class BHB(Friendly):
(minute, hour, tod, season) = self.location.get_time() (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 self.db.is_awake = True
else: else:
self.db.is_awake = False self.db.is_awake = False
@ -445,10 +445,12 @@ class BHB(Friendly):
elif minute == 3: elif minute == 3:
msg = f"The {noun} lets loose a big yawn." msg = f"The {noun} lets loose a big yawn."
if self.db.is_awake and self.location == self.global_search('The Cave'): meadow = self.global_search("mp05")
self.execute_cmd("leave") cave = self.global_search("mp07")
elif not self.db.is_awake and self.location == self.global_search('Meadow'): if self.db.is_awake and self.location != meadow:
self.execute_cmd("cave") 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: if msg and self.location:
self.location.msg_contents(msg) self.location.msg_contents(msg)