From 689969a005fc5a64c11140e524eb453d6dbe0e51 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 8 Sep 2024 17:18:45 -0500 Subject: [PATCH] r* tree buildings acquire 10% more 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 11301dfe..6a54b8c9 100644 --- a/src/engine/objects/Building.java +++ b/src/engine/objects/Building.java @@ -182,6 +182,22 @@ public class Building extends AbstractWorldObject { this.setHealth(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); + } + } + } + } + // Null out blueprint if not needed (npc building) if (blueprintUUID == 0)