Browse Source

bane mechanic complete - working

lakebane2
FatBoy-DOTC 4 weeks ago
parent
commit
1926deb7f9
  1. 10
      src/engine/objects/Bane.java
  2. 8
      src/engine/objects/City.java

10
src/engine/objects/Bane.java

@ -762,13 +762,15 @@ public final class Bane { @@ -762,13 +762,15 @@ public final class Bane {
float attackerMultiplier = ZergManager.getCurrentMultiplier(attackerSize,this.capSize);
float defenderMultiplier = ZergManager.getCurrentMultiplier(defenderSize,this.capSize);
for(int uuid : attackers){
if(city._playerMemory.contains(uuid)) //player is still physically here, needs updated multiplier
PlayerCharacter.getPlayerCharacter(uuid).ZergMultiplier = attackerMultiplier;
PlayerCharacter player = PlayerCharacter.getPlayerCharacter(uuid);
if(inSiegeRange.contains(player)) //player is still physically here, needs updated multiplier
player.ZergMultiplier = attackerMultiplier;
}
for(int uuid : defenders){
if(city._playerMemory.contains(uuid)) //player is still physically here, needs updated multiplier
PlayerCharacter.getPlayerCharacter(uuid).ZergMultiplier = defenderMultiplier;
PlayerCharacter player = PlayerCharacter.getPlayerCharacter(uuid);
if(inSiegeRange.contains(player)) //player is still physically here, needs updated multiplier
player.ZergMultiplier = defenderMultiplier;
}
}

8
src/engine/objects/City.java

@ -1063,15 +1063,19 @@ public class City extends AbstractWorldObject { @@ -1063,15 +1063,19 @@ public class City extends AbstractWorldObject {
private void onExitBane() {
Iterator<Integer> iterator = this.baneAttendees.keySet().iterator();
ArrayList<Integer> toRemove = new ArrayList<>();
while (iterator.hasNext()) {
Integer uuid = iterator.next();
if (!_playerMemory.contains(uuid)) {
long timeGone = System.currentTimeMillis() - this.baneAttendees.get(uuid).longValue();
if (timeGone > 180000) { // 3 minutes
iterator.remove();
if (timeGone > 180000L) { // 3 minutes
toRemove.add(uuid);
}
}
}
for(int uuid : toRemove){
this.baneAttendees.remove(uuid);
}
}

Loading…
Cancel
Save