From 97fcbd8608618648bf089108610df38bdd24752c Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Fri, 23 Feb 2024 20:47:46 -0600 Subject: [PATCH] bane mechanic for zerg measures --- src/engine/gameManager/ZergManager.java | 3 +-- src/engine/objects/Bane.java | 6 +++--- src/engine/objects/City.java | 3 ++- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/engine/gameManager/ZergManager.java b/src/engine/gameManager/ZergManager.java index 7e21fb39..8305eecb 100644 --- a/src/engine/gameManager/ZergManager.java +++ b/src/engine/gameManager/ZergManager.java @@ -165,8 +165,7 @@ public class ZergManager { return multiplier; } - public static int getBaneCapSize(Bane bane){ - Guild defender = bane.getCity().getGuild(); + public static int getBaneCapSize(Guild defender){ int treesInNation = defender.getNation().getSubGuildList().size() + 1; int capSize; switch(treesInNation){ diff --git a/src/engine/objects/Bane.java b/src/engine/objects/Bane.java index 0d1d8051..5f718f35 100644 --- a/src/engine/objects/Bane.java +++ b/src/engine/objects/Bane.java @@ -106,7 +106,7 @@ public final class Bane { if (this.liveDate == null) setDefaultTime(); - this.capSize = ZergManager.getBaneCapSize(this); + this.capSize = ZergManager.getBaneCapSize(this.getCity().getGuild()); } public static boolean summonBanestone(PlayerCharacter player, ClientConnection origin, int rank) { @@ -267,7 +267,7 @@ public final class Bane { BaneRecord baneRecord = BaneRecord.borrow(bane, Enum.RecordEventType.PENDING); DataWarehouse.pushToWarehouse(baneRecord); - bane.capSize = ZergManager.getBaneCapSize(bane); + bane.capSize = ZergManager.getBaneCapSize(bane.getCity().getGuild()); return true; } @@ -343,7 +343,7 @@ public final class Bane { } newBane = DbManager.BaneQueries.LOAD_BANE(city.getObjectUUID()); - newBane.capSize = ZergManager.getBaneCapSize(newBane); + newBane.capSize = ZergManager.getBaneCapSize(newBane.getCity().getGuild()); return newBane; } diff --git a/src/engine/objects/City.java b/src/engine/objects/City.java index f3918c04..430c0be5 100644 --- a/src/engine/objects/City.java +++ b/src/engine/objects/City.java @@ -322,7 +322,8 @@ public class City extends AbstractWorldObject { writer.putFloat(city.location.y); writer.putFloat(city.location.z); - writer.putInt(city.siegesWithstood); + //writer.putInt(city.siegesWithstood); + writer.putInt(ZergManager.getBaneCapSize(city.getGuild())); writer.put((byte) 1); writer.put((byte) 0);