When out of gold, units disband at a rate dependant on your deficit
This commit is contained in:
parent
5fed13eb76
commit
9e50051c61
1 changed files with 9 additions and 8 deletions
|
@ -191,14 +191,15 @@ class CivilizationInfo {
|
|||
policies.endTurn(nextTurnStats.culture.toInt())
|
||||
|
||||
// disband units until there are none left OR the gold values are normal
|
||||
if(!isBarbarianCivilization() && gold < -100){
|
||||
var civMilitaryUnits = getCivUnits().filter { it.getBaseUnit().unitType!=UnitType.Civilian }
|
||||
if(nextTurnStats.gold.toInt() < 0
|
||||
&& civMilitaryUnits.isNotEmpty()){
|
||||
val unitToDisband = civMilitaryUnits.first()
|
||||
unitToDisband.removeFromTile()
|
||||
civMilitaryUnits -= unitToDisband
|
||||
addNotification("Cannot provide unit upkeep for "+unitToDisband.name+" - unit has been disbanded!".tr(),null, Color.RED)
|
||||
if(!isBarbarianCivilization() && gold < -100 && nextTurnStats.gold.toInt() < 0) {
|
||||
for (i in 1 until (gold / -100)) {
|
||||
var civMilitaryUnits = getCivUnits().filter { it.getBaseUnit().unitType != UnitType.Civilian }
|
||||
if (civMilitaryUnits.isNotEmpty()) {
|
||||
val unitToDisband = civMilitaryUnits.first()
|
||||
unitToDisband.removeFromTile()
|
||||
civMilitaryUnits -= unitToDisband
|
||||
addNotification("Cannot provide unit upkeep for " + unitToDisband.name + " - unit has been disbanded!".tr(), null, Color.RED)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue