Browse Source

zerg mechanic work

lakebane-master
FatBoy-DOTC 7 months ago
parent
commit
e4bad5f418
  1. 15
      src/engine/workthreads/ZergMechanicThread.java

15
src/engine/workthreads/ZergMechanicThread.java

@ -34,6 +34,7 @@ import static engine.server.MBServerStatics.MINE_LATE_WINDOW;
public class ZergMechanicThread implements Runnable { public class ZergMechanicThread implements Runnable {
public Bane bane = null; public Bane bane = null;
public Mine mine = null; public Mine mine = null;
public ArrayList<PlayerCharacter> affectedPlayers = new ArrayList<>();
public ZergMechanicThread(Bane b, Mine m) { public ZergMechanicThread(Bane b, Mine m) {
this.mine = m; this.mine = m;
@ -64,6 +65,10 @@ public Mine mine = null;
continue; continue;
player = (PlayerCharacter) playerObject; player = (PlayerCharacter) playerObject;
if(!this.affectedPlayers.contains(player))
this.affectedPlayers.add(player);
//ChatManager.chatSystemInfo(player, "TESTING ZERG MECHANIC"); //ChatManager.chatSystemInfo(player, "TESTING ZERG MECHANIC");
if (mine._recentMemory.containsKey(player.getObjectUUID())) if (mine._recentMemory.containsKey(player.getObjectUUID()))
mine._recentMemory.remove(player.getObjectUUID()); mine._recentMemory.remove(player.getObjectUUID());
@ -118,6 +123,9 @@ public Mine mine = null;
} }
} }
} }
for(PlayerCharacter player : this.affectedPlayers)
player.ZergMultiplier = 1.0f;
} }
public void RunBaneMechanic(){ public void RunBaneMechanic(){
@ -133,6 +141,10 @@ public Mine mine = null;
ArrayList<PlayerCharacter> defenders = new ArrayList<>(); ArrayList<PlayerCharacter> defenders = new ArrayList<>();
for (AbstractWorldObject awo : currentPlayers) { for (AbstractWorldObject awo : currentPlayers) {
if(!this.affectedPlayers.contains((PlayerCharacter)awo))
this.affectedPlayers.add((PlayerCharacter)awo);
PlayerCharacter pc = (PlayerCharacter) awo; PlayerCharacter pc = (PlayerCharacter) awo;
if (!pc.getGuild().getNation().equals(attacker) && !pc.getGuild().getNation().equals(defender)) { if (!pc.getGuild().getNation().equals(attacker) && !pc.getGuild().getNation().equals(defender)) {
pc.teleport(pc.bindLoc); pc.teleport(pc.bindLoc);
@ -164,6 +176,9 @@ public Mine mine = null;
} }
} }
} }
for(PlayerCharacter player : this.affectedPlayers)
player.ZergMultiplier = 1.0f;
} }
public static void startZergThreadMine(Mine mine) { public static void startZergThreadMine(Mine mine) {

Loading…
Cancel
Save