mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-09 23:39:40 +07:00
Fix Citadel not quite buildable where it should be (#3788)
This commit is contained in:
@ -183,7 +183,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Citadel",
|
"name": "Citadel",
|
||||||
"uniques": ["Gives a defensive bonus of [100]%", "Deal 30 damage to adjacent enemy units", "Great Improvement"]
|
"uniques": ["Gives a defensive bonus of [100]%", "Deal 30 damage to adjacent enemy units", "Great Improvement", "Can be built just outside your borders"]
|
||||||
},
|
},
|
||||||
|
|
||||||
//Civilization unique improvements
|
//Civilization unique improvements
|
||||||
|
@ -323,7 +323,11 @@ open class TileInfo {
|
|||||||
return when {
|
return when {
|
||||||
improvement.uniqueTo != null && improvement.uniqueTo != civInfo.civName -> false
|
improvement.uniqueTo != null && improvement.uniqueTo != civInfo.civName -> false
|
||||||
improvement.techRequired != null && !civInfo.tech.isResearched(improvement.techRequired!!) -> false
|
improvement.techRequired != null && !civInfo.tech.isResearched(improvement.techRequired!!) -> false
|
||||||
getOwner() != civInfo && !improvement.hasUnique("Can be built outside your borders") -> false
|
getOwner() != civInfo && ! (
|
||||||
|
improvement.hasUnique("Can be built outside your borders")
|
||||||
|
// citadel can be built only next to or within own borders
|
||||||
|
|| improvement.hasUnique("Can be built just outside your borders") && neighbors.any { it.getOwner() == civInfo }
|
||||||
|
) -> false
|
||||||
improvement.uniqueObjects.any {
|
improvement.uniqueObjects.any {
|
||||||
it.placeholderText == "Obsolete with []" && civInfo.tech.isResearched(it.params[0])
|
it.placeholderText == "Obsolete with []" && civInfo.tech.isResearched(it.params[0])
|
||||||
} -> return false
|
} -> return false
|
||||||
@ -651,4 +655,4 @@ open class TileInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//endregion
|
//endregion
|
||||||
}
|
}
|
||||||
|
@ -352,10 +352,7 @@ object UnitActions {
|
|||||||
unit.destroy()
|
unit.destroy()
|
||||||
}.takeIf {
|
}.takeIf {
|
||||||
unit.currentMovement > 0f && tile.canBuildImprovement(improvement, unit.civInfo)
|
unit.currentMovement > 0f && tile.canBuildImprovement(improvement, unit.civInfo)
|
||||||
&& !tile.isImpassible() && // Not 100% sure that this check is necessary...
|
&& !tile.isImpassible() // Not 100% sure that this check is necessary...
|
||||||
// citadel can be built only next to or within own borders
|
|
||||||
(improvementName != Constants.citadel ||
|
|
||||||
tile.neighbors.any { it.getOwner() == unit.civInfo })
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return finalActions
|
return finalActions
|
||||||
@ -449,4 +446,4 @@ object UnitActions {
|
|||||||
// Can't pillage friendly tiles, just like you can't attack them - it's an 'act of war' thing
|
// Can't pillage friendly tiles, just like you can't attack them - it's an 'act of war' thing
|
||||||
return tileOwner == null || tileOwner == unit.civInfo || unit.civInfo.isAtWarWith(tileOwner)
|
return tileOwner == null || tileOwner == unit.civInfo || unit.civInfo.isAtWarWith(tileOwner)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user