allow 5th slot in r8 TOL + wall health upgrade

This commit is contained in:
2025-01-10 09:17:58 -06:00
parent f96d0caf3c
commit 5eab1ad1c0
2 changed files with 29 additions and 0 deletions
+4
View File
@@ -360,6 +360,10 @@ this.maxRank = rs.getInt("MaxRank");
return 3;
}
if(bg != null && bg.equals(BuildingGroup.TOL) && currentRank == 8){
return 5;
}
if (this.maxRank == 1 && currentRank == 1)
return getMaxSlots();
+25
View File
@@ -10,10 +10,14 @@
package engine.objects;
import engine.Enum;
import engine.InterestManagement.InterestManager;
import engine.InterestManagement.RealmMap;
import engine.InterestManagement.WorldGrid;
import engine.db.archive.DataWarehouse;
import engine.db.archive.RealmRecord;
import engine.gameManager.BuildingManager;
import engine.gameManager.DbManager;
import engine.gameManager.NPCManager;
import engine.gameManager.PowersManager;
import engine.net.ByteBufferWriter;
import engine.powers.PowersBase;
@@ -379,6 +383,16 @@ public class Realm {
public void abandonRealm() {
for(AbstractWorldObject awo : WorldGrid.getObjectsInRangePartial(this.getRulingCity().loc,1750,MBServerStatics.MASK_BUILDING)){
Building wall = (Building)awo;
if(wall.getBlueprint() != null && wall.getBlueprint().getBuildingGroup() != null && wall.getBlueprint().isWallPiece()){
float currentHealthRatio = wall.getCurrentHitpoints()/wall.healthMax;
float newMax = wall.getBlueprint().getMaxHealth(1);
wall.setMaxHitPoints(newMax);
wall.setHealth(wall.healthMax * currentHealthRatio);
}
}
// Push event to warehouse
RealmRecord realmRecord = RealmRecord.borrow(this, Enum.RecordEventType.LOST);
@@ -406,6 +420,17 @@ public class Realm {
this.configure();
this.updateDatabase();
for(AbstractWorldObject awo : WorldGrid.getObjectsInRangePartial(city.loc,1750,MBServerStatics.MASK_BUILDING)){
Building wall = (Building)awo;
if(wall.getBlueprint() != null && wall.getBlueprint().getBuildingGroup() != null && wall.getBlueprint().isWallPiece()){
float currentHealthRatio = wall.getCurrentHitpoints()/wall.healthMax;
float newMax = wall.healthMax * 1.1f;
wall.setMaxHitPoints(newMax);
wall.setHealth(wall.healthMax * currentHealthRatio);
}
}
// Push event to warehouse
RealmRecord realmRecord = RealmRecord.borrow(this, Enum.RecordEventType.CAPTURE);