Update Abilities to Support Player Casting (Part 1)

This commit is contained in:
Kam committed 2026-02-08 01:32:18 -05:00
1 parent c05b6e60b8
commit 2387ece1ff
14 files changed
+259 -117

No files matched your search

@@ -392,6 +392,18 @@ public abstract class Ability implements IAbility {
return 45.0f;
}
/**
* Returns true if the caster is a player (not an NPC).
* Use this instead of checking {@code target != null} to make NPC/Player
* code paths explicit and readable.
* <p>
* NPCs always have an aggro target passed to ability methods.
* Players never do — they use look direction for aiming instead.
*/
protected final boolean isPlayerCaster(EntityLivingBase caster) {
return caster instanceof EntityPlayer;
}
/**
* Returns true if this ability controls NPC movement during ACTIVE phase.
* When true, AI pathfinding will be blocked during ability execution.