From e5e14bedcd7c77d817bc805bd570218eb7e7028b Mon Sep 17 00:00:00 2001 From: Chris Proctor Date: Wed, 12 Jul 2023 14:03:16 -0400 Subject: [PATCH] Bugfix --- return_to_ship.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/return_to_ship.py b/return_to_ship.py index 098be0c..b7c196a 100644 --- a/return_to_ship.py +++ b/return_to_ship.py @@ -19,14 +19,13 @@ FORGOT_BAG = [ ] LOST_TREASURE = [ "You are swimming as fast as you can towards the boat but you can feel the water begin to pull you back as the sea monster opens its giant mouth. You kick with all your might, sure that you are about to breath your last breath.", - "", "Suddenly... The treasure bag slips out of your hand!", "It swirls down through the water and into the mouth of the sea monster. The beast's mouth snaps closed and it jets away into the depth of the ocean, taking with it the treasure. You are safe... but will you attempt the dive again?" ] VICTORY = [ "You are swimming as fast as you can towards the boat but you can feel the water begin to pull you back as the sea monster opens its giant mouth. You kick with all your might, sure that you are about to breathe your last breath." - "", - "Suddenly... A hand appears! You've made it to the boat! The crew pulls you into the boat, just in time to avoid the sea monster's vicious maw. You're safe at last! Now you can finally show off the treasure you risked your life for... Use `open treasure.jpg` to take a peek." + "Suddenly... A hand appears! You've made it to the boat! The crew pulls you into the boat, just in time to avoid the sea monster's vicious maw. You're safe at last! Now you can finally show off the treasure you risked your life for... Use `open bag/treasure.jpg` to take a peek.", + "Congratulations! You have completed the Terminal Adventure." ] def reset(): @@ -45,9 +44,9 @@ def treasure_is_present(): def time_since_chest_was_opened(): if chest_was_opened(): - treasure_opened_time = datetime.fromisoformat(Path(CHEST_TIMER_FILE).read()) + treasure_opened_time = datetime.fromisoformat(Path(CHEST_TIMER_FILE).read_text()) elapsed_time = datetime.now() - treasure_opened_time - return elapsed_time + return elapsed_time.seconds else: return 0