mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-20 17:32:57 +07:00
Resolved #866 - City-states can no longer get Ancient Ruin bonuses
This commit is contained in:
parent
dd80530a93
commit
2a71d9e122
@ -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)
|
||||
|
@ -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))
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user