From 9bf859b473fea95ff8acab91246c8827a95b9a9d Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Mon, 4 Mar 2024 06:58:50 -0600 Subject: [PATCH] Extra ToL SLots --- src/engine/gameManager/BuildingManager.java | 33 ++++++++++++++++++++- src/engine/objects/Blueprint.java | 3 ++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/engine/gameManager/BuildingManager.java b/src/engine/gameManager/BuildingManager.java index 5633df05..19c42471 100644 --- a/src/engine/gameManager/BuildingManager.java +++ b/src/engine/gameManager/BuildingManager.java @@ -520,9 +520,40 @@ public enum BuildingManager { if (building.getBlueprintUUID() == 0) return false; - if (building.getBlueprint().getMaxSlots() == building.getHirelings().size()) + if (building.getBlueprint().getMaxSlots() == building.getHirelings().size() && building.getBlueprint().getBuildingGroup().equals(BuildingGroup.TOL) == false) return false; + int availableSlots = 0; + if(building.getBlueprint().getBuildingGroup().equals(BuildingGroup.TOL)){ + switch (building.getRank()) { + + case 1: + case 2: + availableSlots = 1; + break; + case 3: + case 4: + case 5: + availableSlots = 2; + break; + case 6: + case 7: + availableSlots = 3; + break; + case 8: + availableSlots = 3; + break; + default: + availableSlots = 0; + break; + } + + availableSlots += 1; + } + if (availableSlots == building.getHirelings().size()){ + return false; + } + String pirateName = NPCManager.getPirateName(contract.getMobbaseID()); if (item.getChargesRemaining() > 0) diff --git a/src/engine/objects/Blueprint.java b/src/engine/objects/Blueprint.java index f12120b6..c4c04f53 100644 --- a/src/engine/objects/Blueprint.java +++ b/src/engine/objects/Blueprint.java @@ -181,6 +181,9 @@ public class Blueprint { public int getMaxSlots() { if (this.buildingGroup != null && this.buildingGroup.equals(BuildingGroup.BARRACK)) return 1; + if (this.buildingGroup != null && this.buildingGroup.equals(BuildingGroup.TOL)){ + return 4; + } return maxSlots; }