bane live processing with vulnerable buildings

This commit is contained in:
2024-05-22 19:27:44 -05:00
parent b4ff1a3f7f
commit aa0621bb02
3 changed files with 33 additions and 0 deletions
+19
View File
@@ -340,6 +340,8 @@ public final class Bane {
return newBane;
}
public static boolean isStarted = false;
//Call this to prematurely end a bane
public SiegePhase getSiegePhase() {
@@ -639,4 +641,21 @@ public final class Bane {
return cityUUID;
}
public void startBane(){
City city = this.getCity();
if(city == null)
return;
this.isStarted = true; //flag the bane as started
for(AbstractWorldObject awo : WorldGrid.getObjectsInRangePartial(city.loc,mbEnums.CityBoundsType.ZONE.halfExtents + 64,MBServerStatics.MASK_BUILDING)){
Building building = (Building)awo;
if(building == null)
continue;
if(building.protectionState.equals(ProtectionState.UNDERSIEGE) == false)
building.protectionState = ProtectionState.UNDERSIEGE;
}
}
}