MCPcopy Create free account
hub / github.com/diasurgical/devilution / Theme_Decap

Function Theme_Decap

Source/themes.cpp:786–804  ·  view source on GitHub ↗

Theme_Decap initializes the decapitated theme. Parameters: - t: theme number (index into themes array).

Source from the content-addressed store, hash-verified

784// Parameters:
785// - t: theme number (index into themes array).
786void Theme_Decap(int t)
787{
788 int xp, yp;
789 char decaprnd[4] = { 6, 8, 3, 8 };
790 char monstrnd[4] = { 6, 8, 3, 9 };
791
792 for (yp = 1; yp < MAXDUNY - 1; yp++) {
793 for (xp = 1; xp < MAXDUNX - 1; xp++) {
794 if (dTransVal[xp][yp] == themes[t].ttval && !nSolidTable[dPiece[xp][yp]]) {
795 if (CheckThemeObj3(xp, yp, t, -1)) {
796 if (random_(0, decaprnd[leveltype - 1]) == 0) {
797 AddObject(OBJ_DECAP, xp, yp);
798 }
799 }
800 }
801 }
802 }
803 PlaceThemeMonsts(t, monstrnd[leveltype - 1]);
804}
805
806// Theme_PurifyingFountain initializes the purifying fountain theme.
807//

Callers 1

CreateThemeRoomsFunction · 0.85

Calls 4

CheckThemeObj3Function · 0.85
random_Function · 0.85
AddObjectFunction · 0.85
PlaceThemeMonstsFunction · 0.85

Tested by

no test coverage detected