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

Function AddShrine

Source/objects.cpp:1107–1140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1105}
1106
1107void AddShrine(int i)
1108{
1109 int val, j, slist[NUM_SHRINETYPE];
1110
1111 object[i]._oPreFlag = TRUE;
1112 for (j = 0; j < NUM_SHRINETYPE; j++) {
1113 if (currlevel < shrinemin[j] || currlevel > shrinemax[j]) {
1114 slist[j] = 0;
1115 } else {
1116 slist[j] = 1;
1117 }
1118 if (gbMaxPlayers != 1) {
1119 if (shrineavail[j] == 1) {
1120 slist[j] = 0;
1121 }
1122 } else {
1123 if (shrineavail[j] == 2) {
1124 slist[j] = 0;
1125 }
1126 }
1127 }
1128 while (1) {
1129 val = random_(150, NUM_SHRINETYPE);
1130 if (slist[val]) {
1131 break;
1132 }
1133 }
1134
1135 object[i]._oVar1 = val;
1136 if (random_(150, 2)) {
1137 object[i]._oAnimFrame = 12;
1138 object[i]._oAnimLen = 22;
1139 }
1140}
1141
1142void AddBookcase(int i)
1143{

Callers 1

AddObjectFunction · 0.85

Calls 1

random_Function · 0.85

Tested by

no test coverage detected