Durability and initial charges migrated to template.

This commit is contained in:
2024-03-03 08:38:24 -05:00
parent 436d0cec9b
commit d7dfab5e74
6 changed files with 19 additions and 26 deletions
@@ -75,14 +75,17 @@ public class PrintInventoryCmd extends AbstractDevCmd {
int goldCount = 0;
for (Item item : inventory) {
if (item.getItemBase().getType().equals(ItemType.GOLD) == false) {
ItemTemplate template = ItemTemplate.itemTemplates.get(item.templsteID);
if (item.template.item_type.equals(ItemType.GOLD) == false) {
String chargeInfo = "";
byte chargeMax = item.getChargesMax();
int chargeMax = template.item_initial_charges;
if (chargeMax > 0) {
byte charges = (byte) item.chargesRemaining;
int charges = item.chargesRemaining;
chargeInfo = " charges: " + charges + '/' + chargeMax;
}
ItemTemplate template = ItemTemplate.itemTemplates.get(item.getTemplsteID());
throwbackInfo(pc, " " + template.item_base_name + ", count: " + item.getNumOfItems() + chargeInfo);
} else
goldCount += item.getNumOfItems();