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

Method updateRequiredStatsCacheForPlayer

Source/items.cpp:4784–4799  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4782}
4783
4784void Item::updateRequiredStatsCacheForPlayer(const Player &player)
4785{
4786 if (_itype == ItemType::Misc && _iMiscId == IMISC_BOOK) {
4787 _iMinMag = GetSpellData(_iSpell).minInt;
4788 int8_t spellLevel = player._pSplLvl[static_cast<int8_t>(_iSpell)];
4789 while (spellLevel != 0) {
4790 _iMinMag += 20 * _iMinMag / 100;
4791 spellLevel--;
4792 if (_iMinMag + 20 * _iMinMag / 100 > 255) {
4793 _iMinMag = 255;
4794 spellLevel = 0;
4795 }
4796 }
4797 }
4798 _iStatFlag = player.CanUseItem(*this);
4799}
4800
4801StringOrView Item::getName() const
4802{

Callers 9

OperateBookFunction · 0.80
OperateShrineEnchantedFunction · 0.80
TextCmdArenaPotFunction · 0.80
InvGetItemFunction · 0.80
AutoGetItemFunction · 0.80
CalcPlrInvFunction · 0.80
UseItemFunction · 0.80
RefreshItemStatFlagsMethod · 0.80

Calls 1

CanUseItemMethod · 0.80

Tested by

no test coverage detected