Skip to content
Permalink
Browse files

potential for fewer errors in the damage estimator

  • Loading branch information...
mcmonkey4eva committed May 20, 2017
1 parent c1cf751 commit d950df27027f60d42512d2f6c6debc5a0de4c959
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/main/java/org/mcmonkey/sentinel/SentinelTrait.java
@@ -615,10 +615,12 @@ public double getDamage() {
}
// TODO: Less randomness, more game-like calculations.
double multiplier = 1;
multiplier += weapon.getItemMeta() == null ? 0 : weapon.getItemMeta().getEnchantLevel(Enchantment.DAMAGE_ALL) * 0.2;
multiplier += weapon.getItemMeta() == null || !weapon.getItemMeta().hasEnchant(Enchantment.DAMAGE_ALL)
? 0 : weapon.getItemMeta().getEnchantLevel(Enchantment.DAMAGE_ALL) * 0.2;
switch (weapon.getType()) {
case BOW:
return 6 * (1 + (weapon.getItemMeta() == null ? 0 : weapon.getItemMeta().getEnchantLevel(Enchantment.ARROW_DAMAGE) * 0.3));
return 6 * (1 + (weapon.getItemMeta() == null || !weapon.getItemMeta().hasEnchant(Enchantment.ARROW_DAMAGE)
? 0 : weapon.getItemMeta().getEnchantLevel(Enchantment.ARROW_DAMAGE) * 0.3));
case DIAMOND_SWORD:
return 7 * multiplier;
case IRON_SWORD:

0 comments on commit d950df2

Please sign in to comment.
You can’t perform that action at this time.