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

Function Theme_MonstPit

Source/themes.cpp:562–592  ·  view source on GitHub ↗

Theme_MonstPit initializes the monster pit theme. Parameters: - t: theme number (index into themes array).

Source from the content-addressed store, hash-verified

560// Parameters:
561// - t: theme number (index into themes array).
562void Theme_MonstPit(int t)
563{
564 int r;
565 int ixp, iyp;
566 char monstrnd[4] = { 6, 7, 3, 9 };
567
568 r = random_(0, 100) + 1;
569 ixp = 0;
570 iyp = 0;
571 if (r > 0) {
572 while (TRUE) {
573 if (dTransVal[ixp][iyp] == themes[t].ttval && !nSolidTable[dPiece[ixp][iyp]]) {
574 --r;
575 }
576 if (r <= 0) {
577 break;
578 }
579 ixp++;
580 if (ixp == MAXDUNX) {
581 ixp = 0;
582 iyp++;
583 if (iyp == MAXDUNY) {
584 iyp = 0;
585 }
586 }
587 }
588 }
589 CreateRndItem(ixp, iyp, TRUE, FALSE, TRUE);
590 ItemNoFlippy();
591 PlaceThemeMonsts(t, monstrnd[leveltype - 1]);
592}
593
594// Theme_SkelRoom initializes the skeleton room theme.
595//

Callers 1

CreateThemeRoomsFunction · 0.85

Calls 4

random_Function · 0.85
CreateRndItemFunction · 0.85
ItemNoFlippyFunction · 0.85
PlaceThemeMonstsFunction · 0.85

Tested by

no test coverage detected