R8 bonus application moved to City
This commit is contained in:
@@ -761,6 +761,41 @@ public class City extends AbstractWorldObject {
|
||||
}
|
||||
}
|
||||
|
||||
// Apply health bonus and special mesh for realm if applicable
|
||||
|
||||
if (this.getTOL().rank == 8) {
|
||||
|
||||
// Update mesh accordingly
|
||||
|
||||
this.getTOL().meshUUID = Realm.getRealmMesh(this);
|
||||
|
||||
// Apply realm capital health bonus.
|
||||
// Do not apply bonus to banestones or TOL's. *** Refactor:
|
||||
// Possibly only protected buildings? Needs some thought.
|
||||
|
||||
float missingHealth = 0;
|
||||
|
||||
if (this.health.get() != 0)
|
||||
missingHealth = this.healthMax - this.health.get();
|
||||
|
||||
for (Building building : this.parentZone.zoneBuildingSet) {
|
||||
|
||||
if (building.getBlueprint() != null &&
|
||||
building.getBlueprint().getBuildingGroup() != BuildingGroup.BANESTONE &&
|
||||
building.getBlueprint().getBuildingGroup() != BuildingGroup.TOL) {
|
||||
|
||||
building.healthMax += (building.healthMax * Realm.getRealmHealthMod(this));
|
||||
|
||||
if (this.health.get() != 0)
|
||||
this.health.set(this.healthMax - missingHealth);
|
||||
|
||||
if (this.health.get() > this.healthMax)
|
||||
this.health.set(this.healthMax);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Banes are loaded for this city from the database at this point
|
||||
|
||||
if (this.getBane() == null)
|
||||
|
||||
Reference in New Issue
Block a user