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

Function CheckBookLevel

Source/inv.cpp:1353–1369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1351}
1352
1353void CheckBookLevel(int pnum)
1354{
1355 int slvl;
1356
1357 if (plr[pnum].HoldItem._iMiscId == IMISC_BOOK) {
1358 plr[pnum].HoldItem._iMinMag = spelldata[plr[pnum].HoldItem._iSpell].sMinInt;
1359 slvl = plr[pnum]._pSplLvl[plr[pnum].HoldItem._iSpell];
1360 while (slvl) {
1361 plr[pnum].HoldItem._iMinMag += 20 * plr[pnum].HoldItem._iMinMag / 100;
1362 slvl--;
1363 if (plr[pnum].HoldItem._iMinMag + 20 * plr[pnum].HoldItem._iMinMag / 100 > 255) {
1364 plr[pnum].HoldItem._iMinMag = -1;
1365 slvl = 0;
1366 }
1367 }
1368 }
1369}
1370
1371void CheckQuestItem(int pnum)
1372{

Callers 2

InvGetItemFunction · 0.85
AutoGetItemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected