mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 23:09:05 +00:00
- Added onDamageTaken to Ability
- Reworked AbilityGuard - Added AbilityOrbBarrage - Updated translation - Updated onDamageTaken method calls
This commit is contained in:
1 parent
0004029de9
commit
60b846b35e
11 files changed
+986
-86
No files matched your search
@@ -429,6 +429,14 @@ public class DataAbilities {
|
||||
playAbilityAnimation((Animation) AnimationController.Instance.get(animation));
|
||||
}
|
||||
|
||||
public void playAbilityAnimation(String animation) {
|
||||
if (animation.isEmpty()) return;
|
||||
if (AnimationController.Instance == null) return;
|
||||
if (AnimationController.Instance.get(animation, true) == null) return;
|
||||
|
||||
playAbilityAnimation((Animation) AnimationController.Instance.get(animation, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop any currently playing ability animation.
|
||||
*/
|
||||
@@ -501,18 +509,12 @@ public class DataAbilities {
|
||||
// Track hit for hit count condition
|
||||
recordHit();
|
||||
|
||||
// Check if currently executing a Guard ability and notify it of damage taken
|
||||
if (currentAbility instanceof AbilityGuard) {
|
||||
AbilityGuard guard = (AbilityGuard) currentAbility;
|
||||
if (guard.isGuarding() && source.getEntity() instanceof EntityLivingBase) {
|
||||
guard.onDamageTaken(npc, (EntityLivingBase) source.getEntity(), source, amount);
|
||||
}
|
||||
}
|
||||
|
||||
if (currentAbility == null || !currentAbility.isExecuting()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
currentAbility.onDamageTaken(npc, (EntityLivingBase) source.getEntity(), source, amount);
|
||||
|
||||
if (currentAbility.canInterrupt(source)) {
|
||||
interruptCurrentAbility(source, amount);
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user