From 9aad02c16451fb633d5ecc4cdade7e9b13ff3132 Mon Sep 17 00:00:00 2001 From: Nick Walton Date: Thu, 5 Dec 2019 13:16:14 -0700 Subject: [PATCH] Develop (#14) * various small changes * various small changes * update * update * update * update * update * auto save --- play.py | 6 ++++++ story/story_manager.py | 11 ++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/play.py b/play.py index 04b61ae..b654de3 100644 --- a/play.py +++ b/play.py @@ -97,9 +97,15 @@ def play_aidungeon_2(): tcflush(sys.stdin, TCIFLUSH) action = input("> ") if action == "restart": + rating = input("Please rate the story quality from 1-10: ") + rating_float = float(rating) + story_manager.story.rating = rating_float break elif action == "quit": + rating = input("Please rate the story quality from 1-10: ") + rating_float = float(rating) + story_manager.story.rating = rating_float exit() elif action == "nosaving": diff --git a/story/story_manager.py b/story/story_manager.py index 982ba4b..5cbca84 100644 --- a/story/story_manager.py +++ b/story/story_manager.py @@ -32,13 +32,10 @@ class Story(): def __del__(self): if self.upload_story: - rating = input("Please rate the story quality from 1-10: ") - try: - rating_float = float(rating) - self.rating = rating_float - self.save_to_storage() - except: - pass + self.save_to_storage() + console_print("Game saved.") + console_print("To load the game, type 'load' and enter the following ID: " + self.uuid) + def init_from_dict(self, story_dict): self.story_start = story_dict["story_start"]