Exemplo n.º 1
0
    def initiate_scenario(self):
        if self.progress > self.total_distance():
            self.success = True
            self.experience += 1
            yield 'I made it!'
            return

        self.last_scenario = self.scenario = Scenario.get_random(
            self,
            avoid=self.last_scenario,
        )
        self.delay_next_activity(DELAY_AUTOPLAY)

        yield '{}\n\n{}'.format(
            self.scenario.prompt, '\n'.join(
                ('> {}'.format(a['answer']) for a in self.scenario.answers)))