From 8fb044f71bc01596819f9873b1816228d10fb666 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 4 Sep 2024 09:45:42 -0500 Subject: [PATCH] trainer buildinsg capped at r1 with 3 slots --- src/engine/objects/Blueprint.java | 41 ++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/src/engine/objects/Blueprint.java b/src/engine/objects/Blueprint.java index 6e070fbf..890b9908 100644 --- a/src/engine/objects/Blueprint.java +++ b/src/engine/objects/Blueprint.java @@ -17,6 +17,7 @@ import org.pmw.tinylog.Logger; import java.sql.ResultSet; import java.sql.SQLException; import java.util.HashMap; +import java.util.Objects; /* @Summary - Blueprint class is used for determining characteristics of instanced player owned @@ -60,12 +61,26 @@ public class Blueprint { this.name = rs.getString("MeshName"); this.icon = rs.getInt("Icon"); this.buildingGroup = BuildingGroup.valueOf(rs.getString("BuildingGroup")); - this.maxRank = rs.getInt("MaxRank"); this.maxSlots = rs.getInt("MaxSlots"); this.rank1UUID = rs.getInt("Rank1UUID"); this.rank3UUID = rs.getInt("Rank3UUID"); this.rank7UUID = rs.getInt("Rank7UUID"); this.destroyedUUID = rs.getInt("DestroyedUUID"); + switch(Objects.requireNonNull(this.buildingGroup)){ + case CATHEDRAL: + case ELVENHALL: + case ELVENSANCTUM: + case FORESTHALL: + case IREKEIHALL: + case TEMPLEHALL: + case THIEFHALL: + case WIZARDHALL: + this.maxRank = 1; + break; + default: + this.maxRank = rs.getInt("MaxRank"); + break; + } } @@ -181,6 +196,17 @@ public class Blueprint { return 1; if (this.buildingGroup != null && this.buildingGroup.equals(BuildingGroup.TOL)) return 4; + switch(Objects.requireNonNull(this.buildingGroup)){ + case CATHEDRAL: + case ELVENHALL: + case ELVENSANCTUM: + case FORESTHALL: + case IREKEIHALL: + case TEMPLEHALL: + case THIEFHALL: + case WIZARDHALL: + return 3; + } return maxSlots; } @@ -311,19 +337,6 @@ public class Blueprint { if (currentRank == 0) return 0; - - switch(this.buildingGroup){ - case CATHEDRAL: - case ELVENHALL: - case ELVENSANCTUM: - case FORESTHALL: - case IREKEIHALL: - case TEMPLEHALL: - case THIEFHALL: - case WIZARDHALL: - return 3; - } - // Early exit for buildings with single or no slots if (this.maxSlots <= 1 && !this.buildingGroup.equals(BuildingGroup.TOL)) return maxSlots;