Some Ability Fixes to Defaults and Langs

This commit is contained in:
Kam committed 2026-01-23 23:59:19 -05:00
1 parent a4ac6bb1c1
commit 5992e1badc
12 files changed
+62 -77

No files matched your search

@@ -29,7 +29,7 @@ public class AbilityCharge extends Ability {
// Type-specific parameters
private float chargeSpeed = 0.8f;
private float damage = 15.0f;
private float damage = 8.0f;
private float knockback = 3.0f;
private float hitWidth = 1.5f;
@@ -296,7 +296,7 @@ public class AbilityCharge extends Ability {
@Override
public void readTypeNBT(NBTTagCompound nbt) {
this.chargeSpeed = nbt.hasKey("chargeSpeed") ? nbt.getFloat("chargeSpeed") : 0.8f;
this.damage = nbt.hasKey("damage") ? nbt.getFloat("damage") : 15.0f;
this.damage = nbt.hasKey("damage") ? nbt.getFloat("damage") : 8.0f;
this.knockback = nbt.hasKey("knockback") ? nbt.getFloat("knockback") : 3.0f;
if (nbt.hasKey("hitWidth")) {
this.hitWidth = nbt.getFloat("hitWidth");
@@ -35,7 +35,7 @@ public class AbilityCutter extends Ability {
private float arcAngle = 90.0f;
private float range = 6.0f;
private float damage = 12.0f;
private float damage = 7.0f;
private float knockback = 1.5f;
private SweepMode sweepMode = SweepMode.SWIPE;
@@ -217,7 +217,7 @@ public class AbilityCutter extends Ability {
public void readTypeNBT(NBTTagCompound nbt) {
this.arcAngle = nbt.hasKey("arcAngle") ? nbt.getFloat("arcAngle") : 90.0f;
this.range = nbt.hasKey("range") ? nbt.getFloat("range") : 6.0f;
this.damage = nbt.hasKey("damage") ? nbt.getFloat("damage") : 12.0f;
this.damage = nbt.hasKey("damage") ? nbt.getFloat("damage") : 7.0f;
this.knockback = nbt.hasKey("knockback") ? nbt.getFloat("knockback") : 1.5f;
try {
this.sweepMode = SweepMode.valueOf(nbt.getString("sweepMode"));
@@ -28,7 +28,7 @@ public class AbilityGuard extends Ability {
private float damageReduction = 0.5f;
private boolean canCounter = false;
private CounterType counterType = CounterType.FLAT;
private float counterValue = 10.0f;
private float counterValue = 6.0f;
private float counterChance = 0.3f;
private String counterSound = "random.wood_click";
private int counterAnimationId = -1;
@@ -207,7 +207,7 @@ public class AbilityGuard extends Ability {
} else if (nbt.hasKey("counterDamage")) {
this.counterValue = nbt.getFloat("counterDamage");
} else {
this.counterValue = 10.0f;
this.counterValue = 6.0f;
}
this.counterChance = nbt.hasKey("counterChance") ? nbt.getFloat("counterChance") : 0.3f;
this.counterSound = nbt.hasKey("counterSound") ? nbt.getString("counterSound") : "random.wood_click";
@@ -48,7 +48,7 @@ public class AbilityHazard extends Ability {
private HazardShape shape = HazardShape.CIRCLE;
private PlacementMode placement = PlacementMode.AT_TARGET;
private float damagePerTick = 1.0f;
private float damagePerSecond = 1.0f;
private int damageInterval = 20;
private boolean ignoreInvulnFrames = false;
@@ -290,12 +290,12 @@ public class AbilityHazard extends Ability {
if (damagedThisTick.contains(entity.getEntityId())) continue;
if (!isInZone(entity, npc)) continue;
if (damagePerTick > 0) {
if (damagePerSecond > 0) {
if (ignoreInvulnFrames) {
entity.hurtResistantTime = 0;
}
// Apply damage with scripted event support (no knockback for hazard ticks)
boolean wasHit = applyAbilityDamage(npc, entity, damagePerTick, 0);
// Apply damage with scripted event support (no knockback for hazard)
boolean wasHit = applyAbilityDamage(npc, entity, damagePerSecond, 0);
if (!wasHit) continue; // Skip debuffs if hit was cancelled
}
@@ -369,7 +369,7 @@ public class AbilityHazard extends Ability {
nbt.setFloat("coneAngle", coneAngle);
nbt.setString("shape", shape.name());
nbt.setString("placement", placement.name());
nbt.setFloat("damagePerTick", damagePerTick);
nbt.setFloat("damagePerSecond", damagePerSecond);
nbt.setInteger("damageInterval", damageInterval);
nbt.setBoolean("ignoreInvulnFrames", ignoreInvulnFrames);
nbt.setInteger("slownessLevel", slownessLevel);
@@ -401,7 +401,14 @@ public class AbilityHazard extends Ability {
} catch (Exception e) {
this.placement = PlacementMode.AT_TARGET;
}
this.damagePerTick = nbt.hasKey("damagePerTick") ? nbt.getFloat("damagePerTick") : 1.0f;
// Support legacy "damagePerTick" key for backwards compatibility
if (nbt.hasKey("damagePerSecond")) {
this.damagePerSecond = nbt.getFloat("damagePerSecond");
} else if (nbt.hasKey("damagePerTick")) {
this.damagePerSecond = nbt.getFloat("damagePerTick");
} else {
this.damagePerSecond = 1.0f;
}
this.damageInterval = nbt.hasKey("damageInterval") ? nbt.getInteger("damageInterval") : 20;
this.ignoreInvulnFrames = nbt.hasKey("ignoreInvulnFrames") && nbt.getBoolean("ignoreInvulnFrames");
this.slownessLevel = nbt.hasKey("slownessLevel") ? nbt.getInteger("slownessLevel") : -1;
@@ -459,12 +466,24 @@ public class AbilityHazard extends Ability {
this.placement = placement;
}
public float getDamagePerTick() {
return damagePerTick;
public float getDamagePerSecond() {
return damagePerSecond;
}
public void setDamagePerTick(float damagePerTick) {
this.damagePerTick = damagePerTick;
public void setDamagePerSecond(float damagePerSecond) {
this.damagePerSecond = damagePerSecond;
}
/** @deprecated Use {@link #getDamagePerSecond()} instead */
@Deprecated
public float getDamagePerTick() {
return damagePerSecond;
}
/** @deprecated Use {@link #setDamagePerSecond(float)} instead */
@Deprecated
public void setDamagePerTick(float damage) {
this.damagePerSecond = damage;
}
public int getDamageInterval() {
@@ -21,7 +21,7 @@ import noppes.npcs.entity.EntityNPCInterface;
*/
public class AbilityHeavyHit extends Ability {
private float damage = 15.0f;
private float damage = 8.0f;
private float knockback = 2.0f;
private int slownessLevel = 1;
private int weaknessLevel = 0;
@@ -100,7 +100,7 @@ public class AbilityHeavyHit extends Ability {
@Override
public void readTypeNBT(NBTTagCompound nbt) {
this.damage = nbt.hasKey("damage") ? nbt.getFloat("damage") : 15.0f;
this.damage = nbt.hasKey("damage") ? nbt.getFloat("damage") : 8.0f;
this.knockback = nbt.hasKey("knockback") ? nbt.getFloat("knockback") : 2.0f;
this.slownessLevel = nbt.hasKey("slownessLevel") ? nbt.getInteger("slownessLevel") : 1;
this.weaknessLevel = nbt.hasKey("weaknessLevel") ? nbt.getInteger("weaknessLevel") : 0;
@@ -27,7 +27,7 @@ public class AbilityOrb extends Ability {
private float orbSpeed = 0.5f;
private float orbSize = 1.0f;
private float damage = 15.0f;
private float damage = 7.0f;
private float knockback = 1.0f;
private float maxDistance = 30.0f;
private int maxLifetime = 200;
@@ -301,7 +301,7 @@ public class AbilityOrb extends Ability {
public void readTypeNBT(NBTTagCompound nbt) {
this.orbSpeed = nbt.hasKey("orbSpeed") ? nbt.getFloat("orbSpeed") : 0.5f;
this.orbSize = nbt.hasKey("orbSize") ? nbt.getFloat("orbSize") : 1.0f;
this.damage = nbt.hasKey("damage") ? nbt.getFloat("damage") : 15.0f;
this.damage = nbt.hasKey("damage") ? nbt.getFloat("damage") : 7.0f;
this.knockback = nbt.hasKey("knockback") ? nbt.getFloat("knockback") : 1.0f;
this.maxDistance = nbt.hasKey("maxDistance") ? nbt.getFloat("maxDistance") : 30.0f;
this.maxLifetime = nbt.hasKey("maxLifetime") ? nbt.getInteger("maxLifetime") : 200;
@@ -23,7 +23,7 @@ import java.util.List;
public class AbilityProjectile extends Ability {
// Type-specific parameters
private float damage = 8.0f;
private float damage = 6.0f;
private float speed = 1.5f;
private float knockback = 0.5f;
private String projectileType = "fireball";
@@ -179,7 +179,7 @@ public class AbilityProjectile extends Ability {
@Override
public void readTypeNBT(NBTTagCompound nbt) {
this.damage = nbt.hasKey("damage") ? nbt.getFloat("damage") : 8.0f;
this.damage = nbt.hasKey("damage") ? nbt.getFloat("damage") : 6.0f;
this.speed = nbt.hasKey("speed") ? nbt.getFloat("speed") : 1.5f;
this.knockback = nbt.hasKey("knockback") ? nbt.getFloat("knockback") : 0.5f;
this.projectileType = nbt.hasKey("projectileType") ? nbt.getString("projectileType") : "fireball";
@@ -27,7 +27,7 @@ public class AbilityShockwave extends Ability {
private float pushRadius = 8.0f;
private float pushStrength = 1.5f;
private float damage = 10.0f;
private float damage = 8.0f;
private int stunDuration = 0;
private int maxTargets = 10;
@@ -153,7 +153,7 @@ public class AbilityShockwave extends Ability {
public void readTypeNBT(NBTTagCompound nbt) {
this.pushRadius = nbt.hasKey("pushRadius") ? nbt.getFloat("pushRadius") : 8.0f;
this.pushStrength = nbt.hasKey("pushStrength") ? nbt.getFloat("pushStrength") : 1.5f;
this.damage = nbt.hasKey("damage") ? nbt.getFloat("damage") : 10.0f;
this.damage = nbt.hasKey("damage") ? nbt.getFloat("damage") : 8.0f;
this.stunDuration = nbt.hasKey("stunDuration") ? nbt.getInteger("stunDuration") : 0;
this.maxTargets = nbt.hasKey("maxTargets") ? nbt.getInteger("maxTargets") : 10;
}
@@ -31,7 +31,7 @@ import java.util.List;
public class AbilitySlam extends Ability {
// Type-specific config
private float damage = 20.0f;
private float damage = 10.0f;
private float radius = 5.0f;
private float knockbackStrength = 1.5f;
private float leapSpeed = 1.0f;
@@ -420,7 +420,7 @@ public class AbilitySlam extends Ability {
@Override
public void readTypeNBT(NBTTagCompound nbt) {
damage = nbt.hasKey("damage") ? nbt.getFloat("damage") : 20.0f;
damage = nbt.hasKey("damage") ? nbt.getFloat("damage") : 10.0f;
radius = nbt.hasKey("radius") ? nbt.getFloat("radius") : 5.0f;
knockbackStrength = nbt.hasKey("knockback") ? nbt.getFloat("knockback") : 1.5f;
leapSpeed = nbt.hasKey("leapSpeed") ? nbt.getFloat("leapSpeed") : 1.0f;
@@ -42,7 +42,7 @@ public class AbilityTrap extends Ability {
private int armTime = 20;
private int maxTriggers = 1;
private int triggerCooldown = 20;
private float damage = 10.0f;
private float damage = 6.0f;
private float damageRadius = 0.0f;
private float knockback = 0.5f;
private int stunDuration = 0;
@@ -352,7 +352,7 @@ public class AbilityTrap extends Ability {
this.armTime = nbt.hasKey("armTime") ? nbt.getInteger("armTime") : 20;
this.maxTriggers = nbt.hasKey("maxTriggers") ? nbt.getInteger("maxTriggers") : 1;
this.triggerCooldown = nbt.hasKey("triggerCooldown") ? nbt.getInteger("triggerCooldown") : 20;
this.damage = nbt.hasKey("damage") ? nbt.getFloat("damage") : 10.0f;
this.damage = nbt.hasKey("damage") ? nbt.getFloat("damage") : 6.0f;
this.damageRadius = nbt.hasKey("damageRadius") ? nbt.getFloat("damageRadius") : 0.0f;
this.knockback = nbt.hasKey("knockback") ? nbt.getFloat("knockback") : 0.5f;
this.stunDuration = nbt.hasKey("stunDuration") ? nbt.getInteger("stunDuration") : 0;
@@ -47,9 +47,9 @@ public class SubGuiAbilityHazard extends SubGuiAbilityConfig {
y += 24;
// Row 3: Damage Per Tick + Damage Interval
addLabel(new GuiNpcLabel(104, "ability.dmgPerTick", labelX, y + 5));
addTextField(createFloatField(104, fieldX, y, 50, hazard.getDamagePerTick()));
// Row 3: Damage Per Second + Damage Interval
addLabel(new GuiNpcLabel(104, "ability.dmgPerSec", labelX, y + 5));
addTextField(createFloatField(104, fieldX, y, 50, hazard.getDamagePerSecond()));
addLabel(new GuiNpcLabel(105, "ability.dmgInterval", col2LabelX, y + 5));
addTextField(createIntField(105, col2FieldX, y, 50, hazard.getDamageInterval()));
@@ -99,7 +99,7 @@ public class SubGuiAbilityHazard extends SubGuiAbilityConfig {
hazard.setInnerRadius(parseFloat(field, hazard.getInnerRadius()));
break;
case 104:
hazard.setDamagePerTick(parseFloat(field, hazard.getDamagePerTick()));
hazard.setDamagePerSecond(parseFloat(field, hazard.getDamagePerSecond()));
break;
case 105:
hazard.setDamageInterval(field.getInteger());
@@ -157,6 +157,9 @@ gui.create=Create
gui.rename=Rename
gui.playerMap=Regen PlayerMap
gui.unused=Unused
gui.apply=Apply
gui.cancel=Cancel
gui.yes=Yes
gui.lineColor1=Upper line color
gui.lineColor2=Middle line color
@@ -1647,7 +1650,7 @@ ability.healSelf=Heal Self
ability.healAllies=Heal Allies
# Hazard Settings
ability.dmgPerTick=Dmg/Tick
ability.dmgPerSec=Dmg/Sec
ability.debuffDur=Debuff Dur
ability.shape=Shape
ability.placement=Placement
@@ -1737,17 +1740,6 @@ auction.notify.claim=You have items to claim.
# Main GUI
auction.title=Auction House
auction.browse=Browse
auction.sell=Sell
auction.trades=My Trades
auction.filter=Filter
# Browse
auction.nextPage=Next >
auction.prevPage=< Prev
auction.page=Page %d of %d
auction.noResults=No auctions found
auction.refresh=Refresh
# Listing Display
auction.seller=Seller: %s
@@ -1758,50 +1750,25 @@ auction.bids=%d bids
auction.noBids=No bids
auction.startingPrice=Starting: %s
# Create Listing
auction.sell.title=Create Listing
# Sell Page
auction.sell.startingPrice=Starting Price
auction.sell.buyoutPrice=Buyout Price
auction.sell.noBuyout=(0 = no buyout)
auction.sell.fee=Listing Fee: %s
auction.sell.create=Create Listing
auction.sell.noItem=Place an item to sell
# Trades
auction.trades.title=My Trades
auction.trades.active=Active Listings
auction.trades.activeBids=Active Bids
auction.trades.pending=Pending Claims
auction.trades.claimAll=Claim All
auction.trades.cancel=Cancel Listing
auction.trades.empty=No active trades
# Filter
auction.filter.title=Filter Auctions
auction.filter.search=Search
auction.filter.minPrice=Min Price
auction.filter.maxPrice=Max Price
auction.filter.myOnly=My Listings Only
auction.filter.apply=Apply
auction.filter.reset=Reset
# Bid Dialog
auction.bid.title=Place Bid
auction.bid.current=Current Bid: %s
auction.bid.minimum=Minimum Bid: %s
auction.bid.yourBid=Your Bid:
auction.bid.place=Place Bid
auction.bid.placeBid=Place Bid
auction.bid.buyout=Buyout Now
# Errors
auction.error.notEnoughCurrency=Not enough currency!
auction.error.auctionEnded=This auction has ended.
auction.error.bidTooLow=Bid must be at least %s.
auction.error.maxListings=You have reached your maximum listings.
auction.error.blacklisted=This item cannot be auctioned.
auction.error.noAuctioneer=You must visit an Auctioneer NPC.
auction.error.inventoryFull=Your inventory is full.
auction.error.cannotAfford=You cannot afford this.
# Navigation
auction.nav.listings=Browse Auctions
@@ -1815,9 +1782,6 @@ auction.claim.expires=Expires in %s days
auction.claim.expiresSoon=Expires soon!
auction.claim.clickToClaim=Click to claim
# Create Listing
auction.createListing=Create Listing
# Filter
auction.filter.sort=Sort By
auction.filter.none=(none)
@@ -1827,7 +1791,6 @@ auction.filter.rightClick=Right-click: Cycle Sort
# Pagination
auction.page.prev=Previous Page
auction.page.next=Next Page
auction.listings.count=%d Listings
# Sell Page
auction.sell.confirm=Confirm Listing
@@ -1846,9 +1809,12 @@ auction.trades.activeBid=Active Bid
auction.trades.unavailable=Slot Unavailable
auction.trades.rightClickToCancel=Right-click to cancel
auction.trades.leftClickToClaim=Left-click to claim
auction.trades.leftClickToIncrease=Left-click to increase bid
auction.trades.winningBid=You are the highest bidder
auction.trades.pendingClaim=Pending Claim
auction.trades.refundClaim=Bid Refund
auction.trades.soldClaim=Item Sold!
auction.trades.wonClaim=Auction Won!
auction.trades.expiredClaim=Auction Expired
auction.trades.refundClaim=Outbid - Refund Available
auction.trades.confirmCancel=Cancel Listing?
auction.trades.confirmClaim=Claim Item?
auction.trades.rightClickConfirm=Right-click again to confirm