changes to reforge calculations

This commit is contained in:
aPunch 2012-02-21 01:43:42 -06:00
parent bca7427c1c
commit 377d93062a

View File

@ -164,11 +164,15 @@ public class BlacksmithCharacter extends Character {
} }
} }
// Damage the item // Damage the item
if (random.nextInt(3) == 0) { short durability = (short) (reforge.getDurability() + reforge.getDurability() * random.nextInt(5));
reforge.setDurability(reforge.getDurability() + reforge.getDurability() * random.nextInt(3) < reforge System.out.println("durability: " + durability);
.getType().getMaxDurability() ? (short) (reforge.getDurability() + reforge.getDurability() short maxDurability = reforge.getType().getMaxDurability();
* random.nextInt(3)) : (short) (reforge.getType().getMaxDurability() - 10)); if (durability <= 0)
} durability = (short) (maxDurability / 3);
else if (reforge.getDurability() + durability > maxDurability)
durability = (short) (maxDurability - random.nextInt(maxDurability - 25));
System.out.println("durabilityModified: " + durability);
reforge.setDurability((short) (durability));
return false; return false;
} }
int chance = 50; int chance = 50;