From a350bf20a052ccca70a7a9c0313bad2a30daee99 Mon Sep 17 00:00:00 2001 From: wassname Date: Wed, 25 Dec 2019 09:20:44 +0800 Subject: [PATCH] old way of doing actions --- play.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/play.py b/play.py index d9c389d..98441b1 100644 --- a/play.py +++ b/play.py @@ -171,9 +171,16 @@ def play(generator): colPrint('Suggested actions:', colors['selection-value']) action_suggestion_lines = 1 for i in range(settings.getint('action-alternatives')): - # FIXME it might be better to pass in a longer history - action_prompt = story_manager.story_context() # This should be within the loop as it has a random sampling element - action_prompt[-1] += '> ' + # New way + # action_prompt = story_manager.story_context() # This should be within the loop as it has a random sampling element + # action_prompt[-1] += '\n>' + + # # OLD way + action_prompt = ( + story_manager.story.results[-1] + if story_manager.story.results + else "\nWhat do you do now?" + ) + "\n>" logger.debug("action_prompt %s", action_prompt) suggested_action = ai_player.get_action(action_prompt) suggested_actions.append(suggested_action)