Great Prophets now always have your religion as their religion (#5052)

* Great Prophets now always have your religion as their religion

* Reworded unique for clarity
This commit is contained in:
Xander Lenstra
2021-09-02 19:52:24 +02:00
committed by GitHub
parent 34eb4758ff
commit df853504ae
4 changed files with 19 additions and 6 deletions

View File

@ -1518,7 +1518,8 @@
"uniques": ["Can construct [Holy site] if it hasn't used other actions yet", "Can [Spread Religion] [4] times",
"Removes other religions when spreading religion", "May found a religion", "May enhance a religion",
"May enter foreign tiles without open borders", "[-1] Visibility Range", "Great Person - [Faith]",
"Unbuildable", "Religious Unit", "Hidden when religion is disabled"],
"Unbuildable", "Religious Unit", "Hidden when religion is disabled",
"Takes your religion over the one in their birth city"],
"movement": 2,
"religiousStrength": 1000
},

View File

@ -820,8 +820,12 @@ class CivilizationInfo {
if (placedUnit.hasUnique("Religious Unit")) {
placedUnit.religion =
if (city != null) city.cityConstructions.cityInfo.religion.getMajorityReligionName()
else religionManager.religion?.name
when {
placedUnit.hasUnique("Takes your religion over the one in their birth city") ->
religionManager.religion?.name
city != null -> city.cityConstructions.cityInfo.religion.getMajorityReligionName()
else -> religionManager.religion?.name
}
placedUnit.setupAbilityUses()
}

View File

@ -230,6 +230,10 @@ class ReligionManager {
foundingCityId = null
shouldChoosePantheonBelief = false
for (unit in civInfo.getCivUnits())
if (unit.hasUnique("Religious Unit") && unit.hasUnique("Takes your religion over the one in their birth city"))
unit.religion = newReligion.name
}
fun mayEnhanceReligionAtAll(prophet: MapUnit): Boolean {

View File

@ -388,17 +388,21 @@ class BaseUnit : INamed, INonPerpetualConstruction, ICivilopediaText {
// If this unit has special abilities that need to be kept track of, start doing so here
if (unit.hasUnique("Religious Unit")) {
unit.religion = cityConstructions.cityInfo.religion.getMajorityReligionName()
unit.religion =
if (unit.hasUnique("Takes your religion over the one in their birth city"))
civInfo.religionManager.religion?.name
else cityConstructions.cityInfo.religion.getMajorityReligionName()
unit.setupAbilityUses(cityConstructions.cityInfo)
}
if (boughtWith != null && cityConstructions.cityInfo.civInfo.getMatchingUniques("May buy [] units for [] [] [] starting from the [] at an increasing price ([])")
.filter {
.any {
matchesFilter(it.params[0])
&& cityConstructions.cityInfo.matchesFilter(it.params[3])
&& cityConstructions.cityInfo.civInfo.getEraNumber() >= ruleset.getEraNumber(it.params[4])
&& it.params[2] == boughtWith.name
}.any()
}
) {
cityConstructions.cityInfo.civInfo.boughtConstructionsWithGloballyIncreasingPrice[name] =
(cityConstructions.cityInfo.civInfo.boughtConstructionsWithGloballyIncreasingPrice[name] ?: 0) + 1