mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 08:29:05 +00:00
Ability Push
This commit is contained in:
1 parent
3e85557984
commit
166c8aa228
66 files changed
+10780
-42
No files matched your search
@@ -42,8 +42,14 @@ public class CombatHandler {
|
||||
return;
|
||||
}
|
||||
combatResetTimer = 0;
|
||||
}
|
||||
|
||||
// Try to select and start an ability if not currently executing one
|
||||
// Ability ticking is handled by DataAbilities in onLivingUpdate
|
||||
EntityLivingBase target = npc.getAttackTarget();
|
||||
if (target != null && npc.abilities.enabled && !npc.abilities.isExecutingAbility()) {
|
||||
npc.abilities.trySelectAndStart(target);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean shouldCombatContinue() {
|
||||
if (npc.getAttackTarget() == null)
|
||||
@@ -72,6 +78,9 @@ public class CombatHandler {
|
||||
}
|
||||
aggressors.put(el, f + damageAmount);
|
||||
}
|
||||
|
||||
// Check for ability interruption
|
||||
npc.abilities.onDamage(source, damageAmount);
|
||||
}
|
||||
|
||||
public void start() {
|
||||
@@ -86,6 +95,9 @@ public class CombatHandler {
|
||||
aggressors.clear();
|
||||
recentDamages.clear();
|
||||
npc.setBoolFlag(false, 4);
|
||||
|
||||
// Reset ability state when combat ends
|
||||
npc.abilities.reset();
|
||||
}
|
||||
|
||||
public boolean checkTarget() {
|
||||
@@ -148,4 +160,26 @@ public class CombatHandler {
|
||||
}
|
||||
return newThreat > currentThreat;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if NPC is currently executing an ability.
|
||||
* Used by AI tasks to avoid conflicting with ability execution.
|
||||
*/
|
||||
public boolean isExecutingAbility() {
|
||||
return npc.abilities.isExecutingAbility();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if NPC movement should be blocked due to ability execution.
|
||||
*/
|
||||
public boolean isMovementBlocked() {
|
||||
return npc.abilities.isMovementBlocked();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if NPC should skip normal attacks during ability execution.
|
||||
*/
|
||||
public boolean shouldBlockAttack() {
|
||||
return npc.abilities.shouldBlockAttack();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user