From a113295058153f10c05f53bfdc04c8c5d39a359c Mon Sep 17 00:00:00 2001 From: MagicBot Date: Fri, 5 May 2023 08:51:49 -0400 Subject: [PATCH] Player zone radius now reflects 24.3 at 875. --- src/engine/Enum.java | 7 +++---- src/engine/ai/utilities/MovementUtilities.java | 6 +++--- src/engine/gameManager/ZoneManager.java | 5 ++--- src/engine/net/client/handlers/PlaceAssetMsgHandler.java | 2 +- src/engine/objects/Building.java | 4 ++-- src/engine/objects/City.java | 6 +++--- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/engine/Enum.java b/src/engine/Enum.java index ccd2db53..dd8e7fff 100644 --- a/src/engine/Enum.java +++ b/src/engine/Enum.java @@ -2269,14 +2269,13 @@ public class Enum { public enum CityBoundsType { - GRID(512), - ZONE(576), - SIEGE(1040); + GRID(640), + ZONE(875); public final float extents; CityBoundsType(float extents) { - this.extents = extents; + this.extents = extents; } } diff --git a/src/engine/ai/utilities/MovementUtilities.java b/src/engine/ai/utilities/MovementUtilities.java index f160d987..9b905ad1 100644 --- a/src/engine/ai/utilities/MovementUtilities.java +++ b/src/engine/ai/utilities/MovementUtilities.java @@ -53,9 +53,9 @@ public class MovementUtilities { //Guards recall distance = 814. if (tol != null){ - if (agent.getLoc().distanceSquared2D(tol.getLoc()) > sqr(Enum.CityBoundsType.SIEGE.extents)) { - return false; - } + if (agent.getLoc().distanceSquared2D(tol.getLoc()) > sqr(Enum.CityBoundsType.ZONE.extents)) { + return false; + } } } diff --git a/src/engine/gameManager/ZoneManager.java b/src/engine/gameManager/ZoneManager.java index c2008eb2..bc32a63d 100644 --- a/src/engine/gameManager/ZoneManager.java +++ b/src/engine/gameManager/ZoneManager.java @@ -424,7 +424,7 @@ public enum ZoneManager { city = City.getCity(zone.getPlayerCityUUID()); - if (worldLoc.isInsideCircle(city.getLoc(), Enum.CityBoundsType.SIEGE.extents)) + if (worldLoc.isInsideCircle(city.getLoc(), Enum.CityBoundsType.ZONE.extents)) return city; } @@ -449,11 +449,10 @@ public enum ZoneManager { treeBounds = Bounds.borrow(); - treeBounds.setBounds(new Vector2f(positionX, positionZ), new Vector2f(Enum.CityBoundsType.SIEGE.extents, Enum.CityBoundsType.SIEGE.extents), 0.0f); + treeBounds.setBounds(new Vector2f(positionX, positionZ), new Vector2f(Enum.CityBoundsType.ZONE.extents, Enum.CityBoundsType.ZONE.extents), 0.0f); zoneList = currentZone.getNodes(); - for (Zone zone : zoneList) { if (zone.isContinent()) diff --git a/src/engine/net/client/handlers/PlaceAssetMsgHandler.java b/src/engine/net/client/handlers/PlaceAssetMsgHandler.java index 18b8c835..780779db 100644 --- a/src/engine/net/client/handlers/PlaceAssetMsgHandler.java +++ b/src/engine/net/client/handlers/PlaceAssetMsgHandler.java @@ -427,7 +427,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { if (!building.getBlueprint().isSiegeEquip()) continue; - if (!building.getLoc().isInsideCircle(serverCity.getLoc(), Enum.CityBoundsType.SIEGE.extents)) + if (!building.getLoc().isInsideCircle(serverCity.getLoc(), CityBoundsType.ZONE.extents)) continue; if (building.getGuild() == null) diff --git a/src/engine/objects/Building.java b/src/engine/objects/Building.java index 75cc4c54..b1dfa9d2 100644 --- a/src/engine/objects/Building.java +++ b/src/engine/objects/Building.java @@ -276,14 +276,14 @@ public class Building extends AbstractWorldObject { if (this.getBlueprint() != null && this.getBlueprint().isSiegeEquip() && this.protectionState.equals(ProtectionState.PROTECTED)){ if (this.getGuild() != null){ if (this.getGuild().getOwnedCity() != null){ - if (this.getLoc().isInsideCircle(this.getGuild().getOwnedCity().getLoc(), Enum.CityBoundsType.SIEGE.extents)) + if (this.getLoc().isInsideCircle(this.getGuild().getOwnedCity().getLoc(), CityBoundsType.ZONE.extents)) return this.getGuild().getOwnedCity(); }else{ Bane bane = Bane.getBaneByAttackerGuild(this.getGuild()); if (bane != null){ if (bane.getCity() != null){ - if (this.getLoc().isInsideCircle(bane.getCity().getLoc(), Enum.CityBoundsType.SIEGE.extents)) + if (this.getLoc().isInsideCircle(bane.getCity().getLoc(), CityBoundsType.ZONE.extents)) return bane.getCity(); } } diff --git a/src/engine/objects/City.java b/src/engine/objects/City.java index dba734b8..a63bb9f6 100644 --- a/src/engine/objects/City.java +++ b/src/engine/objects/City.java @@ -942,7 +942,7 @@ public class City extends AbstractWorldObject { public boolean isLocationWithinSiegeBounds(Vector3fImmutable insideLoc) { - return insideLoc.isInsideCircle(this.getLoc(), CityBoundsType.SIEGE.extents); + return insideLoc.isInsideCircle(this.getLoc(), CityBoundsType.ZONE.extents); } @@ -1000,9 +1000,9 @@ public class City extends AbstractWorldObject { HashSet currentMemory; PlayerCharacter player; - // Gather current list of players within a distance defined by the seige bounds + // Gather current list of players within the zone bounds - currentPlayers = WorldGrid.getObjectsInRangePartial(this.location, CityBoundsType.SIEGE.extents, MBServerStatics.MASK_PLAYER); + currentPlayers = WorldGrid.getObjectsInRangePartial(this.location, CityBoundsType.ZONE.extents, MBServerStatics.MASK_PLAYER); currentMemory = new HashSet<>(); for (AbstractWorldObject playerObject : currentPlayers) {