Browse Source

Correct missing hellfire level mapping in leveltype

Hellfire never added the 2 new dungion types, instead it makes
additional checks on currlevel. This is confusing and mess, so cleaned
it up.
pull/4561/head
Anders Jenbo 4 years ago
parent
commit
0645d9b2a1
  1. 12
      Source/automap.cpp
  2. 83
      Source/diablo.cpp
  3. 20
      Source/gamemenu.cpp
  4. 20
      Source/gendung.cpp
  5. 8
      Source/interfac.cpp
  6. 97
      Source/loadsave.cpp
  7. 17
      Source/menu.cpp
  8. 2
      Source/monster.cpp
  9. 6
      Source/multi.cpp
  10. 337
      Source/objdat.cpp
  11. 24
      Source/objdat.h
  12. 733
      Source/objects.cpp
  13. 13
      Source/objects.h
  14. 2
      Source/player.cpp
  15. 6
      Source/sound.cpp
  16. 14
      Source/sound.h
  17. 108
      Source/themes.cpp
  18. 2
      Source/trigs.cpp

12
Source/automap.cpp

@ -537,17 +537,17 @@ std::unique_ptr<AutomapTile[]> LoadAutomapData(size_t &tileCount)
{
switch (leveltype) {
case DTYPE_CATHEDRAL:
if (currlevel < 21)
return LoadFileInMem<AutomapTile>("Levels\\L1Data\\L1.AMP", &tileCount);
return LoadFileInMem<AutomapTile>("NLevels\\L5Data\\L5.AMP", &tileCount);
return LoadFileInMem<AutomapTile>("Levels\\L1Data\\L1.AMP", &tileCount);
case DTYPE_CATACOMBS:
return LoadFileInMem<AutomapTile>("Levels\\L2Data\\L2.AMP", &tileCount);
case DTYPE_CAVES:
if (currlevel < 17)
return LoadFileInMem<AutomapTile>("Levels\\L3Data\\L3.AMP", &tileCount);
return LoadFileInMem<AutomapTile>("NLevels\\L6Data\\L6.AMP", &tileCount);
return LoadFileInMem<AutomapTile>("Levels\\L3Data\\L3.AMP", &tileCount);
case DTYPE_HELL:
return LoadFileInMem<AutomapTile>("Levels\\L4Data\\L4.AMP", &tileCount);
case DTYPE_NEST:
return LoadFileInMem<AutomapTile>("NLevels\\L6Data\\L6.AMP", &tileCount);
case DTYPE_CRYPT:
return LoadFileInMem<AutomapTile>("NLevels\\L5Data\\L5.AMP", &tileCount);
default:
return nullptr;
}

83
Source/diablo.cpp

@ -1079,17 +1079,10 @@ void LoadLvlGFX()
pSpecialCels = LoadCel("Levels\\TownData\\TownS.CEL", SpecialCelWidth);
break;
case DTYPE_CATHEDRAL:
if (currlevel < 21) {
pDungeonCels = LoadFileInMem("Levels\\L1Data\\L1.CEL");
pMegaTiles = LoadFileInMem<MegaTile>("Levels\\L1Data\\L1.TIL");
pLevelPieces = LoadFileInMem<uint16_t>("Levels\\L1Data\\L1.MIN");
pSpecialCels = LoadCel("Levels\\L1Data\\L1S.CEL", SpecialCelWidth);
} else {
pDungeonCels = LoadFileInMem("NLevels\\L5Data\\L5.CEL");
pMegaTiles = LoadFileInMem<MegaTile>("NLevels\\L5Data\\L5.TIL");
pLevelPieces = LoadFileInMem<uint16_t>("NLevels\\L5Data\\L5.MIN");
pSpecialCels = LoadCel("NLevels\\L5Data\\L5S.CEL", SpecialCelWidth);
}
pDungeonCels = LoadFileInMem("Levels\\L1Data\\L1.CEL");
pMegaTiles = LoadFileInMem<MegaTile>("Levels\\L1Data\\L1.TIL");
pLevelPieces = LoadFileInMem<uint16_t>("Levels\\L1Data\\L1.MIN");
pSpecialCels = LoadCel("Levels\\L1Data\\L1S.CEL", SpecialCelWidth);
break;
case DTYPE_CATACOMBS:
pDungeonCels = LoadFileInMem("Levels\\L2Data\\L2.CEL");
@ -1098,15 +1091,9 @@ void LoadLvlGFX()
pSpecialCels = LoadCel("Levels\\L2Data\\L2S.CEL", SpecialCelWidth);
break;
case DTYPE_CAVES:
if (currlevel < 17) {
pDungeonCels = LoadFileInMem("Levels\\L3Data\\L3.CEL");
pMegaTiles = LoadFileInMem<MegaTile>("Levels\\L3Data\\L3.TIL");
pLevelPieces = LoadFileInMem<uint16_t>("Levels\\L3Data\\L3.MIN");
} else {
pDungeonCels = LoadFileInMem("NLevels\\L6Data\\L6.CEL");
pMegaTiles = LoadFileInMem<MegaTile>("NLevels\\L6Data\\L6.TIL");
pLevelPieces = LoadFileInMem<uint16_t>("NLevels\\L6Data\\L6.MIN");
}
pDungeonCels = LoadFileInMem("Levels\\L3Data\\L3.CEL");
pMegaTiles = LoadFileInMem<MegaTile>("Levels\\L3Data\\L3.TIL");
pLevelPieces = LoadFileInMem<uint16_t>("Levels\\L3Data\\L3.MIN");
pSpecialCels = LoadCel("Levels\\L1Data\\L1S.CEL", SpecialCelWidth);
break;
case DTYPE_HELL:
@ -1115,6 +1102,18 @@ void LoadLvlGFX()
pLevelPieces = LoadFileInMem<uint16_t>("Levels\\L4Data\\L4.MIN");
pSpecialCels = LoadCel("Levels\\L2Data\\L2S.CEL", SpecialCelWidth);
break;
case DTYPE_NEST:
pDungeonCels = LoadFileInMem("NLevels\\L6Data\\L6.CEL");
pMegaTiles = LoadFileInMem<MegaTile>("NLevels\\L6Data\\L6.TIL");
pLevelPieces = LoadFileInMem<uint16_t>("NLevels\\L6Data\\L6.MIN");
pSpecialCels = LoadCel("Levels\\L1Data\\L1S.CEL", SpecialCelWidth);
break;
case DTYPE_CRYPT:
pDungeonCels = LoadFileInMem("NLevels\\L5Data\\L5.CEL");
pMegaTiles = LoadFileInMem<MegaTile>("NLevels\\L5Data\\L5.TIL");
pLevelPieces = LoadFileInMem<uint16_t>("NLevels\\L5Data\\L5.MIN");
pSpecialCels = LoadCel("NLevels\\L5Data\\L5S.CEL", SpecialCelWidth);
break;
default:
app_fatal("LoadLvlGFX");
}
@ -1142,43 +1141,34 @@ void CreateLevel(lvl_entry lvldir)
case DTYPE_TOWN:
CreateTown(lvldir);
InitTownTriggers();
LoadRndLvlPal(DTYPE_TOWN);
break;
case DTYPE_CATHEDRAL:
case DTYPE_CRYPT:
CreateL5Dungeon(glSeedTbl[currlevel], lvldir);
InitL1Triggers();
Freeupstairs();
if (currlevel < 21) {
LoadRndLvlPal(DTYPE_CATHEDRAL);
} else {
LoadRndLvlPal(DTYPE_CRYPT);
}
break;
case DTYPE_CATACOMBS:
CreateL2Dungeon(glSeedTbl[currlevel], lvldir);
InitL2Triggers();
Freeupstairs();
LoadRndLvlPal(DTYPE_CATACOMBS);
break;
case DTYPE_CAVES:
case DTYPE_NEST:
CreateL3Dungeon(glSeedTbl[currlevel], lvldir);
InitL3Triggers();
Freeupstairs();
if (currlevel < 17) {
LoadRndLvlPal(DTYPE_CAVES);
} else {
LoadRndLvlPal(DTYPE_NEST);
}
break;
case DTYPE_HELL:
CreateL4Dungeon(glSeedTbl[currlevel], lvldir);
InitL4Triggers();
Freeupstairs();
LoadRndLvlPal(DTYPE_HELL);
break;
default:
app_fatal("CreateLevel");
}
LoadRndLvlPal(leveltype);
}
void UnstuckChargers()
@ -2054,11 +2044,7 @@ void DisableInputWndProc(uint32_t uMsg, int32_t /*wParam*/, int32_t lParam)
void LoadGameLevel(bool firstflag, lvl_entry lvldir)
{
_music_id neededTrack;
if (currlevel >= 17)
neededTrack = currlevel > 20 ? TMUSIC_L5 : TMUSIC_L6;
else
neededTrack = static_cast<_music_id>(leveltype);
_music_id neededTrack = static_cast<_music_id>(leveltype);
if (neededTrack != sgnMusicTrack)
music_stop();
@ -2167,8 +2153,7 @@ void LoadGameLevel(bool firstflag, lvl_entry lvldir)
IncProgress();
InitMonsters();
InitItems();
if (currlevel < 17)
CreateThemeRooms();
CreateThemeRooms();
IncProgress();
[[maybe_unused]] uint32_t mid3Seed = GetLCGEngineState();
InitMissiles();
@ -2352,16 +2337,18 @@ void diablo_color_cyc_logic()
if (PauseMode != 0)
return;
if (leveltype == DTYPE_HELL) {
if (leveltype == DTYPE_CAVES) {
if (setlevel && setlvlnum == Quests[Q_PWATER]._qslvl) {
UpdatePWaterPalette();
} else {
palette_update_caves();
}
} else if (leveltype == DTYPE_HELL) {
lighting_color_cycling();
} else if (currlevel >= 21) {
palette_update_crypt();
} else if (currlevel >= 17) {
} else if (leveltype == DTYPE_NEST) {
palette_update_hive();
} else if (setlevel && setlvlnum == Quests[Q_PWATER]._qslvl) {
UpdatePWaterPalette();
} else if (leveltype == DTYPE_CAVES) {
palette_update_caves();
} else if (leveltype == DTYPE_CRYPT) {
palette_update_crypt();
}
}

20
Source/gamemenu.cpp

@ -193,15 +193,7 @@ void GamemenuMusicVolume(bool bActivate)
} else {
gbMusicOn = true;
sound_get_or_set_music_volume(VOLUME_MAX);
int lt;
if (currlevel >= 17) {
if (currlevel > 20)
lt = TMUSIC_L5;
else
lt = TMUSIC_L6;
} else
lt = leveltype;
music_start(lt);
music_start((_music_id)leveltype);
}
} else {
int volume = GamemenuSliderMusicSound(&sgOptionsMenu[0]);
@ -213,15 +205,7 @@ void GamemenuMusicVolume(bool bActivate)
}
} else if (!gbMusicOn) {
gbMusicOn = true;
int lt;
if (currlevel >= 17) {
if (currlevel > 20)
lt = TMUSIC_L5;
else
lt = TMUSIC_L6;
} else
lt = leveltype;
music_start(lt);
music_start((_music_id)leveltype);
}
}

20
Source/gendung.cpp

@ -70,17 +70,17 @@ std::unique_ptr<uint8_t[]> LoadLevelSOLData(size_t &tileCount)
return LoadFileInMem<uint8_t>("NLevels\\TownData\\Town.SOL", &tileCount);
return LoadFileInMem<uint8_t>("Levels\\TownData\\Town.SOL", &tileCount);
case DTYPE_CATHEDRAL:
if (currlevel < 17)
return LoadFileInMem<uint8_t>("Levels\\L1Data\\L1.SOL", &tileCount);
return LoadFileInMem<uint8_t>("NLevels\\L5Data\\L5.SOL", &tileCount);
return LoadFileInMem<uint8_t>("Levels\\L1Data\\L1.SOL", &tileCount);
case DTYPE_CATACOMBS:
return LoadFileInMem<uint8_t>("Levels\\L2Data\\L2.SOL", &tileCount);
case DTYPE_CAVES:
if (currlevel < 17)
return LoadFileInMem<uint8_t>("Levels\\L3Data\\L3.SOL", &tileCount);
return LoadFileInMem<uint8_t>("NLevels\\L6Data\\L6.SOL", &tileCount);
return LoadFileInMem<uint8_t>("Levels\\L3Data\\L3.SOL", &tileCount);
case DTYPE_HELL:
return LoadFileInMem<uint8_t>("Levels\\L4Data\\L4.SOL", &tileCount);
case DTYPE_NEST:
return LoadFileInMem<uint8_t>("NLevels\\L6Data\\L6.SOL", &tileCount);
case DTYPE_CRYPT:
return LoadFileInMem<uint8_t>("NLevels\\L5Data\\L5.SOL", &tileCount);
default:
app_fatal("FillSolidBlockTbls");
}
@ -185,7 +185,7 @@ void CreateThemeRoom(int themeIndex)
dungeon[xx][yy] = 3;
}
}
if (leveltype == DTYPE_CAVES) {
if (IsAnyOf(leveltype, DTYPE_CAVES, DTYPE_NEST)) {
if (yy == ly || yy == hy - 1) {
dungeon[xx][yy] = 134;
} else if (xx == lx || xx == hx - 1) {
@ -212,7 +212,7 @@ void CreateThemeRoom(int themeIndex)
dungeon[lx][hy - 1] = 9;
dungeon[hx - 1][hy - 1] = 6;
}
if (leveltype == DTYPE_CAVES) {
if (IsAnyOf(leveltype, DTYPE_CAVES, DTYPE_NEST)) {
dungeon[lx][ly] = 150;
dungeon[hx - 1][ly] = 151;
dungeon[lx][hy - 1] = 152;
@ -235,7 +235,7 @@ void CreateThemeRoom(int themeIndex)
break;
}
}
if (leveltype == DTYPE_CAVES) {
if (IsAnyOf(leveltype, DTYPE_CAVES, DTYPE_NEST)) {
switch (GenerateRnd(2)) {
case 0:
dungeon[hx - 1][(ly + hy) / 2] = 147;
@ -540,7 +540,7 @@ void DRLG_PlaceThemeRooms(int minSize, int maxSize, int floor, int freq, bool rn
themeLoc[themeCount].y = j + 1;
themeLoc[themeCount].width = themeW;
themeLoc[themeCount].height = themeH;
if (leveltype == DTYPE_CAVES)
if (IsAnyOf(leveltype, DTYPE_CAVES, DTYPE_NEST))
DRLG_RectTrans(2 * i + 20, 2 * j + 20, 2 * (i + themeW) + 15, 2 * (j + themeH) + 15);
else
DRLG_MRectTrans(i + 1, j + 1, i + themeW, j + themeH);

8
Source/interfac.cpp

@ -66,17 +66,17 @@ Cutscenes PickCutscene(interface_mode uMsg)
case DTYPE_TOWN:
return CutTown;
case DTYPE_CATHEDRAL:
if (lvl > 16)
return CutLevel5;
return CutLevel1;
case DTYPE_CATACOMBS:
return CutLevel2;
case DTYPE_CAVES:
if (lvl > 16)
return CutLevel6;
return CutLevel3;
case DTYPE_HELL:
return CutLevel4;
case DTYPE_NEST:
return CutLevel6;
case DTYPE_CRYPT:
return CutLevel5;
default:
return CutLevel1;
}

97
Source/loadsave.cpp

@ -729,9 +729,48 @@ void LoadMissile(LoadHelper *file)
}
}
_object_id ConvertFromHellfireObject(_object_id type)
{
if (leveltype == DTYPE_NEST) {
switch (type) {
case OBJ_BARREL:
return OBJ_POD;
case OBJ_BARRELEX:
return OBJ_PODEX;
default:
break;
}
}
if (leveltype == DTYPE_CRYPT) {
switch (type) {
case OBJ_BARREL:
return OBJ_URN;
case OBJ_BARRELEX:
return OBJ_URNEX;
case OBJ_STORYBOOK:
return OBJ_L5BOOKS;
case OBJ_STORYCANDLE:
return OBJ_L5CANDLE;
case OBJ_L1LDOOR:
return OBJ_L5LDOOR;
case OBJ_L1RDOOR:
return OBJ_L5RDOOR;
case OBJ_LEVER:
return OBJ_L5LEVER;
case OBJ_SARC:
return OBJ_L5SARC;
default:
break;
}
}
return type;
}
void LoadObject(LoadHelper &file, Object &object)
{
object._otype = static_cast<_object_id>(file.NextLE<int32_t>());
object._otype = ConvertFromHellfireObject(static_cast<_object_id>(file.NextLE<int32_t>()));
object.position.x = file.NextLE<int32_t>();
object.position.y = file.NextLE<int32_t>();
object._oLight = file.NextBool32();
@ -931,6 +970,17 @@ void LoadDroppedItems(LoadHelper &file, size_t savedItemCount)
}
}
int getHellfireLevelType(int type)
{
if (type == DTYPE_CRYPT)
return DTYPE_CATHEDRAL;
if (type == DTYPE_NEST)
return DTYPE_CAVES;
return type;
}
void SaveItem(SaveHelper &file, const Item &item)
{
auto idx = item.IDidx;
@ -1401,9 +1451,48 @@ void SaveMissile(SaveHelper *file, const Missile &missile)
file->WriteLE<uint32_t>(missile.limitReached ? 1 : 0);
}
_object_id ConvertToHellfireObject(_object_id type)
{
if (leveltype == DTYPE_NEST) {
switch (type) {
case OBJ_POD:
return OBJ_BARREL;
case OBJ_PODEX:
return OBJ_BARRELEX;
default:
break;
}
}
if (leveltype == DTYPE_CRYPT) {
switch (type) {
case OBJ_URN:
return OBJ_BARREL;
case OBJ_URNEX:
return OBJ_BARRELEX;
case OBJ_L5BOOKS:
return OBJ_STORYBOOK;
case OBJ_L5CANDLE:
return OBJ_STORYCANDLE;
case OBJ_L5LDOOR:
return OBJ_L1LDOOR;
case OBJ_L5RDOOR:
return OBJ_L1RDOOR;
case OBJ_L5LEVER:
return OBJ_LEVER;
case OBJ_L5SARC:
return OBJ_SARC;
default:
break;
}
}
return type;
}
void SaveObject(SaveHelper &file, const Object &object)
{
file.WriteLE<int32_t>(object._otype);
file.WriteLE<int32_t>(ConvertToHellfireObject(object._otype));
file.WriteLE<int32_t>(object.position.x);
file.WriteLE<int32_t>(object.position.y);
file.WriteLE<uint32_t>(object._oLight ? 1 : 0);
@ -2162,7 +2251,7 @@ void SaveGameData()
file.WriteLE<uint8_t>(setlevel ? 1 : 0);
file.WriteBE<uint32_t>(setlvlnum);
file.WriteBE<uint32_t>(currlevel);
file.WriteBE<uint32_t>(leveltype);
file.WriteBE<uint32_t>(getHellfireLevelType(leveltype));
file.WriteBE<int32_t>(ViewPosition.x);
file.WriteBE<int32_t>(ViewPosition.y);
file.WriteLE<uint8_t>(invflag ? 1 : 0);
@ -2177,7 +2266,7 @@ void SaveGameData()
for (uint8_t i = 0; i < giNumberOfLevels; i++) {
file.WriteBE<uint32_t>(glSeedTbl[i]);
file.WriteBE<int32_t>(gnLevelTypeTbl[i]);
file.WriteBE<int32_t>(getHellfireLevelType(gnLevelTypeTbl[i]));
}
auto &myPlayer = Players[MyPlayerId];

17
Source/menu.cpp

@ -21,7 +21,7 @@ uint32_t gSaveNumber;
namespace {
/** The active music track id for the main menu. */
uint8_t menu_music_track_id = TMUSIC_INTRO;
_music_id menu_music_track_id = TMUSIC_INTRO;
void RefreshMusic()
{
@ -31,13 +31,16 @@ void RefreshMusic()
return;
}
int nextTrack = (int)menu_music_track_id;
do {
menu_music_track_id++;
if (menu_music_track_id == NUM_MUSIC || (!gbIsHellfire && menu_music_track_id > TMUSIC_L4))
menu_music_track_id = TMUSIC_L2;
if (gbIsSpawn && menu_music_track_id > TMUSIC_L1)
menu_music_track_id = TMUSIC_L5;
} while (menu_music_track_id == TMUSIC_TOWN || menu_music_track_id == TMUSIC_L1);
nextTrack++;
if (nextTrack == NUM_MUSIC || (!gbIsHellfire && nextTrack > TMUSIC_HELL))
nextTrack = TMUSIC_CATACOMBS;
if (gbIsSpawn && nextTrack > TMUSIC_CATHEDRAL)
nextTrack = TMUSIC_NEST;
} while (nextTrack == TMUSIC_TOWN || nextTrack == TMUSIC_CATHEDRAL);
menu_music_track_id = (_music_id)nextTrack;
}
bool InitMenu(_selhero_selections type)

2
Source/monster.cpp

@ -4139,7 +4139,7 @@ void DoEnding()
int musicVolume = sound_get_or_set_music_volume(1);
sound_get_or_set_music_volume(0);
music_start(TMUSIC_L2);
music_start(TMUSIC_CATACOMBS);
loop_movie = true;
play_movie("gendata\\loopdend.smk", true);
loop_movie = false;

6
Source/multi.cpp

@ -351,10 +351,10 @@ dungeon_type InitLevelType(int l)
return DTYPE_CAVES;
if (l >= 13 && l <= 16)
return DTYPE_HELL;
if (l >= 21 && l <= 24)
return DTYPE_CATHEDRAL; // Crypt
if (l >= 17 && l <= 20)
return DTYPE_CAVES; // Hive
return DTYPE_NEST;
if (l >= 21 && l <= 24)
return DTYPE_CRYPT;
return DTYPE_CATHEDRAL;
}

337
Source/objdat.cpp

@ -148,115 +148,131 @@ const _object_id ObjTypeConv[] = {
OBJ_LAZSTAND,
OBJ_BOOKSTAND,
OBJ_BOOKSHELFR,
OBJ_POD,
OBJ_PODEX,
OBJ_URN,
OBJ_URNEX,
OBJ_L5BOOKS,
OBJ_L5CANDLE,
OBJ_L5LEVER,
OBJ_L5SARC,
};
/** Contains the data related to each object ID. */
const ObjectData AllObjects[] = {
const ObjectData AllObjects[109] = {
// clang-format off
// oload, ofindex, ominlvl, omaxlvl, olvltype, otheme, oquest, oAnimFlag, oAnimDelay, oAnimLen, oAnimWidth, oSolidFlag, oMissFlag, oLightFlag, oBreak, oSelFlag, oTrapFlag
{ 1, OFILE_L1BRAZ, 1, 4, DTYPE_CATHEDRAL, THEME_NONE, Q_INVALID, 1, 1, 26, 64, true, true, false, 0, 0, false },
{ 1, OFILE_L1DOORS, 1, 4, DTYPE_CATHEDRAL, THEME_NONE, Q_INVALID, 0, 1, 0, 64, false, false, true, 0, 3, true },
{ 1, OFILE_L1DOORS, 1, 4, DTYPE_CATHEDRAL, THEME_NONE, Q_INVALID, 0, 2, 0, 64, false, false, true, 0, 3, true },
{ 3, OFILE_SKULFIRE, 0, 0, DTYPE_NONE, THEME_SKELROOM, Q_INVALID, 1, 2, 11, 96, true, true, false, 0, 0, false },
{ 1, OFILE_LEVER, 1, 4, DTYPE_CATHEDRAL, THEME_NONE, Q_INVALID, 0, 1, 1, 96, true, true, true, 0, 1, true },
{ 1, OFILE_CHEST1, 1, 16, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 1, true },
{ 1, OFILE_CHEST2, 1, 16, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 1, true },
{ 1, OFILE_CHEST3, 1, 16, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 1, true },
{ 2, OFILE_L1BRAZ, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 0, 0, 0, false, false, false, 0, 0, false },
{ 3, OFILE_CANDLE2, 0, 0, DTYPE_NONE, THEME_SHRINE, Q_INVALID, 1, 2, 4, 96, true, true, true, 0, 0, false },
{ 2, OFILE_L1BRAZ, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 0, 0, 0, false, false, false, 0, 0, false },
{ 3, OFILE_BANNER, 0, 0, DTYPE_NONE, THEME_SKELROOM, Q_INVALID, 0, 2, 0, 96, true, true, true, 0, 0, false },
{ 3, OFILE_BANNER, 0, 0, DTYPE_NONE, THEME_SKELROOM, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 0, false },
{ 3, OFILE_BANNER, 0, 0, DTYPE_NONE, THEME_SKELROOM, Q_INVALID, 0, 3, 0, 96, true, true, true, 0, 0, false },
{ 2, OFILE_SKULPILE, 1, 4, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 1, 96, true, true, true, 0, 0, false },
{ 2, OFILE_L1BRAZ, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 0, 0, 0, false, false, false, 0, 0, false },
{ 2, OFILE_L1BRAZ, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 0, 0, 0, false, false, false, 0, 0, false },
{ 2, OFILE_L1BRAZ, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 0, 0, 0, false, false, false, 0, 0, false },
{ 2, OFILE_L1BRAZ, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 0, 0, 0, false, false, false, 0, 0, false },
{ 2, OFILE_L1BRAZ, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 0, 0, 0, false, false, false, 0, 0, false },
{ 2, OFILE_CRUXSK1, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 15, 96, true, false, true, 1, 3, false },
{ 2, OFILE_CRUXSK2, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 15, 96, true, false, true, 1, 3, false },
{ 2, OFILE_CRUXSK3, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 15, 96, true, false, true, 1, 3, false },
{ 1, OFILE_ROCKSTAN, 5, 5, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 0, false },
{ 2, OFILE_ANGEL, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, false, true, 0, 0, false },
{ 2, OFILE_BOOK2, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 3, false },
{ 2, OFILE_BURNCROS, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 1, 0, 10, 160, true, false, false, 0, 0, false },
{ 2, OFILE_NUDE2, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 1, 3, 6, 128, true, false, true, 0, 0, false },
{ 1, OFILE_SWITCH4, 16, 16, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 1, true },
{ 1, OFILE_TNUDEM, 13, 16, DTYPE_NONE, THEME_NONE, Q_BUTCHER, 0, 1, 0, 128, true, false, true, 0, 0, false },
{ 1, OFILE_TNUDEM, 13, 16, DTYPE_NONE, THEME_TORTURE, Q_BUTCHER, 0, 2, 0, 128, true, false, true, 0, 0, false },
{ 1, OFILE_TNUDEM, 13, 16, DTYPE_NONE, THEME_TORTURE, Q_BUTCHER, 0, 3, 0, 128, true, false, true, 0, 0, false },
{ 1, OFILE_TNUDEM, 13, 16, DTYPE_NONE, THEME_TORTURE, Q_BUTCHER, 0, 4, 0, 128, true, false, true, 0, 0, false },
{ 1, OFILE_TNUDEW, 13, 16, DTYPE_NONE, THEME_TORTURE, Q_BUTCHER, 0, 1, 0, 128, true, false, true, 0, 0, false },
{ 1, OFILE_TNUDEW, 13, 16, DTYPE_NONE, THEME_TORTURE, Q_BUTCHER, 0, 2, 0, 128, true, false, true, 0, 0, false },
{ 1, OFILE_TNUDEW, 13, 16, DTYPE_NONE, THEME_TORTURE, Q_BUTCHER, 0, 3, 0, 128, true, false, true, 0, 0, false },
{ 1, OFILE_TSOUL, 13, 16, DTYPE_NONE, THEME_NONE, Q_BUTCHER, 0, 1, 0, 128, false, true, true, 0, 0, false },
{ 1, OFILE_TSOUL, 13, 16, DTYPE_NONE, THEME_NONE, Q_BUTCHER, 0, 2, 0, 128, false, true, true, 0, 0, false },
{ 1, OFILE_TSOUL, 13, 16, DTYPE_NONE, THEME_NONE, Q_BUTCHER, 0, 3, 0, 128, false, true, true, 0, 0, false },
{ 1, OFILE_TSOUL, 13, 16, DTYPE_NONE, THEME_NONE, Q_BUTCHER, 0, 4, 0, 128, false, true, true, 0, 0, false },
{ 1, OFILE_TSOUL, 13, 16, DTYPE_NONE, THEME_NONE, Q_BUTCHER, 0, 5, 0, 128, false, true, true, 0, 0, false },
{ 1, OFILE_BOOK2, 6, 6, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 4, 0, 96, true, true, true, 0, 3, false },
{ 1, OFILE_L2DOORS, 5, 8, DTYPE_CATACOMBS, THEME_NONE, Q_INVALID, 0, 1, 0, 64, false, false, true, 0, 3, true },
{ 1, OFILE_L2DOORS, 5, 8, DTYPE_CATACOMBS, THEME_NONE, Q_INVALID, 0, 2, 0, 64, false, false, true, 0, 3, true },
{ 1, OFILE_WTORCH4, 5, 8, DTYPE_CATACOMBS, THEME_NONE, Q_INVALID, 1, 1, 9, 96, false, true, false, 0, 0, false },
{ 1, OFILE_WTORCH3, 5, 8, DTYPE_CATACOMBS, THEME_NONE, Q_INVALID, 1, 1, 9, 96, false, true, false, 0, 0, false },
{ 1, OFILE_WTORCH1, 5, 8, DTYPE_CATACOMBS, THEME_NONE, Q_INVALID, 1, 1, 9, 96, false, true, false, 0, 0, false },
{ 1, OFILE_WTORCH2, 5, 8, DTYPE_CATACOMBS, THEME_NONE, Q_INVALID, 1, 1, 9, 96, false, true, false, 0, 0, false },
{ 1, OFILE_SARC, 1, 4, DTYPE_CATHEDRAL, THEME_NONE, Q_INVALID, 0, 1, 5, 128, true, true, true, 0, 3, true },
{ 2, OFILE_FLAME1, 1, 4, DTYPE_CATHEDRAL, THEME_NONE, Q_INVALID, 0, 1, 20, 96, false, true, true, 0, 0, false },
{ 2, OFILE_LEVER, 1, 4, DTYPE_CATHEDRAL, THEME_NONE, Q_INVALID, 0, 1, 2, 96, true, true, true, 0, 1, true },
{ 2, OFILE_MINIWATR, 1, 4, DTYPE_CATHEDRAL, THEME_NONE, Q_INVALID, 1, 1, 10, 64, true, false, true, 0, 0, false },
{ 1, OFILE_BOOK1, 3, 4, DTYPE_CATHEDRAL, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 3, false },
{ 1, OFILE_TRAPHOLE, 1, 16, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 64, false, true, true, 0, 0, false },
{ 1, OFILE_TRAPHOLE, 1, 16, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 2, 0, 64, false, true, true, 0, 0, false },
{ 2, OFILE_BCASE, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, false, true, 0, 0, false },
{ 2, OFILE_WEAPSTND, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, false, true, 0, 0, false },
{ 1, OFILE_BARREL, 1, 16, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 9, 96, true, true, true, 1, 3, false },
{ 1, OFILE_BARRELEX, 1, 16, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 10, 96, true, true, true, 1, 3, false },
{ 3, OFILE_LSHRINEG, 0, 0, DTYPE_NONE, THEME_SHRINE, Q_INVALID, 0, 1, 11, 128, false, false, true, 0, 3, false },
{ 3, OFILE_RSHRINEG, 0, 0, DTYPE_NONE, THEME_SHRINE, Q_INVALID, 0, 1, 11, 128, false, false, true, 0, 3, false },
{ 3, OFILE_BOOK2, 0, 0, DTYPE_NONE, THEME_SKELROOM, Q_INVALID, 0, 4, 0, 96, true, true, true, 0, 3, false },
{ 3, OFILE_BCASE, 0, 0, DTYPE_NONE, THEME_LIBRARY, Q_INVALID, 0, 3, 0, 96, false, false, true, 0, 3, false },
{ 3, OFILE_BCASE, 0, 0, DTYPE_NONE, THEME_LIBRARY, Q_INVALID, 0, 4, 0, 96, false, false, true, 0, 3, false },
{ 3, OFILE_BOOK2, 0, 0, DTYPE_NONE, THEME_LIBRARY, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 3, false },
{ 3, OFILE_CANDLE2, 0, 0, DTYPE_NONE, THEME_LIBRARY, Q_INVALID, 1, 2, 4, 96, true, true, true, 0, 0, false },
{ 3, OFILE_BLOODFNT, 0, 0, DTYPE_NONE, THEME_BLOODFOUNTAIN, Q_INVALID, 1, 2, 10, 96, true, true, true, 0, 3, false },
{ 1, OFILE_DECAP, 13, 16, DTYPE_NONE, THEME_DECAPITATED, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 1, false },
{ 1, OFILE_CHEST1, 1, 16, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 1, true },
{ 1, OFILE_CHEST2, 1, 16, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 1, true },
{ 1, OFILE_CHEST3, 1, 16, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 1, true },
{ 1, OFILE_BOOK1, 7, 7, DTYPE_CATACOMBS, THEME_NONE, Q_BLIND, 0, 1, 0, 96, true, true, true, 0, 3, false },
{ 1, OFILE_BOOK1, 5, 5, DTYPE_CATACOMBS, THEME_NONE, Q_BLOOD, 0, 4, 0, 96, true, true, true, 0, 3, false },
{ 1, OFILE_PEDISTL, 5, 5, DTYPE_CATACOMBS, THEME_NONE, Q_BLOOD, 0, 1, 0, 96, true, true, true, 0, 3, false },
{ 1, OFILE_L3DOORS, 9, 12, DTYPE_CAVES, THEME_NONE, Q_INVALID, 0, 1, 0, 64, false, false, true, 0, 3, true },
{ 1, OFILE_L3DOORS, 9, 12, DTYPE_CAVES, THEME_NONE, Q_INVALID, 0, 2, 0, 64, false, false, true, 0, 3, true },
{ 3, OFILE_PFOUNTN, 0, 0, DTYPE_NONE, THEME_PURIFYINGFOUNTAIN, Q_INVALID, 1, 2, 10, 128, true, true, true, 0, 3, false },
{ 3, OFILE_ARMSTAND, 0, 0, DTYPE_NONE, THEME_ARMORSTAND, Q_INVALID, 0, 1, 0, 96, true, false, true, 0, 3, false },
{ 3, OFILE_ARMSTAND, 0, 0, DTYPE_NONE, THEME_ARMORSTAND, Q_INVALID, 0, 2, 0, 96, true, false, true, 0, 0, false },
{ 3, OFILE_GOATSHRN, 0, 0, DTYPE_NONE, THEME_GOATSHRINE, Q_INVALID, 1, 2, 10, 96, true, true, true, 0, 3, false },
{ 1, OFILE_CAULDREN, 13, 16, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, false, true, 0, 3, false },
{ 3, OFILE_MFOUNTN, 0, 0, DTYPE_NONE, THEME_MURKYFOUNTAIN, Q_INVALID, 1, 2, 10, 128, true, true, true, 0, 3, false },
{ 3, OFILE_TFOUNTN, 0, 0, DTYPE_NONE, THEME_TEARFOUNTAIN, Q_INVALID, 1, 2, 4, 128, true, true, true, 0, 3, false },
{ 1, OFILE_ALTBOY, 0, 0, DTYPE_CATHEDRAL, THEME_NONE, Q_BETRAYER, 0, 1, 0, 128, true, true, true, 0, 0, false },
{ 1, OFILE_MCIRL, 0, 0, DTYPE_CATHEDRAL, THEME_NONE, Q_BETRAYER, 0, 1, 0, 96, false, true, true, 0, 0, false },
{ 1, OFILE_MCIRL, 0, 0, DTYPE_CATHEDRAL, THEME_NONE, Q_BETRAYER, 0, 1, 0, 96, false, true, true, 0, 0, false },
{ 1, OFILE_BKSLBRNT, 1, 12, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 3, false }, // BUGFIX should only be loaded on level 1-12 (crypt masks as 1-4) (fixed)
{ 1, OFILE_CANDLE2, 1, 12, DTYPE_NONE, THEME_NONE, Q_BETRAYER, 1, 2, 4, 96, true, true, true, 0, 0, false },
{ 1, OFILE_BOOK1, 13, 13, DTYPE_HELL, THEME_NONE, Q_WARLORD, 0, 4, 0, 96, true, true, true, 0, 3, false },
{ 1, OFILE_ARMSTAND, 13, 13, DTYPE_NONE, THEME_NONE, Q_WARLORD, 0, 1, 0, 96, true, false, true, 0, 3, false },
{ 2, OFILE_WEAPSTND, 13, 13, DTYPE_NONE, THEME_NONE, Q_WARLORD, 0, 1, 0, 96, true, false, true, 0, 3, false },
{ 2, OFILE_BURNCROS, 0, 0, DTYPE_NONE, THEME_BRNCROSS, Q_INVALID, 1, 0, 10, 160, true, false, false, 0, 0, false },
{ 2, OFILE_WEAPSTND, 0, 0, DTYPE_NONE, THEME_WEAPONRACK, Q_INVALID, 0, 1, 0, 96, true, false, true, 0, 3, false },
{ 2, OFILE_WEAPSTND, 0, 0, DTYPE_NONE, THEME_WEAPONRACK, Q_INVALID, 0, 2, 0, 96, true, false, true, 0, 0, false },
{ 2, OFILE_MUSHPTCH, 0, 0, DTYPE_NONE, THEME_NONE, Q_MUSHROOM, 0, 1, 0, 96, true, true, true, 0, 3, true },
{ 2, OFILE_LZSTAND, 0, 0, DTYPE_NONE, THEME_NONE, Q_BETRAYER, 0, 1, 0, 128, true, false, true, 0, 3, false },
{ 1, OFILE_DECAP, 9, 9, DTYPE_CAVES, THEME_NONE, Q_INVALID, 0, 2, 0, 96, true, true, true, 0, 1, false },
{ 2, OFILE_CHEST3, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 1, true },
{ 2, OFILE_BCASE, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 2, 0, 96, true, false, true, 0, 0, false },
{ -1, OFILE_NULL, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 0, 0, 0, false, false, false, 0, 0, false },
// ofindex, ominlvl, omaxlvl, olvltype, otheme, oquest, oAnimFlag, oAnimDelay, oAnimLen, oAnimWidth, oSolidFlag, oMissFlag, oLightFlag, oBreak, oSelFlag, oTrapFlag
{ OFILE_L1BRAZ, 1, 4, DTYPE_CATHEDRAL, THEME_NONE, Q_INVALID, 1, 1, 26, 64, true, true, false, 0, 0, false },
{ OFILE_L1DOORS, 1, 4, DTYPE_CATHEDRAL, THEME_NONE, Q_INVALID, 0, 1, 0, 64, false, false, true, 0, 3, true },
{ OFILE_L1DOORS, 1, 4, DTYPE_CATHEDRAL, THEME_NONE, Q_INVALID, 0, 2, 0, 64, false, false, true, 0, 3, true },
{ OFILE_SKULFIRE, 0, 0, DTYPE_NONE, THEME_SKELROOM, Q_INVALID, 1, 2, 11, 96, true, true, false, 0, 0, false },
{ OFILE_LEVER, 1, 4, DTYPE_CATHEDRAL, THEME_NONE, Q_INVALID, 0, 1, 1, 96, true, true, true, 0, 1, true },
{ OFILE_CHEST1, 1, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 1, true },
{ OFILE_CHEST2, 1, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 1, true },
{ OFILE_CHEST3, 1, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 1, true },
{ OFILE_L1BRAZ, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 0, 0, 0, false, false, false, 0, 0, false },
{ OFILE_CANDLE2, 0, 0, DTYPE_NONE, THEME_SHRINE, Q_INVALID, 1, 2, 4, 96, true, true, true, 0, 0, false },
{ OFILE_L1BRAZ, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 0, 0, 0, false, false, false, 0, 0, false },
{ OFILE_BANNER, 0, 0, DTYPE_NONE, THEME_SKELROOM, Q_INVALID, 0, 2, 0, 96, true, true, true, 0, 0, false },
{ OFILE_BANNER, 0, 0, DTYPE_NONE, THEME_SKELROOM, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 0, false },
{ OFILE_BANNER, 0, 0, DTYPE_NONE, THEME_SKELROOM, Q_INVALID, 0, 3, 0, 96, true, true, true, 0, 0, false },
{ OFILE_SKULPILE, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 1, 96, true, true, true, 0, 0, false },
{ OFILE_L1BRAZ, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 0, 0, 0, false, false, false, 0, 0, false },
{ OFILE_L1BRAZ, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 0, 0, 0, false, false, false, 0, 0, false },
{ OFILE_L1BRAZ, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 0, 0, 0, false, false, false, 0, 0, false },
{ OFILE_L1BRAZ, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 0, 0, 0, false, false, false, 0, 0, false },
{ OFILE_L1BRAZ, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 0, 0, 0, false, false, false, 0, 0, false },
{ OFILE_CRUXSK1, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 15, 96, true, false, true, 1, 3, false },
{ OFILE_CRUXSK2, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 15, 96, true, false, true, 1, 3, false },
{ OFILE_CRUXSK3, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 15, 96, true, false, true, 1, 3, false },
{ OFILE_ROCKSTAN, 5, 5, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 0, false },
{ OFILE_ANGEL, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, false, true, 0, 0, false },
{ OFILE_BOOK2, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 3, false },
{ OFILE_BURNCROS, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 1, 0, 10, 160, true, false, false, 0, 0, false },
{ OFILE_NUDE2, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 1, 3, 6, 128, true, false, true, 0, 0, false },
{ OFILE_SWITCH4, 16, 16, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 1, true },
{ OFILE_TNUDEM, 13, 16, DTYPE_NONE, THEME_NONE, Q_BUTCHER, 0, 1, 0, 128, true, false, true, 0, 0, false },
{ OFILE_TNUDEM, 13, 16, DTYPE_NONE, THEME_TORTURE, Q_BUTCHER, 0, 2, 0, 128, true, false, true, 0, 0, false },
{ OFILE_TNUDEM, 13, 16, DTYPE_NONE, THEME_TORTURE, Q_BUTCHER, 0, 3, 0, 128, true, false, true, 0, 0, false },
{ OFILE_TNUDEM, 13, 16, DTYPE_NONE, THEME_TORTURE, Q_BUTCHER, 0, 4, 0, 128, true, false, true, 0, 0, false },
{ OFILE_TNUDEW, 13, 16, DTYPE_NONE, THEME_TORTURE, Q_BUTCHER, 0, 1, 0, 128, true, false, true, 0, 0, false },
{ OFILE_TNUDEW, 13, 16, DTYPE_NONE, THEME_TORTURE, Q_BUTCHER, 0, 2, 0, 128, true, false, true, 0, 0, false },
{ OFILE_TNUDEW, 13, 16, DTYPE_NONE, THEME_TORTURE, Q_BUTCHER, 0, 3, 0, 128, true, false, true, 0, 0, false },
{ OFILE_TSOUL, 13, 16, DTYPE_NONE, THEME_NONE, Q_BUTCHER, 0, 1, 0, 128, false, true, true, 0, 0, false },
{ OFILE_TSOUL, 13, 16, DTYPE_NONE, THEME_NONE, Q_BUTCHER, 0, 2, 0, 128, false, true, true, 0, 0, false },
{ OFILE_TSOUL, 13, 16, DTYPE_NONE, THEME_NONE, Q_BUTCHER, 0, 3, 0, 128, false, true, true, 0, 0, false },
{ OFILE_TSOUL, 13, 16, DTYPE_NONE, THEME_NONE, Q_BUTCHER, 0, 4, 0, 128, false, true, true, 0, 0, false },
{ OFILE_TSOUL, 13, 16, DTYPE_NONE, THEME_NONE, Q_BUTCHER, 0, 5, 0, 128, false, true, true, 0, 0, false },
{ OFILE_BOOK2, 6, 6, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 4, 0, 96, true, true, true, 0, 3, false },
{ OFILE_L2DOORS, 5, 8, DTYPE_CATACOMBS, THEME_NONE, Q_INVALID, 0, 1, 0, 64, false, false, true, 0, 3, true },
{ OFILE_L2DOORS, 5, 8, DTYPE_CATACOMBS, THEME_NONE, Q_INVALID, 0, 2, 0, 64, false, false, true, 0, 3, true },
{ OFILE_WTORCH4, 5, 8, DTYPE_CATACOMBS, THEME_NONE, Q_INVALID, 1, 1, 9, 96, false, true, false, 0, 0, false },
{ OFILE_WTORCH3, 5, 8, DTYPE_CATACOMBS, THEME_NONE, Q_INVALID, 1, 1, 9, 96, false, true, false, 0, 0, false },
{ OFILE_WTORCH1, 5, 8, DTYPE_CATACOMBS, THEME_NONE, Q_INVALID, 1, 1, 9, 96, false, true, false, 0, 0, false },
{ OFILE_WTORCH2, 5, 8, DTYPE_CATACOMBS, THEME_NONE, Q_INVALID, 1, 1, 9, 96, false, true, false, 0, 0, false },
{ OFILE_SARC, 1, 4, DTYPE_CATHEDRAL, THEME_NONE, Q_INVALID, 0, 1, 5, 128, true, true, true, 0, 3, true },
{ OFILE_FLAME1, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 20, 96, false, true, true, 0, 0, false },
{ OFILE_LEVER, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 2, 96, true, true, true, 0, 1, true },
{ OFILE_MINIWATR, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 1, 1, 10, 64, true, false, true, 0, 0, false },
{ OFILE_BOOK1, 3, 4, DTYPE_CATHEDRAL, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 3, false },
{ OFILE_TRAPHOLE, 1, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 64, false, true, true, 0, 0, false },
{ OFILE_TRAPHOLE, 1, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 2, 0, 64, false, true, true, 0, 0, false },
{ OFILE_BCASE, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, false, true, 0, 0, false },
{ OFILE_WEAPSTND, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, false, true, 0, 0, false },
{ OFILE_BARREL, 1, 16, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 9, 96, true, true, true, 1, 3, false },
{ OFILE_BARRELEX, 1, 16, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 10, 96, true, true, true, 1, 3, false },
{ OFILE_LSHRINEG, 0, 0, DTYPE_NONE, THEME_SHRINE, Q_INVALID, 0, 1, 11, 128, false, false, true, 0, 3, false },
{ OFILE_RSHRINEG, 0, 0, DTYPE_NONE, THEME_SHRINE, Q_INVALID, 0, 1, 11, 128, false, false, true, 0, 3, false },
{ OFILE_BOOK2, 0, 0, DTYPE_NONE, THEME_SKELROOM, Q_INVALID, 0, 4, 0, 96, true, true, true, 0, 3, false },
{ OFILE_BCASE, 0, 0, DTYPE_NONE, THEME_LIBRARY, Q_INVALID, 0, 3, 0, 96, false, false, true, 0, 3, false },
{ OFILE_BCASE, 0, 0, DTYPE_NONE, THEME_LIBRARY, Q_INVALID, 0, 4, 0, 96, false, false, true, 0, 3, false },
{ OFILE_BOOK2, 0, 0, DTYPE_NONE, THEME_LIBRARY, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 3, false },
{ OFILE_CANDLE2, 0, 0, DTYPE_NONE, THEME_LIBRARY, Q_INVALID, 1, 2, 4, 96, true, true, true, 0, 0, false },
{ OFILE_BLOODFNT, 0, 0, DTYPE_NONE, THEME_BLOODFOUNTAIN, Q_INVALID, 1, 2, 10, 96, true, true, true, 0, 3, false },
{ OFILE_DECAP, 13, 16, DTYPE_NONE, THEME_DECAPITATED, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 1, false },
{ OFILE_CHEST1, 1, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 1, true },
{ OFILE_CHEST2, 1, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 1, true },
{ OFILE_CHEST3, 1, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 1, true },
{ OFILE_BOOK1, 7, 7, DTYPE_CATACOMBS, THEME_NONE, Q_BLIND, 0, 1, 0, 96, true, true, true, 0, 3, false },
{ OFILE_BOOK1, 5, 5, DTYPE_CATACOMBS, THEME_NONE, Q_BLOOD, 0, 4, 0, 96, true, true, true, 0, 3, false },
{ OFILE_PEDISTL, 5, 5, DTYPE_CATACOMBS, THEME_NONE, Q_BLOOD, 0, 1, 0, 96, true, true, true, 0, 3, false },
{ OFILE_L3DOORS, 9, 12, DTYPE_CAVES, THEME_NONE, Q_INVALID, 0, 1, 0, 64, false, false, true, 0, 3, true },
{ OFILE_L3DOORS, 9, 12, DTYPE_CAVES, THEME_NONE, Q_INVALID, 0, 2, 0, 64, false, false, true, 0, 3, true },
{ OFILE_PFOUNTN, 0, 0, DTYPE_NONE, THEME_PURIFYINGFOUNTAIN, Q_INVALID, 1, 2, 10, 128, true, true, true, 0, 3, false },
{ OFILE_ARMSTAND, 0, 0, DTYPE_NONE, THEME_ARMORSTAND, Q_INVALID, 0, 1, 0, 96, true, false, true, 0, 3, false },
{ OFILE_ARMSTAND, 0, 0, DTYPE_NONE, THEME_ARMORSTAND, Q_INVALID, 0, 2, 0, 96, true, false, true, 0, 0, false },
{ OFILE_GOATSHRN, 0, 0, DTYPE_NONE, THEME_GOATSHRINE, Q_INVALID, 1, 2, 10, 96, true, true, true, 0, 3, false },
{ OFILE_CAULDREN, 13, 16, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, false, true, 0, 3, false },
{ OFILE_MFOUNTN, 0, 0, DTYPE_NONE, THEME_MURKYFOUNTAIN, Q_INVALID, 1, 2, 10, 128, true, true, true, 0, 3, false },
{ OFILE_TFOUNTN, 0, 0, DTYPE_NONE, THEME_TEARFOUNTAIN, Q_INVALID, 1, 2, 4, 128, true, true, true, 0, 3, false },
{ OFILE_ALTBOY, 0, 0, DTYPE_CATHEDRAL, THEME_NONE, Q_BETRAYER, 0, 1, 0, 128, true, true, true, 0, 0, false },
{ OFILE_MCIRL, 0, 0, DTYPE_CATHEDRAL, THEME_NONE, Q_BETRAYER, 0, 1, 0, 96, false, true, true, 0, 0, false },
{ OFILE_MCIRL, 0, 0, DTYPE_CATHEDRAL, THEME_NONE, Q_BETRAYER, 0, 1, 0, 96, false, true, true, 0, 0, false },
{ OFILE_BKSLBRNT, 1, 12, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 3, false },
{ OFILE_CANDLE2, 1, 12, DTYPE_NONE, THEME_NONE, Q_BETRAYER, 1, 2, 4, 96, true, true, true, 0, 0, false },
{ OFILE_BOOK1, 13, 13, DTYPE_HELL, THEME_NONE, Q_WARLORD, 0, 4, 0, 96, true, true, true, 0, 3, false },
{ OFILE_ARMSTAND, 13, 13, DTYPE_NONE, THEME_NONE, Q_WARLORD, 0, 1, 0, 96, true, false, true, 0, 3, false },
{ OFILE_WEAPSTND, 0, 0, DTYPE_NONE, THEME_NONE, Q_WARLORD, 0, 1, 0, 96, true, false, true, 0, 3, false },
{ OFILE_BURNCROS, 0, 0, DTYPE_NONE, THEME_BRNCROSS, Q_INVALID, 1, 0, 10, 160, true, false, false, 0, 0, false },
{ OFILE_WEAPSTND, 0, 0, DTYPE_NONE, THEME_WEAPONRACK, Q_INVALID, 0, 1, 0, 96, true, false, true, 0, 3, false },
{ OFILE_WEAPSTND, 0, 0, DTYPE_NONE, THEME_WEAPONRACK, Q_INVALID, 0, 2, 0, 96, true, false, true, 0, 0, false },
{ OFILE_MUSHPTCH, 0, 0, DTYPE_NONE, THEME_NONE, Q_MUSHROOM, 0, 1, 0, 96, true, true, true, 0, 3, true },
{ OFILE_LZSTAND, 0, 0, DTYPE_NONE, THEME_NONE, Q_BETRAYER, 0, 1, 0, 128, true, false, true, 0, 3, false },
{ OFILE_DECAP, 9, 9, DTYPE_CAVES, THEME_NONE, Q_INVALID, 0, 2, 0, 96, true, true, true, 0, 1, false },
{ OFILE_CHEST3, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 1, true },
{ OFILE_BCASE, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 2, 0, 96, true, false, true, 0, 0, false },
{ OFILE_POD, 17, 20, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 9, 96, true, true, true, 1, 3, false },
{ OFILE_PODEX, 17, 20, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 10, 96, true, true, true, 1, 3, false },
{ OFILE_URN, 21, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 9, 96, true, true, true, 1, 3, false },
{ OFILE_URNEX, 21, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 10, 96, true, true, true, 1, 3, false },
{ OFILE_L5BOOKS, 21, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 0, 96, true, true, true, 0, 3, false },
{ OFILE_L5CANDLE, 21, 23, DTYPE_NONE, THEME_NONE, Q_INVALID, 1, 2, 4, 96, true, true, true, 0, 0, false },
{ OFILE_L5DOORS, 21, 24, DTYPE_CRYPT, THEME_NONE, Q_INVALID, 0, 1, 0, 64, false, false, true, 0, 3, true },
{ OFILE_L5DOORS, 21, 24, DTYPE_CRYPT, THEME_NONE, Q_INVALID, 0, 2, 0, 64, false, false, true, 0, 3, true },
{ OFILE_L5LEVER, 21, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 1, 96, true, true, true, 0, 1, true },
{ OFILE_L5SARC, 21, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, 0, 1, 5, 128, true, true, true, 0, 3, true },
// clang-format on
};
/** Maps from object_graphic_id to object CEL name. */
const char *const ObjMasterLoadList[] = {
"L1Braz",
@ -314,125 +330,16 @@ const char *const ObjMasterLoadList[] = {
"Mcirl",
"Bkslbrnt",
"Mushptch",
"LzStand"
};
/** Maps from object_graphic_id to object CEL name (Hellfire Crypt overwrite). */
const char *ObjCryptLoadList[] = {
"L1Braz",
"LzStand",
"L6Pod1",
"L6Pod2",
"L5Door",
"L5Lever",
"Chest1",
"Chest2",
"Banner",
"SkulPile",
"SkulFire",
"SkulStik",
"CruxSk1",
"CruxSk2",
"CruxSk3",
"Book1",
"Book2",
"Rockstan",
"Angel",
"Chest3",
"Burncros",
"L5Light",
"Nude2",
"Switch4",
"TNudeM",
"TNudeW",
"TSoul",
"L2Doors",
"WTorch4",
"WTorch3",
"L5Sarco",
"Flame1",
"Prsrplt1",
"Traphole",
"MiniWatr",
"WTorch2",
"WTorch1",
"BCase",
"BShelf",
"WeapStnd",
"Urn",
"Urnexpld",
"LShrineG",
"RShrineG",
"Bloodfnt",
"Decap",
"Pedistl",
"L3Doors",
"PFountn",
"Armstand",
"Goatshrn",
"Cauldren",
"MFountn",
"TFountn",
"Altboy",
"Mcirl",
"L5Books",
"Mushptch",
"LzStand",
};
/** Maps from object_graphic_id to object CEL name (Hellfire Hive overwrite). */
const char *ObjHiveLoadList[] = {
"L1Braz",
"L1Doors",
"Lever",
"Chest1",
"Chest2",
"Banner",
"SkulPile",
"SkulFire",
"SkulStik",
"CruxSk1",
"CruxSk2",
"CruxSk3",
"Book1",
"Book2",
"Rockstan",
"Angel",
"Chest3",
"Burncros",
"Candle2",
"Nude2",
"Switch4",
"TNudeM",
"TNudeW",
"TSoul",
"L2Doors",
"WTorch4",
"WTorch3",
"Sarc",
"Flame1",
"Prsrplt1",
"Traphole",
"MiniWatr",
"WTorch2",
"WTorch1",
"BCase",
"BShelf",
"WeapStnd",
"L6Pod1",
"L6Pod2",
"LShrineG",
"RShrineG",
"Bloodfnt",
"Decap",
"Pedistl",
"L3Doors",
"PFountn",
"Armstand",
"Goatshrn",
"Cauldren",
"MFountn",
"TFountn",
"Altboy",
"Mcirl",
"Bkslbrnt",
"Mushptch",
"LzStand",
};
} // namespace devilution

24
Source/objdat.h

@ -89,6 +89,15 @@ enum object_graphic_id : int8_t {
OFILE_BKSLBRNT,
OFILE_MUSHPTCH,
OFILE_LZSTAND,
OFILE_POD,
OFILE_PODEX,
OFILE_L5DOORS,
OFILE_L5LEVER,
OFILE_L5CANDLE,
OFILE_L5SARC,
OFILE_URN,
OFILE_URNEX,
OFILE_L5BOOKS,
OFILE_NULL = -1,
};
@ -192,6 +201,16 @@ enum _object_id : int8_t {
OBJ_SLAINHERO,
OBJ_SIGNCHEST,
OBJ_BOOKSHELFR,
OBJ_POD,
OBJ_PODEX,
OBJ_URN,
OBJ_URNEX,
OBJ_L5BOOKS,
OBJ_L5CANDLE,
OBJ_L5LDOOR,
OBJ_L5RDOOR,
OBJ_L5LEVER,
OBJ_L5SARC,
OBJ_NULL = -1,
};
@ -224,7 +243,6 @@ enum quest_id : int8_t {
};
struct ObjectData {
int oload; // Todo create enum
object_graphic_id ofindex;
int8_t ominlvl;
int8_t omaxlvl;
@ -244,9 +262,7 @@ struct ObjectData {
};
extern const _object_id ObjTypeConv[];
extern const ObjectData AllObjects[];
extern const ObjectData AllObjects[109];
extern const char *const ObjMasterLoadList[];
extern const char *ObjCryptLoadList[];
extern const char *ObjHiveLoadList[];
} // namespace devilution

733
Source/objects.cpp

File diff suppressed because it is too large Load Diff

13
Source/objects.h

@ -170,7 +170,15 @@ struct Object {
*/
[[nodiscard]] constexpr bool IsBarrel() const
{
return IsAnyOf(_otype, _object_id::OBJ_BARREL, _object_id::OBJ_BARRELEX);
return IsAnyOf(_otype, _object_id::OBJ_BARREL, _object_id::OBJ_BARRELEX, _object_id::OBJ_POD, _object_id::OBJ_PODEX, _object_id::OBJ_URN, _object_id::OBJ_URNEX);
}
/**
* @brief Check if this object contains explosives or caustic material
*/
[[nodiscard]] constexpr bool isExplosive() const
{
return IsAnyOf(_otype, _object_id::OBJ_BARRELEX, _object_id::OBJ_PODEX, _object_id::OBJ_URNEX);
}
/**
@ -220,7 +228,7 @@ struct Object {
*/
[[nodiscard]] constexpr bool IsDoor() const
{
return IsAnyOf(_otype, _object_id::OBJ_L1LDOOR, _object_id::OBJ_L1RDOOR, _object_id::OBJ_L2LDOOR, _object_id::OBJ_L2RDOOR, _object_id::OBJ_L3LDOOR, _object_id::OBJ_L3RDOOR);
return IsAnyOf(_otype, _object_id::OBJ_L1LDOOR, _object_id::OBJ_L1RDOOR, _object_id::OBJ_L2LDOOR, _object_id::OBJ_L2RDOOR, _object_id::OBJ_L3LDOOR, _object_id::OBJ_L3RDOOR, _object_id::OBJ_L5LDOOR, _object_id::OBJ_L5RDOOR);
}
/**
@ -280,6 +288,7 @@ void InitObjectGFX();
void FreeObjectGFX();
void AddL1Objs(int x1, int y1, int x2, int y2);
void AddL2Objs(int x1, int y1, int x2, int y2);
void AddL5Objs(int x1, int y1, int x2, int y2);
void InitObjects();
void SetMapObjects(const uint16_t *dunData, int startx, int starty);
/**

2
Source/player.cpp

@ -2917,7 +2917,7 @@ void PlrClrTrans(Point position)
void PlrDoTrans(Point position)
{
if (leveltype != DTYPE_CATHEDRAL && leveltype != DTYPE_CATACOMBS) {
if (IsNoneOf(leveltype, DTYPE_CATHEDRAL, DTYPE_CATACOMBS, DTYPE_CRYPT)) {
TransList[1] = true;
return;
}

6
Source/sound.cpp

@ -121,8 +121,8 @@ const char *const SpawnMusicTracks[NUM_MUSIC] = {
"Music\\sLvlA.wav",
"Music\\sLvlA.wav",
"Music\\sLvlA.wav",
"Music\\DLvlE.wav",
"Music\\DLvlF.wav",
"Music\\DLvlE.wav",
"Music\\sintro.wav",
};
/** Maps from track ID to track name. */
@ -132,8 +132,8 @@ const char *const MusicTracks[NUM_MUSIC] = {
"Music\\DLvlB.wav",
"Music\\DLvlC.wav",
"Music\\DLvlD.wav",
"Music\\DLvlE.wav",
"Music\\DLvlF.wav",
"Music\\DLvlE.wav",
"Music\\Dintro.wav",
};
@ -228,7 +228,7 @@ void music_stop()
sgnMusicTrack = NUM_MUSIC;
}
void music_start(uint8_t nTrack)
void music_start(_music_id nTrack)
{
const char *trackPath;

14
Source/sound.h

@ -19,12 +19,12 @@ namespace devilution {
enum _music_id : uint8_t {
TMUSIC_TOWN,
TMUSIC_L1,
TMUSIC_L2,
TMUSIC_L3,
TMUSIC_L4,
TMUSIC_L5,
TMUSIC_L6,
TMUSIC_CATHEDRAL,
TMUSIC_CATACOMBS,
TMUSIC_CAVES,
TMUSIC_HELL,
TMUSIC_NEST,
TMUSIC_CRYPT,
TMUSIC_INTRO,
NUM_MUSIC,
};
@ -59,7 +59,7 @@ std::unique_ptr<TSnd> sound_file_load(const char *path, bool stream = false);
void snd_init();
void snd_deinit();
void music_stop();
void music_start(uint8_t nTrack);
void music_start(_music_id nTrack);
void sound_disable_music(bool disable);
int sound_get_or_set_music_volume(int volume);
int sound_get_or_set_sound_volume(int volume);

108
Source/themes.cpp

@ -141,7 +141,7 @@ bool TFit_Obj5(int t)
bool TFit_SkelRoom(int t)
{
if (leveltype != DTYPE_CATHEDRAL && leveltype != DTYPE_CATACOMBS) {
if (IsNoneOf(leveltype, DTYPE_CATHEDRAL, DTYPE_CATACOMBS, DTYPE_CRYPT)) {
return false;
}
@ -193,7 +193,7 @@ bool CheckThemeObj3(Point origin, int8_t regionId, int frequency)
bool TFit_Obj3(int8_t regionId)
{
char objrnd[4] = { 4, 4, 3, 5 };
int objrnd[6] = { 4, 4, 3, 5, 3, 4 };
for (int yp = 1; yp < MAXDUNY - 1; yp++) {
for (int xp = 1; xp < MAXDUNX - 1; xp++) {
@ -229,7 +229,7 @@ bool CheckThemeReqs(theme_id t)
}
break;
case THEME_ARMORSTAND:
if (leveltype == DTYPE_CATHEDRAL) {
if (leveltype == DTYPE_CATHEDRAL || leveltype == DTYPE_CRYPT) {
return false;
}
break;
@ -249,7 +249,7 @@ bool CheckThemeReqs(theme_id t)
}
break;
case THEME_WEAPONRACK:
if (leveltype == DTYPE_CATHEDRAL) {
if (leveltype == DTYPE_CATHEDRAL || leveltype == DTYPE_CRYPT) {
return false;
}
break;
@ -363,7 +363,7 @@ bool CheckThemeRoom(int tv)
}
}
if (leveltype == DTYPE_CATHEDRAL && (tarea < 9 || tarea > 100))
if (IsAnyOf(leveltype, DTYPE_CATHEDRAL, DTYPE_CRYPT) && (tarea < 9 || tarea > 100))
return false;
for (int j = 0; j < MAXDUNY; j++) {
@ -400,7 +400,7 @@ void InitThemes()
if (currlevel == 16)
return;
if (leveltype == DTYPE_CATHEDRAL) {
if (IsAnyOf(leveltype, DTYPE_CATHEDRAL, DTYPE_CRYPT)) {
for (size_t i = 0; i < 256 && numthemes < MAXTHEMES; i++) {
if (CheckThemeRoom(i)) {
themes[numthemes].ttval = i;
@ -412,32 +412,34 @@ void InitThemes()
numthemes++;
}
}
return;
}
if (leveltype == DTYPE_CATACOMBS || leveltype == DTYPE_CAVES || leveltype == DTYPE_HELL) {
for (int i = 0; i < themeCount; i++)
themes[i].ttype = THEME_NONE;
if (Quests[Q_ZHAR].IsAvailable()) {
for (int j = 0; j < themeCount; j++) {
themes[j].ttval = themeLoc[j].ttval;
if (SpecialThemeFit(j, THEME_LIBRARY)) {
themes[j].ttype = THEME_LIBRARY;
zharlib = j;
break;
}
for (int i = 0; i < themeCount; i++) {
themes[i].ttype = THEME_NONE;
}
if (Quests[Q_ZHAR].IsAvailable()) {
for (int j = 0; j < themeCount; j++) {
themes[j].ttval = themeLoc[j].ttval;
if (SpecialThemeFit(j, THEME_LIBRARY)) {
themes[j].ttype = THEME_LIBRARY;
zharlib = j;
break;
}
}
for (int i = 0; i < themeCount; i++) {
if (themes[i].ttype == THEME_NONE) {
themes[i].ttval = themeLoc[i].ttval;
theme_id j = ThemeGood[GenerateRnd(4)];
while (!SpecialThemeFit(i, j)) {
j = (theme_id)GenerateRnd(17);
}
themes[i].ttype = j;
}
for (int i = 0; i < themeCount; i++) {
if (themes[i].ttype == THEME_NONE) {
themes[i].ttval = themeLoc[i].ttval;
theme_id j = ThemeGood[GenerateRnd(4)];
while (!SpecialThemeFit(i, j)) {
j = (theme_id)GenerateRnd(17);
}
themes[i].ttype = j;
}
numthemes += themeCount;
}
numthemes += themeCount;
}
void HoldThemeRooms()
@ -445,7 +447,7 @@ void HoldThemeRooms()
if (currlevel == 16)
return;
if (leveltype != DTYPE_CATHEDRAL) {
if (leveltype != DTYPE_CATHEDRAL && leveltype != DTYPE_CRYPT) {
DRLG_HoldThemeRooms();
return;
}
@ -498,8 +500,8 @@ void PlaceThemeMonsts(int t, int f)
*/
void Theme_Barrel(int t)
{
char barrnd[4] = { 2, 6, 4, 8 };
char monstrnd[4] = { 5, 7, 3, 9 };
int barrnd[6] = { 2, 6, 4, 8, 4, 2 };
int monstrnd[6] = { 5, 7, 3, 9, 3, 5 };
for (int yp = 0; yp < MAXDUNY; yp++) {
for (int xp = 0; xp < MAXDUNX; xp++) {
@ -524,7 +526,7 @@ void Theme_Barrel(int t)
*/
void Theme_Shrine(int t)
{
char monstrnd[4] = { 6, 6, 3, 9 };
int monstrnd[6] = { 6, 6, 3, 9, 3, 6 };
TFit_Shrine(t);
if (themeVar1 == 1) {
@ -546,7 +548,7 @@ void Theme_Shrine(int t)
*/
void Theme_MonstPit(int t)
{
uint8_t monstrnd[4] = { 6, 7, 3, 9 };
int monstrnd[6] = { 6, 7, 3, 9, 3, 6 };
int r = GenerateRnd(100) + 1;
int ixp = 0;
@ -578,7 +580,7 @@ void Theme_MonstPit(int t)
*/
void Theme_SkelRoom(int t)
{
char monstrnd[4] = { 6, 7, 3, 9 };
int monstrnd[6] = { 6, 7, 3, 9, 3, 6 };
TFit_SkelRoom(t);
@ -651,8 +653,8 @@ void Theme_SkelRoom(int t)
*/
void Theme_Treasure(int t)
{
int8_t treasrnd[4] = { 4, 9, 7, 10 };
int8_t monstrnd[4] = { 6, 8, 3, 7 };
int treasrnd[6] = { 4, 9, 7, 10, 7, 4 };
int monstrnd[6] = { 6, 8, 3, 7, 3, 6 };
AdvanceRndSeed();
for (int yp = 0; yp < MAXDUNY; yp++) {
@ -669,7 +671,7 @@ void Theme_Treasure(int t)
CreateRndItem({ xp, yp }, false, false, true);
ItemNoFlippy();
}
if (rv >= treasureType - 2 && leveltype != DTYPE_CATHEDRAL) {
if (rv >= treasureType - 2 && IsNoneOf(leveltype, DTYPE_CATHEDRAL, DTYPE_CRYPT)) {
Item &item = Items[ActiveItems[ActiveItemCount - 1]];
if (item.IDidx == IDI_GOLD) {
item._ivalue = std::max(item._ivalue / 2, 1);
@ -688,8 +690,8 @@ void Theme_Treasure(int t)
*/
void Theme_Library(int t)
{
char librnd[4] = { 1, 2, 2, 5 };
char monstrnd[4] = { 5, 7, 3, 9 };
int librnd[6] = { 1, 2, 2, 5, 2, 1 };
int monstrnd[6] = { 5, 7, 3, 9, 3, 5 };
TFit_Shrine(t);
@ -735,8 +737,8 @@ void Theme_Library(int t)
*/
void Theme_Torture(int t)
{
char tortrnd[4] = { 6, 8, 3, 8 };
char monstrnd[4] = { 6, 8, 3, 9 };
int tortrnd[6] = { 6, 8, 3, 8, 3, 6 };
int monstrnd[6] = { 6, 8, 3, 9, 3, 6 };
for (int yp = 1; yp < MAXDUNY - 1; yp++) {
for (int xp = 1; xp < MAXDUNX - 1; xp++) {
@ -758,7 +760,7 @@ void Theme_Torture(int t)
*/
void Theme_BloodFountain(int t)
{
char monstrnd[4] = { 6, 8, 3, 9 };
int monstrnd[6] = { 6, 8, 3, 9, 3, 6 };
TFit_Obj5(t);
AddObject(OBJ_BLOODFTN, { themex, themey });
@ -772,8 +774,8 @@ void Theme_BloodFountain(int t)
*/
void Theme_Decap(int t)
{
char decaprnd[4] = { 6, 8, 3, 8 };
char monstrnd[4] = { 6, 8, 3, 9 };
int decaprnd[6] = { 6, 8, 3, 8, 3, 6 };
int monstrnd[6] = { 6, 8, 3, 9, 3, 6 };
for (int yp = 1; yp < MAXDUNY - 1; yp++) {
for (int xp = 1; xp < MAXDUNX - 1; xp++) {
@ -796,7 +798,7 @@ void Theme_Decap(int t)
*/
void Theme_PurifyingFountain(int t)
{
char monstrnd[4] = { 6, 7, 3, 9 };
int monstrnd[6] = { 6, 7, 3, 9, 3, 6 };
TFit_Obj5(t);
AddObject(OBJ_PURIFYINGFTN, { themex, themey });
@ -810,8 +812,8 @@ void Theme_PurifyingFountain(int t)
*/
void Theme_ArmorStand(int t)
{
char armorrnd[4] = { 6, 8, 3, 8 };
char monstrnd[4] = { 6, 7, 3, 9 };
int armorrnd[6] = { 6, 8, 3, 8, 3, 6 };
int monstrnd[6] = { 6, 7, 3, 9, 3, 6 };
if (armorFlag) {
TFit_Obj3(themes[t].ttval);
@ -857,7 +859,7 @@ void Theme_GoatShrine(int t)
*/
void Theme_Cauldron(int t)
{
char monstrnd[4] = { 6, 7, 3, 9 };
int monstrnd[6] = { 6, 7, 3, 9, 3, 6 };
TFit_Obj5(t);
AddObject(OBJ_CAULDRON, { themex, themey });
@ -871,7 +873,7 @@ void Theme_Cauldron(int t)
*/
void Theme_MurkyFountain(int t)
{
char monstrnd[4] = { 6, 7, 3, 9 };
int monstrnd[6] = { 6, 7, 3, 9, 3, 6 };
TFit_Obj5(t);
AddObject(OBJ_MURKYFTN, { themex, themey });
@ -885,7 +887,7 @@ void Theme_MurkyFountain(int t)
*/
void Theme_TearFountain(int t)
{
char monstrnd[4] = { 6, 7, 3, 9 };
int monstrnd[6] = { 6, 7, 3, 9, 3, 6 };
TFit_Obj5(t);
AddObject(OBJ_TEARFTN, { themex, themey });
@ -900,8 +902,8 @@ void Theme_TearFountain(int t)
void Theme_BrnCross(int t)
{
int8_t regionId = themes[t].ttval;
char monstrnd[4] = { 6, 8, 3, 9 };
char bcrossrnd[4] = { 5, 7, 3, 8 };
int monstrnd[6] = { 6, 8, 3, 9, 3, 6 };
int bcrossrnd[6] = { 5, 7, 3, 8, 3, 5 };
for (int yp = 0; yp < MAXDUNY; yp++) {
for (int xp = 0; xp < MAXDUNX; xp++) {
@ -925,8 +927,8 @@ void Theme_BrnCross(int t)
void Theme_WeaponRack(int t)
{
int8_t regionId = themes[t].ttval;
char weaponrnd[4] = { 6, 8, 5, 8 };
char monstrnd[4] = { 6, 7, 3, 9 };
int weaponrnd[6] = { 6, 8, 5, 8, 5, 6 };
int monstrnd[6] = { 6, 7, 3, 9, 3, 6 };
if (weaponFlag) {
TFit_Obj3(regionId);
@ -963,7 +965,7 @@ void UpdateL4Trans()
void CreateThemeRooms()
{
if (currlevel == 16) {
if (currlevel == 16 || IsAnyOf(leveltype, DTYPE_NEST, DTYPE_CRYPT)) {
return;
}
ApplyObjectLighting = true;

2
Source/trigs.cpp

@ -761,12 +761,14 @@ void CheckTrigForce()
trigflag = ForceTownTrig();
break;
case DTYPE_CATHEDRAL:
case DTYPE_CRYPT:
trigflag = ForceL1Trig();
break;
case DTYPE_CATACOMBS:
trigflag = ForceL2Trig();
break;
case DTYPE_CAVES:
case DTYPE_NEST:
trigflag = ForceL3Trig();
break;
case DTYPE_HELL:

Loading…
Cancel
Save