mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 20:49:05 +00:00
Counter, Dodge, Guard Animation Hookup + Damage Fixes
This commit is contained in:
1 parent
b49316d9bb
commit
f1a6d7488f
5 files changed
+156
-44
No files matched your search
@@ -869,6 +869,24 @@ public abstract class AbstractDataAbilities {
|
||||
|
||||
currentAbility.onActiveTick(entity, target, currentAbility.getCurrentTick());
|
||||
|
||||
// Play pending defend reaction animation + sound (counter strike, dodge roll, etc.)
|
||||
if (currentAbility instanceof AbilityDefend) {
|
||||
AbilityDefend defend = (AbilityDefend) currentAbility;
|
||||
Animation defendAnim = defend.consumeDefendAnimation();
|
||||
if (defendAnim != null) {
|
||||
playAbilityAnimation(defendAnim);
|
||||
playAbilitySound(currentAbility.getActiveSound());
|
||||
defend.scheduleReturnToActive(currentAbility.getCurrentTick(), defendAnim);
|
||||
}
|
||||
// Return to active animation after defend animation finishes (Counter → guard stance)
|
||||
if (defend.shouldReturnToActiveAnimation(currentAbility.getCurrentTick())) {
|
||||
Animation activeAnim = currentAbility.getActiveAnimation();
|
||||
if (activeAnim != null) {
|
||||
playAbilityAnimation(activeAnim);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check if ability completed during onActiveTick
|
||||
if (currentAbility.getPhase() == AbilityPhase.IDLE) {
|
||||
handleAbilityCompletion(target);
|
||||
|
||||
Reference in new issue
Block a user