From 28cc905bb5afa1e534a0177065d4dbdccbafde19 Mon Sep 17 00:00:00 2001 From: Duan Tao Date: Sun, 28 Apr 2019 10:44:35 +0800 Subject: [PATCH] Pops defeat msg before AI founds any city. --- core/src/com/unciv/logic/battle/Battle.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/logic/battle/Battle.kt b/core/src/com/unciv/logic/battle/Battle.kt index a92fa5ebb0..d8c8c4d431 100644 --- a/core/src/com/unciv/logic/battle/Battle.kt +++ b/core/src/com/unciv/logic/battle/Battle.kt @@ -219,6 +219,12 @@ class Battle(val gameInfo:GameInfo) { defender.takeDamage(100) return } // barbarians don't capture civilians! + + if (defender.getCivInfo().isDefeated()) {//Last settler captured + defender.getCivInfo().destroy() + attacker.getCivInfo().popupAlerts.add(PopupAlert(AlertType.Defeated,defender.getCivInfo().civName)) + } + val capturedUnit = (defender as MapUnitCombatant).unit capturedUnit.civInfo.addNotification("An enemy ["+attacker.getName()+"] has captured our ["+defender.getName()+"]", defender.getTile().position, Color.RED) @@ -226,4 +232,4 @@ class Battle(val gameInfo:GameInfo) { capturedUnit.civInfo.removeUnit(capturedUnit) capturedUnit.assignOwner(attacker.getCivInfo()) } -} \ No newline at end of file +}