mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -04: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"
|
applicationId "com.unciv.app"
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 319
|
versionCode 320
|
||||||
versionName "3.1.13"
|
versionName "3.2.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Had to add this crap for Travis to build, it wanted to sign the app
|
// 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){
|
private fun captureCivilianUnit(attacker: ICombatant, defender: ICombatant){
|
||||||
// barbarians don't capture civilians
|
// barbarians don't capture civilians
|
||||||
// City-states & OCC don't capture settlers
|
if(attacker.getCivInfo().isBarbarian()){
|
||||||
if(attacker.getCivInfo().isBarbarian()
|
|
||||||
|| ((attacker.getCivInfo().isCityState() || attacker.getCivInfo().isPlayerOneCityChallenger())
|
|
||||||
&& defender.getName()==Constants.settler)){
|
|
||||||
defender.takeDamage(100)
|
defender.takeDamage(100)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -272,8 +269,16 @@ class Battle(val gameInfo:GameInfo) {
|
|||||||
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)
|
||||||
|
|
||||||
capturedUnit.civInfo.removeUnit(capturedUnit)
|
// Apparently in Civ V, captured settlers are converted to workers.
|
||||||
capturedUnit.assignOwner(attacker.getCivInfo())
|
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()
|
capturedUnit.updateVisibleTiles()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user