From ae98d12fafa29f48656f8bc9d2ad998a7fd2c3d3 Mon Sep 17 00:00:00 2001 From: Kam Date: Fri, 27 Feb 2026 16:43:34 -0500 Subject: [PATCH] Remove all Legacy Ability Content, cleanup API. - Add Script Tab to Abilities - Add Custom Ability - Add Icon Support for Abilities / Default Icon Support - Remove Icon Tab and throw it into Effects with allowed Override - Removed Deprecated API Sources --- .../npcs/api/ability/ICustomAbility.java | 42 ++++++++++ .../npcs/api/ability/IDataAbilities.java | 5 ++ .../npcs/api/ability/IPlayerAbilityData.java | 5 ++ .../npcs/api/ability/type/IAbilityDisc.java | 10 --- .../api/ability/type/IAbilityEnergyBeam.java | 10 --- .../npcs/api/ability/type/IAbilityOrb.java | 10 --- java/noppes/npcs/api/event/IAbilityEvent.java | 17 ++++ java/noppes/npcs/api/event/IChainEvent.java | 80 +++++++++++++++++++ 8 files changed, 149 insertions(+), 30 deletions(-) create mode 100644 java/noppes/npcs/api/ability/ICustomAbility.java create mode 100644 java/noppes/npcs/api/event/IChainEvent.java diff --git a/java/noppes/npcs/api/ability/ICustomAbility.java b/java/noppes/npcs/api/ability/ICustomAbility.java new file mode 100644 index 0000000..eb8ebfa --- /dev/null +++ b/java/noppes/npcs/api/ability/ICustomAbility.java @@ -0,0 +1,42 @@ +package noppes.npcs.api.ability; + +/** + * A custom (script-driven) ability whose behavior is entirely defined by script event hooks. + * Supports both instant execution mode and toggle mode. + */ +public interface ICustomAbility extends IAbility { + + /** + * Get the duration in ticks for instant mode (non-toggle). + */ + int getDurationTicks(); + + /** + * Set the duration in ticks for instant mode. + */ + void setDurationTicks(int ticks); + + /** + * Get the telegraph shape type ordinal. + * @return ordinal of TelegraphType: 0=CIRCLE, 1=RING, 2=LINE, 3=CONE, 4=POINT, 5=SQUARE, 6=NONE + */ + int getTelegraphShapeType(); + + /** + * Set the telegraph shape type by ordinal. + * @param type ordinal of TelegraphType + */ + void setTelegraphShapeType(int type); + + /** + * Get the targeting mode ordinal. + * @return ordinal of TargetingMode: 0=AGGRO_TARGET, 1=SELF, 2=AOE_SELF, 3=AOE_TARGET + */ + int getTargetingModeType(); + + /** + * Set the targeting mode by ordinal. + * @param type ordinal of TargetingMode + */ + void setTargetingModeType(int type); +} diff --git a/java/noppes/npcs/api/ability/IDataAbilities.java b/java/noppes/npcs/api/ability/IDataAbilities.java index 081400a..9a3feb0 100644 --- a/java/noppes/npcs/api/ability/IDataAbilities.java +++ b/java/noppes/npcs/api/ability/IDataAbilities.java @@ -80,6 +80,11 @@ public interface IDataAbilities { */ void interruptCurrentAbility(); + /** + * Signal the current ability to complete immediately. + */ + void completeCurrentAbility(); + /** * Get the global cooldown timer in ticks. */ diff --git a/java/noppes/npcs/api/ability/IPlayerAbilityData.java b/java/noppes/npcs/api/ability/IPlayerAbilityData.java index 7c5ea64..ece63ee 100644 --- a/java/noppes/npcs/api/ability/IPlayerAbilityData.java +++ b/java/noppes/npcs/api/ability/IPlayerAbilityData.java @@ -70,6 +70,11 @@ public interface IPlayerAbilityData { */ void interruptCurrentAbility(); + /** + * Signal the current ability to complete immediately. + */ + void completeCurrentAbility(); + /** * Check if the player is on universal cooldown. */ diff --git a/java/noppes/npcs/api/ability/type/IAbilityDisc.java b/java/noppes/npcs/api/ability/type/IAbilityDisc.java index 807d410..6dbff7e 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityDisc.java +++ b/java/noppes/npcs/api/ability/type/IAbilityDisc.java @@ -54,16 +54,6 @@ public interface IAbilityDisc extends IAbilityEnergyProjectile { void setFireDelay(int delay); - /** - * @deprecated Use {@link #getFireDelay()} - */ - int getDualFireDelay(); - - /** - * @deprecated Use {@link #setFireDelay(int)} - */ - void setDualFireDelay(int delay); - // Indexed accessors int getInnerColor(int projectileIndex); diff --git a/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java b/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java index ace857f..45bc822 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java +++ b/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java @@ -42,16 +42,6 @@ public interface IAbilityEnergyBeam extends IAbilityEnergyProjectile { void setFireDelay(int delay); - /** - * @deprecated Use {@link #getFireDelay()} - */ - int getDualFireDelay(); - - /** - * @deprecated Use {@link #setFireDelay(int)} - */ - void setDualFireDelay(int delay); - // Indexed accessors int getInnerColor(int projectileIndex); diff --git a/java/noppes/npcs/api/ability/type/IAbilityOrb.java b/java/noppes/npcs/api/ability/type/IAbilityOrb.java index 9cbc606..1079478 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityOrb.java +++ b/java/noppes/npcs/api/ability/type/IAbilityOrb.java @@ -38,16 +38,6 @@ public interface IAbilityOrb extends IAbilityEnergyProjectile { void setFireDelay(int delay); - /** - * @deprecated Use {@link #getFireDelay()} - */ - int getDualFireDelay(); - - /** - * @deprecated Use {@link #setFireDelay(int)} - */ - void setDualFireDelay(int delay); - // Indexed accessors int getInnerColor(int projectileIndex); diff --git a/java/noppes/npcs/api/event/IAbilityEvent.java b/java/noppes/npcs/api/event/IAbilityEvent.java index 1c43278..0f28d33 100644 --- a/java/noppes/npcs/api/event/IAbilityEvent.java +++ b/java/noppes/npcs/api/event/IAbilityEvent.java @@ -3,7 +3,9 @@ package noppes.npcs.api.event; import cpw.mods.fml.common.eventhandler.Cancelable; import noppes.npcs.api.IDamageSource; import noppes.npcs.api.ability.IAbility; +import noppes.npcs.api.entity.ICustomNpc; import noppes.npcs.api.entity.IEntityLivingBase; +import noppes.npcs.api.entity.IPlayer; /** * Events related to NPC ability execution. @@ -11,6 +13,21 @@ import noppes.npcs.api.entity.IEntityLivingBase; */ public interface IAbilityEvent extends INpcEvent { + /** + * Get the entity executing the ability (NPC or Player). + */ + IEntityLivingBase getEntity(); + + /** + * Get the player executing the ability, or null if the caster is an NPC. + */ + IPlayer getPlayer(); + + /** + * Whether the entity executing the ability is an NPC. + */ + boolean isNPC(); + /** * Get the ability involved in this event. */ diff --git a/java/noppes/npcs/api/event/IChainEvent.java b/java/noppes/npcs/api/event/IChainEvent.java new file mode 100644 index 0000000..7ab8fae --- /dev/null +++ b/java/noppes/npcs/api/event/IChainEvent.java @@ -0,0 +1,80 @@ +package noppes.npcs.api.event; + +import noppes.npcs.api.IDamageSource; +import noppes.npcs.api.ability.IChainedAbility; +import noppes.npcs.api.entity.ICustomNpc; +import noppes.npcs.api.entity.IEntityLivingBase; +import noppes.npcs.api.entity.IPlayer; + +/** + * Events related to chained ability execution lifecycle. + * These fire at chain-level transitions, not per-ability. + * Unified for both NPCs and Players. + */ +public interface IChainEvent extends ICustomNPCsEvent { + + /** + * Get the entity executing the chain (NPC or Player). + */ + IEntityLivingBase getEntity(); + + /** + * Get the player executing the chain, or null if the caster is an NPC. + */ + IPlayer getPlayer(); + + /** + * Get the NPC executing the chain, or null if the caster is a player. + */ + ICustomNpc getNpc(); + + /** + * Whether the entity executing the chain is an NPC. + */ + boolean isNPC(); + + /** + * Get the chained ability being executed. + */ + IChainedAbility getChain(); + + /** + * Get the target of the chain, or null if no target. + */ + IEntityLivingBase getTarget(); + + /** + * Get the current entry index within the chain (0-based). + */ + int getEntryIndex(); + + /** + * Fired when a chained ability sequence starts executing. + */ + interface StartEvent extends IChainEvent {} + + /** + * Fired when the chain advances to the next entry in the sequence. + */ + interface NextEvent extends IChainEvent {} + + /** + * Fired when a chained ability sequence completes all entries. + */ + interface CompleteEvent extends IChainEvent {} + + /** + * Fired when a chained ability is interrupted by damage. + */ + interface InterruptEvent extends IChainEvent { + /** + * Get the damage source that caused the interruption. + */ + IDamageSource getDamageSource(); + + /** + * Get the amount of damage that caused the interruption. + */ + float getDamage(); + } +}