Browse Source

allow 5th slot in r8 TOL + wall health upgrade

lakebane
FatBoy-DOTC 1 week ago
parent
commit
5eab1ad1c0
  1. 4
      src/engine/objects/Blueprint.java
  2. 25
      src/engine/objects/Realm.java

4
src/engine/objects/Blueprint.java

@ -360,6 +360,10 @@ this.maxRank = rs.getInt("MaxRank");
return 3; return 3;
} }
if(bg != null && bg.equals(BuildingGroup.TOL) && currentRank == 8){
return 5;
}
if (this.maxRank == 1 && currentRank == 1) if (this.maxRank == 1 && currentRank == 1)
return getMaxSlots(); return getMaxSlots();

25
src/engine/objects/Realm.java

@ -10,10 +10,14 @@
package engine.objects; package engine.objects;
import engine.Enum; import engine.Enum;
import engine.InterestManagement.InterestManager;
import engine.InterestManagement.RealmMap; import engine.InterestManagement.RealmMap;
import engine.InterestManagement.WorldGrid;
import engine.db.archive.DataWarehouse; import engine.db.archive.DataWarehouse;
import engine.db.archive.RealmRecord; import engine.db.archive.RealmRecord;
import engine.gameManager.BuildingManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.NPCManager;
import engine.gameManager.PowersManager; import engine.gameManager.PowersManager;
import engine.net.ByteBufferWriter; import engine.net.ByteBufferWriter;
import engine.powers.PowersBase; import engine.powers.PowersBase;
@ -379,6 +383,16 @@ public class Realm {
public void abandonRealm() { 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 // Push event to warehouse
RealmRecord realmRecord = RealmRecord.borrow(this, Enum.RecordEventType.LOST); RealmRecord realmRecord = RealmRecord.borrow(this, Enum.RecordEventType.LOST);
@ -406,6 +420,17 @@ public class Realm {
this.configure(); this.configure();
this.updateDatabase(); 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 // Push event to warehouse
RealmRecord realmRecord = RealmRecord.borrow(this, Enum.RecordEventType.CAPTURE); RealmRecord realmRecord = RealmRecord.borrow(this, Enum.RecordEventType.CAPTURE);

Loading…
Cancel
Save