diff --git a/console_play.py b/console_play.py index 1466206..68746e2 100644 --- a/console_play.py +++ b/console_play.py @@ -50,8 +50,6 @@ def play_constrained(): story_manager = ConstrainedStoryManager(generator) story_manager.start_new_story(prompt, context=context) - console_print("\n") - console_print(str(story_manager.story)) possible_actions = story_manager.get_possible_actions() while (True): console_print("\nOptions:") diff --git a/story/story_manager.py b/story/story_manager.py index 82365ee..cdb3811 100644 --- a/story/story_manager.py +++ b/story/story_manager.py @@ -207,35 +207,14 @@ class ConstrainedStoryManager(StoryManager): class CTRLStoryManager(ConstrainedStoryManager): - def __init__(self, generator, action_verbs_key="anything"): - super().__init__(generator, action_verbs_key) - - def start_new_story(self, story_prompt, game_state=None): - game_state = {"current_room": "lobby"} - super().start_new_story(story_prompt, game_state=game_state) - - return self.story.story_start - - def get_constrained_movement_options(self): - options = {} - options["word_whitelist"] = dict() - options["word_whitelist"][0] = get_ctrl_verbs("movement") - options["word_whitelist"][1] = ["to"] - options["word_whitelist"][2] = ["the"] - options["word_whitelist"][3] = \ - [room for room in get_rooms("haunted_hospital") if room is not self.story.game_state["current_room"]] - options["word_whitelist"][4] = ["and"] - options["word_whitelist"][5] = ["see"] - - return options, 3 def get_action_results_generate(self): results = [] - options, location_pos = self.get_constrained_movement_options() + options = {} for phrase in self.action_phrases: result = self.generate_action_result(self.story_context(), phrase, options=options) - location = result[0].split()[location_pos+1] - options["word_whitelist"][location_pos].remove(location) - + action_verb = result[0].split() + print("blacklisted verb is ", action_verb) + options["word_blacklist"].append(action_verb) results.append(result) return results