From 9e50051c61c91cd5451528a0da69da0b97dce67e Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Tue, 17 Jul 2018 23:05:08 +0300 Subject: [PATCH] When out of gold, units disband at a rate dependant on your deficit --- .../logic/civilization/CivilizationInfo.kt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt index 1b399eca9a..ef8fa41755 100644 --- a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt +++ b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt @@ -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) + } } }