Add Chained Abilities

This commit is contained in:
Kam committed 2026-02-18 04:02:51 -05:00
1 parent 0311dc5806
commit 0512588a7a
51 files changed
+2955 -800

No files matched your search

@@ -2,7 +2,7 @@ package kamkeel.npcs.entity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import kamkeel.npcs.controllers.data.ability.AbilityController;
import kamkeel.npcs.controllers.AbilityController;
import kamkeel.npcs.controllers.data.ability.AbilityPotionEffect;
import kamkeel.npcs.controllers.data.ability.AnchorPoint;
import kamkeel.npcs.controllers.data.ability.data.*;
@@ -56,6 +56,10 @@ public abstract class EntityEnergyProjectile extends EntityEnergyAbility {
refs.add(new WeakReference<>(projectile));
}
public static void clearAllProjectiles() {
activeProjectiles.clear();
}
public static List<EntityEnergyProjectile> getActiveProjectiles(int ownerEntityId) {
List<WeakReference<EntityEnergyProjectile>> refs = activeProjectiles.get(ownerEntityId);
if (refs == null) return Collections.emptyList();
@@ -455,8 +459,9 @@ public abstract class EntityEnergyProjectile extends EntityEnergyAbility {
Math.pow(target.posZ - posZ, 2)
);
if (dist <= getExplosionRadius()) {
float falloff = 1.0f - (float) (dist / getExplosionRadius()) * getExplosionDamageFalloff();
float radius = getExplosionRadius();
if (radius > 0 && dist <= radius) {
float falloff = 1.0f - (float) (dist / radius) * getExplosionDamageFalloff();
applyDamage(target, getDamage() * falloff, getKnockback() * falloff);
}
}