def test_quest(self): s = State({'red': Player()}) q = Quest(Release(Resources(fighters=3)), Supply(Resources(vp=6))) s = actions.run(q.action('red', s)) r = s.players['red'].resources self.assertEqual([r.fighters, r.vp], [-3, 6])
def test_quest_query(self): s = State({'red': OpenPlayer()}, Board(quests=[Quest().name("Reward")])) q = Quest(Release(Resources(fighters=3)), TakeFaceUp(QualityResources(quests=1))) s = actions.feed(q.action('red', s), QuestQuery=[Quest().name("Reward"), Quest().name("New")]) p = s.players['red'] self.assertEqual(p.resources.fighters, -3) self.assertEqual({quest.name for quest in p.quests}, {"Reward"}) self.assertIn("New", {quest.name for quest in s.board.quests})
def test_query_feed(self): quests_on_board = [Quest().name("Reward"), Quest().name("Reward2")] s = State({'red': OpenPlayer(4)}, Board(quests=[Quest().name("Reward"), Quest().name("Reward2")])) q = Quest(TakeFaceUp(QualityResources(quests=2)), DrawFaceDown(QualityResources(intrigues=1))) s = actions.feed(q.action('red', s), QuestQuery=[Quest().name("Reward"), Quest().name("New"), Quest().name("Reward2"), Quest().name("New2")], IntrigueQuery=[NoopIntrigue().name("Reward3")]) p = s.players['red'] self.assertEqual({quest.name for quest in p.quests}, {"Reward", "Reward2"}) self.assertEqual({intrigue.name for intrigue in p.intrigues}, {"Reward3"}) self.assertIn("New", {quest.name for quest in s.board.quests}) self.assertIn("New2", {quest.name for quest in s.board.quests}) pass