|
|
@ -1,7 +1,9 @@ |
|
|
|
package engine.jobs; |
|
|
|
package engine.jobs; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import engine.gameManager.ZoneManager; |
|
|
|
import engine.job.AbstractScheduleJob; |
|
|
|
import engine.job.AbstractScheduleJob; |
|
|
|
import engine.objects.Building; |
|
|
|
import engine.objects.Building; |
|
|
|
|
|
|
|
import engine.objects.City; |
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
/* |
|
|
@ -41,6 +43,18 @@ public class UpgradeBuildingJob extends AbstractScheduleJob { |
|
|
|
|
|
|
|
|
|
|
|
rankingBuilding.setRank(rankingBuilding.getRank() + 1); |
|
|
|
rankingBuilding.setRank(rankingBuilding.getRank() + 1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(rankingBuilding.getBlueprint().isWallPiece()){ |
|
|
|
|
|
|
|
City cityObject = ZoneManager.getCityAtLocation(rankingBuilding.loc); |
|
|
|
|
|
|
|
if(cityObject.getTOL().getRank() == 8) { |
|
|
|
|
|
|
|
if (rankingBuilding.getBlueprint() != null && rankingBuilding.getBlueprint().getBuildingGroup() != null && rankingBuilding.getBlueprint().isWallPiece()) { |
|
|
|
|
|
|
|
float currentHealthRatio = rankingBuilding.getCurrentHitpoints() / rankingBuilding.healthMax; |
|
|
|
|
|
|
|
float newMax = rankingBuilding.healthMax * 1.1f; |
|
|
|
|
|
|
|
rankingBuilding.setMaxHitPoints(newMax); |
|
|
|
|
|
|
|
rankingBuilding.setHealth(rankingBuilding.healthMax * currentHealthRatio); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Reload the object
|
|
|
|
// Reload the object
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|