Add energy projectile types and events: implement IEnergyOrb, IEnergyBeam, IEnergyDisc, and IEnergyLaser interfaces, along with their respective script handlers and event hooks

This commit is contained in:
Kam committed 2026-02-16 01:03:05 -05:00
1 parent 66fff09d20
commit efa8721d36
10 files changed
+402 -5

No files matched your search

@@ -1,6 +1,7 @@
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.IEntityLivingBase;
@@ -20,9 +21,75 @@ public interface IPlayerAbilityEvent extends IPlayerEvent {
*/
IEntityLivingBase getTarget();
/**
* Fired when a player's ability starts executing (enters WINDUP phase).
* Canceling prevents the ability from starting.
*
* @hookName abilityStart
*/
@Cancelable
interface StartEvent extends IPlayerAbilityEvent {
}
/**
* Fired when a player's ability enters the ACTIVE phase and performs its effect.
* Canceling prevents the ability effect from occurring.
*
* @hookName abilityExecute
*/
@Cancelable
interface ExecuteEvent extends IPlayerAbilityEvent {
}
/**
* Fired when a player's ability is interrupted by damage.
*
* @hookName abilityInterrupt
*/
interface InterruptEvent extends IPlayerAbilityEvent {
/**
* Get the damage source that caused the interruption, or null if not damage-triggered.
*/
IDamageSource getDamageSource();
/**
* Get the amount of damage that caused the interruption.
*/
float getDamage();
}
/**
* Fired when a player's ability completes its full execution cycle.
*
* @hookName abilityComplete
*/
interface CompleteEvent extends IPlayerAbilityEvent {
}
/**
* Fired every tick while a player's ability is executing.
* Provides the current phase and tick count.
*
* @hookName abilityTick
*/
interface TickEvent extends IPlayerAbilityEvent {
/**
* Get the current phase of the ability.
* 0 = IDLE, 1 = WINDUP, 2 = ACTIVE, 3 = RECOVERY
*/
int getAbilityPhase();
/**
* Get the current tick count within the phase.
*/
int getTick();
}
/**
* Fired when a player's ability hits an entity with damage.
* Canceling this event prevents the damage from being applied.
*
* @hookName abilityHit
*/
@Cancelable
interface HitEvent extends IPlayerAbilityEvent {