From 3d7810c56854c2efc80a8a8085852a2037538f2e Mon Sep 17 00:00:00 2001 From: Ineusia Date: Sat, 28 Sep 2024 16:21:44 -0400 Subject: [PATCH] Bugfix/acrobatics roll chance (#5094) * Fix acrobatics * Move acrobatics damage reduction inside success check --- .../skills/subskills/acrobatics/Roll.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java b/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java index 530c7ec02..99bb1b457 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java @@ -77,18 +77,18 @@ public class Roll extends AcrobaticsSubSkill { return false; } - // Clear out the damage from falling so that way our modified damage doesn't get re-reduced by protection/feather falling - entityDamageEvent.setDamage(0); - // Send the damage is MAGIC so that it cuts through all resistances - // This is fine because we considered protection/featherfalling in the rollCheck method - entityDamageEvent.setDamage(EntityDamageEvent.DamageModifier.MAGIC, rollResult.getModifiedDamage()); - - if (entityDamageEvent.getFinalDamage() == 0) { - entityDamageEvent.setCancelled(true); - } - - // Roll happened, send messages and XP + // Roll happened, reduce damage, send messages and XP if (rollResult.isRollSuccess()) { + // Clear out the damage from falling so that way our modified damage doesn't get re-reduced by protection/feather falling + entityDamageEvent.setDamage(0); + // Send the damage is MAGIC so that it cuts through all resistances + // This is fine because we considered protection/featherfalling in the rollCheck method + entityDamageEvent.setDamage(EntityDamageEvent.DamageModifier.MAGIC, rollResult.getModifiedDamage()); + + if (entityDamageEvent.getFinalDamage() == 0) { + entityDamageEvent.setCancelled(true); + } + final String key = rollResult.isGraceful() ? GRACEFUL_ROLL_ACTIVATED_LOCALE_STR_KEY : ROLL_ACTIVATED_LOCALE_KEY; sendPlayerInformation(mmoPlayer.getPlayer(), NotificationType.SUBSKILL_MESSAGE, key);