Browse Source

implement bane cap sizes based on trees in nation

lakebane-master
FatBoy-DOTC 6 months ago
parent
commit
fb6a3706cd
  1. 12
      src/engine/gameManager/ZergManager.java
  2. 7
      src/engine/objects/Bane.java
  3. 11
      src/engine/objects/City.java
  4. 24
      src/engine/workthreads/ZergMechanicThread.java

12
src/engine/gameManager/ZergManager.java

@ -1,7 +1,19 @@
package engine.gameManager; package engine.gameManager;
import engine.objects.Guild;
public class ZergManager { public class ZergManager {
public static int getBaneCap(Guild guild){
if(guild.getOwnedCity().getTOL().getRank() == 8)
return 20;
if(guild.getNation().getSubGuildList().size() + 1 <= 4)
return 10;
return 20;
}
public static float getMultiplier3Man(int count){ public static float getMultiplier3Man(int count){
float multiplier = 1.0f; float multiplier = 1.0f;

7
src/engine/objects/Bane.java

@ -106,12 +106,7 @@ public final class Bane {
if (this.liveDate == null) if (this.liveDate == null)
setDefaultTime(); setDefaultTime();
if(this.getCity().getTOL().getRank() == 8) this.capSize = ZergManager.getBaneCap(this.getCity().getGuild());
this.capSize = 40;
else
this.capSize = 20;
this.getCity().setSiegesWithstood(this.capSize);
} }
public static boolean summonBanestone(PlayerCharacter player, ClientConnection origin, int rank) { public static boolean summonBanestone(PlayerCharacter player, ClientConnection origin, int rank) {

11
src/engine/objects/City.java

@ -321,16 +321,7 @@ public class City extends AbstractWorldObject {
writer.putFloat(city.location.x); writer.putFloat(city.location.x);
writer.putFloat(city.location.y); writer.putFloat(city.location.y);
writer.putFloat(city.location.z); writer.putFloat(city.location.z);
writer.putInt(ZergManager.getBaneCap(city.getGuild()));
//writer.putInt(city.siegesWithstood);
if(city.getBane() != null) {
writer.putInt(city.siegesWithstood);
} else{
if(city.getTOL().getRank() == 8)
writer.putInt(40);
else
writer.putInt(20);
}
writer.put((byte) 1); writer.put((byte) 1);
writer.put((byte) 0); writer.put((byte) 0);
writer.putInt(0x64); writer.putInt(0x64);

24
src/engine/workthreads/ZergMechanicThread.java

@ -158,21 +158,27 @@ public ArrayList<PlayerCharacter> affectedPlayers = new ArrayList<>();
defenders.add(pc); defenders.add(pc);
} }
int treeRank = bane.getCity().getTOL().getRank(); //int treeRank = bane.getCity().getTOL().getRank();
for (PlayerCharacter pc : attackers) { for (PlayerCharacter pc : attackers) {
if (treeRank == 8) { switch(bane.capSize){
pc.ZergMultiplier = ZergManager.getMultiplier40Man(attackers.size()); case 10:
} else { pc.ZergMultiplier = ZergManager.getMultiplier10Man(attackers.size());
pc.ZergMultiplier = ZergManager.getMultiplier20Man(attackers.size()); break;
case 20:
pc.ZergMultiplier = ZergManager.getMultiplier20Man(attackers.size());
break;
} }
} }
for (PlayerCharacter pc : defenders) { for (PlayerCharacter pc : defenders) {
if (treeRank == 8) { switch(bane.capSize){
pc.ZergMultiplier = ZergManager.getMultiplier40Man(defenders.size()); case 10:
} else { pc.ZergMultiplier = ZergManager.getMultiplier10Man(defenders.size());
pc.ZergMultiplier = ZergManager.getMultiplier20Man(defenders.size()); break;
case 20:
pc.ZergMultiplier = ZergManager.getMultiplier20Man(defenders.size());
break;
} }
} }
} }

Loading…
Cancel
Save