mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-25 08:35:27 +02:00
Change Acrobatics roll handling to take event.getDamage() instead of the
event. Also adds a few new config options in advanced.yml for further customizing roll behavior.
This commit is contained in:
@@ -12,33 +12,6 @@ public class AcrobaticsManager extends SkillManager {
|
||||
super(mcMMOPlayer, SkillType.ACROBATICS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for fall damage reduction.
|
||||
*
|
||||
* @param event The event to check
|
||||
*/
|
||||
public void rollCheck(EntityDamageEvent event) {
|
||||
RollEventHandler eventHandler = new RollEventHandler(this, event);
|
||||
|
||||
double chance;
|
||||
|
||||
if (eventHandler.isGraceful) {
|
||||
chance = (Acrobatics.gracefulRollMaxChance / Acrobatics.gracefulRollMaxBonusLevel) * eventHandler.skillModifier;
|
||||
}
|
||||
else {
|
||||
chance = (Acrobatics.rollMaxChance / Acrobatics.rollMaxBonusLevel) * eventHandler.skillModifier;
|
||||
}
|
||||
|
||||
if (chance > Misc.getRandom().nextInt(activationChance) && !eventHandler.isFatal(eventHandler.modifiedDamage)) {
|
||||
eventHandler.modifyEventDamage();
|
||||
eventHandler.sendAbilityMessage();
|
||||
eventHandler.processXpGain(eventHandler.damage * Acrobatics.rollXpModifier);
|
||||
}
|
||||
else if (!eventHandler.isFatal(event.getDamage())) {
|
||||
eventHandler.processXpGain(eventHandler.damage * Acrobatics.fallXpModifier);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for dodge damage reduction.
|
||||
*
|
||||
|
Reference in New Issue
Block a user