mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-24 21:51:14 +07:00
When spreading a religion with a great prophet, other religions are now removed (#5055)
This commit is contained in:
parent
b347366d50
commit
186d06faf0
@ -1516,9 +1516,9 @@
|
||||
"name": "Great Prophet",
|
||||
"unitType": "Civilian",
|
||||
"uniques": ["Can construct [Holy site] if it hasn't used other actions yet", "Can [Spread Religion] [4] times",
|
||||
"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"],
|
||||
"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"],
|
||||
"movement": 2,
|
||||
"religiousStrength": 1000
|
||||
},
|
||||
|
@ -59,8 +59,7 @@ class CityInfoReligionManager {
|
||||
}
|
||||
|
||||
fun getUniques(): Sequence<Unique> {
|
||||
val majorityReligion = getMajorityReligion()
|
||||
if (majorityReligion == null) return sequenceOf()
|
||||
val majorityReligion = getMajorityReligion() ?: return sequenceOf()
|
||||
return majorityReligion.getFollowerUniques()
|
||||
}
|
||||
|
||||
@ -72,7 +71,7 @@ class CityInfoReligionManager {
|
||||
return pressures.clone()
|
||||
}
|
||||
|
||||
fun clearAllPressures() {
|
||||
private fun clearAllPressures() {
|
||||
pressures.clear()
|
||||
// We add pressure for following no religion
|
||||
// Basically used as a failsafe so that there is always some religion,
|
||||
@ -92,8 +91,11 @@ class CityInfoReligionManager {
|
||||
|
||||
fun removeAllPressuresExceptFor(religion: String) {
|
||||
val pressureFromThisReligion = pressures[religion]!!
|
||||
// Atheism is never removed
|
||||
val pressureFromAtheism = pressures[Constants.noReligionName]
|
||||
clearAllPressures()
|
||||
pressures.add(religion, pressureFromThisReligion)
|
||||
if (pressureFromAtheism != null) pressures[Constants.noReligionName] = pressureFromAtheism
|
||||
updateNumberOfFollowers()
|
||||
}
|
||||
|
||||
|
@ -557,6 +557,8 @@ object UnitActions {
|
||||
unit.civInfo.addStat(Stat.valueOf(unique.params[1]), followersOfOtherReligions * unique.params[0].toInt())
|
||||
}
|
||||
city.religion.addPressure(unit.religion!!, unit.getPressureAddedFromSpread())
|
||||
if (unit.hasUnique("Removes other religions when spreading religion"))
|
||||
city.religion.removeAllPressuresExceptFor(unit.religion!!)
|
||||
unit.currentMovement = 0f
|
||||
useActionWithLimitedUses(unit, Constants.spreadReligionAbilityCount)
|
||||
}.takeIf { unit.currentMovement > 0 && !blockedByInquisitor }
|
||||
|
Loading…
Reference in New Issue
Block a user