mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-18 11:49:19 +07:00
"Uncapturable" unique (#3388)
* WIP * "Uncapturable" unique; civilians will be destroyed instead of captured
This commit is contained in:
@ -333,7 +333,8 @@ object Battle {
|
||||
|
||||
private fun captureCivilianUnit(attacker: ICombatant, defender: ICombatant){
|
||||
// barbarians don't capture civilians
|
||||
if(attacker.getCivInfo().isBarbarian()){
|
||||
if(attacker.getCivInfo().isBarbarian()
|
||||
||(defender as MapUnitCombatant).unit.hasUnique("Uncapturable")){
|
||||
defender.takeDamage(100)
|
||||
return
|
||||
}
|
||||
@ -341,7 +342,7 @@ object Battle {
|
||||
// need to save this because if the unit is captured its owner wil be overwritten
|
||||
val defenderCiv = defender.getCivInfo()
|
||||
|
||||
val capturedUnit = (defender as MapUnitCombatant).unit
|
||||
val capturedUnit = defender.unit
|
||||
capturedUnit.civInfo.addNotification("An enemy ["+attacker.getName()+"] has captured our ["+defender.getName()+"]",
|
||||
defender.getTile().position, Color.RED)
|
||||
|
||||
|
@ -167,7 +167,10 @@ class BattleTable(val worldScreen: WorldScreen): Table() {
|
||||
if(attacker.isMelee() && (defender.getUnitType().isCivilian()
|
||||
|| defender.getUnitType()==UnitType.City && defender.isDefeated())) {
|
||||
add("")
|
||||
add(if(defender.getUnitType().isCivilian()) "Captured!".tr() else "Occupied!".tr() )
|
||||
add(if(defender.getUnitType().isCivilian()
|
||||
&& (defender as MapUnitCombatant).unit.hasUnique("Uncapturable")) ""
|
||||
else if(defender.getUnitType().isCivilian()) "Captured!".tr()
|
||||
else "Occupied!".tr())
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user