Project reformat.

This commit is contained in:
2024-03-24 09:42:27 -04:00
parent d0bb761344
commit 943d274e5f
53 changed files with 998 additions and 971 deletions
+44 -44
View File
@@ -1037,13 +1037,13 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
}
public void recalculateStats() {
if(this.isPlayerGuard()){
if (this.isPlayerGuard()) {
NPCManager.setMaxHealthForGuard(this);
NPCManager.setAttackRatingForGuard(this);
NPCManager.setDefenseForGuard(this);
NPCManager.setDamageAndSpeedForGuard(this);
NPCManager.applyGuardStanceModifiers(this);
}else {
} else {
try {
calculateAtrDefenseDamage();
@@ -1061,64 +1061,64 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
} catch (Exception e) {
Logger.error(e.getMessage());
}
if(this.isSiege())
if (this.isSiege())
this.healthMax = 10000;
Resists.calculateResists(this);
}
public void calculateMaxHealthManaStamina() {
float h;
float m;
float s;
float h;
float m;
float s;
h = this.mobBase.getHealthMax();
if (this.isPet()) {
h = this.level * 0.5f * 120;
}
m = this.statSpiCurrent;
s = this.statConCurrent;
h = this.mobBase.getHealthMax();
if (this.isPet()) {
h = this.level * 0.5f * 120;
}
m = this.statSpiCurrent;
s = this.statConCurrent;
// Apply any bonuses from runes and effects
// Apply any bonuses from runes and effects
if (this.bonuses != null) {
h += this.bonuses.getFloat(ModType.HealthFull, SourceType.NONE);
m += this.bonuses.getFloat(ModType.ManaFull, SourceType.NONE);
s += this.bonuses.getFloat(ModType.StaminaFull, SourceType.NONE);
if (this.bonuses != null) {
h += this.bonuses.getFloat(ModType.HealthFull, SourceType.NONE);
m += this.bonuses.getFloat(ModType.ManaFull, SourceType.NONE);
s += this.bonuses.getFloat(ModType.StaminaFull, SourceType.NONE);
//apply effects percent modifiers. DO THIS LAST!
//apply effects percent modifiers. DO THIS LAST!
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, SourceType.NONE));
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, SourceType.NONE));
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, SourceType.NONE));
}
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, SourceType.NONE));
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, SourceType.NONE));
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, SourceType.NONE));
}
// Set max health, mana and stamina
// Set max health, mana and stamina
if (h > 0)
this.healthMax = h;
else
this.healthMax = 1;
if (h > 0)
this.healthMax = h;
else
this.healthMax = 1;
if (m > -1)
this.manaMax = m;
else
this.manaMax = 0;
if (m > -1)
this.manaMax = m;
else
this.manaMax = 0;
if (s > -1)
this.staminaMax = s;
else
this.staminaMax = 0;
if (s > -1)
this.staminaMax = s;
else
this.staminaMax = 0;
// Update health, mana and stamina if needed
// Update health, mana and stamina if needed
if (this.getHealth() > this.healthMax)
this.setHealth(this.healthMax);
if (this.getHealth() > this.healthMax)
this.setHealth(this.healthMax);
if (this.mana.get() > this.manaMax)
this.mana.set(this.manaMax);
if (this.mana.get() > this.manaMax)
this.mana.set(this.manaMax);
if (this.stamina.get() > this.staminaMax)
this.stamina.set(staminaMax);
if (this.stamina.get() > this.staminaMax)
this.stamina.set(staminaMax);
}
@@ -1885,9 +1885,9 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
}
}
public Boolean isGuard(){
public Boolean isGuard() {
switch(this.behaviourType){
switch (this.behaviourType) {
case GuardMinion:
case GuardCaptain:
case GuardWallArcher: