Removed deprecated components

This commit is contained in:
yairm210
2021-11-02 18:15:49 +02:00
parent 1ca17fb3a7
commit f568d98694
7 changed files with 8 additions and 29 deletions

View File

@ -362,7 +362,6 @@ class GameInfo {
removeMissingModReferences()
replaceDiplomacyFlag(DiplomacyFlags.Denunceation, DiplomacyFlags.Denunciation)
for (baseUnit in ruleSet.units.values)
baseUnit.ruleset = ruleSet

View File

@ -211,8 +211,7 @@ object GameStarter {
val allMercantileResources = ruleset.tileResources.values.filter {
it.unique == "Can only be created by Mercantile City-States" // Deprecated as of 3.16.16
|| it.hasUnique(UniqueType.CityStateOnlyResource) }.map { it.name }
it.hasUnique(UniqueType.CityStateOnlyResource) }.map { it.name }
val unusedMercantileResources = Stack<String>()

View File

@ -331,7 +331,6 @@ object BattleDamage {
*/
private fun getAttackingStrength(
attacker: ICombatant,
tileToAttackFrom: TileInfo?,
defender: ICombatant
): Float {
val attackModifier = modifiersToMultiplicationBonus(getAttackModifiers(attacker, defender))
@ -355,7 +354,7 @@ object BattleDamage {
if (attacker.isRanged()) return 0
if (defender.isCivilian()) return 0
val ratio =
getAttackingStrength(attacker, tileToAttackFrom, defender) / getDefendingStrength(
getAttackingStrength(attacker, defender) / getDefendingStrength(
attacker,
defender
)
@ -368,7 +367,7 @@ object BattleDamage {
defender: ICombatant
): Int {
val ratio =
getAttackingStrength(attacker, tileToAttackFrom, defender) / getDefendingStrength(
getAttackingStrength(attacker, defender) / getDefendingStrength(
attacker,
defender
)

View File

@ -86,19 +86,6 @@ class CityStats(val cityInfo: CityInfo) {
return stats
}
@Deprecated("As of 3.16.16 - replaced by regular getStatPercentBonusesFromUniques()")
private fun getStatPercentBonusesFromResources(construction: IConstruction): Stats {
val stats = Stats()
if (construction is Building
&& construction.isWonder
&& cityInfo.civInfo.getCivResources()
.any { it.amount > 0 && it.resource.unique == "+15% production towards Wonder construction" })
stats.production += 15f
return stats
}
private fun getStatsFromNationUnique(): Stats {
return getStatsFromUniques(cityInfo.civInfo.nation.uniqueObjects.asSequence())
}
@ -493,8 +480,6 @@ class CityStats(val cityInfo: CityInfo) {
newStatPercentBonusList["Railroads"] = getStatPercentBonusesFromRailroad() // Name chosen same as tech, for translation, but theoretically independent
val resourceUniques = cityInfo.civInfo.getCivResources().asSequence().flatMap { it.resource.uniqueObjects }
newStatPercentBonusList["Resources"] = getStatPercentBonusesFromUniques(currentConstruction, resourceUniques)
// Deprecated as of 3.16.16
newStatPercentBonusList["Resources"] = getStatPercentBonusesFromResources(currentConstruction)
newStatPercentBonusList["National ability"] = getStatPercentBonusesFromNationUnique(currentConstruction)
newStatPercentBonusList["Puppet City"] = getStatPercentBonusesFromPuppetCity()
newStatPercentBonusList["Religion"] = getStatPercentBonusesFromUniques(currentConstruction, cityInfo.religion.getUniques())

View File

@ -252,17 +252,17 @@ open class TileInfo {
}
if (naturalWonder != null) {
val wonder = getNaturalWonder().clone()
val wonderStats = getNaturalWonder().clone()
// Spain doubles tile yield
if (city != null && city.civInfo.hasUnique("Tile yields from Natural Wonders doubled")) {
wonder.timesInPlace(2f)
wonderStats.timesInPlace(2f)
}
if (getNaturalWonder().overrideStats)
stats = wonder
stats = wonderStats
else
stats.add(wonder)
stats.add(wonderStats)
}
if (city != null) {

View File

@ -177,8 +177,7 @@ class Nation : RulesetObject() {
if (showResources) {
val allMercantileResources = ruleset.tileResources.values
.filter { it.unique == "Can only be created by Mercantile City-States" // Deprecated 3.16.16
|| it.hasUnique(UniqueType.CityStateOnlyResource) }
.filter { it.hasUnique(UniqueType.CityStateOnlyResource) }
if (allMercantileResources.isNotEmpty()) {
textList += FormattedLine()

View File

@ -14,8 +14,6 @@ class TileResource : RulesetStatsObject() {
var improvement: String? = null
var improvementStats: Stats? = null
var revealedBy: String? = null
@Deprecated("As of 3.16.16 - replaced by uniques")
var unique: String? = null
var majorDepositAmount: DepositAmount = DepositAmount()
var minorDepositAmount: DepositAmount = DepositAmount()