mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-25 23:54:31 +00:00
Add Better Info Panel and Display Damage to Abilities
This commit is contained in:
1 parent
d9f100d245
commit
6f6e080ee0
17 files changed
+226
-14
No files matched your search
@@ -302,6 +302,26 @@ public abstract class Ability implements IAbility, IAbilityAction {
|
||||
return hasDamage();
|
||||
}
|
||||
|
||||
// ── Display methods for inventory preview ──────────────────────
|
||||
|
||||
/** Base damage for preview display. Override in damaging types. */
|
||||
public float getDisplayDamage() { return 0; }
|
||||
|
||||
/** True if getDisplayDamage() is damage-per-second (e.g., Hazard). */
|
||||
public boolean isDisplayDamageDPS() { return false; }
|
||||
|
||||
/** Base barrier health for preview display. Override in barrier types. */
|
||||
public float getDisplayBarrierHealth() { return 0; }
|
||||
|
||||
/** True if this ability reflects projectiles. */
|
||||
public boolean isDisplayReflect() { return false; }
|
||||
|
||||
/** Reflection strength percentage (0-100). */
|
||||
public float getDisplayReflectStrength() { return 0; }
|
||||
|
||||
/** True if this ability absorbs projectiles. */
|
||||
public boolean isDisplayAbsorbing() { return false; }
|
||||
|
||||
/**
|
||||
* Override to provide variant templates for this ability type.
|
||||
* When a user creates this ability type, they will be shown a selection dialog
|
||||
|
||||
@@ -276,6 +276,9 @@ public class AbilityCharge extends AbilityMovement implements IAbilityCharge {
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDisplayDamage() { return damage; }
|
||||
|
||||
public float getKnockback() {
|
||||
return knockback;
|
||||
}
|
||||
|
||||
@@ -375,6 +375,9 @@ public class AbilityCutter extends Ability implements IAbilityCutter {
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDisplayDamage() { return damage; }
|
||||
|
||||
public float getKnockback() {
|
||||
return knockback;
|
||||
}
|
||||
|
||||
@@ -127,6 +127,12 @@ public class AbilityHazard extends AbilityZone implements IAbilityHazard {
|
||||
this.damagePerSecond = damagePerSecond;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDisplayDamage() { return damagePerSecond; }
|
||||
|
||||
@Override
|
||||
public boolean isDisplayDamageDPS() { return true; }
|
||||
|
||||
public int getDamageInterval() {
|
||||
return damageInterval;
|
||||
}
|
||||
|
||||
@@ -174,6 +174,9 @@ public class AbilityHeavyHit extends Ability implements IAbilityHeavyHit {
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDisplayDamage() { return damage; }
|
||||
|
||||
public float getKnockback() {
|
||||
return knockback;
|
||||
}
|
||||
|
||||
@@ -293,6 +293,9 @@ public class AbilityProjectile extends Ability implements IAbilityProjectile {
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDisplayDamage() { return damage; }
|
||||
|
||||
public float getSpeed() {
|
||||
return speed;
|
||||
}
|
||||
|
||||
@@ -197,6 +197,9 @@ public class AbilityShockwave extends Ability implements IAbilityShockwave {
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDisplayDamage() { return damage; }
|
||||
|
||||
public boolean isAoe() {
|
||||
return aoe;
|
||||
}
|
||||
|
||||
@@ -751,6 +751,9 @@ public class AbilitySlam extends Ability implements IAbilitySlam {
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDisplayDamage() { return damage; }
|
||||
|
||||
public float getRadius() {
|
||||
return radius;
|
||||
}
|
||||
|
||||
@@ -536,6 +536,9 @@ public class AbilityTeleport extends Ability implements IAbilityTeleport {
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDisplayDamage() { return damage; }
|
||||
|
||||
public float getDamageRadius() {
|
||||
return damageRadius;
|
||||
}
|
||||
|
||||
@@ -270,6 +270,9 @@ public class AbilityTrap extends AbilityZone implements IAbilityTrap {
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDisplayDamage() { return damage; }
|
||||
|
||||
public float getDamageRadius() {
|
||||
return damageRadius;
|
||||
}
|
||||
|
||||
@@ -349,6 +349,9 @@ public class AbilityVortex extends Ability implements IAbilityVortex {
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDisplayDamage() { return damage; }
|
||||
|
||||
public float getKnockback() {
|
||||
return knockback;
|
||||
}
|
||||
|
||||
@@ -213,6 +213,18 @@ public abstract class AbilityBarrier extends AbilityEnergy {
|
||||
barrierData.useHealth = useHealth;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDisplayBarrierHealth() { return barrierData.useHealth ? barrierData.maxHealth : 0; }
|
||||
|
||||
@Override
|
||||
public boolean isDisplayReflect() { return barrierData.reflect; }
|
||||
|
||||
@Override
|
||||
public float getDisplayReflectStrength() { return barrierData.reflectStrengthPct; }
|
||||
|
||||
@Override
|
||||
public boolean isDisplayAbsorbing() { return barrierData.absorbing; }
|
||||
|
||||
public int getBarrierDuration() {
|
||||
return barrierData.durationTicks;
|
||||
}
|
||||
|
||||
+3
@@ -639,6 +639,9 @@ public abstract class AbilityEnergyProjectile<E extends EntityEnergyProjectile>
|
||||
combatData.damage = damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDisplayDamage() { return combatData.damage; }
|
||||
|
||||
@Override
|
||||
public float getKnockback() {
|
||||
return combatData.knockback;
|
||||
|
||||
@@ -235,6 +235,9 @@ public class AbilitySweeper extends AbilityEnergy implements IAbilitySweeper {
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDisplayDamage() { return damage; }
|
||||
|
||||
public int getDamageInterval() {
|
||||
return damageInterval;
|
||||
}
|
||||
|
||||
@@ -200,6 +200,9 @@ public class AbilityWall extends AbilityBarrier {
|
||||
panelData.setLaunchDamage(damage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDisplayDamage() { return panelData.launching ? panelData.launchDamage : 0; }
|
||||
|
||||
public float getLaunchKnockback() {
|
||||
return panelData.launchKnockback;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user