Browse Source

Ruins or SDR driven by config.

master
MagicBot 2 years ago
parent
commit
b383aab556
  1. 9
      src/engine/Enum.java
  2. 4
      src/engine/gameManager/ZoneManager.java
  3. 3
      src/engine/objects/PlayerCharacter.java

9
src/engine/Enum.java

@ -9,6 +9,7 @@
package engine; package engine;
import ch.claude_martin.enumbitset.EnumBitSetHelper; import ch.claude_martin.enumbitset.EnumBitSetHelper;
import engine.gameManager.ConfigManager;
import engine.gameManager.PowersManager; import engine.gameManager.PowersManager;
import engine.gameManager.ZoneManager; import engine.gameManager.ZoneManager;
import engine.math.Vector2f; import engine.math.Vector2f;
@ -433,7 +434,13 @@ public class Enum {
Zone ruinZone; Zone ruinZone;
Vector3fImmutable spawnLocation; Vector3fImmutable spawnLocation;
ruinZone = ZoneManager.getZoneByUUID(this.zoneUUID); // Send to SDR if so configured
if (ConfigManager.MB_USE_RUINS.getValue().equalsIgnoreCase("true"))
ruinZone = ZoneManager.getZoneByUUID(this.zoneUUID);
else
ruinZone = ZoneManager.getZoneByName("Sea Dog's Rest");
spawnLocation = Vector3fImmutable.getRandomPointOnCircle(ruinZone.getLoc(), 30); spawnLocation = Vector3fImmutable.getRandomPointOnCircle(ruinZone.getLoc(), 30);
return spawnLocation; return spawnLocation;

4
src/engine/gameManager/ZoneManager.java

@ -144,6 +144,10 @@ public enum ZoneManager {
return ZoneManager.zonesByID.get(zoneID); return ZoneManager.zonesByID.get(zoneID);
} }
public static Zone getZoneByName(final String zoneName) {
return ZoneManager.zonesByName.get(zoneName);
}
public static final Collection<Zone> getAllZones() { public static final Collection<Zone> getAllZones() {
return ZoneManager.zonesByUUID.values(); return ZoneManager.zonesByUUID.values();
} }

3
src/engine/objects/PlayerCharacter.java

@ -879,14 +879,11 @@ public class PlayerCharacter extends AbstractCharacter {
//handle rented room binds. //handle rented room binds.
if (bindBuilding == null){ if (bindBuilding == null){
bindLocation = Enum.Ruins.getRandomRuin().getLocation(); bindLocation = Enum.Ruins.getRandomRuin().getLocation();
return bindLocation; return bindLocation;
} }
bindLocation = BuildingManager.GetBindLocationForBuilding(bindBuilding); bindLocation = BuildingManager.GetBindLocationForBuilding(bindBuilding);
if (bindLocation == null) if (bindLocation == null)

Loading…
Cancel
Save