maintenance resolution
This commit is contained in:
@@ -88,7 +88,7 @@ public enum MaintenanceManager {
|
|||||||
maintenanceDue = 0;
|
maintenanceDue = 0;
|
||||||
strongboxGold -= maintenanceDue;
|
strongboxGold -= maintenanceDue;
|
||||||
tol.setStrongboxValue(strongboxGold); //update strongbox value
|
tol.setStrongboxValue(strongboxGold); //update strongbox value
|
||||||
setMaintDateTime(tol, tol.maintDateTime.plusDays(7)); //maintenance paid, set next maintenance date for 1 week from today
|
setMaintDateTime(tol, LocalDateTime.now().plusDays(7)); //maintenance paid, set next maintenance date for 1 week from today
|
||||||
return; //maintenance is paid, all done
|
return; //maintenance is paid, all done
|
||||||
} else {
|
} else {
|
||||||
maintenanceDue -= strongboxGold;
|
maintenanceDue -= strongboxGold;
|
||||||
@@ -106,7 +106,7 @@ public enum MaintenanceManager {
|
|||||||
warehouseGold -= maintenanceDue;
|
warehouseGold -= maintenanceDue;
|
||||||
warehouse.getResources().put(ItemBase.getItemBase(7),warehouseGold);
|
warehouse.getResources().put(ItemBase.getItemBase(7),warehouseGold);
|
||||||
DbManager.WarehouseQueries.updateGold(warehouse, warehouseGold);
|
DbManager.WarehouseQueries.updateGold(warehouse, warehouseGold);
|
||||||
setMaintDateTime(tol, tol.maintDateTime.plusDays(7)); //maintenance paid, set next maintenance date for 1 week from today
|
setMaintDateTime(tol, LocalDateTime.now().plusDays(7)); //maintenance paid, set next maintenance date for 1 week from today
|
||||||
//maintenance is paid, all done
|
//maintenance is paid, all done
|
||||||
} else {
|
} else {
|
||||||
//failed maintenance, derank asset
|
//failed maintenance, derank asset
|
||||||
@@ -161,7 +161,7 @@ public enum MaintenanceManager {
|
|||||||
warehouse.getResources().put(ItemBase.getItemBase(1580004), lumberLeft);
|
warehouse.getResources().put(ItemBase.getItemBase(1580004), lumberLeft);
|
||||||
warehouse.getResources().put(ItemBase.getItemBase(1580000), stoneLeft);
|
warehouse.getResources().put(ItemBase.getItemBase(1580000), stoneLeft);
|
||||||
warehouse.getResources().put(ItemBase.getItemBase(1580018), wormwoodLeft);
|
warehouse.getResources().put(ItemBase.getItemBase(1580018), wormwoodLeft);
|
||||||
setMaintDateTime(tol, tol.maintDateTime.plusDays(7)); //maintenance paid, set next maintenance date for 1 week from today
|
setMaintDateTime(tol, LocalDateTime.now().plusDays(7)); //maintenance paid, set next maintenance date for 1 week from today
|
||||||
}else{
|
}else{
|
||||||
HandleMaintenanceDerank(tol);//handle derank or potential destruction of the city
|
HandleMaintenanceDerank(tol);//handle derank or potential destruction of the city
|
||||||
}
|
}
|
||||||
@@ -169,7 +169,7 @@ public enum MaintenanceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void HandleMaintenanceDerank(Building tol){
|
public static void HandleMaintenanceDerank(Building tol){
|
||||||
setMaintDateTime(tol, tol.maintDateTime.plusDays(1)); //failed to pay maintenance, set next date for tomorrow
|
setMaintDateTime(tol, LocalDateTime.now().plusDays(1)); //failed to pay maintenance, set next date for tomorrow
|
||||||
tol.destroyOrDerank(null);
|
tol.destroyOrDerank(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user