mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 15:16:45 +01:00
Finish Axe restructuring, modify a little bit of Swords stuff as well.
This commit is contained in:
parent
105f088576
commit
5bdf4b5dcc
@ -82,4 +82,18 @@ public class AxeManager extends SkillManager {
|
||||
eventHandler.applyGreaterImpact();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for Skull Splitter ability.
|
||||
*
|
||||
* @param event The event to process
|
||||
*/
|
||||
public void skullSplitter(EntityDamageByEntityEvent event) {
|
||||
if (Misc.isNPC(player) || !Permissions.skullSplitter(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
SkullSplitterEventHandler eventHandler = new SkullSplitterEventHandler(this, event);
|
||||
eventHandler.applyAbilityEffects();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
package com.gmail.nossr50.skills.axes;
|
||||
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
import com.gmail.nossr50.util.Combat;
|
||||
|
||||
public class SkullSplitterEventHandler {
|
||||
private Player player;
|
||||
private LivingEntity target;
|
||||
private int damage;
|
||||
|
||||
protected SkullSplitterEventHandler(AxeManager manager, EntityDamageByEntityEvent event) {
|
||||
this.player = manager.getPlayer();
|
||||
this.target = (LivingEntity) event.getEntity();
|
||||
this.damage = event.getDamage();
|
||||
}
|
||||
|
||||
protected void applyAbilityEffects() {
|
||||
Combat.applyAbilityAoE(player, target, damage / 2, SkillType.AXES);
|
||||
}
|
||||
}
|
@ -19,9 +19,6 @@ public class SerratedStrikesEventHandler {
|
||||
}
|
||||
|
||||
protected void applyAbilityEffects() {
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
Combat.applyAbilityAoE(player, target, damage / Swords.SERRATED_STRIKES_MODIFIER, SkillType.SWORDS);
|
||||
BleedTimer.add(target, Swords.SERRATED_STRIKES_BLEED_TICKS);
|
||||
}
|
||||
|
@ -76,10 +76,7 @@ public class SwordsManager extends SkillManager {
|
||||
}
|
||||
|
||||
public void serratedStrikes(LivingEntity target, int damage) {
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
if (!Permissions.serratedStrikes(player)) {
|
||||
if (Misc.isNPC(player) || !Permissions.serratedStrikes(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,8 @@ public class Combat {
|
||||
axeManager.criticalHitCheck(event);
|
||||
axeManager.impact(event);
|
||||
|
||||
if (attackerProfile.getAbilityMode(AbilityType.SKULL_SPLIITER) && Permissions.skullSplitter(attacker)) {
|
||||
if (attackerProfile.getAbilityMode(AbilityType.SKULL_SPLIITER)) {
|
||||
axeManager.skullSplitter(event);
|
||||
applyAbilityAoE(attacker, target, event.getDamage() / 2, SkillType.AXES);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user