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

Function GetItemBonus

Source/items.cpp:1757–1790  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1755}
1756
1757void GetItemBonus(int i, int idata, int minlvl, int maxlvl, BOOL onlygood)
1758{
1759 if (item[i]._iClass != ICLASS_GOLD) {
1760 if (minlvl > 25)
1761 minlvl = 25;
1762
1763 switch (item[i]._itype) {
1764 case ITYPE_SWORD:
1765 case ITYPE_AXE:
1766 case ITYPE_MACE:
1767 GetItemPower(i, minlvl, maxlvl, PLT_WEAP, onlygood);
1768 break;
1769 case ITYPE_BOW:
1770 GetItemPower(i, minlvl, maxlvl, PLT_BOW, onlygood);
1771 break;
1772 case ITYPE_SHIELD:
1773 GetItemPower(i, minlvl, maxlvl, PLT_SHLD, onlygood);
1774 break;
1775 case ITYPE_LARMOR:
1776 case ITYPE_HELM:
1777 case ITYPE_MARMOR:
1778 case ITYPE_HARMOR:
1779 GetItemPower(i, minlvl, maxlvl, PLT_ARMO, onlygood);
1780 break;
1781 case ITYPE_STAFF:
1782 GetStaffSpell(i, maxlvl, onlygood);
1783 break;
1784 case ITYPE_RING:
1785 case ITYPE_AMULET:
1786 GetItemPower(i, minlvl, maxlvl, PLT_MISC, onlygood);
1787 break;
1788 }
1789 }
1790}
1791
1792void SetupItem(int i)
1793{

Callers 7

SetupAllItemsFunction · 0.85
SpawnOnePremiumFunction · 0.85
SpawnWitchFunction · 0.85
SpawnBoyFunction · 0.85
RecreatePremiumItemFunction · 0.85
RecreateBoyItemFunction · 0.85
RecreateWitchItemFunction · 0.85

Calls 2

GetItemPowerFunction · 0.85
GetStaffSpellFunction · 0.85

Tested by

no test coverage detected