mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-13 19:39:34 +07:00
Resolved #1302 - captured settlers are converted workers as per original Civ V
This commit is contained in:
parent
1ea961b54a
commit
140753e9c4
@ -21,8 +21,8 @@ android {
|
||||
applicationId "com.unciv.app"
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 29
|
||||
versionCode 319
|
||||
versionName "3.1.13"
|
||||
versionCode 320
|
||||
versionName "3.2.0"
|
||||
}
|
||||
|
||||
// Had to add this crap for Travis to build, it wanted to sign the app
|
||||
|
@ -255,10 +255,7 @@ class Battle(val gameInfo:GameInfo) {
|
||||
|
||||
private fun captureCivilianUnit(attacker: ICombatant, defender: ICombatant){
|
||||
// barbarians don't capture civilians
|
||||
// City-states & OCC don't capture settlers
|
||||
if(attacker.getCivInfo().isBarbarian()
|
||||
|| ((attacker.getCivInfo().isCityState() || attacker.getCivInfo().isPlayerOneCityChallenger())
|
||||
&& defender.getName()==Constants.settler)){
|
||||
if(attacker.getCivInfo().isBarbarian()){
|
||||
defender.takeDamage(100)
|
||||
return
|
||||
}
|
||||
@ -272,8 +269,16 @@ class Battle(val gameInfo:GameInfo) {
|
||||
capturedUnit.civInfo.addNotification("An enemy ["+attacker.getName()+"] has captured our ["+defender.getName()+"]",
|
||||
defender.getTile().position, Color.RED)
|
||||
|
||||
capturedUnit.civInfo.removeUnit(capturedUnit)
|
||||
capturedUnit.assignOwner(attacker.getCivInfo())
|
||||
// Apparently in Civ V, captured settlers are converted to workers.
|
||||
if(capturedUnit.name==Constants.settler){
|
||||
val tile = capturedUnit.getTile()
|
||||
capturedUnit.destroy()
|
||||
attacker.getCivInfo().placeUnitNearTile(tile.position, Constants.worker)
|
||||
}
|
||||
else {
|
||||
capturedUnit.civInfo.removeUnit(capturedUnit)
|
||||
capturedUnit.assignOwner(attacker.getCivInfo())
|
||||
}
|
||||
capturedUnit.updateVisibleTiles()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user