Various Fixes to CNPC Abilities

- super slow speed orb has weird properites, after awhile it flies weirdly
- Binding HUD scroll key to middle mouse button crashes client
- Zero Knockback still does knockback to CNPCs
- Charge: the telegraph is where you are looking but you actuually charge where your current body rotation is instead
- using slam mid air makes it not work correctly
- Beam disappears after going out of the render distance but still fires
- Player vortex can only pull one target

Slam now takes current height when being used to calculate damage
This commit is contained in:
Kam committed 2026-02-22 21:19:44 -05:00
1 parent ec60a9bb21
commit d2d5bcc59b
15 files changed
+317 -95

No files matched your search

@@ -10,6 +10,7 @@ import kamkeel.npcs.controllers.AbilityController;
import kamkeel.npcs.controllers.AttributeController;
import kamkeel.npcs.controllers.SyncController;
import kamkeel.npcs.controllers.data.ability.Ability;
import kamkeel.npcs.controllers.data.ability.enums.AbilityPhase;
import kamkeel.npcs.util.AttributeAttackUtil;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -105,7 +106,8 @@ public class ScriptPlayerEventHandler {
// Skip zeroing if the ability has its own movement (Charge/Dash/Slam)
if (playerData.abilityData.isMovementLocked()) {
Ability current = playerData.abilityData.getCurrentAbility();
if (current == null || !current.hasAbilityMovement()) {
if (current == null || !current.hasAbilityMovement()
|| current.getPhase() != AbilityPhase.ACTIVE) {
boolean sFlying = playerData.abilityData.wasFlyingAtLock()
|| AbilityController.Instance.isPlayerFlying(player);
@@ -120,6 +122,17 @@ public class ScriptPlayerEventHandler {
}
}
// Zero WASD input during ability-controlled movement to prevent
// moveEntityWithHeading from interfering with ability velocity
{
Ability current = playerData.abilityData.getCurrentAbility();
if (current != null && current.hasAbilityMovement()
&& current.getPhase() == AbilityPhase.ACTIVE) {
player.moveForward = 0;
player.moveStrafing = 0;
}
}
if (playerData.updateClient) {
SyncController.syncPlayerData((EntityPlayerMP) player, true);
playerData.updateClient = false;