mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 09:55:11 +00:00
Add Chained Abilities
This commit is contained in:
1 parent
0311dc5806
commit
0512588a7a
51 files changed
+2955
-800
No files matched your search
@@ -1,7 +1,7 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.data.ability.AbilityController;
|
||||
import kamkeel.npcs.controllers.AbilityController;
|
||||
import kamkeel.npcs.controllers.data.ability.AbilityPhase;
|
||||
import kamkeel.npcs.controllers.data.ability.ChainedAbility;
|
||||
import kamkeel.npcs.controllers.data.ability.ChainedAbilityEntry;
|
||||
@@ -352,6 +352,11 @@ public abstract class AbstractDataAbilities {
|
||||
cooldownEndTime = 0;
|
||||
}
|
||||
|
||||
/** Set the cooldown end time directly. */
|
||||
public void setCooldownEndTime(long endTime) {
|
||||
cooldownEndTime = endTime;
|
||||
}
|
||||
|
||||
// ═══════════════════════════════════════════════════════════════════
|
||||
// POSITION LOCKING
|
||||
// ═══════════════════════════════════════════════════════════════════
|
||||
@@ -500,7 +505,10 @@ public abstract class AbstractDataAbilities {
|
||||
|
||||
// Fire execute event (cancelable)
|
||||
if (fireExecuteEvent(currentAbility, target)) {
|
||||
return; // Cancelled
|
||||
// Script cancelled — abort cleanly instead of leaving stuck in ACTIVE
|
||||
currentAbility.interrupt();
|
||||
handleAbilityCompletion(target);
|
||||
return;
|
||||
}
|
||||
|
||||
// Call onExecute
|
||||
@@ -638,7 +646,10 @@ public abstract class AbstractDataAbilities {
|
||||
|
||||
// Fire execute event (cancelable)
|
||||
if (fireExecuteEvent(ability, target)) {
|
||||
return; // Cancelled
|
||||
// Script cancelled — abort cleanly instead of leaving stuck in ACTIVE
|
||||
ability.interrupt();
|
||||
handleAbilityCompletion(target);
|
||||
return;
|
||||
}
|
||||
|
||||
// Call onExecute
|
||||
@@ -741,7 +752,7 @@ public abstract class AbstractDataAbilities {
|
||||
}
|
||||
|
||||
ChainedAbilityEntry entry = currentChain.getEntries().get(chainEntryIndex);
|
||||
Ability ability = AbilityController.Instance.resolveAbility(entry.getAbilityReference());
|
||||
Ability ability = entry.resolve();
|
||||
if (ability == null) {
|
||||
// Broken reference - complete chain
|
||||
completeChain();
|
||||
|
||||
Reference in new issue
Block a user