mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-07 05:51:12 +07:00
Added "Can only start games from the starting era" conditional, "if [buildingFilter] is not constructed" unique
This commit is contained in:
parent
2b752866bf
commit
b58b73a790
@ -26,7 +26,6 @@ object DeclareWar {
|
||||
internal fun declareWar(diplomacyManager: DiplomacyManager, declareWarReason: DeclareWarReason) {
|
||||
val civInfo = diplomacyManager.civInfo
|
||||
val otherCiv = diplomacyManager.otherCiv()
|
||||
if (otherCiv.isDefeated()) throw Exception("Tried to declare war on a defeated civ!")
|
||||
val otherCivDiplomacy = diplomacyManager.otherCivDiplomacy()
|
||||
|
||||
if (otherCiv.isCityState && declareWarReason.warType == WarType.DirectWar)
|
||||
|
@ -171,6 +171,8 @@ object Conditionals {
|
||||
|
||||
UniqueType.ConditionalBuildingBuilt ->
|
||||
checkOnCiv { cities.any { it.cityConstructions.containsBuildingOrEquivalent(conditional.params[0]) } }
|
||||
UniqueType.ConditionalBuildingNotBuilt ->
|
||||
checkOnCiv { cities.none { it.cityConstructions.containsBuildingOrEquivalent(conditional.params[0]) } }
|
||||
UniqueType.ConditionalBuildingBuiltAll ->
|
||||
checkOnCiv { cities.filter { it.matchesFilter(conditional.params[1]) }.all {
|
||||
it.cityConstructions.containsBuildingOrEquivalent(conditional.params[0]) } }
|
||||
|
@ -706,6 +706,7 @@ enum class UniqueType(
|
||||
ConditionalAfterGeneratingGreatProphet("after generating a Great Prophet", UniqueTarget.Conditional),
|
||||
|
||||
ConditionalBuildingBuilt("if [buildingFilter] is constructed", UniqueTarget.Conditional),
|
||||
ConditionalBuildingNotBuilt("if [buildingFilter] is not constructed", UniqueTarget.Conditional),
|
||||
ConditionalBuildingBuiltAll("if [buildingFilter] is constructed in all [cityFilter] cities", UniqueTarget.Conditional),
|
||||
ConditionalBuildingBuiltAmount("if [buildingFilter] is constructed in at least [positiveAmount] of [cityFilter] cities", UniqueTarget.Conditional),
|
||||
ConditionalBuildingBuiltByAnybody("if [buildingFilter] is constructed by anybody", UniqueTarget.Conditional),
|
||||
@ -911,6 +912,7 @@ enum class UniqueType(
|
||||
AllowCityStatesSpawnUnits("Allow City States to spawn with additional units", UniqueTarget.ModOptions, flags = UniqueFlag.setOfNoConditionals),
|
||||
TradeCivIntroductions("Can trade civilization introductions for [positiveAmount] Gold", UniqueTarget.ModOptions, flags = UniqueFlag.setOfNoConditionals),
|
||||
DisableReligion("Disable religion", UniqueTarget.ModOptions, flags = UniqueFlag.setOfNoConditionals),
|
||||
CanOnlyStartFromStartingEra("Can only start games from the starting era", UniqueTarget.ModOptions, flags = UniqueFlag.setOfNoConditionals),
|
||||
AllowRazeCapital("Allow raze capital", UniqueTarget.ModOptions, flags = UniqueFlag.setOfNoConditionals),
|
||||
AllowRazeHolyCity("Allow raze holy city", UniqueTarget.ModOptions, flags = UniqueFlag.setOfNoConditionals),
|
||||
|
||||
@ -1385,6 +1387,6 @@ enum class UniqueType(
|
||||
targetTypes.any { uniqueTarget.canAcceptUniqueTarget(it) }
|
||||
|
||||
companion object {
|
||||
val uniqueTypeMap: Map<String, UniqueType> = UniqueType.values().associateBy { it.placeholderText }
|
||||
val uniqueTypeMap: Map<String, UniqueType> = entries.associateBy { it.placeholderText }
|
||||
}
|
||||
}
|
||||
|
@ -408,6 +408,10 @@ class GameOptionsTable(
|
||||
|
||||
private fun Table.addEraSelectBox() {
|
||||
if (ruleset.eras.isEmpty()) return // mod with no techs
|
||||
if (ruleset.modOptions.hasUnique(UniqueType.CanOnlyStartFromStartingEra)){
|
||||
gameParameters.startingEra = ruleset.eras.keys.first()
|
||||
return
|
||||
}
|
||||
val eras = ruleset.eras.keys
|
||||
addSelectBox("{Starting Era}:", eras, gameParameters.startingEra)
|
||||
{ gameParameters.startingEra = it; null }
|
||||
|
@ -2622,6 +2622,9 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
|
||||
??? example "Disable religion"
|
||||
Applicable to: ModOptions
|
||||
|
||||
??? example "Can only start games from the default era"
|
||||
Applicable to: ModOptions
|
||||
|
||||
??? example "Allow raze capital"
|
||||
Applicable to: ModOptions
|
||||
|
||||
@ -2842,6 +2845,11 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
|
||||
|
||||
Applicable to: Conditional
|
||||
|
||||
??? example "<if [buildingFilter] is not constructed>"
|
||||
Example: "<if [Culture] is not constructed>"
|
||||
|
||||
Applicable to: Conditional
|
||||
|
||||
??? example "<if [buildingFilter] is constructed in all [cityFilter] cities>"
|
||||
Example: "<if [Culture] is constructed in all [in all cities] cities>"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user