diff --git a/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java b/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java index 8bce08230..407c105d3 100644 --- a/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java +++ b/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java @@ -151,7 +151,21 @@ public class AcrobaticsManager extends SkillManager { } private boolean isFatal(double damage) { - return getPlayer().getHealth() - damage <= 0; + Player player = getPlayer(); + int discount=1; + // If the player has resistance active, carry resistance checking + if(player.hasPotionEffect(PotionEffectType.DAMAGE_RESISTANCE)){ + Iterator potions=t.getActivePotionEffects().iterator(); + while(potions.hasNext()){ + PotionEffect potion=(PotionEffect)potions.next(); + if(potion.getType()==PotionEffectType.DAMAGE_RESISANCE) + {//Having resistance allows you to recieve less damage + int coupon=potion.getAmplifier(); + discount=Math.min(0,1-(coupon*0.2)); + } + } + }//...Which is accounted here + return getPlayer().getHealth() - damage*discount <= 0; } private float calculateRollXP(double damage, boolean isRoll) {