mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-14 01:39:40 +07:00
Pops defeat msg before AI founds any city.
This commit is contained in:

committed by
Yair Morgenstern

parent
292297e02d
commit
28cc905bb5
@ -219,6 +219,12 @@ class Battle(val gameInfo:GameInfo) {
|
|||||||
defender.takeDamage(100)
|
defender.takeDamage(100)
|
||||||
return
|
return
|
||||||
} // barbarians don't capture civilians!
|
} // 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
|
val capturedUnit = (defender as MapUnitCombatant).unit
|
||||||
capturedUnit.civInfo.addNotification("An enemy ["+attacker.getName()+"] has captured our ["+defender.getName()+"]",
|
capturedUnit.civInfo.addNotification("An enemy ["+attacker.getName()+"] has captured our ["+defender.getName()+"]",
|
||||||
defender.getTile().position, Color.RED)
|
defender.getTile().position, Color.RED)
|
||||||
@ -226,4 +232,4 @@ class Battle(val gameInfo:GameInfo) {
|
|||||||
capturedUnit.civInfo.removeUnit(capturedUnit)
|
capturedUnit.civInfo.removeUnit(capturedUnit)
|
||||||
capturedUnit.assignOwner(attacker.getCivInfo())
|
capturedUnit.assignOwner(attacker.getCivInfo())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user