Browse Source

calculate combat stats spam fix

lakebane-ai
FatBoy-DOTC 3 weeks ago
parent
commit
f4267c3c92
  1. 16
      src/engine/objects/PlayerCharacter.java
  2. 24
      src/engine/objects/PlayerCombatStats.java

16
src/engine/objects/PlayerCharacter.java

@ -5060,14 +5060,16 @@ public class PlayerCharacter extends AbstractCharacter { @@ -5060,14 +5060,16 @@ public class PlayerCharacter extends AbstractCharacter {
return;
}
this.updateLocation();
this.updateMovementState();
this.doRegen();
if (this.combatStats == null) {
this.combatStats = new PlayerCombatStats(this);
}else{
this.combatStats.update();
}
if(this.isAlive() && this.isActive && this.enteredWorld) {
this.updateMovementState();
this.doRegen();
if (this.combatStats == null) {
this.combatStats = new PlayerCombatStats(this);
} else {
this.combatStats.update();
}
}
if (this.getStamina() < 10) {
if (this.getAltitude() > 0 || this.getDesiredAltitude() > 0) {

24
src/engine/objects/PlayerCombatStats.java

@ -41,62 +41,62 @@ public class PlayerCombatStats { @@ -41,62 +41,62 @@ public class PlayerCombatStats {
try {
this.calculateATR(true);
} catch (Exception e) {
Logger.error("FAILED TO CALCULATE ATR FOR: " + this.owner.getObjectUUID());
//Logger.error("FAILED TO CALCULATE ATR FOR: " + this.owner.getObjectUUID());
}
try {
this.calculateATR(false);
} catch (Exception e) {
Logger.error("FAILED TO CALCULATE ATR FOR: " + this.owner.getObjectUUID());
//Logger.error("FAILED TO CALCULATE ATR FOR: " + this.owner.getObjectUUID());
}
try {
this.calculateMin(true);
} catch (Exception e) {
Logger.error("FAILED TO CALCULATE Min FOR: " + this.owner.getObjectUUID());
//Logger.error("FAILED TO CALCULATE Min FOR: " + this.owner.getObjectUUID());
}
try {
this.calculateMin(false);
} catch (Exception e) {
Logger.error("FAILED TO CALCULATE Min FOR: " + this.owner.getObjectUUID());
//Logger.error("FAILED TO CALCULATE Min FOR: " + this.owner.getObjectUUID());
}
try {
this.calculateMax(true);
} catch (Exception e) {
Logger.error("FAILED TO CALCULATE Max FOR: " + this.owner.getObjectUUID());
//Logger.error("FAILED TO CALCULATE Max FOR: " + this.owner.getObjectUUID());
}
try {
this.calculateMax(false);
} catch (Exception e) {
Logger.error("FAILED TO CALCULATE Max FOR: " + this.owner.getObjectUUID());
//Logger.error("FAILED TO CALCULATE Max FOR: " + this.owner.getObjectUUID());
}
try {
this.calculateAttackSpeed(true);
} catch (Exception e) {
Logger.error("FAILED TO CALCULATE Attack Speed FOR: " + this.owner.getObjectUUID());
//Logger.error("FAILED TO CALCULATE Attack Speed FOR: " + this.owner.getObjectUUID());
}
try {
this.calculateAttackSpeed(false);
} catch (Exception e) {
Logger.error("FAILED TO CALCULATE Attack Speed FOR: " + this.owner.getObjectUUID());
//Logger.error("FAILED TO CALCULATE Attack Speed FOR: " + this.owner.getObjectUUID());
}
try {
this.calculateAttackRange(true);
} catch (Exception e) {
Logger.error("FAILED TO CALCULATE Attack Range FOR: " + this.owner.getObjectUUID());
//Logger.error("FAILED TO CALCULATE Attack Range FOR: " + this.owner.getObjectUUID());
}
try {
this.calculateAttackRange(false);
} catch (Exception e) {
Logger.error("FAILED TO CALCULATE Attack Range FOR: " + this.owner.getObjectUUID());
//Logger.error("FAILED TO CALCULATE Attack Range FOR: " + this.owner.getObjectUUID());
}
try {
this.calculateRegen();
} catch (Exception e) {
Logger.error("FAILED TO CALCULATE Regen FOR: " + this.owner.getObjectUUID());
//Logger.error("FAILED TO CALCULATE Regen FOR: " + this.owner.getObjectUUID());
}
try {
this.calculateDefense();
} catch (Exception e) {
Logger.error("FAILED TO CALCULATE Defense FOR: " + this.owner.getObjectUUID());
//Logger.error("FAILED TO CALCULATE Defense FOR: " + this.owner.getObjectUUID());
}
}

Loading…
Cancel
Save