Browse Source

bane zerg mechanics enabled

lakebane2
FatBoy-DOTC 3 weeks ago
parent
commit
8ab97a1b36
  1. 6
      src/engine/gameManager/SimulationManager.java
  2. 37
      src/engine/objects/Bane.java
  3. 1
      src/engine/objects/City.java

6
src/engine/gameManager/SimulationManager.java

@ -204,6 +204,12 @@ public enum SimulationManager {
if(mine != null && mine.isActive) if(mine != null && mine.isActive)
mine.onEnter(); mine.onEnter();
} }
for(int baneId : Bane.banes.keySet()){
Bane bane = Bane.banes.get(baneId);
if(bane.getSiegePhase().equals(Enum.SiegePhase.WAR)){
bane.applyZergBuffs();
}
}
_cityPulseTime = System.currentTimeMillis() + CITY_PULSE; _cityPulseTime = System.currentTimeMillis() + CITY_PULSE;
} }

37
src/engine/objects/Bane.java

@ -683,4 +683,41 @@ public final class Bane {
return cityUUID; return cityUUID;
} }
public void applyZergBuffs(){
City city = this.getCity();
if(city == null)
return;
ArrayList<Integer> attackers = new ArrayList<>();
ArrayList<Integer> defenders = new ArrayList<>();
ArrayList<Integer> crashers = new ArrayList<>();
for(int uuid : city.baneAttendees.keySet()){
PlayerCharacter player = PlayerCharacter.getPlayerCharacter(uuid);
if(player == null)
continue;
//separate the players into categories
if(player.guild.getNation().equals(city.getGuild().getNation()))
defenders.add(uuid);
else if(player.guild.getNation().equals(this.getOwner().getGuild().getNation()))
attackers.add(uuid);
else
player.teleport(player.bindLoc);
}
//apply zerg mechanic for attackers
float attackerMultiplier = ZergManager.getCurrentMultiplier(attackers.size(),this.capSize);
float defenderMultiplier = ZergManager.getCurrentMultiplier(defenders.size(),this.capSize);
for(int uuid : attackers){
if(city._playerMemory.contains(uuid)) //player is still physically here, needs updated multiplier
PlayerCharacter.getPlayerCharacter(uuid).ZergMultiplier = attackerMultiplier;
}
for(int uuid : defenders){
if(city._playerMemory.contains(uuid)) //player is still physically here, needs updated multiplier
PlayerCharacter.getPlayerCharacter(uuid).ZergMultiplier = defenderMultiplier;
}
}
} }

1
src/engine/objects/City.java

@ -1055,7 +1055,6 @@ public class City extends AbstractWorldObject {
} catch (Exception e) { } catch (Exception e) {
Logger.error(e.getMessage()); Logger.error(e.getMessage());
} }
} }
private void onExitBane(){ private void onExitBane(){

Loading…
Cancel
Save