mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 05:46:43 -04:00
Fixing to also capture Civilian Unit when capturing during battle (#6114)
Co-authored-by: temurakami <spellman23@gmail.com>
This commit is contained in:
parent
aa11602c9a
commit
77dd9f63f6
@ -214,6 +214,10 @@ object Battle {
|
||||
"Your [${attacker.getName()}] captured an enemy [$defenderName]",
|
||||
newUnit.getTile().position, attacker.getName(), NotificationIcon.War, defenderName )
|
||||
|
||||
// Also capture any civilians on the same tile
|
||||
if (newUnit.currentTile.civilianUnit != null)
|
||||
captureCivilianUnit(attacker, MapUnitCombatant(newUnit.currentTile.civilianUnit!!))
|
||||
|
||||
newUnit.currentMovement = 0f
|
||||
newUnit.health = 50
|
||||
return true
|
||||
@ -339,6 +343,9 @@ object Battle {
|
||||
attacker.getCivInfo().placeUnitNearTile(attackedTile.position, defender.getName())
|
||||
attacker.getCivInfo().addGold(25)
|
||||
attacker.getCivInfo().addNotification("A barbarian [${defender.getName()}] has joined us!", attackedTile.position, defender.getName())
|
||||
// Also capture any civilians on the same tile
|
||||
if (attackedTile.civilianUnit != null)
|
||||
captureCivilianUnit(attacker, MapUnitCombatant(attackedTile.civilianUnit!!))
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user