Added before/after Pantheon conditionals - see #3242

This commit is contained in:
Yair Morgenstern
2022-11-07 22:39:55 +02:00
parent 6d831be942
commit 3e05b875bd
6 changed files with 24 additions and 9 deletions

View File

@ -58,13 +58,14 @@
{
"name": "discover holy symbols",
"notification": "We have found holy symbols in the ruins, giving us a deeper understanding of religion! (+[faithAmount] Faith)",
"uniques": ["Hidden when religion is disabled", "Gain enough Faith for a Pantheon", "Hidden after founding a Pantheon", "Only available after [20] turns"],
"uniques": ["Hidden when religion is disabled", "Gain enough Faith for a Pantheon", "Only available <before founding a Pantheon>", "Only available after [20] turns"],
"color": "#CDDDF4"
},
{
"name": "an ancient prophecy",
"notification": "We have found an ancient prophecy in the ruins, greatly increasing our spiritual connection! (+[faithAmount] Faith)",
"uniques": ["Hidden when religion is disabled", "Gain enough Faith for [33]% of a Great Prophet", "Hidden after generating a Great Prophet", "Hidden before founding a Pantheon", "Only available after [20] turns"],
"uniques": ["Hidden when religion is disabled", "Gain enough Faith for [33]% of a Great Prophet", "Hidden after generating a Great Prophet",
"Only available <after founding a Pantheon>", "Only available after [20] turns"],
"color": "#CDDDF4"
}
]

View File

@ -49,6 +49,7 @@ class RuinsManager : IsPartOfGameInfoSerialization {
if (possibleReward.hasUnique(UniqueType.HiddenAfterGreatProphet)
&& (civInfo.civConstructions.boughtItemsWithIncreasingPrice[civInfo.religionManager.getGreatProphetEquivalent()] ?: 0) > 0
) continue
if (possibleReward.hasUnique(UniqueType.HiddenAfterPantheon) && civInfo.religionManager.religionState >= ReligionState.Pantheon)
continue
if (possibleReward.hasUnique(UniqueType.HiddenBeforePantheon) && civInfo.religionManager.religionState == ReligionState.None)

View File

@ -6,6 +6,7 @@ import com.unciv.logic.battle.CombatAction
import com.unciv.logic.battle.MapUnitCombatant
import com.unciv.logic.city.CityInfo
import com.unciv.logic.civilization.CivilizationInfo
import com.unciv.logic.civilization.ReligionState
import com.unciv.models.ruleset.Ruleset
import com.unciv.models.stats.Stats
import com.unciv.models.translations.getConditionals
@ -173,6 +174,10 @@ class Unique(val text: String, val sourceObjectType: UniqueTarget? = null, val s
state.civInfo != null && state.civInfo.policies.isAdopted(condition.params[0])
UniqueType.ConditionalNoPolicy ->
state.civInfo != null && !state.civInfo.policies.isAdopted(condition.params[0])
UniqueType.ConditionalBeforePantheon ->
state.civInfo != null && state.civInfo.religionManager.religionState == ReligionState.None
UniqueType.ConditionalAfterPantheon ->
state.civInfo != null && state.civInfo.religionManager.religionState != ReligionState.None
UniqueType.ConditionalBuildingBuilt ->
state.civInfo != null && state.civInfo.cities.any { it.cityConstructions.containsBuildingOrEquivalent(condition.params[0]) }

View File

@ -607,6 +607,9 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
ConditionalPolicy("after adopting [policy]", UniqueTarget.Conditional),
ConditionalNoPolicy("before adopting [policy]", UniqueTarget.Conditional),
ConditionalBeforePantheon("before founding a Pantheon", UniqueTarget.Conditional),
ConditionalAfterPantheon("after founding a Pantheon", UniqueTarget.Conditional),
ConditionalBuildingBuilt("if [buildingName] is constructed", UniqueTarget.Conditional),
ConditionalWithResource("with [resource]", UniqueTarget.Conditional),
ConditionalWithoutResource("without [resource]", UniqueTarget.Conditional),
@ -694,7 +697,10 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
AvailableAfterCertainTurns("Only available after [amount] turns", UniqueTarget.Ruins),
HiddenWithoutReligion("Hidden when religion is disabled", UniqueTarget.Unit, UniqueTarget.Building, UniqueTarget.Ruins, flags = UniqueFlag.setOfHiddenToUsers),
@Deprecated("as of 4.2.18", ReplaceWith("Only available <before founding a Pantheon>"))
HiddenBeforePantheon("Hidden before founding a Pantheon", UniqueTarget.Ruins),
@Deprecated("as of 4.2.18", ReplaceWith("Only available <before founding a Pantheon>"))
HiddenAfterPantheon("Hidden after founding a Pantheon", UniqueTarget.Ruins),
HiddenAfterGreatProphet("Hidden after generating a Great Prophet", UniqueTarget.Ruins),
HiddenWithoutVictoryType("Hidden when [victoryType] Victory is disabled", UniqueTarget.Building, UniqueTarget.Unit, flags = UniqueFlag.setOfHiddenToUsers),

View File

@ -170,6 +170,7 @@ class ModCheckTab(
mod.unitPromotions,
mod.unitTypes,
mod.units,
mod.ruinRewards
)
val allDeprecatedUniques = HashSet<String>()
val deprecatedUniquesToReplacementText = HashMap<String, String>()
@ -238,6 +239,7 @@ class ModCheckTab(
"UnitPromotions.json",
"UnitTypes.json",
"Units.json",
"Ruins.json"
)
val jsonFolder = mod.folderLocation!!.child("jsons")

View File

@ -815,7 +815,7 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: Tech
??? example "Only available"
Applicable to: Tech, Policy, Building, Unit, Promotion, Improvement
Applicable to: Tech, Policy, Building, Unit, Promotion, Improvement, Ruins
??? example "Cannot be hurried"
Applicable to: Tech, Building
@ -1624,12 +1624,6 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: Ruins
??? example "Hidden before founding a Pantheon"
Applicable to: Ruins
??? example "Hidden after founding a Pantheon"
Applicable to: Ruins
??? example "Hidden after generating a Great Prophet"
Applicable to: Ruins
@ -1739,6 +1733,12 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: Conditional
??? example "&lt;before founding a Pantheon&gt;"
Applicable to: Conditional
??? example "&lt;after founding a Pantheon&gt;"
Applicable to: Conditional
??? example "&lt;if [buildingName] is constructed&gt;"
Example: "&lt;if [Library] is constructed&gt;"