diff --git a/test/drlg_l1_test.cpp b/test/drlg_l1_test.cpp index 2ad4991d6..005f61fdf 100644 --- a/test/drlg_l1_test.cpp +++ b/test/drlg_l1_test.cpp @@ -30,13 +30,16 @@ TEST(Drlg_l1, DRLG_Init_Globals) void TestCreateL5Dungeon(bool hellfire, int level, uint32_t seed, lvl_entry entry) { - pMegaTiles = std::make_unique(1648); - - MyPlayer->pOriginalCathedral = !hellfire; + if (level >= 1 && level <= 4) { + MyPlayer->pOriginalCathedral = !hellfire; + pMegaTiles = std::make_unique(206); + leveltype = DTYPE_CATHEDRAL; + } else if (level >= 21 && level <= 24) { + pMegaTiles = std::make_unique(216); + leveltype = DTYPE_CRYPT; + } currlevel = level; - leveltype = DTYPE_CATHEDRAL; - CreateL5Dungeon(seed, entry); std::string path = paths::BasePath(); @@ -157,4 +160,43 @@ TEST(Drlg_l1, CreateL5Dungeon_hellfire_4_1190318991) EXPECT_EQ(ViewPosition.y, 45); } +TEST(Drlg_l1, CreateL5Dungeon_crypt_1_2122696790) +{ + TestCreateL5Dungeon(true, 21, 2122696790, ENTRY_TWARPUP); + EXPECT_EQ(ViewPosition.x, 61); + EXPECT_EQ(ViewPosition.y, 80); + TestCreateL5Dungeon(true, 21, 2122696790, ENTRY_PREV); + EXPECT_EQ(ViewPosition.x, 53); + EXPECT_EQ(ViewPosition.y, 67); +} + +TEST(Drlg_l1, CreateL5Dungeon_crypt_2_1191662129) +{ + Quests[Q_PWATER]._qactive = QUEST_NOTAVAIL; + + TestCreateL5Dungeon(true, 22, 1191662129, ENTRY_MAIN); + EXPECT_EQ(ViewPosition.x, 71); + EXPECT_EQ(ViewPosition.y, 47); + TestCreateL5Dungeon(true, 22, 1191662129, ENTRY_PREV); + EXPECT_EQ(ViewPosition.x, 85); + EXPECT_EQ(ViewPosition.y, 71); +} + +TEST(Drlg_l1, CreateL5Dungeon_crypt_3_97055268) +{ + TestCreateL5Dungeon(true, 23, 97055268, ENTRY_MAIN); + EXPECT_EQ(ViewPosition.x, 71); + EXPECT_EQ(ViewPosition.y, 57); + TestCreateL5Dungeon(true, 23, 97055268, ENTRY_PREV); + EXPECT_EQ(ViewPosition.x, 81); + EXPECT_EQ(ViewPosition.y, 59); +} + +TEST(Drlg_l1, CreateL5Dungeon_crypt_4_1324803725) +{ + TestCreateL5Dungeon(true, 24, 1324803725, ENTRY_MAIN); + EXPECT_EQ(ViewPosition.x, 79); + EXPECT_EQ(ViewPosition.y, 47); +} + } // namespace diff --git a/test/fixtures/hellfire/21-2122696790.dun b/test/fixtures/hellfire/21-2122696790.dun new file mode 100644 index 000000000..44af7d575 Binary files /dev/null and b/test/fixtures/hellfire/21-2122696790.dun differ diff --git a/test/fixtures/hellfire/22-1191662129.dun b/test/fixtures/hellfire/22-1191662129.dun new file mode 100644 index 000000000..d4a4d9650 Binary files /dev/null and b/test/fixtures/hellfire/22-1191662129.dun differ diff --git a/test/fixtures/hellfire/23-97055268.dun b/test/fixtures/hellfire/23-97055268.dun new file mode 100644 index 000000000..ddbbbe730 Binary files /dev/null and b/test/fixtures/hellfire/23-97055268.dun differ diff --git a/test/fixtures/hellfire/24-1324803725.dun b/test/fixtures/hellfire/24-1324803725.dun new file mode 100644 index 000000000..dc0ede22c Binary files /dev/null and b/test/fixtures/hellfire/24-1324803725.dun differ