mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-04 15:27:50 +07:00
Fixed some bugs with spreading of religion (#4851)
* Fixed some bugs with spreading of religion * Implemented requested changes
This commit is contained in:
@ -263,7 +263,14 @@ class CivilizationInfo {
|
|||||||
} +
|
} +
|
||||||
policies.policyUniques.getUniques(uniqueTemplate) +
|
policies.policyUniques.getUniques(uniqueTemplate) +
|
||||||
tech.techUniques.getUniques(uniqueTemplate) +
|
tech.techUniques.getUniques(uniqueTemplate) +
|
||||||
temporaryUniques.filter { it.first.placeholderText == uniqueTemplate }.map { it.first }
|
temporaryUniques
|
||||||
|
.asSequence()
|
||||||
|
.filter { it.first.placeholderText == uniqueTemplate }.map { it.first } +
|
||||||
|
if (religionManager.religion != null)
|
||||||
|
religionManager.religion!!.getFounderUniques()
|
||||||
|
.asSequence()
|
||||||
|
.filter { it.placeholderText == uniqueTemplate }
|
||||||
|
else sequenceOf()
|
||||||
}
|
}
|
||||||
|
|
||||||
//region Units
|
//region Units
|
||||||
@ -778,6 +785,15 @@ class CivilizationInfo {
|
|||||||
if (unit.isGreatPerson()) {
|
if (unit.isGreatPerson()) {
|
||||||
addNotification("A [${unit.name}] has been born in [${cityToAddTo.name}]!", placedUnit.getTile().position, unit.name)
|
addNotification("A [${unit.name}] has been born in [${cityToAddTo.name}]!", placedUnit.getTile().position, unit.name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (placedUnit.hasUnique("Religious Unit")) {
|
||||||
|
placedUnit.religion =
|
||||||
|
if (city != null) city.cityConstructions.cityInfo.religion.getMajorityReligion()
|
||||||
|
else religionManager.religion?.name
|
||||||
|
if (placedUnit.hasUnique("Can spread religion [] times"))
|
||||||
|
placedUnit.abilityUsedCount["Religion Spread"] = 0
|
||||||
|
}
|
||||||
|
|
||||||
return placedUnit
|
return placedUnit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,7 +117,6 @@ class ReligionManager {
|
|||||||
else civInfo.cities.firstOrNull { it.religion.religionThisIsTheHolyCityOf == religion!!.name }
|
else civInfo.cities.firstOrNull { it.religion.religionThisIsTheHolyCityOf == religion!!.name }
|
||||||
val prophet = civInfo.addUnit("Great Prophet", birthCity) ?: return
|
val prophet = civInfo.addUnit("Great Prophet", birthCity) ?: return
|
||||||
prophet.religion = religion!!.name
|
prophet.religion = religion!!.name
|
||||||
prophet.abilityUsedCount["Religion Spread"] = 0
|
|
||||||
storedFaith -= faithForNextGreatProphet()
|
storedFaith -= faithForNextGreatProphet()
|
||||||
greatProphetsEarned += 1
|
greatProphetsEarned += 1
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user