mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-18 11:49:19 +07:00
City-states allied to Civs no longer attempt to declare war when it does on Civs they haven't met yet
This commit is contained in:
BIN
android/Images/TileSets/FantasyHex/Tiles/Atoll.png
Normal file
BIN
android/Images/TileSets/FantasyHex/Tiles/Atoll.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 677 B |
@ -374,7 +374,7 @@ class CivilizationInfo {
|
||||
policies.endTurn(nextTurnStats.culture.toInt())
|
||||
|
||||
// disband units until there are none left OR the gold values are normal
|
||||
if(!isBarbarian() && gold < -100 && nextTurnStats.gold.toInt() < 0) {
|
||||
if (!isBarbarian() && gold < -100 && nextTurnStats.gold.toInt() < 0) {
|
||||
for (i in 1 until (gold / -100)) {
|
||||
var civMilitaryUnits = getCivUnits().filter { !it.type.isCivilian() }
|
||||
if (civMilitaryUnits.isNotEmpty()) {
|
||||
@ -390,7 +390,7 @@ class CivilizationInfo {
|
||||
|
||||
if (cities.isNotEmpty()) tech.nextTurn(nextTurnStats.science.toInt())
|
||||
|
||||
if(isMajorCiv()) greatPeople.addGreatPersonPoints(getGreatPersonPointsForNextTurn()) // City-states don't get great people!
|
||||
if (isMajorCiv()) greatPeople.addGreatPersonPoints(getGreatPersonPointsForNextTurn()) // City-states don't get great people!
|
||||
|
||||
for (city in cities.toList()) { // a city can be removed while iterating (if it's being razed) so we need to iterate over a copy
|
||||
city.endTurn()
|
||||
@ -398,7 +398,7 @@ class CivilizationInfo {
|
||||
|
||||
goldenAges.endTurn(getHappiness())
|
||||
getCivUnits().forEach { it.endTurn() }
|
||||
diplomacy.values.forEach{it.nextTurn()}
|
||||
diplomacy.values.forEach { it.nextTurn() }
|
||||
updateAllyCivForCityState()
|
||||
updateHasActiveGreatWall()
|
||||
}
|
||||
|
@ -346,14 +346,18 @@ class DiplomacyManager() {
|
||||
|
||||
if (!civInfo.isCityState()) {
|
||||
for (thirdCiv in civInfo.getKnownCivs()) {
|
||||
if (thirdCiv.isCityState() && thirdCiv.getAllyCiv() == civInfo.civName && thirdCiv.getDiplomacyManager(otherCiv).canDeclareWar()) {
|
||||
if (thirdCiv.isCityState() && thirdCiv.getAllyCiv() == civInfo.civName
|
||||
&& thirdCiv.knows(otherCiv)
|
||||
&& thirdCiv.getDiplomacyManager(otherCiv).canDeclareWar()) {
|
||||
thirdCiv.getDiplomacyManager(otherCiv).declareWar()
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!otherCiv.isCityState()) {
|
||||
for (thirdCiv in otherCiv.getKnownCivs()) {
|
||||
if (thirdCiv.isCityState() && thirdCiv.getAllyCiv() == otherCiv.civName && thirdCiv.getDiplomacyManager(civInfo).canDeclareWar()) {
|
||||
if (thirdCiv.isCityState() && thirdCiv.getAllyCiv() == otherCiv.civName
|
||||
&& thirdCiv.knows(otherCiv)
|
||||
&& thirdCiv.getDiplomacyManager(civInfo).canDeclareWar()) {
|
||||
thirdCiv.getDiplomacyManager(civInfo).declareWar()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user