From 3360a034b2d3382190c47a4582ac5a32d81a5fbb Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 11 Feb 2024 16:59:46 -0600 Subject: [PATCH] maintenenace only ran for ToL, 3,000,000 cost, recycling daily when payment isnt received --- .../gameManager/MaintenanceManager.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/engine/gameManager/MaintenanceManager.java b/src/engine/gameManager/MaintenanceManager.java index f92d531e..c657b124 100644 --- a/src/engine/gameManager/MaintenanceManager.java +++ b/src/engine/gameManager/MaintenanceManager.java @@ -39,7 +39,7 @@ public enum MaintenanceManager { // Build list of buildings to apply maintenance on. - buildingList = new ArrayList(DbManager.getList(Enum.GameObjectType.Building)); + buildingList = new ArrayList(DbManager.getList(Enum.GameObjectType.City)); maintList = buildMaintList(buildingList); // Deduct upkeep and build list of buildings @@ -53,7 +53,10 @@ public enum MaintenanceManager { // Reset maintenance dates for these buildings for (Building building : maintList) { - setMaintDateTime(building, LocalDateTime.now().plusDays(7)); + if(derankList.contains(building) == false) + setMaintDateTime(building, LocalDateTime.now().plusDays(7)); + else + setMaintDateTime(building, LocalDateTime.now().plusDays(1)); } // Derak or destroy buildings that did not @@ -74,7 +77,10 @@ public enum MaintenanceManager { for (AbstractGameObject gameObject : buildingList) { - Building building = (Building) gameObject; + Building building = ((City)gameObject).getTOL();//(Building) gameObject; + + if(building == null) + continue; // No maintenance on NPC owned buildings (Cache loaded) @@ -154,7 +160,8 @@ public enum MaintenanceManager { // Cache maintenance cost value - maintCost = building.getMaintCost(); + //maintCost = building.getMaintCost(); + maintCost = 3000000; // Something went wrong. Missing buildinggroup from switch? @@ -225,9 +232,9 @@ public enum MaintenanceManager { // Add cash back to strongbox for lost rank if the building isn't being destroyed // and it's not an R8 deranking - if ((building.getRank() > 1) && (building.getRank() < 8)) { - building.setStrongboxValue(building.getStrongboxValue() + building.getBlueprint().getRankCost(Math.min(building.getRank(), 7))); - } + //if ((building.getRank() > 1) && (building.getRank() < 8)) { + // building.setStrongboxValue(building.getStrongboxValue() + building.getBlueprint().getRankCost(Math.min(building.getRank(), 7))); + //} return false; // Early exit for having failed to meet maintenance }