Browse Source

property conforms to JSON

combat-2
MagicBot 1 year ago
parent
commit
1b2c218e83
  1. 12
      src/engine/InterestManagement/Terrain.java
  2. 2
      src/engine/devcmd/cmds/GetHeightCmd.java
  3. 2
      src/engine/devcmd/cmds/SeaAuditCmd.java
  4. 2
      src/engine/devcmd/cmds/ZoneInfoCmd.java
  5. 2
      src/engine/gameManager/ZoneManager.java
  6. 2
      src/engine/net/client/handlers/PlaceAssetMsgHandler.java
  7. 6
      src/engine/objects/Zone.java

12
src/engine/InterestManagement/Terrain.java

@ -35,15 +35,15 @@ public class Terrain { @@ -35,15 +35,15 @@ public class Terrain {
this.zone = zone;
this.heightmap = this.zone.terrain_image;
// Configure PLANAR zones to use the same
// 16x16 pixel image that all other flat
// terrains share.
// Configure PLANAR zones to use the same 16x16 pixel image
// that all similar terrains share. (See JSON) Guild zones
// use an inverted clone of this heightmap.
if (this.zone.terrain_type.equals("PLANAR"))
if (this.zone.guild_zone)
this.heightmap = 1006301;
this.heightmap = 1006301; // all 255
else
this.heightmap = 1006300;
this.heightmap = 1006300; // all 0
// Load pixel data for this terrain from cache
@ -110,7 +110,7 @@ public class Terrain { @@ -110,7 +110,7 @@ public class Terrain {
// Interpolate height for this position in terrain
float interpolatedChildHeight = terrainZone.terrain.getInterpolatedTerrainHeight(terrainLoc);
interpolatedChildHeight += terrainZone.worldAltitude;
interpolatedChildHeight += terrainZone.global_height;
return interpolatedChildHeight;
}

2
src/engine/devcmd/cmds/GetHeightCmd.java

@ -44,7 +44,7 @@ public class GetHeightCmd extends AbstractDevCmd { @@ -44,7 +44,7 @@ public class GetHeightCmd extends AbstractDevCmd {
this.throwbackInfo(playerCharacter, "Current Zone : " + currentZone.zoneName);
this.throwbackInfo(playerCharacter, "Heightmap Zone : " + heightmapZone.zoneName);
this.throwbackInfo(playerCharacter, "Global Height: " + heightmapZone.worldAltitude);
this.throwbackInfo(playerCharacter, "Global Height: " + heightmapZone.global_height);
this.throwbackInfo(playerCharacter, "Sea Level: " + heightmapZone.seaLevel);
this.throwbackInfo(playerCharacter, "Grid : " + Math.floor(gridSquare.x) + "x" + Math.floor(gridSquare.y));
this.throwbackInfo(playerCharacter, "Blend: " + heightmapZone.terrain.terrainBlend(zoneOffset));

2
src/engine/devcmd/cmds/SeaAuditCmd.java

@ -26,7 +26,7 @@ public class SeaAuditCmd extends AbstractDevCmd { @@ -26,7 +26,7 @@ public class SeaAuditCmd extends AbstractDevCmd {
AbstractGameObject target) {
for (Zone zone : ZoneManager.getAllZones())
if (zone.seaLevel > zone.worldAltitude)
if (zone.seaLevel > zone.global_height)
this.throwbackInfo(playerCharacter, zone.getObjectUUID() + zone.zoneName);
}

2
src/engine/devcmd/cmds/ZoneInfoCmd.java

@ -101,7 +101,7 @@ public class ZoneInfoCmd extends AbstractDevCmd { @@ -101,7 +101,7 @@ public class ZoneInfoCmd extends AbstractDevCmd {
output += newline;
output += "Sea Level = " + zone.seaLevel;
output += newline;
output += "World Altitude = " + zone.worldAltitude;
output += "World Altitude = " + zone.global_height;
throwbackInfo(player, output);
City city = ZoneManager.getCityAtLocation(player.getLoc());

2
src/engine/gameManager/ZoneManager.java

@ -453,7 +453,7 @@ public enum ZoneManager { @@ -453,7 +453,7 @@ public enum ZoneManager {
}
}
public static float caclulateWorldAltitude(Zone zone) {
public static float calculateGlobalZoneHeight(Zone zone) {
float worldAlttitude = MBServerStatics.SEA_FLOOR_ALTITUDE;

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

@ -792,7 +792,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { @@ -792,7 +792,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
ZoneManager.addPlayerCityZone(zoneObject);
serverZone.addNode(zoneObject);
zoneObject.worldAltitude = ZoneManager.caclulateWorldAltitude(zoneObject);
zoneObject.global_height = ZoneManager.calculateGlobalZoneHeight(zoneObject);
cityObject.setParent(zoneObject);
cityObject.setObjectTypeMask(MBServerStatics.MASK_CITY); // *** Refactor : should have it already

6
src/engine/objects/Zone.java

@ -56,7 +56,7 @@ public class Zone extends AbstractGameObject { @@ -56,7 +56,7 @@ public class Zone extends AbstractGameObject {
public boolean isNPCCity = false;
public boolean guild_zone;
public String hash;
public float worldAltitude = 0;
public float global_height = 0;
public float seaLevel = 0f;
public float sea_level_offset = 0;
public static final Set<Mob> respawnQue = Collections.newSetFromMap(new ConcurrentHashMap<>());
@ -230,7 +230,7 @@ public class Zone extends AbstractGameObject { @@ -230,7 +230,7 @@ public class Zone extends AbstractGameObject {
}
this.setBounds();
this.worldAltitude = ZoneManager.caclulateWorldAltitude(this);
this.global_height = ZoneManager.calculateGlobalZoneHeight(this);
setSeaLevel();
}
@ -251,7 +251,7 @@ public class Zone extends AbstractGameObject { @@ -251,7 +251,7 @@ public class Zone extends AbstractGameObject {
this.sea_level = this.parent.sea_level + this.sea_level_offset;
break;
case "SELF":
this.sea_level = this.worldAltitude + this.sea_level_offset;
this.sea_level = this.global_height + this.sea_level_offset;
break;
}
}

Loading…
Cancel
Save