mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-24 05:31:22 +07:00
Move trigger on founding/enhancing religion to after belief pick (#10877)
This commit is contained in:
parent
be13394b44
commit
26fb286252
@ -284,9 +284,6 @@ class ReligionManager : IsPartOfGameInfoSerialization {
|
||||
if (religionState == ReligionState.None) shouldChoosePantheonBelief = true
|
||||
religionState = ReligionState.FoundingReligion
|
||||
civInfo.religionManager.foundingCityId = prophet.getTile().getCity()!!.id
|
||||
|
||||
for (unique in civInfo.getTriggeredUniques(UniqueType.TriggerUponFoundingReligion))
|
||||
UniqueTriggerActivation.triggerCivwideUnique(unique, civInfo)
|
||||
}
|
||||
|
||||
fun mayEnhanceReligionAtAll(): Boolean {
|
||||
@ -313,9 +310,6 @@ class ReligionManager : IsPartOfGameInfoSerialization {
|
||||
fun useProphetForEnhancingReligion(prophet: MapUnit) {
|
||||
if (!mayEnhanceReligionHere(prophet.getTile())) return // How did you do this?
|
||||
religionState = ReligionState.EnhancingReligion
|
||||
|
||||
for (unique in civInfo.getTriggeredUniques(UniqueType.TriggerUponEnhancingReligion))
|
||||
UniqueTriggerActivation.triggerCivwideUnique(unique, civInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
@ -381,15 +375,6 @@ class ReligionManager : IsPartOfGameInfoSerialization {
|
||||
// Must be done first in case when gain more later
|
||||
freeBeliefs.clear()
|
||||
|
||||
when (religionState) {
|
||||
ReligionState.EnhancingReligion -> {
|
||||
religionState = ReligionState.EnhancedReligion
|
||||
}
|
||||
ReligionState.None -> {
|
||||
foundPantheon(beliefs[0].name, useFreeBeliefs)
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
// add beliefs (religion exists at this point)
|
||||
religion!!.followerBeliefs.addAll(
|
||||
beliefs
|
||||
@ -402,6 +387,24 @@ class ReligionManager : IsPartOfGameInfoSerialization {
|
||||
.map { it.name }
|
||||
)
|
||||
|
||||
when (religionState) {
|
||||
ReligionState.None -> {
|
||||
foundPantheon(beliefs[0].name, useFreeBeliefs)
|
||||
}
|
||||
ReligionState.FoundingReligion -> {
|
||||
religionState = ReligionState.Religion
|
||||
for (unique in civInfo.getTriggeredUniques(UniqueType.TriggerUponFoundingReligion))
|
||||
UniqueTriggerActivation.triggerCivwideUnique(unique, civInfo)
|
||||
}
|
||||
ReligionState.EnhancingReligion -> {
|
||||
religionState = ReligionState.EnhancedReligion
|
||||
for (unique in civInfo.getTriggeredUniques(UniqueType.TriggerUponEnhancingReligion))
|
||||
UniqueTriggerActivation.triggerCivwideUnique(unique, civInfo)
|
||||
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
|
||||
for (unique in civInfo.getTriggeredUniques(UniqueType.TriggerUponAdoptingPolicyOrBelief))
|
||||
for (belief in beliefs)
|
||||
if (unique.conditionals.any {it.type == UniqueType.TriggerUponAdoptingPolicyOrBelief && it.params[0] == belief.name})
|
||||
@ -427,8 +430,6 @@ class ReligionManager : IsPartOfGameInfoSerialization {
|
||||
religion = newReligion
|
||||
civInfo.gameInfo.religions[name] = newReligion
|
||||
|
||||
religionState = ReligionState.Religion
|
||||
|
||||
val holyCity = civInfo.cities.first { it.id == foundingCityId }
|
||||
holyCity.religion.religionThisIsTheHolyCityOf = newReligion.name
|
||||
holyCity.religion.addPressure(name, holyCity.population.population * 500)
|
||||
|
Loading…
Reference in New Issue
Block a user