|
|
|
@ -33,29 +33,22 @@ import static engine.server.MBServerStatics.MINE_LATE_WINDOW;
@@ -33,29 +33,22 @@ import static engine.server.MBServerStatics.MINE_LATE_WINDOW;
|
|
|
|
|
public class ZergMechanicThread implements Runnable { |
|
|
|
|
public Bane bane = null; |
|
|
|
|
public Mine mine = null; |
|
|
|
|
public boolean isMine = false; |
|
|
|
|
|
|
|
|
|
public ZergMechanicThread(Bane b, Mine m) { |
|
|
|
|
if(b != null){ |
|
|
|
|
this.isMine = false; |
|
|
|
|
} |
|
|
|
|
if(m != null){ |
|
|
|
|
this.isMine = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void run() { |
|
|
|
|
|
|
|
|
|
while(mine != null && mine.isActive) |
|
|
|
|
if (mine != null) |
|
|
|
|
RunMineMechanic(); |
|
|
|
|
|
|
|
|
|
while(bane != null && bane.getSiegePhase().equals(Enum.SiegePhase.WAR)) |
|
|
|
|
if (bane != null) |
|
|
|
|
RunBaneMechanic(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void RunMineMechanic(){ |
|
|
|
|
|
|
|
|
|
while(mine.isActive) { |
|
|
|
|
HashSet<AbstractWorldObject> currentPlayers; |
|
|
|
|
PlayerCharacter player; |
|
|
|
|
|
|
|
|
@ -88,7 +81,8 @@ public boolean isMine = false;
@@ -88,7 +81,8 @@ public boolean isMine = false;
|
|
|
|
|
mine.dividedPlayers = new HashMap<>(); |
|
|
|
|
for (Integer playerID : mine._playerMemory) { |
|
|
|
|
player = PlayerCharacter.getFromCache(playerID); |
|
|
|
|
Guild nation = player.getGuild().getNation(); Guild entry; |
|
|
|
|
Guild nation = player.getGuild().getNation(); |
|
|
|
|
Guild entry; |
|
|
|
|
if (mine.dividedPlayers.containsKey(nation)) { |
|
|
|
|
mine.dividedPlayers.get(nation).add(playerID); |
|
|
|
|
} else { |
|
|
|
@ -122,8 +116,10 @@ public boolean isMine = false;
@@ -122,8 +116,10 @@ public boolean isMine = false;
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void RunBaneMechanic(){ |
|
|
|
|
while(bane.getSiegePhase().equals(Enum.SiegePhase.WAR)) { |
|
|
|
|
HashSet<AbstractWorldObject> currentPlayers; |
|
|
|
|
|
|
|
|
|
currentPlayers = WorldGrid.getObjectsInRangePartial(bane.getCity().loc, Enum.CityBoundsType.GRID.extents * 2.0f, MBServerStatics.MASK_PLAYER); |
|
|
|
@ -165,6 +161,6 @@ public boolean isMine = false;
@@ -165,6 +161,6 @@ public boolean isMine = false;
|
|
|
|
|
pc.ZergMultiplier = ZergManager.getMultiplier20Man(defenders.size()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|