mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 15:29:10 +00:00
Add Chained Abilities
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user