MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / AddInitItems

Function AddInitItems

Source/items.cpp:447–472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

445}
446
447void AddInitItems()
448{
449 int curlv = ItemsGetCurrlevel();
450 int rnd = GenerateRnd(3) + 3;
451 for (int j = 0; j < rnd; j++) {
452 int ii = AllocateItem();
453 auto &item = Items[ii];
454
455 Point position = GetRandomAvailableItemPosition();
456 item.position = position;
457
458 dItem[position.x][position.y] = ii + 1;
459
460 item._iSeed = AdvanceRndSeed();
461 SetRndSeed(item._iSeed);
462
463 GetItemAttrs(item, PickRandomlyAmong({ IDI_MANA, IDI_HEAL }), curlv);
464
465 item._iCreateInfo = curlv | CF_PREGEN;
466 SetupItem(item);
467 item.AnimInfo.currentFrame = item.AnimInfo.numberOfFrames - 1;
468 item._iAnimFlag = false;
469 item._iSelFlag = 1;
470 DeltaAddItem(ii);
471 }
472}
473
474void SpawnNote()
475{

Callers 1

InitItemsFunction · 0.85

Calls 10

ItemsGetCurrlevelFunction · 0.85
GenerateRndFunction · 0.85
AllocateItemFunction · 0.85
AdvanceRndSeedFunction · 0.85
SetRndSeedFunction · 0.85
GetItemAttrsFunction · 0.85
PickRandomlyAmongFunction · 0.85
SetupItemFunction · 0.85
DeltaAddItemFunction · 0.85

Tested by

no test coverage detected