Merge remote-tracking branch 'origin/master'

This commit is contained in:
yairm210
2021-12-06 19:20:28 +02:00
8 changed files with 50 additions and 35 deletions

View File

@ -274,14 +274,17 @@ class CityInfoConquestFunctions(val city: CityInfo){
// Remove their free buildings from this city and remove free buildings provided by the city from their cities
removeBuildingsOnMoveToCiv(oldCiv)
// Add our free buildings to this city and add free buildings provided by the city to other cities
civInfo.civConstructions.tryAddFreeBuildings()
// Place palace for newCiv if this is the only city they have
// This needs to happen _before_ free buildings are added, as somtimes these should
// only be placed in the capital, and then there needs to be a capital.
if (newCivInfo.cities.count() == 1) {
cityConstructions.addBuilding(capitalCityIndicator)
}
// Add our free buildings to this city and add free buildings provided by the city to other cities
civInfo.civConstructions.tryAddFreeBuildings()
isBeingRazed = false
// Transfer unique buildings

View File

@ -337,9 +337,13 @@ class MapUnit {
return 1
}
visibilityRange += getMatchingUniques(UniqueType.Sight, checkCivInfoUniques = true)
visibilityRange += getMatchingUniques(UniqueType.Sight, conditionalState, checkCivInfoUniques = true)
.sumOf { it.params[0].toInt() }
visibilityRange += getTile().getAllTerrains()
.flatMap { it.getMatchingUniques(UniqueType.Sight, conditionalState) }
.sumOf { it.params[0].toInt() }
if (visibilityRange < 1) visibilityRange = 1
return visibilityRange

View File

@ -94,7 +94,7 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget, val flags:
@Deprecated("As of 3.17.1", ReplaceWith("[amount]% [stat] [in all cities] <while the empire is happy>"), DeprecationLevel.WARNING)
StatPercentBonusCitiesDeprecatedWhileEmpireHappy("[amount]% [stat] while the empire is happy", UniqueTarget.Global),
StatPercentFromReligionFollowers("[amount]% [stat] from every follower, up to [amount]%", UniqueTarget.FollowerBelief, UniqueTarget.Global),
StatPercentFromReligionFollowers("[amount]% [stat] from every follower, up to [amount]%", UniqueTarget.FollowerBelief),
//endregion Stat providing uniques
@ -227,7 +227,7 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget, val flags:
Movement("[amount] Movement", UniqueTarget.Unit, UniqueTarget.Global),
Sight("[amount] Sight", UniqueTarget.Unit, UniqueTarget.Global),
Sight("[amount] Sight", UniqueTarget.Unit, UniqueTarget.Global, UniqueTarget.Terrain),
SpreadReligionStrength("[amount]% Spread Religion Strength", UniqueTarget.Unit, UniqueTarget.Global),
MayFoundReligion("May found a religion", UniqueTarget.Unit),
MayEnhanceReligion("May enhance a religion", UniqueTarget.Unit),

View File

@ -173,7 +173,7 @@ class DiplomacyOverviewTable (
val statusLine = ImageGetter.getLine(civGroup.x + civGroup.width / 2, civGroup.y + civGroup.height / 2,
otherCivGroup.x + otherCivGroup.width / 2, otherCivGroup.y + otherCivGroup.height / 2, 2f)
statusLine.color = if (diplomacy.diplomaticStatus == DiplomaticStatus.Peace) Color.GREEN else Color.RED
statusLine.color = if (diplomacy.diplomaticStatus == DiplomaticStatus.War) Color.RED else Color.GREEN
civLines[civ.civName]!!.add(statusLine)