diff --git a/core/src/com/unciv/logic/GameInfo.kt b/core/src/com/unciv/logic/GameInfo.kt index 212049207e..4058a3d15a 100644 --- a/core/src/com/unciv/logic/GameInfo.kt +++ b/core/src/com/unciv/logic/GameInfo.kt @@ -342,13 +342,6 @@ class GameInfo { cityInfo.cityStats.update() } - if(!civInfo.greatPeople.greatPersonPoints.isEmpty()) { - civInfo.greatPeople.greatPersonPointsCounter.add( - GreatPersonManager.statsToGreatPersonCounter(civInfo.greatPeople.greatPersonPoints) - ) - civInfo.greatPeople.greatPersonPoints.clear() - } - if (civInfo.hasEverOwnedOriginalCapital == null) { civInfo.hasEverOwnedOriginalCapital = civInfo.cities.any { it.isOriginalCapital } } diff --git a/core/src/com/unciv/logic/city/CityInfo.kt b/core/src/com/unciv/logic/city/CityInfo.kt index af9cb66d48..ee5140787f 100644 --- a/core/src/com/unciv/logic/city/CityInfo.kt +++ b/core/src/com/unciv/logic/city/CityInfo.kt @@ -385,20 +385,6 @@ class CityInfo { gppCounter.add(unitName, gppCounter[unitName]!! * allGppPercentageBonus / 100) } - // Since existing buildings and specialists have *stat names* rather than Great Person names - // as the keys, convert every stat name to the appropriate Great Person name instead - - for (counter in sourceToGPP.values) - for ((key, gppAmount) in counter.toMap()) { // since we're removing, copy to avoid concurrency problems - val relevantStatEntry = GreatPersonManager.statToGreatPersonMapping - .entries.firstOrNull { it.key.name.equals(key, true) } - if (relevantStatEntry == null) continue - - counter.add(relevantStatEntry.value, gppAmount) - counter.remove(key) - } - - return sourceToGPP } diff --git a/core/src/com/unciv/logic/civilization/GreatPersonManager.kt b/core/src/com/unciv/logic/civilization/GreatPersonManager.kt index 0d93c68321..b7804feda7 100644 --- a/core/src/com/unciv/logic/civilization/GreatPersonManager.kt +++ b/core/src/com/unciv/logic/civilization/GreatPersonManager.kt @@ -8,37 +8,10 @@ class GreatPersonManager { var pointsForNextGreatPerson = 100 var pointsForNextGreatGeneral = 30 - @Deprecated("As of 3.15.15 - Should be converted to greatPersonPointsCounter") - var greatPersonPoints = Stats() var greatPersonPointsCounter = Counter() var greatGeneralPoints = 0 var freeGreatPeople = 0 - companion object { - val statToGreatPersonMapping = hashMapOf( - Stat.Science to "Great Scientist", - Stat.Production to "Great Engineer", - Stat.Gold to "Great Merchant", - Stat.Culture to "Great Artist", - ) - - fun statsToGreatPersonCounter(stats: Stats): Counter { - val counter = Counter() - for ((key, value) in stats) - if (statToGreatPersonMapping.containsKey(key)) - counter.add(statToGreatPersonMapping[key]!!, value.toInt()) - return counter - } - - fun greatPersonCounterToStats(counter: Counter): Stats { - val stats = Stats() - for ((key, value) in counter) { - val stat = statToGreatPersonMapping.entries.firstOrNull { it.value == key }?.key - if (stat != null) stats.add(stat, value.toFloat()) - } - return stats - } - } fun clone(): GreatPersonManager { val toReturn = GreatPersonManager() diff --git a/core/src/com/unciv/models/ruleset/Difficulty.kt b/core/src/com/unciv/models/ruleset/Difficulty.kt index 2df8b54587..4028663e8c 100644 --- a/core/src/com/unciv/models/ruleset/Difficulty.kt +++ b/core/src/com/unciv/models/ruleset/Difficulty.kt @@ -16,7 +16,7 @@ class Difficulty: INamed, ICivilopediaText { var policyCostModifier:Float = 1f var unhappinessModifier:Float = 1f var barbarianBonus:Float = 0f - var startingUnits = ArrayList() // Deprecated since 3.15.8 + var startingUnits = ArrayList() // Deprecated since 3.15.8 - with eras var playerBonusStartingUnits = ArrayList() var aiCityGrowthModifier:Float = 1f @@ -26,7 +26,7 @@ class Difficulty: INamed, ICivilopediaText { var aiBuildingMaintenanceModifier:Float = 1f var aiUnitMaintenanceModifier = 1f var aiFreeTechs = ArrayList() - var aiMajorCivStartingUnits = ArrayList() // Deprecated since 3.15.8 + var aiMajorCivStartingUnits = ArrayList() // Deprecated since 3.15.8 - with eras var aiMajorCivBonusStartingUnits = ArrayList() var aiCityStateStartingUnits = ArrayList() // Deprecated since 3.15.8 var aiCityStateBonusStartingUnits = ArrayList() diff --git a/core/src/com/unciv/ui/civilopedia/CivilopediaScreen.kt b/core/src/com/unciv/ui/civilopedia/CivilopediaScreen.kt index 6d590c81ba..570c84b11f 100644 --- a/core/src/com/unciv/ui/civilopedia/CivilopediaScreen.kt +++ b/core/src/com/unciv/ui/civilopedia/CivilopediaScreen.kt @@ -184,9 +184,6 @@ class CivilopediaScreen( && !(uniqueObjects.filter { unique -> unique.placeholderText == "Hidden when [] Victory is disabled"}.any { unique -> !game.gameInfo.gameParameters.victoryTypes.contains(VictoryType.valueOf(unique.params[0] )) }) - // Deprecated since 3.15.14 - && !(noCulturalVictory && "Hidden when cultural victory is disabled" in uniques) - // } fun getCategoryIterator(category: CivilopediaCategories): Collection = diff --git a/core/src/com/unciv/ui/overviewscreen/StatsOverviewTable.kt b/core/src/com/unciv/ui/overviewscreen/StatsOverviewTable.kt index 74e77ab417..537776e01d 100644 --- a/core/src/com/unciv/ui/overviewscreen/StatsOverviewTable.kt +++ b/core/src/com/unciv/ui/overviewscreen/StatsOverviewTable.kt @@ -106,12 +106,6 @@ class StatsOverviewTable ( private fun getGreatPeopleTable(): Table { val greatPeopleTable = Table(CameraStageBaseScreen.skin) - val greatPersonPoints = GreatPersonManager - .greatPersonCounterToStats(viewingPlayer.greatPeople.greatPersonPointsCounter) - val greatPersonPointsPerTurn = GreatPersonManager - .greatPersonCounterToStats(viewingPlayer.getGreatPersonPointsForNextTurn()) - val pointsToGreatPerson = viewingPlayer.greatPeople.pointsForNextGreatPerson - greatPeopleTable.defaults().pad(5f) val greatPeopleHeader = Table(CameraStageBaseScreen.skin) val greatPeopleIcon = ImageGetter.getStatIcon("Specialist") @@ -124,11 +118,14 @@ class StatsOverviewTable ( greatPeopleTable.add("Current points".tr()) greatPeopleTable.add("Points per turn".tr()).row() - val mapping = GreatPersonManager.statToGreatPersonMapping - for(entry in mapping){ - greatPeopleTable.add(entry.value.tr()) - greatPeopleTable.add(greatPersonPoints[entry.key].toInt().toString()+"/"+pointsToGreatPerson) - greatPeopleTable.add(greatPersonPointsPerTurn[entry.key].toInt().toString()).row() + val greatPersonPoints = viewingPlayer.greatPeople.greatPersonPointsCounter + val greatPersonPointsPerTurn = viewingPlayer.getGreatPersonPointsForNextTurn() + val pointsToGreatPerson = viewingPlayer.greatPeople.pointsForNextGreatPerson + + for((greatPerson, points) in greatPersonPoints) { + greatPeopleTable.add(greatPerson.tr()) + greatPeopleTable.add("$points/$pointsToGreatPerson") + greatPeopleTable.add(greatPersonPointsPerTurn[greatPerson].toString()).row() } val pointsForGreatGeneral = viewingPlayer.greatPeople.greatGeneralPoints val pointsForNextGreatGeneral = viewingPlayer.greatPeople.pointsForNextGreatGeneral