allow 5th slot in r8 TOL + wall health upgrade for r8 trees

This commit is contained in:
2025-01-10 09:28:08 -06:00
parent 5eab1ad1c0
commit b71bb60669
3 changed files with 36 additions and 2 deletions
+13 -2
View File
@@ -166,8 +166,19 @@ public class Building extends AbstractWorldObject {
if (this.blueprintUUID != 0)
this.meshUUID = blueprint.getMeshForRank(rank);
this.healthMax = blueprint.getMaxHealth(this.rank);
if(this.getBlueprint() != null && this.getBlueprint().getBuildingGroup() != null && this.getBlueprint().isWallPiece()){
City cityObject = ZoneManager.getCityAtLocation(this.loc);
if(cityObject.getTOL().getRank() == 8) {
float currentHealthRatio = this.getCurrentHitpoints() / this.healthMax;
float newMax = this.healthMax * 1.1f;
this.setMaxHitPoints(newMax);
this.setHealth(this.healthMax * currentHealthRatio);
}else {
this.healthMax = blueprint.getMaxHealth(this.rank);
}
} else {
this.healthMax = blueprint.getMaxHealth(this.rank);
}
// If this object has no blueprint but is a blueprint
// mesh then set it's current health to max health