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

Function InitItems

Source/items.cpp:253–289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251}
252
253void InitItems()
254{
255 int i;
256 long s;
257
258 GetItemAttrs(0, IDI_GOLD, 1);
259 golditem = item[0];
260 golditem._iStatFlag = TRUE;
261 numitems = 0;
262
263 for (i = 0; i < MAXITEMS; i++) {
264 item[i]._itype = ITYPE_MISC;
265 item[i]._ix = 0;
266 item[i]._iy = 0;
267 item[i]._iAnimFlag = FALSE;
268 item[i]._iSelFlag = 0;
269 item[i]._iIdentified = FALSE;
270 item[i]._iPostDraw = FALSE;
271 }
272
273 for (i = 0; i < MAXITEMS; i++) {
274 itemavail[i] = i;
275 itemactive[i] = 0;
276 }
277
278 if (!setlevel) {
279 s = GetRndSeed(); /* unused */
280 if (QuestStatus(QTYPE_INFRA))
281 SpawnRock();
282 if (QuestStatus(QTYPE_ANVIL))
283 SpawnQuestItem(IDI_ANVIL, 2 * setpc_x + 27, 2 * setpc_y + 27, 0, 1);
284 if (currlevel > 0 && currlevel < 16)
285 AddInitItems();
286 }
287
288 uitemflag = FALSE;
289}
290
291void CalcPlrItemVals(int p, BOOL Loadgfx)
292{

Callers 1

LoadGameLevelFunction · 0.85

Calls 6

GetItemAttrsFunction · 0.85
GetRndSeedFunction · 0.85
QuestStatusFunction · 0.85
SpawnRockFunction · 0.85
SpawnQuestItemFunction · 0.85
AddInitItemsFunction · 0.85

Tested by

no test coverage detected