mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 06:16:37 -04:00
Removed deprecated components
This commit is contained in:
parent
1ca17fb3a7
commit
f568d98694
@ -362,7 +362,6 @@ class GameInfo {
|
|||||||
|
|
||||||
removeMissingModReferences()
|
removeMissingModReferences()
|
||||||
|
|
||||||
replaceDiplomacyFlag(DiplomacyFlags.Denunceation, DiplomacyFlags.Denunciation)
|
|
||||||
|
|
||||||
for (baseUnit in ruleSet.units.values)
|
for (baseUnit in ruleSet.units.values)
|
||||||
baseUnit.ruleset = ruleSet
|
baseUnit.ruleset = ruleSet
|
||||||
|
@ -211,8 +211,7 @@ object GameStarter {
|
|||||||
|
|
||||||
|
|
||||||
val allMercantileResources = ruleset.tileResources.values.filter {
|
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>()
|
val unusedMercantileResources = Stack<String>()
|
||||||
|
@ -331,7 +331,6 @@ object BattleDamage {
|
|||||||
*/
|
*/
|
||||||
private fun getAttackingStrength(
|
private fun getAttackingStrength(
|
||||||
attacker: ICombatant,
|
attacker: ICombatant,
|
||||||
tileToAttackFrom: TileInfo?,
|
|
||||||
defender: ICombatant
|
defender: ICombatant
|
||||||
): Float {
|
): Float {
|
||||||
val attackModifier = modifiersToMultiplicationBonus(getAttackModifiers(attacker, defender))
|
val attackModifier = modifiersToMultiplicationBonus(getAttackModifiers(attacker, defender))
|
||||||
@ -355,7 +354,7 @@ object BattleDamage {
|
|||||||
if (attacker.isRanged()) return 0
|
if (attacker.isRanged()) return 0
|
||||||
if (defender.isCivilian()) return 0
|
if (defender.isCivilian()) return 0
|
||||||
val ratio =
|
val ratio =
|
||||||
getAttackingStrength(attacker, tileToAttackFrom, defender) / getDefendingStrength(
|
getAttackingStrength(attacker, defender) / getDefendingStrength(
|
||||||
attacker,
|
attacker,
|
||||||
defender
|
defender
|
||||||
)
|
)
|
||||||
@ -368,7 +367,7 @@ object BattleDamage {
|
|||||||
defender: ICombatant
|
defender: ICombatant
|
||||||
): Int {
|
): Int {
|
||||||
val ratio =
|
val ratio =
|
||||||
getAttackingStrength(attacker, tileToAttackFrom, defender) / getDefendingStrength(
|
getAttackingStrength(attacker, defender) / getDefendingStrength(
|
||||||
attacker,
|
attacker,
|
||||||
defender
|
defender
|
||||||
)
|
)
|
||||||
|
@ -86,19 +86,6 @@ class CityStats(val cityInfo: CityInfo) {
|
|||||||
return stats
|
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 {
|
private fun getStatsFromNationUnique(): Stats {
|
||||||
return getStatsFromUniques(cityInfo.civInfo.nation.uniqueObjects.asSequence())
|
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
|
newStatPercentBonusList["Railroads"] = getStatPercentBonusesFromRailroad() // Name chosen same as tech, for translation, but theoretically independent
|
||||||
val resourceUniques = cityInfo.civInfo.getCivResources().asSequence().flatMap { it.resource.uniqueObjects }
|
val resourceUniques = cityInfo.civInfo.getCivResources().asSequence().flatMap { it.resource.uniqueObjects }
|
||||||
newStatPercentBonusList["Resources"] = getStatPercentBonusesFromUniques(currentConstruction, resourceUniques)
|
newStatPercentBonusList["Resources"] = getStatPercentBonusesFromUniques(currentConstruction, resourceUniques)
|
||||||
// Deprecated as of 3.16.16
|
|
||||||
newStatPercentBonusList["Resources"] = getStatPercentBonusesFromResources(currentConstruction)
|
|
||||||
newStatPercentBonusList["National ability"] = getStatPercentBonusesFromNationUnique(currentConstruction)
|
newStatPercentBonusList["National ability"] = getStatPercentBonusesFromNationUnique(currentConstruction)
|
||||||
newStatPercentBonusList["Puppet City"] = getStatPercentBonusesFromPuppetCity()
|
newStatPercentBonusList["Puppet City"] = getStatPercentBonusesFromPuppetCity()
|
||||||
newStatPercentBonusList["Religion"] = getStatPercentBonusesFromUniques(currentConstruction, cityInfo.religion.getUniques())
|
newStatPercentBonusList["Religion"] = getStatPercentBonusesFromUniques(currentConstruction, cityInfo.religion.getUniques())
|
||||||
|
@ -252,17 +252,17 @@ open class TileInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (naturalWonder != null) {
|
if (naturalWonder != null) {
|
||||||
val wonder = getNaturalWonder().clone()
|
val wonderStats = getNaturalWonder().clone()
|
||||||
|
|
||||||
// Spain doubles tile yield
|
// Spain doubles tile yield
|
||||||
if (city != null && city.civInfo.hasUnique("Tile yields from Natural Wonders doubled")) {
|
if (city != null && city.civInfo.hasUnique("Tile yields from Natural Wonders doubled")) {
|
||||||
wonder.timesInPlace(2f)
|
wonderStats.timesInPlace(2f)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getNaturalWonder().overrideStats)
|
if (getNaturalWonder().overrideStats)
|
||||||
stats = wonder
|
stats = wonderStats
|
||||||
else
|
else
|
||||||
stats.add(wonder)
|
stats.add(wonderStats)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (city != null) {
|
if (city != null) {
|
||||||
|
@ -177,8 +177,7 @@ class Nation : RulesetObject() {
|
|||||||
|
|
||||||
if (showResources) {
|
if (showResources) {
|
||||||
val allMercantileResources = ruleset.tileResources.values
|
val allMercantileResources = ruleset.tileResources.values
|
||||||
.filter { it.unique == "Can only be created by Mercantile City-States" // Deprecated 3.16.16
|
.filter { it.hasUnique(UniqueType.CityStateOnlyResource) }
|
||||||
|| it.hasUnique(UniqueType.CityStateOnlyResource) }
|
|
||||||
|
|
||||||
if (allMercantileResources.isNotEmpty()) {
|
if (allMercantileResources.isNotEmpty()) {
|
||||||
textList += FormattedLine()
|
textList += FormattedLine()
|
||||||
|
@ -14,8 +14,6 @@ class TileResource : RulesetStatsObject() {
|
|||||||
var improvement: String? = null
|
var improvement: String? = null
|
||||||
var improvementStats: Stats? = null
|
var improvementStats: Stats? = null
|
||||||
var revealedBy: String? = null
|
var revealedBy: String? = null
|
||||||
@Deprecated("As of 3.16.16 - replaced by uniques")
|
|
||||||
var unique: String? = null
|
|
||||||
var majorDepositAmount: DepositAmount = DepositAmount()
|
var majorDepositAmount: DepositAmount = DepositAmount()
|
||||||
var minorDepositAmount: DepositAmount = DepositAmount()
|
var minorDepositAmount: DepositAmount = DepositAmount()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user