def test_tri_visual(self): unit = Unit.from_query("kaede2 nao4 rika4u uzuki3 anzu4 kaede2") np.testing.assert_equal( unit.leader_bonuses(), np.array([[0, 200, 0, 0, 0], [0, 200, 0, 0, 0], [0, 200, 0, 0, 0]]).transpose()) unit = Unit.from_query("kaede2 nao4 rika4u uzuki3 anzu4") np.testing.assert_equal( unit.leader_bonuses(), np.array([[0, 100, 0, 0, 0], [0, 100, 0, 0, 0], [0, 100, 0, 0, 0]]).transpose())
def test_2_reso(self): unit = Unit.from_query("sae4 rika4u uzuki1 uzuki3 anzu4 sae4") np.testing.assert_equal( unit.leader_bonuses(), np.array([[-100, 0, -100, 0, 0], [-100, 0, -100, 0, 0], [-100, 0, -100, 0, 0]]).transpose()) unit = Unit.from_query("sae4 rika4u uzuki1 uzuki3 anzu4 karen4") np.testing.assert_equal( unit.leader_bonuses(), np.array([[-100, -100, -100, 0, 0], [-100, -100, -100, 0, 0], [-100, -100, -100, 0, 0]]).transpose())
def test_duo_ens(self): unit = Unit.from_query("kyoko4 uzuki1 kanako1 uzuki3 anzu4 kyoko4") np.testing.assert_equal( unit.leader_bonuses(song_color=Color.CUTE), np.array([[110, 110, 110, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]).transpose()) np.testing.assert_equal( unit.leader_bonuses(song_color=Color.ALL), np.array([[60, 60, 60, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]).transpose())
def test_ens_and_princess(self): unit = Unit.from_query("kyoko4 uzuki1 kanako1 uzuki3 anzu4 uzuki3") np.testing.assert_equal( unit.leader_bonuses(song_color=Color.COOL), np.array([[80, 80, 80, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]).transpose()) np.testing.assert_equal( unit.leader_bonuses(song_color=Color.CUTE), np.array([[105, 105, 105, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]).transpose())
def test_mismatch_ens(self): unit = Unit.from_query("kyoko4 uzuki1 kanako1 uzuki3 anzu4 nao4") np.testing.assert_equal( unit.leader_bonuses(song_color=Color.CUTE), np.array([[55, 55, 55, 0, 0], [30, 30, 30, 0, 0], [0, 0, 0, 0, 0]]).transpose()) np.testing.assert_equal( unit.leader_bonuses(song_color=Color.COOL), np.array([[30, 30, 30, 0, 0], [55, 55, 55, 0, 0], [0, 0, 0, 0, 0]]).transpose())
def test_tri_visual_vocal(self): unit = Unit.from_query("kaede2 rika4u uzuki1 uzuki3 anzu4 rin2") np.testing.assert_equal( unit.leader_bonuses(), np.array([[100, 100, 0, 0, 0], [100, 100, 0, 0, 0], [100, 100, 0, 0, 0]]).transpose())
def test_fail_princess(self): unit = Unit.from_query("uzuki3 nao4 kanako1 uzuki3 anzu4 uzuki3") np.testing.assert_equal( unit.leader_bonuses(), np.array([[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]).transpose())
def test_fail_reso(self): unit = Unit.from_query("sae4 rika4u kaede2 yui2 anzu4 rin2") np.testing.assert_equal( unit.leader_bonuses(), np.array([[100, 0, 0, 0, 0], [100, 0, 0, 0, 0], [100, 0, 0, 0, 0]]).transpose())
sae4 = Card.from_query("sae4", custom_pots=(2, 10, 0, 0, 10)) chieri4 = Card.from_query("chieri4", custom_pots=(0, 10, 9, 0, 10)) yoshino3 = Card.from_query("yoshino3", custom_pots=(8, 10, 0, 0, 10)) rika4 = Card.from_query("rika4", custom_pots=(8, 10, 0, 0, 10)) mio4 = Card.from_query("mio4", custom_pots=(0, 5, 0, 0, 10)) kaede2_guest = Card.from_query("kaede2", custom_pots=(10, 10, 10, 0, 5)) unit = Unit.from_list([sae4, chieri4, yoshino3, rika4, mio4, kaede2_guest]) live = Live() live.set_music(music_name="印象", difficulty=Difficulty.MPLUS) live.set_unit(unit) sim = Simulator(live) assert sim.simulate(times=100, appeals=270000).perfect_score == 1736810 unitA = Unit.from_query("kaede2 chieri4 kyoko4 rika4 rika4u") unitB = Unit.from_query("sae4 kozue2 momoka3 frederica3 sachiko4") unitC = Unit.from_query("atsumi2 anzu3 anzu3u miku4 miku3") gu = GrandUnit(unitA, unitB, unitC) live = GrandLive() live.set_music(music_name="Starry-Go-Round", difficulty=Difficulty.PIANO) live.set_unit(gu) sim = Simulator(live) assert sim.simulate(times=10, appeals=490781).perfect_score == 3424303 unit = Unit.from_query("nao4 yukimi2 haru2 mizuki4 rin2 ranko3", custom_pots=(0, 0, 0, 0, 10)) live = Live() live.set_music(music_name="in fact", difficulty=Difficulty.MPLUS) live.set_unit(unit) sim = Simulator(live)
def test_princess_mismatch(self): unit = Unit.from_query("mio1 mio2 mio3 mio4 rin2") self.assertEqual(unit.get_card(2).skill.probability, 0)
def test_princess_all_passion(self): unit = Unit.from_query("mio1 mio2 mio3 mio4 rika4") self.assertEqual(unit.get_card(2).skill.probability, 8000)
def test_syn_all_passion(self): unit = Unit.from_query("mio1 mio2 mio3 mio4 rika4") self.assertEqual(unit.get_card(4).skill.probability, 0)