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

Function DrawDurIcon4Item

Source/control.cpp:1650–1683  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1648}
1649
1650int DrawDurIcon4Item(ItemStruct *pItem, int x, int c)
1651{
1652 if (pItem->_itype == ITYPE_NONE)
1653 return x;
1654 if (pItem->_iDurability > 5)
1655 return x;
1656 if (c == 0) {
1657 if (pItem->_iClass == ICLASS_WEAPON) {
1658 switch (pItem->_itype) {
1659 case ITYPE_SWORD:
1660 c = 2;
1661 break;
1662 case ITYPE_AXE:
1663 c = 6;
1664 break;
1665 case ITYPE_BOW:
1666 c = 7;
1667 break;
1668 case ITYPE_MACE:
1669 c = 5;
1670 break;
1671 case ITYPE_STAFF:
1672 c = 8;
1673 break;
1674 }
1675 } else {
1676 c = 1;
1677 }
1678 }
1679 if (pItem->_iDurability > 2)
1680 c += 8;
1681 CelDraw(x, -17 + PANEL_Y, pDurIcons, c, 32);
1682 return x - 40;
1683}
1684
1685void RedBack()
1686{

Callers 1

DrawDurIconFunction · 0.85

Calls 1

CelDrawFunction · 0.85

Tested by

no test coverage detected