mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-04 07:17:50 +07:00
Deprecated old uniques
This commit is contained in:
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 874 KiB After Width: | Height: | Size: 873 KiB |
@ -163,7 +163,7 @@
|
||||
"outerColor": [ 38, 98, 255],
|
||||
"innerColor": [239,236,148],
|
||||
"uniqueName": "Ancien Régime",
|
||||
"uniques": ["+2 Culture per turn from cities before discovering Steam Power"],
|
||||
"uniques": ["[+2 Culture] per turn from cities before [Steam Power]"],
|
||||
"cities": ["Paris","Orleans","Lyon","Troyes","Tours","Marseille","Chartres","Avignon","Rouen","Grenoble",
|
||||
"Dijon","Amiens","Cherbourg","Poitiers","Toulouse","Bayonne","Strasbourg","Brest","Bordeaux","Rennes",
|
||||
"Nice","Saint Etienne","Nantes","Reims","Le Mans","Montpellier","Limoges","Nancy","Lille","Caen","Toulon",
|
||||
|
@ -31,7 +31,7 @@
|
||||
},
|
||||
{
|
||||
"name": "Monarchy",
|
||||
"uniques": ["+1 gold and -1 unhappiness for every 2 citizens in capital"],
|
||||
"uniques": ["[+1 Gold, +1 Happiness] per [2] population [in capital]"],
|
||||
"requires": ["Legalism"],
|
||||
"row": 2,
|
||||
"column": 4
|
||||
|
@ -252,10 +252,20 @@ class CityStats {
|
||||
|| unique.placeholderText == "[] in all cities"
|
||||
|| unique.placeholderText == "[] in all cities with a garrison" && cityInfo.getCenterTile().militaryUnit != null)
|
||||
stats.add(unique.stats)
|
||||
|
||||
// "[stats] per [amount] population [cityfilter]"
|
||||
if (unique.placeholderText=="[] per [] population []" && cityInfo.matchesFilter(unique.params[2])) {
|
||||
val amountOfEffects = (cityInfo.population.population / unique.params[1].toInt()).toFloat()
|
||||
stats.add(unique.stats.times(amountOfEffects))
|
||||
}
|
||||
|
||||
// Deprecated by 3.12.13 - replaced by "[] per [] population [in all cities]"
|
||||
if (unique.placeholderText == "[] per [] population in all cities") {
|
||||
val amountOfEffects = (cityInfo.population.population / unique.params[1].toInt()).toFloat()
|
||||
stats.add(unique.stats.times(amountOfEffects))
|
||||
}
|
||||
|
||||
// Deprecated by 3.12.13 - replaced by "[+1 Gold, +1 Happiness] per [2] population [in capital]"
|
||||
if (unique.text == "+1 gold and -1 unhappiness for every 2 citizens in capital" && cityInfo.isCapital()) {
|
||||
stats.gold += (cityInfo.population.population / 2).toFloat()
|
||||
stats.happiness += (cityInfo.population.population / 2).toFloat()
|
||||
@ -275,18 +285,6 @@ class CityStats {
|
||||
return stats
|
||||
}
|
||||
|
||||
private fun getStatPercentBonusesFromBuildings(currentConstruction: IConstruction): Stats {
|
||||
val stats = cityInfo.cityConstructions.getStatPercentBonuses()
|
||||
|
||||
// Deprecated as of 3.12.11 - replaces with "+[amount]% Production when constructing [unitFilter] units [in this city]"
|
||||
for (unique in cityInfo.cityConstructions.builtBuildingUniqueMap.getUniques("+[]% production when building [] in this city")) {
|
||||
if (constructionMatchesFilter(currentConstruction, unique.params[1]))
|
||||
stats.production += unique.params[0].toInt()
|
||||
}
|
||||
|
||||
return stats
|
||||
}
|
||||
|
||||
private fun getStatPercentBonusesFromUniques(currentConstruction: IConstruction, uniqueSequence: Sequence<Unique>): Stats {
|
||||
val stats = Stats()
|
||||
val uniques = uniqueSequence.toList().asSequence()
|
||||
@ -361,14 +359,6 @@ class CityStats {
|
||||
|
||||
fun constructionMatchesFilter(construction: IConstruction, filter: String): Boolean {
|
||||
return construction.name == filter
|
||||
// All of these are deprecated as of 3.11.20 in favor of "+[]% Production when constructing [] units"
|
||||
|| filter == "land units" && construction is BaseUnit && construction.unitType.isLandUnit()
|
||||
|| filter == "naval units" && construction is BaseUnit && construction.unitType.isWaterUnit()
|
||||
|| filter == "ranged units" && construction is BaseUnit && construction.unitType == UnitType.Ranged
|
||||
|| filter == "mounted units" && construction is BaseUnit && construction.unitType == UnitType.Mounted
|
||||
|| filter == "military units" && construction is BaseUnit && !construction.unitType.isCivilian()
|
||||
|| filter == "melee units" && construction is BaseUnit && construction.unitType.isMelee()
|
||||
|
||||
|| filter == "Buildings" && construction is Building && !(construction.isWonder || construction.isNationalWonder)
|
||||
|| filter == "Wonders" && construction is Building && (construction.isWonder || construction.isNationalWonder)
|
||||
|| construction is Building && construction.uniques.contains(filter)
|
||||
@ -409,7 +399,7 @@ class CityStats {
|
||||
newStatPercentBonusList["Golden Age"] = getStatPercentBonusesFromGoldenAge(cityInfo.civInfo.goldenAges.isGoldenAge())
|
||||
newStatPercentBonusList["Policies"] = getStatPercentBonusesFromUniques(currentConstruction, cityInfo.civInfo.policies.policyUniques.getAllUniques())
|
||||
newStatPercentBonusList["Buildings"] = getStatPercentBonusesFromUniques(currentConstruction, citySpecificUniques)
|
||||
.plus(getStatPercentBonusesFromBuildings(currentConstruction)) // This function is to be deprecated but it'll take a while.
|
||||
.plus(cityInfo.cityConstructions.getStatPercentBonuses()) // This function is to be deprecated but it'll take a while.
|
||||
newStatPercentBonusList["Wonders"] = getStatPercentBonusesFromUniques(currentConstruction, cityInfo.civInfo.getCivWideBuildingUniques())
|
||||
newStatPercentBonusList["Railroad"] = getStatPercentBonusesFromRailroad()
|
||||
newStatPercentBonusList["Resources"] = getStatPercentBonusesFromResources(currentConstruction)
|
||||
|
@ -73,17 +73,6 @@ class CivInfoStats(val civInfo: CivilizationInfo) {
|
||||
transportationUpkeep += tileUpkeep
|
||||
}
|
||||
}
|
||||
// Inca unique according to https://civilization.fandom.com/wiki/Incan_%28Civ5%29
|
||||
// Deprecated as of 3.12. in favor of "Maintenance on roads & railroads reduced by [50]%"
|
||||
if (civInfo.hasUnique("50% Maintenance costs reduction"))
|
||||
transportationUpkeep /= 2
|
||||
|
||||
// Deprecated as of 3.12. in favor of "Maintenance on roads & railroads reduced by [33]%"
|
||||
if (civInfo.hasUnique("Maintenance on roads & railroads reduced by 33%")
|
||||
//presume we want to deprecate the old one at some point?
|
||||
|| civInfo.hasUnique("Maintenance on roads & railroads reduced by 33%, +2 gold from all trade routes"))
|
||||
transportationUpkeep = (transportationUpkeep * 2 / 3f).toInt()
|
||||
|
||||
for (unique in civInfo.getMatchingUniques("Maintenance on roads & railroads reduced by []%"))
|
||||
transportationUpkeep = (transportationUpkeep * (100f - unique.params[0].toInt()) / 100).toInt()
|
||||
|
||||
|
@ -74,13 +74,6 @@ class PolicyManager {
|
||||
var policyCultureCost = 25 + (numberOfAdoptedPolicies * 6).toDouble().pow(1.7)
|
||||
var cityModifier = 0.3f * (civInfo.cities.count { !it.isPuppet } - 1)
|
||||
|
||||
// As of 3.10.11 These are to be deprecated. Keeping it here so that mods with this can still work for now.
|
||||
// Use "Culture cost of adopting new Policies reduced by [10]%" and "Each city founded increases culture cost of policies [33]% less than normal" instead
|
||||
if (civInfo.hasUnique("Each city founded increases culture cost of policies 33% less than normal"))
|
||||
cityModifier *= (2 / 3f)
|
||||
for (unique in civInfo.getMatchingUniques("Culture cost of adopting new Policies reduced by 10%"))
|
||||
policyCultureCost *= 0.9
|
||||
|
||||
for (unique in civInfo.getMatchingUniques("Each city founded increases culture cost of policies []% less than normal"))
|
||||
cityModifier *= 1 - unique.params[0].toFloat() / 100
|
||||
for (unique in civInfo.getMatchingUniques("Culture cost of adopting new Policies reduced by []%"))
|
||||
|
@ -104,10 +104,6 @@ class MapUnit {
|
||||
&& civInfo.hasUnique("All military naval units receive +1 movement and +1 sight"))
|
||||
movement += 1
|
||||
|
||||
// Deprecated as of 3.11.18
|
||||
if (type.isWaterUnit() && civInfo.hasUnique("+2 movement for all naval units"))
|
||||
movement += 2
|
||||
|
||||
for (unique in civInfo.getMatchingUniques("+[] Movement for all [] units"))
|
||||
if (matchesFilter(unique.params[1]))
|
||||
movement += unique.params[0].toInt()
|
||||
|
@ -280,17 +280,6 @@ class Building : NamedStats(), IConstruction {
|
||||
"Can only be built in annexed cities" -> if (construction.cityInfo.isPuppet || construction.cityInfo.foundingCiv == ""
|
||||
|| construction.cityInfo.civInfo.civName == construction.cityInfo.foundingCiv) return unique.text
|
||||
"Obsolete with []" -> if (civInfo.tech.isResearched(unique.params[0])) return unique.text
|
||||
|
||||
"Must have an owned mountain within 2 tiles" -> // Deprecated as of 3.10.8 . Use "Must have an owned [Mountain] within [2] tiles" instead
|
||||
if (cityCenter.getTilesInDistance(2)
|
||||
.none { it.baseTerrain == Constants.mountain && it.getOwner() == construction.cityInfo.civInfo })
|
||||
return unique.text
|
||||
"Must be next to river" -> // Deprecated as of 3.10.8 . Use "Must be on [River]" instead
|
||||
if (!cityCenter.isAdjacentToRiver()) return unique.text
|
||||
"Can only be built in coastal cities" -> // Deprecated as of 3.10.8 . Use "Must be next to [Coast]" instead
|
||||
if (!cityCenter.isCoastalTile()) return unique.text
|
||||
"Must border a source of fresh water" -> // Deprecated as of 3.10.8 . Use "Must be next to [Fresh water]" instead
|
||||
if (!cityCenter.isAdjacentToFreshwater) return unique.text
|
||||
}
|
||||
|
||||
if (uniqueTo != null && uniqueTo != civInfo.civName) return "Unique to $uniqueTo"
|
||||
|
Reference in New Issue
Block a user