QcToolWear Namespace
One use of an item that wears (decision E-864): a tool mining, a weapon hitting, a bow shooting. More...
| Header: | #include <server/gameplay/QcToolWear.h> |
Functions
| bool | armourKeeps(QcServerState &state, const QcItemStack &stack) |
| QcItemStack | worn(QcServerState &state, const QcItemStack &tool) |
Detailed Description
Unbreaking lets a use leave the durability with the chance of QcEnchanting::keepsDurability, drawn from the server's random generator.
Function Documentation
bool QcToolWear::armourKeeps(QcServerState &state, const QcItemStack &stack)
Returns whether unbreaking keeps a worn armour piece stack from wearing by a hit (dice from state).
QcItemStack QcToolWear::worn(QcServerState &state, const QcItemStack &tool)
Returns tool after one use: one more damage, empty when that breaks it; unchanged for items without durability or when unbreaking keeps it (dice from state).