Skip to content

Commit

Permalink
Bugfix/acrobatics roll chance (#5094)
Browse files Browse the repository at this point in the history
* Fix acrobatics

* Move acrobatics damage reduction inside success check
  • Loading branch information
Ineusia authored Sep 28, 2024
1 parent 8b81c9a commit 3d7810c
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,18 @@ public boolean doInteraction(Event event, mcMMO plugin) {
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);
Expand Down

0 comments on commit 3d7810c

Please sign in to comment.