diff --git a/Source/levels/crypt.cpp b/Source/levels/crypt.cpp index fd942d2ab..e2b160466 100644 --- a/Source/levels/crypt.cpp +++ b/Source/levels/crypt.cpp @@ -4,6 +4,7 @@ #include "engine/point.hpp" #include "items.h" #include "levels/drlg_l1.h" +#include "lighting.h" namespace devilution { @@ -811,4 +812,27 @@ void SetCryptSetPieceRoom() } } +void PlaceCryptLights() +{ + constexpr int lavaTiles[] = { + 124, 128, 130, 132, 133, 134, 135, 139, 141, 143, 145, 156, 164, 166, + 167, 168, 169, 170, 182, 190, 192, 195, 196, 199, 200, 254, 266, 273, + 276, 281, 282, 283, 284, 285, 286, 287, 288, 290, 302, 316, 434, 435, + 436, 437, 445, 446, 447, 453, 457, 460, 466, 470, 477, 479, 484, 485, + 486, 490, 507, 537, 557, 559, 561, 563, 564, 568, 569, 572, 578, 580, + 584, 585, 589, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601 + }; + + for (int j = 0; j < MAXDUNY; j++) { + for (int i = 0; i < MAXDUNX; i++) { + for (const int lavaTile : lavaTiles) { + if (dPiece[i][j] == lavaTile) { + DoLighting({ i, j }, 3, {}); + break; + } + } + } + } +} + } // namespace devilution diff --git a/Source/levels/crypt.h b/Source/levels/crypt.h index 9c06f54f2..9f8786e54 100644 --- a/Source/levels/crypt.h +++ b/Source/levels/crypt.h @@ -24,5 +24,6 @@ void FixCryptDirtTiles(); bool PlaceCryptStairs(lvl_entry entry); void CryptSubstitution(); void SetCryptSetPieceRoom(); +void PlaceCryptLights(); } // namespace devilution diff --git a/Source/levels/drlg_l1.cpp b/Source/levels/drlg_l1.cpp index bf7e726d1..d48e2b975 100644 --- a/Source/levels/drlg_l1.cpp +++ b/Source/levels/drlg_l1.cpp @@ -1298,6 +1298,7 @@ void CreateL5Dungeon(uint32_t rseed, lvl_entry entry) Pass3(); if (leveltype == DTYPE_CRYPT) { + PlaceCryptLights(); SetCryptSetPieceRoom(); } } @@ -1324,10 +1325,12 @@ void LoadL1Dungeon(const char *path, Point spawn) Pass3(); - if (setlvltype == DTYPE_CRYPT) + if (setlvltype == DTYPE_CRYPT) { AddCryptObjects(0, 0, MAXDUNX, MAXDUNY); - else + PlaceCryptLights(); + } else { AddL1Objs(0, 0, MAXDUNX, MAXDUNY); + } } } // namespace devilution diff --git a/Source/lighting.cpp b/Source/lighting.cpp index f7735a2d0..66930ca90 100644 --- a/Source/lighting.cpp +++ b/Source/lighting.cpp @@ -381,7 +381,7 @@ void MakeLightTable() float scaled; if (IsAnyOf(leveltype, DTYPE_NEST, DTYPE_CRYPT)) { // quardratic falloff with over exposure - const float brightness = radius * 1.5; + const float brightness = radius * 1.25; scaled = factor * factor * brightness + (maxDarkness - brightness); scaled = std::max(maxBrightness, scaled); } else {