mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-19 20:28:56 +07:00
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:
@ -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
|
||||
},
|
||||
|
@ -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()
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user