From 62c188c5c784b9bb384fd402c3a71e8822f926d9 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Fri, 10 Jan 2025 09:45:51 -0600 Subject: [PATCH] wall bonus HP --- src/engine/objects/Building.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/engine/objects/Building.java b/src/engine/objects/Building.java index e8ee3f1d..0412648e 100644 --- a/src/engine/objects/Building.java +++ b/src/engine/objects/Building.java @@ -412,6 +412,22 @@ public class Building extends AbstractWorldObject { this.healthMax = this.getBlueprint().getMaxHealth(this.rank); this.setCurrentHitPoints(this.healthMax); + if(!this.ownerIsNPC){ + //add extra HP for city walls of R8 trees + City city = ZoneManager.getCityAtLocation(this.loc); + if(city != null){ + Building ToL = city.getTOL(); + if(ToL != null){ + if(ToL.rank == 8){ + float currentHealth = this.health.get(); + float newHealth = (currentHealth/this.healthMax) * (this.healthMax * 1.1f); + this.healthMax *= 1.1f; + this.setHealth(newHealth); + } + } + } + } + if (this.getUpgradeDateTime() != null) BuildingManager.setUpgradeDateTime(this, null, 0);