mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 20:07:32 +00:00
Modified Damage on Energy Projectile System
This commit is contained in:
1 parent
a6265d7ba3
commit
cb57e26d04
1 file changed
+18
-1
@@ -330,7 +330,8 @@ public abstract class EntityEnergyProjectile extends EntityEnergyAbility {
|
||||
for (EntityEnergyBarrier barrier : barriers) {
|
||||
if (barrier.isDead) continue;
|
||||
if (barrier.isIncomingProjectile(this)) {
|
||||
if (barrier.onProjectileHit(this, getDamage())) {
|
||||
float damage = getModifiedDamage();
|
||||
if (barrier.onProjectileHit(this, damage)) {
|
||||
hasHit = true;
|
||||
this.setDead();
|
||||
return true;
|
||||
@@ -341,6 +342,22 @@ public abstract class EntityEnergyProjectile extends EntityEnergyAbility {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the projectile damage modified by extenders (e.g. DBC damage scaling).
|
||||
* Falls back to base getDamage() when no sourceAbility or no extenders modify it.
|
||||
*/
|
||||
protected float getModifiedDamage() {
|
||||
float damage = getDamage();
|
||||
if (sourceAbility != null) {
|
||||
Entity owner = getOwnerEntity();
|
||||
if (owner instanceof EntityLivingBase) {
|
||||
damage = AbilityController.Instance.fireModifyProjectileDamage(
|
||||
sourceAbility, (EntityLivingBase) owner, damage);
|
||||
}
|
||||
}
|
||||
return damage;
|
||||
}
|
||||
|
||||
// ==================== POSITION INTERPOLATION ====================
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user