Browse Source

implement bane cap sizes based on trees in nation

lakebane-master
FatBoy-DOTC 7 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 @@ @@ -1,7 +1,19 @@
package engine.gameManager;
import engine.objects.Guild;
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){
float multiplier = 1.0f;

7
src/engine/objects/Bane.java

@ -106,12 +106,7 @@ public final class Bane { @@ -106,12 +106,7 @@ public final class Bane {
if (this.liveDate == null)
setDefaultTime();
if(this.getCity().getTOL().getRank() == 8)
this.capSize = 40;
else
this.capSize = 20;
this.getCity().setSiegesWithstood(this.capSize);
this.capSize = ZergManager.getBaneCap(this.getCity().getGuild());
}
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 { @@ -321,16 +321,7 @@ public class City extends AbstractWorldObject {
writer.putFloat(city.location.x);
writer.putFloat(city.location.y);
writer.putFloat(city.location.z);
//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.putInt(ZergManager.getBaneCap(city.getGuild()));
writer.put((byte) 1);
writer.put((byte) 0);
writer.putInt(0x64);

24
src/engine/workthreads/ZergMechanicThread.java

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

Loading…
Cancel
Save