forked from MagicBane/Server
bane mechanic for zerg measures
This commit is contained in:
@@ -165,8 +165,7 @@ public class ZergManager {
|
|||||||
return multiplier;
|
return multiplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getBaneCapSize(Bane bane){
|
public static int getBaneCapSize(Guild defender){
|
||||||
Guild defender = bane.getCity().getGuild();
|
|
||||||
int treesInNation = defender.getNation().getSubGuildList().size() + 1;
|
int treesInNation = defender.getNation().getSubGuildList().size() + 1;
|
||||||
int capSize;
|
int capSize;
|
||||||
switch(treesInNation){
|
switch(treesInNation){
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ public final class Bane {
|
|||||||
if (this.liveDate == null)
|
if (this.liveDate == null)
|
||||||
setDefaultTime();
|
setDefaultTime();
|
||||||
|
|
||||||
this.capSize = ZergManager.getBaneCapSize(this);
|
this.capSize = ZergManager.getBaneCapSize(this.getCity().getGuild());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean summonBanestone(PlayerCharacter player, ClientConnection origin, int rank) {
|
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);
|
BaneRecord baneRecord = BaneRecord.borrow(bane, Enum.RecordEventType.PENDING);
|
||||||
DataWarehouse.pushToWarehouse(baneRecord);
|
DataWarehouse.pushToWarehouse(baneRecord);
|
||||||
|
|
||||||
bane.capSize = ZergManager.getBaneCapSize(bane);
|
bane.capSize = ZergManager.getBaneCapSize(bane.getCity().getGuild());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -343,7 +343,7 @@ public final class Bane {
|
|||||||
}
|
}
|
||||||
|
|
||||||
newBane = DbManager.BaneQueries.LOAD_BANE(city.getObjectUUID());
|
newBane = DbManager.BaneQueries.LOAD_BANE(city.getObjectUUID());
|
||||||
newBane.capSize = ZergManager.getBaneCapSize(newBane);
|
newBane.capSize = ZergManager.getBaneCapSize(newBane.getCity().getGuild());
|
||||||
return newBane;
|
return newBane;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -322,7 +322,8 @@ public class City extends AbstractWorldObject {
|
|||||||
writer.putFloat(city.location.y);
|
writer.putFloat(city.location.y);
|
||||||
writer.putFloat(city.location.z);
|
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) 1);
|
||||||
writer.put((byte) 0);
|
writer.put((byte) 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user