Resolved #866 - City-states can no longer get Ancient Ruin bonuses

This commit is contained in:
Yair Morgenstern 2019-06-09 23:00:59 +03:00
parent dd80530a93
commit 2a71d9e122
3 changed files with 5 additions and 7 deletions

View File

@ -401,7 +401,7 @@ class UnitAutomation{
}
fun tryGoToRuin(unit:MapUnit, unitDistanceToTiles: HashMap<TileInfo, Float>): Boolean {
if(unit.civInfo.isBarbarianCivilization()) return false // barbs don't have anything to do in ruins
if(!unit.civInfo.isMajorCiv()) return false // barbs don't have anything to do in ruins
val tileWithRuin = unitDistanceToTiles.keys.firstOrNull{unit.canMoveTo(it) && it.improvement == Constants.ancientRuins}
if(tileWithRuin==null) return false
unit.moveToTile(tileWithRuin)

View File

@ -234,14 +234,12 @@ class Battle(val gameInfo:GameInfo) {
}
fun captureCivilianUnit(attacker: ICombatant, defender: ICombatant){
if(attacker.getCivInfo().isBarbarianCivilization()){
if(attacker.getCivInfo().isBarbarianCivilization()
|| (attacker.getCivInfo().isCityState() && defender.getName()==Constants.settler)){
defender.takeDamage(100)
return
} // barbarians don't capture civilians!
if (attacker.getCivInfo().isCityState() && defender.getName() == Constants.settler) {
defender.takeDamage(100)
return
}
if (defender.getCivInfo().isDefeated()) {//Last settler captured
defender.getCivInfo().destroy()
attacker.getCivInfo().popupAlerts.add(PopupAlert(AlertType.Defeated,defender.getCivInfo().civName))

View File

@ -456,7 +456,7 @@ class MapUnit {
tile.civilianUnit=this
else tile.militaryUnit=this
currentTile = tile
if(tile.improvement==Constants.ancientRuins && !civInfo.isBarbarianCivilization())
if(tile.improvement==Constants.ancientRuins && civInfo.isMajorCiv())
getAncientRuinBonus()
if(tile.improvement==Constants.barbarianEncampment && !civInfo.isBarbarianCivilization())
clearEncampment(tile)