Esempio n. 1
0
    def quest_test_method(self):
        from questgen.selectors import Selector

        from the_tale.game.quests import logic
        from the_tale.game.quests import uids

        knowledge_base = logic.get_knowledge_base(
            logic.create_hero_info(self.hero))

        qb = QuestsBase()
        qb += [q.quest_class for q in quests]

        selector = Selector(knowledge_base, qb)

        hero_uid = uids.hero(self.hero.id)

        quests_facts = selector.create_quest_from_place(
            nesting=0,
            initiator_position=selector.place_for(objects=(hero_uid, )),
            allowed=[quest.quest_class.TYPE],
            excluded=[],
            tags=('can_start', ))

        knowledge_base += quests_facts

        self.check_quest(knowledge_base)
Esempio n. 2
0
    def quest_test_method(self):
        from questgen.selectors import Selector

        from the_tale.game.quests import logic
        from the_tale.game.quests import uids

        knowledge_base = logic.get_knowledge_base(logic.create_hero_info(self.hero))

        qb = QuestsBase()
        qb += [q.quest_class for q in quests]

        selector = Selector(knowledge_base, qb)

        hero_uid = uids.hero(self.hero.id)

        quests_facts = selector.create_quest_from_place(nesting=0,
                                                        initiator_position=selector.place_for(objects=(hero_uid,)),
                                                        allowed=[quest.quest_class.TYPE],
                                                        excluded=[],
                                                        tags=('can_start',))

        knowledge_base += quests_facts

        self.check_quest(knowledge_base)