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

Function Theme_WeaponRack

Source/themes.cpp:935–958  ·  view source on GitHub ↗

Theme_WeaponRack initializes the weapon rack theme. Parameters: - t: theme number (index into themes array).

Source from the content-addressed store, hash-verified

933// Parameters:
934// - t: theme number (index into themes array).
935void Theme_WeaponRack(int t)
936{
937 int xp, yp;
938 char weaponrnd[4] = { 6, 8, 5, 8 };
939 char monstrnd[4] = { 6, 7, 3, 9 };
940
941 if (weaponFlag) {
942 TFit_Obj3(t);
943 AddObject(OBJ_WEAPONRACK, themex, themey);
944 }
945 for (yp = 0; yp < MAXDUNY; yp++) {
946 for (xp = 0; xp < MAXDUNX; xp++) {
947 if (dTransVal[xp][yp] == themes[t].ttval && !nSolidTable[dPiece[xp][yp]]) {
948 if (CheckThemeObj3(xp, yp, t, -1)) {
949 if (random_(0, weaponrnd[leveltype - 1]) == 0) {
950 AddObject(OBJ_WEAPONRACKN, xp, yp);
951 }
952 }
953 }
954 }
955 }
956 PlaceThemeMonsts(t, monstrnd[leveltype - 1]);
957 weaponFlag = FALSE;
958}
959
960// UpdateL4Trans sets each value of the transparency map to 1.
961void UpdateL4Trans()

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