|
|
|
@ -2371,28 +2371,6 @@ public class CharacterItemManager {
@@ -2371,28 +2371,6 @@ public class CharacterItemManager {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//Damage a random piece of armor a specified amount
|
|
|
|
|
public void damageRandomArmor(int amount) { |
|
|
|
|
ArrayList<Item> armor = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
if (this.equipped.containsKey(Enum.EquipSlotType.LHELD)) { |
|
|
|
|
Item item = this.equipped.get(Enum.EquipSlotType.LHELD); |
|
|
|
|
|
|
|
|
|
if (ItemTemplate.isShield(item)) |
|
|
|
|
armor.add(item); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (Item equipment : this.equipped.values()) |
|
|
|
|
if (equipment.template.item_type.equals(ItemType.ARMOR)) |
|
|
|
|
armor.add(equipment); |
|
|
|
|
|
|
|
|
|
if (armor.isEmpty()) |
|
|
|
|
return; //nothing to damage
|
|
|
|
|
|
|
|
|
|
int roll = ThreadLocalRandom.current().nextInt(armor.size()); |
|
|
|
|
damageItem(armor.get(roll), amount); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//Damage all equipped gear a random amount between 1 and 5
|
|
|
|
|
public void damageAllGear() { |
|
|
|
|
for (Item gear : this.equipped.values()) { |
|
|
|
|