mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-10 07:48:31 +07:00
Add May not annex cities
unique (#9314)
* Add `May not annex cities` unique, following same behaviour as Civ5 Venice. Hopefully this time I won't need to re-install windows. * Add `May not annex cities` unique, following same behaviour as Civ5 Venice. Hopefully this time I won't need to re-install windows. * Fix raze button being unavailable in city screen * Fixed raze button being available in city screen, as per civ5 * Corrected indentation * mayAnnex instead of canAnnex, hasUnique rather than getMatchingUniques * AI will follow rules * Replaced getMatchingUniques with hasUnique, for real this time
This commit is contained in:
@ -1016,7 +1016,7 @@ object NextTurnAutomation {
|
||||
ownMilitaryStrength < sumOfEnemiesMilitaryStrength * 0.66f
|
||||
for (city in civInfo.cities) {
|
||||
if (city.isPuppet && city.population.population > 9
|
||||
&& !city.isInResistance()
|
||||
&& !city.isInResistance() && !civInfo.hasUnique(UniqueType.MayNotAnnexCities)
|
||||
) {
|
||||
city.annexCity()
|
||||
}
|
||||
@ -1124,7 +1124,7 @@ object NextTurnAutomation {
|
||||
if ((city.population.population < 4 || civInfo.isCityState())
|
||||
&& city.foundingCiv != civInfo.civName && city.canBeDestroyed(justCaptured = true)) {
|
||||
// raze if attacker is a city state
|
||||
city.annexCity()
|
||||
if (!civInfo.hasUnique(UniqueType.MayNotAnnexCities)) { city.annexCity() }
|
||||
city.isBeingRazed = true
|
||||
}
|
||||
}
|
||||
|
@ -595,6 +595,7 @@ object Battle {
|
||||
if (city.isOriginalCapital && city.foundingCiv == attackerCiv.civName) {
|
||||
// retaking old capital
|
||||
city.puppetCity(attackerCiv)
|
||||
//Although in Civ5 Venice is unable to re-annex their capital, that seems a bit silly. No check for May not annex cities here.
|
||||
city.annexCity()
|
||||
} else if (attackerCiv.isHuman()) {
|
||||
// we're not taking our former capital
|
||||
|
@ -315,6 +315,13 @@ class CityInfoConquestFunctions(val city: City){
|
||||
|
||||
if (civ.gameInfo.isReligionEnabled()) religion.removeUnknownPantheons()
|
||||
|
||||
if (newCiv.hasUnique(UniqueType.MayNotAnnexCities)) {
|
||||
isPuppet = true
|
||||
cityConstructions.currentConstructionIsUserSet = false
|
||||
cityConstructions.constructionQueue.clear()
|
||||
cityConstructions.chooseNextConstruction()
|
||||
}
|
||||
|
||||
tryUpdateRoadStatus()
|
||||
cityStats.update()
|
||||
|
||||
|
Reference in New Issue
Block a user