From c9c1f6ba1c60b7907027fb0db60294909430d586 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Fri, 10 Jan 2025 09:52:34 -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 8bc4025f..8c79d2c8 100644 --- a/src/engine/objects/Building.java +++ b/src/engine/objects/Building.java @@ -1137,6 +1137,22 @@ public class Building extends AbstractWorldObject { } } + if(!this.ownerIsNPC && this.getBlueprint() != null && this.getBlueprint().isWallPiece()){ + //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); + } + } + } + } + // Set bounds for this building Bounds buildingBounds = Bounds.borrow();