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

Function CreateMagicWeapon

Source/items.cpp:3969–3994  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3967}
3968
3969void CreateMagicWeapon(int x, int y, int imisc, int icurs, BOOL sendmsg, BOOL delta)
3970{
3971 int ii, idx;
3972 BOOL done;
3973
3974 done = FALSE;
3975 if (numitems < MAXITEMS) {
3976 ii = itemavail[0];
3977 GetSuperItemSpace(x, y, ii);
3978 itemavail[0] = itemavail[MAXITEMS - numitems - 1];
3979 itemactive[numitems] = ii;
3980 idx = RndTypeItems(imisc, IMISC_NONE);
3981 while (!done) {
3982 SetupAllItems(ii, idx, GetRndSeed(), 2 * currlevel, 1, TRUE, FALSE, delta);
3983 if (item[ii]._iCurs == icurs)
3984 done = TRUE;
3985 else
3986 idx = RndTypeItems(imisc, IMISC_NONE);
3987 }
3988 if (sendmsg)
3989 NetSendCmdDItem(FALSE, ii);
3990 if (delta)
3991 DeltaAddItem(ii);
3992 numitems++;
3993 }
3994}
3995
3996BOOL GetItemRecord(int nSeed, WORD wCI, int nIndex)
3997{

Callers 1

OperateSlainHeroFunction · 0.85

Calls 6

GetSuperItemSpaceFunction · 0.85
RndTypeItemsFunction · 0.85
SetupAllItemsFunction · 0.85
GetRndSeedFunction · 0.85
NetSendCmdDItemFunction · 0.85
DeltaAddItemFunction · 0.85

Tested by

no test coverage detected