Browse Source

Player zone radius now reflects 24.3 at 875.

master
MagicBot 2 years ago
parent
commit
a113295058
  1. 7
      src/engine/Enum.java
  2. 6
      src/engine/ai/utilities/MovementUtilities.java
  3. 5
      src/engine/gameManager/ZoneManager.java
  4. 2
      src/engine/net/client/handlers/PlaceAssetMsgHandler.java
  5. 4
      src/engine/objects/Building.java
  6. 6
      src/engine/objects/City.java

7
src/engine/Enum.java

@ -2269,14 +2269,13 @@ public class Enum {
public enum CityBoundsType { public enum CityBoundsType {
GRID(512), GRID(640),
ZONE(576), ZONE(875);
SIEGE(1040);
public final float extents; public final float extents;
CityBoundsType(float extents) { CityBoundsType(float extents) {
this.extents = extents; this.extents = extents;
} }
} }

6
src/engine/ai/utilities/MovementUtilities.java

@ -53,9 +53,9 @@ public class MovementUtilities {
//Guards recall distance = 814. //Guards recall distance = 814.
if (tol != null){ if (tol != null){
if (agent.getLoc().distanceSquared2D(tol.getLoc()) > sqr(Enum.CityBoundsType.SIEGE.extents)) { if (agent.getLoc().distanceSquared2D(tol.getLoc()) > sqr(Enum.CityBoundsType.ZONE.extents)) {
return false; return false;
} }
} }
} }

5
src/engine/gameManager/ZoneManager.java

@ -424,7 +424,7 @@ public enum ZoneManager {
city = City.getCity(zone.getPlayerCityUUID()); 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; return city;
} }
@ -449,11 +449,10 @@ public enum ZoneManager {
treeBounds = Bounds.borrow(); 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(); zoneList = currentZone.getNodes();
for (Zone zone : zoneList) { for (Zone zone : zoneList) {
if (zone.isContinent()) if (zone.isContinent())

2
src/engine/net/client/handlers/PlaceAssetMsgHandler.java

@ -427,7 +427,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
if (!building.getBlueprint().isSiegeEquip()) if (!building.getBlueprint().isSiegeEquip())
continue; continue;
if (!building.getLoc().isInsideCircle(serverCity.getLoc(), Enum.CityBoundsType.SIEGE.extents)) if (!building.getLoc().isInsideCircle(serverCity.getLoc(), CityBoundsType.ZONE.extents))
continue; continue;
if (building.getGuild() == null) if (building.getGuild() == null)

4
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.getBlueprint() != null && this.getBlueprint().isSiegeEquip() && this.protectionState.equals(ProtectionState.PROTECTED)){
if (this.getGuild() != null){ if (this.getGuild() != null){
if (this.getGuild().getOwnedCity() != 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(); return this.getGuild().getOwnedCity();
}else{ }else{
Bane bane = Bane.getBaneByAttackerGuild(this.getGuild()); Bane bane = Bane.getBaneByAttackerGuild(this.getGuild());
if (bane != null){ if (bane != null){
if (bane.getCity() != 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(); return bane.getCity();
} }
} }

6
src/engine/objects/City.java

@ -942,7 +942,7 @@ public class City extends AbstractWorldObject {
public boolean isLocationWithinSiegeBounds(Vector3fImmutable insideLoc) { 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<Integer> currentMemory; HashSet<Integer> currentMemory;
PlayerCharacter player; 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<>(); currentMemory = new HashSet<>();
for (AbstractWorldObject playerObject : currentPlayers) { for (AbstractWorldObject playerObject : currentPlayers) {

Loading…
Cancel
Save