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

Function Theme_ArmorStand

Source/themes.cpp:823–846  ·  view source on GitHub ↗

Theme_ArmorStand initializes the armor stand theme. Parameters: - t: theme number (index into themes array).

Source from the content-addressed store, hash-verified

821// Parameters:
822// - t: theme number (index into themes array).
823void Theme_ArmorStand(int t)
824{
825 int xp, yp;
826 char armorrnd[4] = { 6, 8, 3, 8 };
827 char monstrnd[4] = { 6, 7, 3, 9 };
828
829 if (armorFlag) {
830 TFit_Obj3(t);
831 AddObject(OBJ_ARMORSTAND, themex, themey);
832 }
833 for (yp = 0; yp < MAXDUNY; yp++) {
834 for (xp = 0; xp < MAXDUNX; xp++) {
835 if (dTransVal[xp][yp] == themes[t].ttval && !nSolidTable[dPiece[xp][yp]]) {
836 if (CheckThemeObj3(xp, yp, t, -1)) {
837 if (random_(0, armorrnd[leveltype - 1]) == 0) {
838 AddObject(OBJ_ARMORSTANDN, xp, yp);
839 }
840 }
841 }
842 }
843 }
844 PlaceThemeMonsts(t, monstrnd[leveltype - 1]);
845 armorFlag = FALSE;
846}
847
848// Theme_GoatShrine initializes the goat shrine theme.
849//

Callers 1

CreateThemeRoomsFunction · 0.85

Calls 5

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

Tested by

no test coverage detected