Added notification when enemy religion spread converts a city

This commit is contained in:
yairm210
2025-01-11 19:48:54 +02:00
parent 39ebaad85a
commit a3b48ab532
2 changed files with 7 additions and 0 deletions

View File

@ -1469,6 +1469,7 @@ Hurry Construction =
Hurry Construction (+[productionAmount]⚙) =
Spread Religion =
Spread [religionName] =
[civName]'s [unitName] has converted [cityName] to [religionName] =
Remove Heresy =
Found a Religion =
Enhance a Religion =

View File

@ -97,10 +97,16 @@ object UnitActionsReligion {
for (unique in unit.getMatchingUniques(UniqueType.StatsWhenSpreading, checkCivInfoUniques = true)) {
unit.civ.addStat(Stat.valueOf(unique.params[1]), followersOfOtherReligions * unique.params[0].toInt())
}
val previousReligion = city.religion.getMajorityReligion()
city.religion.addPressure(unit.religion!!, getPressureAddedFromSpread(unit))
if (unit.hasUnique(UniqueType.RemoveOtherReligions))
city.religion.removeAllPressuresExceptFor(unit.religion!!)
val newReligion = city.religion.getMajorityReligion()
if (previousReligion != newReligion && newReligion != null && city.civ != unit.civ) {
city.civ.addNotification("[${unit.civ.civName}]'s [${unit.name}] has converted [${city.name}] to [${newReligion.name}]!", NotificationCategory.Religion)
}
UnitActionModifiers.activateSideEffects(unit, newStyleUnique)
if (city.civ != unit.civ) city.civ.getDiplomacyManager(unit.civ)!!