diff --git a/core/src/com/unciv/logic/battle/BattleDamage.kt b/core/src/com/unciv/logic/battle/BattleDamage.kt index 9da043f17b..1277a00c90 100644 --- a/core/src/com/unciv/logic/battle/BattleDamage.kt +++ b/core/src/com/unciv/logic/battle/BattleDamage.kt @@ -88,7 +88,7 @@ object BattleDamage { .flatMap { it.getUnits() }.filter { it.civInfo == combatant.unit.civInfo } if (nearbyCivUnits.any { it.hasUnique("Bonus for units in 2 tile radius 15%") }) { val greatGeneralModifier = - if (combatant.unit.civInfo.hasUnique("Great General provides double combat bonus")) 30 else 15 + if (combatant.unit.civInfo.hasUnique(UniqueType.GreatGeneralProvidesDoubleCombatBonus)) 30 else 15 modifiers["Great General"] = greatGeneralModifier } @@ -253,7 +253,7 @@ object BattleDamage { private fun getHealthDependantDamageRatio(combatant: ICombatant): Float { return if (combatant !is MapUnitCombatant // is city - || (combatant.getCivInfo().hasUnique("Units fight as though they were at full strength even when damaged") + || (combatant.getCivInfo().hasUnique(UniqueType.UnitsFightFullStrengthWhenDamaged) && !combatant.unit.baseUnit.movesLikeAirUnits() ) ) { diff --git a/core/src/com/unciv/logic/city/CityInfo.kt b/core/src/com/unciv/logic/city/CityInfo.kt index 424630a399..3bd54cb8ce 100644 --- a/core/src/com/unciv/logic/city/CityInfo.kt +++ b/core/src/com/unciv/logic/city/CityInfo.kt @@ -181,7 +181,7 @@ class CityInfo { val cityName = nationCities[cityNameIndex] val cityNameRounds = civInfo.citiesCreated / nationCities.size - if (cityNameRounds > 0 && civInfo.hasUnique("\"Borrows\" city names from other civilizations in the game")) { + if (cityNameRounds > 0 && civInfo.hasUnique(UniqueType.BorrowsCityNames)) { name = borrowCityName() return } diff --git a/core/src/com/unciv/logic/city/CityStats.kt b/core/src/com/unciv/logic/city/CityStats.kt index dca7d63693..24d78e585b 100644 --- a/core/src/com/unciv/logic/city/CityStats.kt +++ b/core/src/com/unciv/logic/city/CityStats.kt @@ -399,7 +399,7 @@ class CityStats(val cityInfo: CityInfo) { unhappinessModifier *= civInfo.gameInfo.getDifficulty().aiUnhappinessModifier var unhappinessFromCity = -3f // -3 happiness per city - if (civInfo.hasUnique("Unhappiness from number of Cities doubled")) + if (civInfo.hasUnique(UniqueType.UnhappinessFromCitiesDoubled)) unhappinessFromCity *= 2f //doubled for the Indian newHappinessList["Cities"] = unhappinessFromCity * unhappinessModifier diff --git a/core/src/com/unciv/logic/civilization/CivInfoTransientUpdater.kt b/core/src/com/unciv/logic/civilization/CivInfoTransientUpdater.kt index 1e2b4759e1..1f77e8d03d 100644 --- a/core/src/com/unciv/logic/civilization/CivInfoTransientUpdater.kt +++ b/core/src/com/unciv/logic/civilization/CivInfoTransientUpdater.kt @@ -127,7 +127,7 @@ class CivInfoTransientUpdater(val civInfo: CivilizationInfo) { goldGained += 500 } - if (civInfo.hasUnique("100 Gold for discovering a Natural Wonder (bonus enhanced to 500 Gold if first to discover it)")) { + if (civInfo.hasUnique(UniqueType.GoldWhenDiscoveringNaturalWonder)) { goldGained += if (discoveredNaturalWonders.contains(tile.naturalWonder!!)) 100 else 500 } diff --git a/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt b/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt index 649de20327..0879307a95 100644 --- a/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt +++ b/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt @@ -289,7 +289,7 @@ class DiplomacyManager() { var modifierPercent = 0f - if (otherCiv().hasUnique("City-State Influence recovers at twice the normal rate")) + if (otherCiv().hasUnique(UniqueType.CityStateInfluenceRecoversTwiceNormalRate)) modifierPercent += 100f val religion = if (civInfo.cities.isEmpty()) null @@ -355,7 +355,7 @@ class DiplomacyManager() { */ fun isConsideredFriendlyTerritory(): Boolean { if (civInfo.isCityState() && - (relationshipLevel() >= RelationshipLevel.Friend || otherCiv().hasUnique("City-State territory always counts as friendly territory"))) + (relationshipLevel() >= RelationshipLevel.Friend || otherCiv().hasUnique(UniqueType.CityStateTerritoryAlwaysFriendly))) return true return hasOpenBorders } diff --git a/core/src/com/unciv/models/ruleset/Building.kt b/core/src/com/unciv/models/ruleset/Building.kt index a57c5e489f..54ba568c03 100644 --- a/core/src/com/unciv/models/ruleset/Building.kt +++ b/core/src/com/unciv/models/ruleset/Building.kt @@ -735,7 +735,7 @@ class Building : RulesetStatsObject(), INonPerpetualConstruction { civInfo.updateHasActiveGreatWall() // Korean unique - apparently gives the same as the research agreement - if (science > 0 && civInfo.hasUnique("Receive a tech boost when scientific buildings/wonders are built in capital")) + if (science > 0 && civInfo.hasUnique(UniqueType.TechBoostWhenScientificBuildingsBuiltInCapital)) civInfo.tech.addScience(civInfo.tech.scienceOfLast8Turns.sum() / 8) cityConstructions.cityInfo.cityStats.update() // new building, new stats diff --git a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt index 2f7e879705..b421a8e915 100644 --- a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt +++ b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt @@ -144,7 +144,7 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags: CityStateLuxuryHappiness("[amount]% Happiness from luxury resources gifted by City-States", UniqueTarget.Global), @Deprecated("as of 3.18.17", ReplaceWith("[+amount]% Happiness from luxury resources gifted by City-States")) CityStateLuxuryHappinessDeprecated("Happiness from Luxury Resources gifted by City-States increased by [amount]%", UniqueTarget.Global), - + CityStateInfluenceRecoversTwiceNormalRate("City-State Influence recovers at twice the normal rate", UniqueTarget.Global), // endregion /////// region Other global uniques @@ -241,7 +241,14 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags: EnablesConstructionOfSpaceshipParts("Enables construction of Spaceship parts", UniqueTarget.Global), + // Misc national uniques NotifiedOfBarbarianEncampments("Notified of new Barbarian encampments", UniqueTarget.Global), + BorrowsCityNames("\"Borrows\" city names from other civilizations in the game", UniqueTarget.Global), + UnitsFightFullStrengthWhenDamaged("Units fight as though they were at full strength even when damaged", UniqueTarget.Global), + GoldWhenDiscoveringNaturalWonder("100 Gold for discovering a Natural Wonder (bonus enhanced to 500 Gold if first to discover it)", UniqueTarget.Global), + UnhappinessFromCitiesDoubled("Unhappiness from number of Cities doubled", UniqueTarget.Global), + GreatGeneralProvidesDoubleCombatBonus("Great General provides double combat bonus", UniqueTarget.Global), + TechBoostWhenScientificBuildingsBuiltInCapital("Receive a tech boost when scientific buildings/wonders are built in capital", UniqueTarget.Global), EnablesOpenBorders("Enables Open Borders agreements", UniqueTarget.Global), // Should the 'R' in 'Research agreements' be capitalized? diff --git a/docs/uniques.md b/docs/uniques.md index b5af7fe347..0e197e7cb0 100644 --- a/docs/uniques.md +++ b/docs/uniques.md @@ -185,6 +185,9 @@ Example: "[20]% Happiness from luxury resources gifted by City-States" Applicable to: Global +#### City-State Influence recovers at twice the normal rate +Applicable to: Global + #### [amount] units cost no maintenance Example: "[20] units cost no maintenance" @@ -384,6 +387,24 @@ Applicable to: Global #### Notified of new Barbarian encampments Applicable to: Global +#### "Borrows" city names from other civilizations in the game +Applicable to: Global + +#### Units fight as though they were at full strength even when damaged +Applicable to: Global + +#### 100 Gold for discovering a Natural Wonder (bonus enhanced to 500 Gold if first to discover it) +Applicable to: Global + +#### Unhappiness from number of Cities doubled +Applicable to: Global + +#### Great General provides double combat bonus +Applicable to: Global + +#### Receive a tech boost when scientific buildings/wonders are built in capital +Applicable to: Global + #### Enables Open Borders agreements Applicable to: Global