mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 19:15:11 +00:00
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:
1 parent
ec60a9bb21
commit
d2d5bcc59b
15 files changed
+317
-95
No files matched your search
@@ -295,7 +295,7 @@ public class CustomNpcs {
|
||||
registerNewEntity(EntityAbilityOrb.class, "abilityorb", 64, 1, true);
|
||||
registerNewEntity(EntityAbilityDisc.class, "abilitydisc", 64, 1, true);
|
||||
registerNewEntity(EntityAbilityLaser.class, "abilitylaser", 64, 1, true);
|
||||
registerNewEntity(EntityAbilityBeam.class, "abilitybeam", 64, 1, true);
|
||||
registerNewEntity(EntityAbilityBeam.class, "abilitybeam", 160, 1, true);
|
||||
registerNewEntity(EntityAbilitySweeper.class, "abilitysweeper", 64, 3, true);
|
||||
registerNewEntity(EntityAbilityZone.class, "abilityzone", 64, 3, true);
|
||||
registerNewEntity(EntityAbilityDome.class, "energydome", 64, 3, true);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -102,7 +102,13 @@ public class ClientEventHandler {
|
||||
// Ability Hotbar: Hold HUD key + scroll wheel to cycle
|
||||
if (event.dwheel != 0 && ClientProxy.AbilityHudKey != null) {
|
||||
int hudKeyCode = ClientProxy.AbilityHudKey.getKeyCode();
|
||||
if (hudKeyCode != 0 && org.lwjgl.input.Keyboard.isKeyDown(hudKeyCode)) {
|
||||
boolean hudKeyHeld = false;
|
||||
if (hudKeyCode > 0) {
|
||||
hudKeyHeld = org.lwjgl.input.Keyboard.isKeyDown(hudKeyCode);
|
||||
} else if (hudKeyCode < 0) {
|
||||
hudKeyHeld = org.lwjgl.input.Mouse.isButtonDown(hudKeyCode + 100);
|
||||
}
|
||||
if (hudKeyHeld) {
|
||||
AbilityHotbarComponent comp = (AbilityHotbarComponent) ClientHudManager.getInstance()
|
||||
.getHudComponents().get(EnumHudComponent.AbilityHotbar);
|
||||
if (comp != null && comp.hasAnyAbilities()) {
|
||||
|
||||
Reference in new issue
Block a user