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

Function SpawnHealer

Source/items.cpp:3735–3774  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3733}
3734
3735void SpawnHealer(int lvl)
3736{
3737 int i, nsi, srnd, itype;
3738
3739 GetItemAttrs(0, IDI_HEAL, 1);
3740 healitem[0] = item[0];
3741 healitem[0]._iCreateInfo = lvl;
3742 healitem[0]._iStatFlag = TRUE;
3743
3744 GetItemAttrs(0, IDI_FULLHEAL, 1);
3745 healitem[1] = item[0];
3746 healitem[1]._iCreateInfo = lvl;
3747 healitem[1]._iStatFlag = TRUE;
3748
3749 if (gbMaxPlayers != 1) {
3750 GetItemAttrs(0, IDI_RESURRECT, 1);
3751 healitem[2] = item[0];
3752 healitem[2]._iCreateInfo = lvl;
3753 healitem[2]._iStatFlag = TRUE;
3754
3755 srnd = 3;
3756 } else {
3757 srnd = 2;
3758 }
3759 nsi = random_(50, 8) + 10;
3760 for (i = srnd; i < nsi; i++) {
3761 item[0]._iSeed = GetRndSeed();
3762 SetRndSeed(item[0]._iSeed);
3763 itype = RndHealerItem(lvl) - 1;
3764 GetItemAttrs(0, itype, lvl);
3765 healitem[i] = item[0];
3766 healitem[i]._iCreateInfo = lvl | 0x4000;
3767 healitem[i]._iIdentified = TRUE;
3768 healitem[i]._iStatFlag = StoreStatOk(&healitem[i]);
3769 }
3770 for (i = nsi; i < 20; i++) {
3771 healitem[i]._itype = ITYPE_NONE;
3772 }
3773 SortHealer();
3774}
3775
3776void SpawnStoreGold()
3777{

Callers 1

SetupTownStoresFunction · 0.85

Calls 7

GetItemAttrsFunction · 0.85
random_Function · 0.85
GetRndSeedFunction · 0.85
SetRndSeedFunction · 0.85
RndHealerItemFunction · 0.85
StoreStatOkFunction · 0.85
SortHealerFunction · 0.85

Tested by

no test coverage detected