mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -04:00
Massive unique deprecation
This commit is contained in:
parent
64b8d805c3
commit
2786e0091c
@ -61,15 +61,6 @@ object BattleDamage {
|
|||||||
//https://www.carlsguides.com/strategy/civilization5/war/combatbonuses.php
|
//https://www.carlsguides.com/strategy/civilization5/war/combatbonuses.php
|
||||||
val adjacentUnits = combatant.getTile().neighbors.flatMap { it.getUnits() }
|
val adjacentUnits = combatant.getTile().neighbors.flatMap { it.getUnits() }
|
||||||
|
|
||||||
// Deprecated since 3.18.17
|
|
||||||
for (unique in civInfo.getMatchingUniques(UniqueType.StrengthFromAdjacentUnits)) {
|
|
||||||
if (combatant.matchesCategory(unique.params[1])
|
|
||||||
&& adjacentUnits.any { it.civInfo == civInfo && it.matchesFilter(unique.params[2]) }
|
|
||||||
) {
|
|
||||||
modifiers.add("Adjacent units", unique.params[0].toInt())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//
|
|
||||||
|
|
||||||
for (unique in adjacentUnits.filter { it.civInfo.isAtWarWith(combatant.getCivInfo()) }
|
for (unique in adjacentUnits.filter { it.civInfo.isAtWarWith(combatant.getCivInfo()) }
|
||||||
.flatMap { it.getMatchingUniques("[]% Strength for enemy [] units in adjacent [] tiles") })
|
.flatMap { it.getMatchingUniques("[]% Strength for enemy [] units in adjacent [] tiles") })
|
||||||
@ -178,18 +169,6 @@ object BattleDamage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (attacker is CityCombatant) {
|
|
||||||
// Deprecated since 3.19.1
|
|
||||||
if (attacker.city.getCenterTile().militaryUnit != null) {
|
|
||||||
val garrisonBonus = attacker.city.getMatchingUniques(UniqueType.StrengthForGarrisonedCitiesAttacking)
|
|
||||||
.sumOf { it.params[0].toInt() }
|
|
||||||
if (garrisonBonus != 0)
|
|
||||||
modifiers["Garrisoned unit"] = garrisonBonus
|
|
||||||
}
|
|
||||||
for (unique in attacker.city.getMatchingUniques(UniqueType.StrengthForCitiesAttacking)) {
|
|
||||||
modifiers.add("Attacking Bonus", unique.params[0].toInt())
|
|
||||||
}
|
|
||||||
//
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return modifiers
|
return modifiers
|
||||||
@ -222,11 +201,6 @@ object BattleDamage {
|
|||||||
|
|
||||||
if (defender.unit.isFortified())
|
if (defender.unit.isFortified())
|
||||||
modifiers["Fortification"] = 20 * defender.unit.getFortificationTurns()
|
modifiers["Fortification"] = 20 * defender.unit.getFortificationTurns()
|
||||||
} else if (defender is CityCombatant) {
|
|
||||||
|
|
||||||
modifiers["Defensive Bonus"] =
|
|
||||||
defender.city.civInfo.getMatchingUniques(UniqueType.StrengthForCitiesDefending)
|
|
||||||
.map { it.params[0].toFloat() / 100f }.sum().toInt()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return modifiers
|
return modifiers
|
||||||
|
@ -61,10 +61,6 @@ class CityCombatant(val city: CityInfo) : ICombatant {
|
|||||||
var buildingsStrength = city.cityConstructions.getBuiltBuildings().sumOf { it.cityStrength }.toFloat()
|
var buildingsStrength = city.cityConstructions.getBuiltBuildings().sumOf { it.cityStrength }.toFloat()
|
||||||
val stateForConditionals = StateForConditionals(getCivInfo(), city, ourCombatant = this, combatAction = combatAction)
|
val stateForConditionals = StateForConditionals(getCivInfo(), city, ourCombatant = this, combatAction = combatAction)
|
||||||
|
|
||||||
// Deprecated since 3.18.17
|
|
||||||
if (getCivInfo().hasUnique(UniqueType.DefensiveBuilding25, stateForConditionals))
|
|
||||||
buildingsStrength *= 1.25f
|
|
||||||
//
|
|
||||||
for (unique in getCivInfo().getMatchingUniques(UniqueType.BetterDefensiveBuildings, stateForConditionals))
|
for (unique in getCivInfo().getMatchingUniques(UniqueType.BetterDefensiveBuildings, stateForConditionals))
|
||||||
buildingsStrength *= unique.params[0].toPercent()
|
buildingsStrength *= unique.params[0].toPercent()
|
||||||
strength += buildingsStrength
|
strength += buildingsStrength
|
||||||
|
@ -358,12 +358,6 @@ class CityStats(val cityInfo: CityInfo) {
|
|||||||
buildingsMaintenance *= cityInfo.civInfo.gameInfo.getDifficulty().aiBuildingMaintenanceModifier
|
buildingsMaintenance *= cityInfo.civInfo.gameInfo.getDifficulty().aiBuildingMaintenanceModifier
|
||||||
}
|
}
|
||||||
|
|
||||||
// e.g. "-[50]% maintenance costs for buildings [in this city]"
|
|
||||||
// Deprecated since 3.18.17
|
|
||||||
for (unique in cityInfo.getMatchingUniques(UniqueType.DecreasedBuildingMaintenanceDeprecated)) {
|
|
||||||
buildingsMaintenance *= (1f - unique.params[0].toFloat() / 100)
|
|
||||||
}
|
|
||||||
//
|
|
||||||
for (unique in cityInfo.getMatchingUniques(UniqueType.BuildingMaintenance)) {
|
for (unique in cityInfo.getMatchingUniques(UniqueType.BuildingMaintenance)) {
|
||||||
buildingsMaintenance *= unique.params[0].toPercent()
|
buildingsMaintenance *= unique.params[0].toPercent()
|
||||||
}
|
}
|
||||||
|
@ -92,10 +92,6 @@ class CivInfoStats(val civInfo: CivilizationInfo) {
|
|||||||
transportationUpkeep += tile.roadStatus.upkeep
|
transportationUpkeep += tile.roadStatus.upkeep
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Deprecated since 3.18.17
|
|
||||||
for (unique in civInfo.getMatchingUniques(UniqueType.DecreasedRoadMaintenanceDeprecated))
|
|
||||||
transportationUpkeep *= (100f - unique.params[0].toInt()) / 100
|
|
||||||
//
|
|
||||||
for (unique in civInfo.getMatchingUniques(UniqueType.RoadMaintenance))
|
for (unique in civInfo.getMatchingUniques(UniqueType.RoadMaintenance))
|
||||||
transportationUpkeep *= unique.params[0].toPercent()
|
transportationUpkeep *= unique.params[0].toPercent()
|
||||||
|
|
||||||
@ -246,11 +242,7 @@ class CivInfoStats(val civInfo: CivilizationInfo) {
|
|||||||
statMap["Base happiness"] = civInfo.getDifficulty().baseHappiness.toFloat()
|
statMap["Base happiness"] = civInfo.getDifficulty().baseHappiness.toFloat()
|
||||||
|
|
||||||
var happinessPerUniqueLuxury = 4f + civInfo.getDifficulty().extraHappinessPerLuxury
|
var happinessPerUniqueLuxury = 4f + civInfo.getDifficulty().extraHappinessPerLuxury
|
||||||
for (unique in
|
for (unique in civInfo.getMatchingUniques(UniqueType.BonusHappinessFromLuxury))
|
||||||
// Deprecated since 3.18.17
|
|
||||||
civInfo.getMatchingUniques(UniqueType.BonusHappinessFromLuxuryDeprecated) +
|
|
||||||
//
|
|
||||||
civInfo.getMatchingUniques(UniqueType.BonusHappinessFromLuxury))
|
|
||||||
happinessPerUniqueLuxury += unique.params[0].toInt()
|
happinessPerUniqueLuxury += unique.params[0].toInt()
|
||||||
|
|
||||||
val ownedLuxuries = civInfo.getCivResources().map { it.resource }
|
val ownedLuxuries = civInfo.getCivResources().map { it.resource }
|
||||||
@ -264,12 +256,7 @@ class CivInfoStats(val civInfo: CivilizationInfo) {
|
|||||||
statMap["Luxury resources"] = relevantLuxuries * happinessPerUniqueLuxury
|
statMap["Luxury resources"] = relevantLuxuries * happinessPerUniqueLuxury
|
||||||
|
|
||||||
val happinessBonusForCityStateProvidedLuxuries =
|
val happinessBonusForCityStateProvidedLuxuries =
|
||||||
(
|
civInfo.getMatchingUniques(UniqueType.CityStateLuxuryHappiness).sumOf { it.params[0].toInt() } / 100f
|
||||||
// Deprecated since 3.18.17
|
|
||||||
civInfo.getMatchingUniques(UniqueType.CityStateLuxuryHappinessDeprecated) +
|
|
||||||
//
|
|
||||||
civInfo.getMatchingUniques(UniqueType.CityStateLuxuryHappiness)
|
|
||||||
).sumOf { it.params[0].toInt() } / 100f
|
|
||||||
|
|
||||||
val luxuriesProvidedByCityStates = civInfo.getKnownCivs().asSequence()
|
val luxuriesProvidedByCityStates = civInfo.getKnownCivs().asSequence()
|
||||||
.filter { it.isCityState() && it.getAllyCiv() == civInfo.civName }
|
.filter { it.isCityState() && it.getAllyCiv() == civInfo.civName }
|
||||||
|
@ -170,11 +170,7 @@ class CivInfoTransientUpdater(val civInfo: CivilizationInfo) {
|
|||||||
|
|
||||||
if (!civInfo.isCityState()) {
|
if (!civInfo.isCityState()) {
|
||||||
var resourceBonusPercentage = 1f
|
var resourceBonusPercentage = 1f
|
||||||
for (unique in
|
for (unique in civInfo.getMatchingUniques(UniqueType.CityStateResources))
|
||||||
// Deprecated since 3.18.17
|
|
||||||
civInfo.getMatchingUniques(UniqueType.CityStateResourcesDeprecated) +
|
|
||||||
//
|
|
||||||
civInfo.getMatchingUniques(UniqueType.CityStateResources))
|
|
||||||
resourceBonusPercentage += unique.params[0].toFloat() / 100
|
resourceBonusPercentage += unique.params[0].toFloat() / 100
|
||||||
for (city in civInfo.getKnownCivs().filter { it.getAllyCiv() == civInfo.civName }
|
for (city in civInfo.getKnownCivs().filter { it.getAllyCiv() == civInfo.civName }
|
||||||
.flatMap { it.cities }) {
|
.flatMap { it.cities }) {
|
||||||
|
@ -27,7 +27,7 @@ class GoldenAgeManager {
|
|||||||
|
|
||||||
fun enterGoldenAge(unmodifiedNumberOfTurns: Int = 10) {
|
fun enterGoldenAge(unmodifiedNumberOfTurns: Int = 10) {
|
||||||
var turnsToGoldenAge = unmodifiedNumberOfTurns.toFloat()
|
var turnsToGoldenAge = unmodifiedNumberOfTurns.toFloat()
|
||||||
for (unique in civInfo.getMatchingUniques(UniqueType.GoldenAgeLengthIncreased) + civInfo.getMatchingUniques(UniqueType.GoldenAgeLength))
|
for (unique in civInfo.getMatchingUniques(UniqueType.GoldenAgeLength))
|
||||||
turnsToGoldenAge *= unique.params[0].toPercent()
|
turnsToGoldenAge *= unique.params[0].toPercent()
|
||||||
turnsToGoldenAge *= civInfo.gameInfo.gameParameters.gameSpeed.modifier
|
turnsToGoldenAge *= civInfo.gameInfo.gameParameters.gameSpeed.modifier
|
||||||
turnsLeftForCurrentGoldenAge += turnsToGoldenAge.toInt()
|
turnsLeftForCurrentGoldenAge += turnsToGoldenAge.toInt()
|
||||||
|
@ -89,11 +89,7 @@ class PolicyManager {
|
|||||||
|
|
||||||
for (unique in civInfo.getMatchingUniques(UniqueType.LessPolicyCostFromCities))
|
for (unique in civInfo.getMatchingUniques(UniqueType.LessPolicyCostFromCities))
|
||||||
cityModifier *= 1 - unique.params[0].toFloat() / 100
|
cityModifier *= 1 - unique.params[0].toFloat() / 100
|
||||||
// Deprecated since 3.18.17
|
for (unique in civInfo.getMatchingUniques(UniqueType.LessPolicyCost))
|
||||||
for (unique in civInfo.getMatchingUniques(UniqueType.LessPolicyCostDeprecated))
|
|
||||||
policyCultureCost *= 1 - unique.params[0].toFloat() / 100
|
|
||||||
//
|
|
||||||
for (unique in civInfo.getMatchingUniques(UniqueType.LessPolicyCost) + civInfo.getMatchingUniques(UniqueType.LessPolicyCostDeprecated2))
|
|
||||||
policyCultureCost *= unique.params[0].toPercent()
|
policyCultureCost *= unique.params[0].toPercent()
|
||||||
if (civInfo.isPlayerCivilization())
|
if (civInfo.isPlayerCivilization())
|
||||||
policyCultureCost *= civInfo.getDifficulty().policyCostModifier
|
policyCultureCost *= civInfo.getDifficulty().policyCostModifier
|
||||||
|
@ -261,10 +261,6 @@ class DiplomacyManager() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var modifierPercent = 0f
|
var modifierPercent = 0f
|
||||||
// Deprecated since 3.18.17
|
|
||||||
for (unique in otherCiv().getMatchingUniques(UniqueType.CityStateInfluenceDegradationDeprecated))
|
|
||||||
modifierPercent -= unique.params[0].toFloat()
|
|
||||||
//
|
|
||||||
for (unique in otherCiv().getMatchingUniques(UniqueType.CityStateInfluenceDegradation))
|
for (unique in otherCiv().getMatchingUniques(UniqueType.CityStateInfluenceDegradation))
|
||||||
modifierPercent += unique.params[0].toFloat()
|
modifierPercent += unique.params[0].toFloat()
|
||||||
|
|
||||||
|
@ -521,12 +521,6 @@ class MapUnit {
|
|||||||
fun getCostOfUpgrade(): Int {
|
fun getCostOfUpgrade(): Int {
|
||||||
val unitToUpgradeTo = getUnitToUpgradeTo()
|
val unitToUpgradeTo = getUnitToUpgradeTo()
|
||||||
var goldCostOfUpgrade = (unitToUpgradeTo.cost - baseUnit().cost) * 2f + 10f
|
var goldCostOfUpgrade = (unitToUpgradeTo.cost - baseUnit().cost) * 2f + 10f
|
||||||
// Deprecated since 3.18.17
|
|
||||||
for (unique in civInfo.getMatchingUniques(UniqueType.ReducedUpgradingGoldCost)) {
|
|
||||||
if (matchesFilter(unique.params[0]))
|
|
||||||
goldCostOfUpgrade *= (1 - unique.params[1].toFloat() / 100f)
|
|
||||||
}
|
|
||||||
//
|
|
||||||
for (unique in civInfo.getMatchingUniques(UniqueType.UnitUpgradeCost, StateForConditionals(civInfo, unit=this)))
|
for (unique in civInfo.getMatchingUniques(UniqueType.UnitUpgradeCost, StateForConditionals(civInfo, unit=this)))
|
||||||
goldCostOfUpgrade *= unique.params[0].toPercent()
|
goldCostOfUpgrade *= unique.params[0].toPercent()
|
||||||
|
|
||||||
|
@ -443,19 +443,14 @@ open class TileInfo {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unique in city.getMatchingUniques(UniqueType.AllStatsPercentFromObject, conditionalState) +
|
for (unique in city.getMatchingUniques(UniqueType.AllStatsPercentFromObject, conditionalState)) {
|
||||||
city.getMatchingUniques(UniqueType.AllStatsSignedPercentFromObject) // Deprecated
|
|
||||||
) {
|
|
||||||
if (improvement.matchesFilter(unique.params[1]))
|
if (improvement.matchesFilter(unique.params[1]))
|
||||||
stats.timesInPlace(unique.params[0].toPercent())
|
stats.timesInPlace(unique.params[0].toPercent())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (city == null) { // As otherwise we already got this above
|
if (city == null) { // As otherwise we already got this above
|
||||||
for (unique in
|
for (unique in observingCiv.getMatchingUniques(UniqueType.AllStatsPercentFromObject, conditionalState)) {
|
||||||
observingCiv.getMatchingUniques(UniqueType.AllStatsPercentFromObject, conditionalState) +
|
|
||||||
observingCiv.getMatchingUniques(UniqueType.AllStatsSignedPercentFromObject) // Deprecated
|
|
||||||
) {
|
|
||||||
if (improvement.matchesFilter(unique.params[1]))
|
if (improvement.matchesFilter(unique.params[1]))
|
||||||
stats.timesInPlace(unique.params[0].toPercent())
|
stats.timesInPlace(unique.params[0].toPercent())
|
||||||
}
|
}
|
||||||
|
@ -195,13 +195,6 @@ class Building : RulesetStatsObject(), INonPerpetualConstruction {
|
|||||||
val stats = percentStatBonus?.clone() ?: Stats()
|
val stats = percentStatBonus?.clone() ?: Stats()
|
||||||
val civInfo = cityInfo?.civInfo ?: return stats // initial stats
|
val civInfo = cityInfo?.civInfo ?: return stats // initial stats
|
||||||
|
|
||||||
// Deprecated since 3.18.17
|
|
||||||
for (unique in civInfo.getMatchingUniques(UniqueType.StatPercentSignedFromObject)) {
|
|
||||||
if (matchesFilter(unique.params[2]))
|
|
||||||
stats.add(Stat.valueOf(unique.params[1]), unique.params[0].toFloat())
|
|
||||||
}
|
|
||||||
//
|
|
||||||
|
|
||||||
for (unique in civInfo.getMatchingUniques(UniqueType.StatPercentFromObject)) {
|
for (unique in civInfo.getMatchingUniques(UniqueType.StatPercentFromObject)) {
|
||||||
if (matchesFilter(unique.params[2]))
|
if (matchesFilter(unique.params[2]))
|
||||||
stats.add(Stat.valueOf(unique.params[1]), unique.params[0].toFloat())
|
stats.add(Stat.valueOf(unique.params[1]), unique.params[0].toFloat())
|
||||||
|
@ -93,11 +93,7 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
|
|||||||
StatPercentBonus("[amount]% [stat]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
StatPercentBonus("[amount]% [stat]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
||||||
StatPercentBonusCities("[amount]% [stat] [cityFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
StatPercentBonusCities("[amount]% [stat] [cityFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
||||||
StatPercentFromObject("[amount]% [stat] from every [tileFilter/specialist/buildingName]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
StatPercentFromObject("[amount]% [stat] from every [tileFilter/specialist/buildingName]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
||||||
@Deprecated("as of 3.18.17", ReplaceWith("[+amount]% [stat] from every [tileFilter/specialist/buildingName]"))
|
|
||||||
StatPercentSignedFromObject("+[amount]% [stat] from every [tileFilter/specialist/buildingName]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
|
||||||
AllStatsPercentFromObject("[amount]% Yield from every [tileFilter]", UniqueTarget.FollowerBelief, UniqueTarget.Global),
|
AllStatsPercentFromObject("[amount]% Yield from every [tileFilter]", UniqueTarget.FollowerBelief, UniqueTarget.Global),
|
||||||
@Deprecated("as of 3.18.17", ReplaceWith("[+amount]% Yield from every [tileFilter]"))
|
|
||||||
AllStatsSignedPercentFromObject("+[amount]% yield from every [tileFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
|
||||||
StatPercentFromReligionFollowers("[amount]% [stat] from every follower, up to [amount]%", UniqueTarget.FollowerBelief),
|
StatPercentFromReligionFollowers("[amount]% [stat] from every follower, up to [amount]%", UniqueTarget.FollowerBelief),
|
||||||
BonusStatsFromCityStates("[amount]% [stat] from City-States", UniqueTarget.Global),
|
BonusStatsFromCityStates("[amount]% [stat] from City-States", UniqueTarget.Global),
|
||||||
|
|
||||||
@ -135,20 +131,15 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
|
|||||||
CityStateCanGiftGreatPeople("Allied City-States will occasionally gift Great People", UniqueTarget.Global), // used in Policy
|
CityStateCanGiftGreatPeople("Allied City-States will occasionally gift Great People", UniqueTarget.Global), // used in Policy
|
||||||
CityStateDeprecated("Will not be chosen for new games", UniqueTarget.Nation), // implemented for CS only for now
|
CityStateDeprecated("Will not be chosen for new games", UniqueTarget.Nation), // implemented for CS only for now
|
||||||
CityStateInfluenceDegradation("[amount]% City-State Influence degradation", UniqueTarget.Global),
|
CityStateInfluenceDegradation("[amount]% City-State Influence degradation", UniqueTarget.Global),
|
||||||
@Deprecated("as of 3.18.17", ReplaceWith("[-amount]% City-State Influence degradation"))
|
|
||||||
CityStateInfluenceDegradationDeprecated("City-State Influence degrades [amount]% slower", UniqueTarget.Global),
|
|
||||||
CityStateRestingPoint("Resting point for Influence with City-States is increased by [amount]", UniqueTarget.Global),
|
CityStateRestingPoint("Resting point for Influence with City-States is increased by [amount]", UniqueTarget.Global),
|
||||||
|
|
||||||
CityStateStatPercent("Allied City-States provide [stat] equal to [amount]% of what they produce for themselves", UniqueTarget.Global),
|
CityStateStatPercent("Allied City-States provide [stat] equal to [amount]% of what they produce for themselves", UniqueTarget.Global),
|
||||||
CityStateResources("[amount]% resources gifted by City-States", UniqueTarget.Global),
|
CityStateResources("[amount]% resources gifted by City-States", UniqueTarget.Global),
|
||||||
@Deprecated("as of 3.18.17", ReplaceWith("[+amount]% resources gifted by City-States"))
|
|
||||||
CityStateResourcesDeprecated("Quantity of Resources gifted by City-States increased by [amount]%", UniqueTarget.Global),
|
|
||||||
CityStateLuxuryHappiness("[amount]% Happiness from luxury resources gifted by City-States", UniqueTarget.Global),
|
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),
|
CityStateInfluenceRecoversTwiceNormalRate("City-State Influence recovers at twice the normal rate", UniqueTarget.Global),
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
|
|
||||||
/////// region Other global uniques
|
/////// region Other global uniques
|
||||||
|
|
||||||
FreeUnits("[amount] units cost no maintenance", UniqueTarget.Global),
|
FreeUnits("[amount] units cost no maintenance", UniqueTarget.Global),
|
||||||
@ -214,12 +205,8 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
|
|||||||
RoadMovementSpeed("Improves movement speed on roads",UniqueTarget.Global),
|
RoadMovementSpeed("Improves movement speed on roads",UniqueTarget.Global),
|
||||||
RoadsConnectAcrossRivers("Roads connect tiles across rivers", UniqueTarget.Global),
|
RoadsConnectAcrossRivers("Roads connect tiles across rivers", UniqueTarget.Global),
|
||||||
RoadMaintenance("[amount]% maintenance on road & railroads", UniqueTarget.Global),
|
RoadMaintenance("[amount]% maintenance on road & railroads", UniqueTarget.Global),
|
||||||
@Deprecated("as of 3.18.17", ReplaceWith("[-amount]% maintenance on road & railroads"))
|
|
||||||
DecreasedRoadMaintenanceDeprecated("Maintenance on roads & railroads reduced by [amount]%", UniqueTarget.Global),
|
|
||||||
|
|
||||||
BuildingMaintenance("[amount]% maintenance cost for buildings [cityFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
BuildingMaintenance("[amount]% maintenance cost for buildings [cityFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
||||||
@Deprecated("as of 3.18.17", ReplaceWith("[-amount]% maintenance cost for buildings [cityFilter]"))
|
|
||||||
DecreasedBuildingMaintenanceDeprecated("-[amount]% maintenance cost for buildings [cityFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
|
||||||
|
|
||||||
// This should probably support conditionals, e.g. <after discovering [tech]>
|
// This should probably support conditionals, e.g. <after discovering [tech]>
|
||||||
MayanGainGreatPerson("Receive a free Great Person at the end of every [comment] (every 394 years), after researching [tech]. Each bonus person can only be chosen once.", UniqueTarget.Global),
|
MayanGainGreatPerson("Receive a free Great Person at the end of every [comment] (every 394 years), after researching [tech]. Each bonus person can only be chosen once.", UniqueTarget.Global),
|
||||||
@ -227,14 +214,9 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
|
|||||||
|
|
||||||
RetainHappinessFromLuxury("Retain [amount]% of the happiness from a luxury after the last copy has been traded away", UniqueTarget.Global),
|
RetainHappinessFromLuxury("Retain [amount]% of the happiness from a luxury after the last copy has been traded away", UniqueTarget.Global),
|
||||||
BonusHappinessFromLuxury("[amount] Happiness from each type of luxury resource", UniqueTarget.Global),
|
BonusHappinessFromLuxury("[amount] Happiness from each type of luxury resource", UniqueTarget.Global),
|
||||||
@Deprecated("as of 3.18.17", ReplaceWith("[+amount] Happiness from each type of luxury resource"))
|
|
||||||
BonusHappinessFromLuxuryDeprecated("+[amount] happiness from each type of luxury resource", UniqueTarget.Global),
|
|
||||||
LessPolicyCostFromCities("Each city founded increases culture cost of policies [amount]% less than normal", UniqueTarget.Global),
|
LessPolicyCostFromCities("Each city founded increases culture cost of policies [amount]% less than normal", UniqueTarget.Global),
|
||||||
LessPolicyCost("[amount]% Culture cost of adopting new Policies", UniqueTarget.Global),
|
LessPolicyCost("[amount]% Culture cost of adopting new Policies", UniqueTarget.Global),
|
||||||
@Deprecated("as of 3.18.17", ReplaceWith("[-amount]% Culture cost of adopting new Policies"))
|
|
||||||
LessPolicyCostDeprecated("Culture cost of adopting new Policies reduced by [amount]%", UniqueTarget.Global),
|
|
||||||
@Deprecated("as of 3.19.1", ReplaceWith("[amount]% Culture cost of adopting new Policies"))
|
|
||||||
LessPolicyCostDeprecated2("[amount]% Culture cost of adopting new policies", UniqueTarget.Global),
|
|
||||||
|
|
||||||
StrategicResourcesIncrease("Quantity of strategic resources produced by the empire +[amount]%", UniqueTarget.Global), // used in Policy
|
StrategicResourcesIncrease("Quantity of strategic resources produced by the empire +[amount]%", UniqueTarget.Global), // used in Policy
|
||||||
DoubleResourceProduced("Double quantity of [resource] produced", UniqueTarget.Global),
|
DoubleResourceProduced("Double quantity of [resource] produced", UniqueTarget.Global),
|
||||||
@ -260,30 +242,15 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
|
|||||||
TriggersCulturalVictory("Triggers a Cultural Victory upon completion", UniqueTarget.Global),
|
TriggersCulturalVictory("Triggers a Cultural Victory upon completion", UniqueTarget.Global),
|
||||||
|
|
||||||
BetterDefensiveBuildings("[amount]% City Strength from defensive buildings", UniqueTarget.Global),
|
BetterDefensiveBuildings("[amount]% City Strength from defensive buildings", UniqueTarget.Global),
|
||||||
@Deprecated("as of 3.18.17", ReplaceWith("[+25]% City Strength from defensive buildings"))
|
|
||||||
DefensiveBuilding25("Defensive buildings in all cities are 25% more effective", UniqueTarget.Global),
|
|
||||||
|
|
||||||
TileImprovementTime("[amount]% tile improvement construction time", UniqueTarget.Global),
|
TileImprovementTime("[amount]% tile improvement construction time", UniqueTarget.Global),
|
||||||
PercentGoldFromTradeMissions("[amount]% Gold from Great Merchant trade missions", UniqueTarget.Global),
|
PercentGoldFromTradeMissions("[amount]% Gold from Great Merchant trade missions", UniqueTarget.Global),
|
||||||
// Todo: Lowercase the 'U' of 'Units' in this unique
|
// Todo: Lowercase the 'U' of 'Units' in this unique
|
||||||
CityHealingUnits("[mapUnitFilter] Units adjacent to this city heal [amount] HP per turn when healing", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
CityHealingUnits("[mapUnitFilter] Units adjacent to this city heal [amount] HP per turn when healing", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
||||||
|
|
||||||
@Deprecated("as of 3.18.17", ReplaceWith("[amount]% Strength <for [mapUnitFilter] units> <when adjacent to a [mapUnitFilter] unit>"))
|
|
||||||
StrengthFromAdjacentUnits("[amount]% Strength for [mapUnitFilter] units which have another [mapUnitFilter] unit in an adjacent tile", UniqueTarget.Unit, UniqueTarget.Global),
|
|
||||||
@Deprecated("as of 3.18.17", ReplaceWith("[-amount]% Gold cost of upgrading <for [baseUnitFilter] units>"))
|
|
||||||
ReducedUpgradingGoldCost("Gold cost of upgrading [baseUnitFilter] units reduced by [amount]%", UniqueTarget.Unit, UniqueTarget.Global),
|
|
||||||
@Deprecated("as of 3.18.17", ReplaceWith("[+100]% Gold from Great Merchant trade missions"))
|
|
||||||
DoubleGoldFromTradeMissions("Double gold from Great Merchant trade missions", UniqueTarget.Global),
|
|
||||||
|
|
||||||
GoldenAgeLength("[amount]% Golden Age length", UniqueTarget.Global),
|
GoldenAgeLength("[amount]% Golden Age length", UniqueTarget.Global),
|
||||||
@Deprecated("as of 3.18.17", ReplaceWith("[+amount]% Golden Age length"))
|
|
||||||
GoldenAgeLengthIncreased("Golden Age length increased by [amount]%", UniqueTarget.Global),
|
|
||||||
|
|
||||||
StrengthForCities("[amount]% Strength for cities", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
StrengthForCities("[amount]% Strength for cities", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
||||||
@Deprecated("as of 3.18.17", ReplaceWith("[+amount]% Strength for cities <when defending>"))
|
|
||||||
StrengthForCitiesDefending("+[amount]% Defensive Strength for cities", UniqueTarget.Global),
|
|
||||||
@Deprecated("as of 3.18.17", ReplaceWith("[+amount]% Strength for cities <when attacking>"))
|
|
||||||
StrengthForCitiesAttacking("[amount]% Attacking Strength for cities", UniqueTarget.Global),
|
|
||||||
@Deprecated("as of 3.19.1", ReplaceWith("[+amount]% Strength for cities <with a garrison> <when attacking>"))
|
@Deprecated("as of 3.19.1", ReplaceWith("[+amount]% Strength for cities <with a garrison> <when attacking>"))
|
||||||
StrengthForGarrisonedCitiesAttacking("+[amount]% attacking strength for cities with garrisoned units", UniqueTarget.Global),
|
StrengthForGarrisonedCitiesAttacking("+[amount]% attacking strength for cities with garrisoned units", UniqueTarget.Global),
|
||||||
|
|
||||||
@ -688,7 +655,43 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
|
|||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
// region DEPRECATED AND REMOVED
|
// region DEPRECATED AND REMOVED
|
||||||
@Deprecated("as of 3.18.14", ReplaceWith("[stats] [in all cities] <before discovering [tech]>\" OR \"[stats] [in all cities] <before adopting [policy]>"))
|
|
||||||
|
@Deprecated("as of 3.18.17", ReplaceWith("[+amount]% Golden Age length"), DeprecationLevel.ERROR)
|
||||||
|
GoldenAgeLengthIncreased("Golden Age length increased by [amount]%", UniqueTarget.Global),
|
||||||
|
@Deprecated("as of 3.18.17", ReplaceWith("[+amount]% Strength for cities <when defending>"), DeprecationLevel.ERROR)
|
||||||
|
StrengthForCitiesDefending("+[amount]% Defensive Strength for cities", UniqueTarget.Global),
|
||||||
|
@Deprecated("as of 3.18.17", ReplaceWith("[+amount]% Strength for cities <when attacking>"), DeprecationLevel.ERROR)
|
||||||
|
StrengthForCitiesAttacking("[amount]% Attacking Strength for cities", UniqueTarget.Global),
|
||||||
|
@Deprecated("as of 3.18.17", ReplaceWith("[amount]% Strength <for [mapUnitFilter] units> <when adjacent to a [mapUnitFilter] unit>"), DeprecationLevel.ERROR)
|
||||||
|
StrengthFromAdjacentUnits("[amount]% Strength for [mapUnitFilter] units which have another [mapUnitFilter] unit in an adjacent tile", UniqueTarget.Unit, UniqueTarget.Global),
|
||||||
|
@Deprecated("as of 3.18.17", ReplaceWith("[-amount]% Gold cost of upgrading <for [baseUnitFilter] units>"), DeprecationLevel.ERROR)
|
||||||
|
ReducedUpgradingGoldCost("Gold cost of upgrading [baseUnitFilter] units reduced by [amount]%", UniqueTarget.Unit, UniqueTarget.Global),
|
||||||
|
@Deprecated("as of 3.18.17", ReplaceWith("[+100]% Gold from Great Merchant trade missions"), DeprecationLevel.ERROR)
|
||||||
|
DoubleGoldFromTradeMissions("Double gold from Great Merchant trade missions", UniqueTarget.Global),
|
||||||
|
@Deprecated("as of 3.18.17", ReplaceWith("[+25]% City Strength from defensive buildings"), DeprecationLevel.ERROR)
|
||||||
|
DefensiveBuilding25("Defensive buildings in all cities are 25% more effective", UniqueTarget.Global),
|
||||||
|
@Deprecated("as of 3.18.17", ReplaceWith("[-amount]% maintenance on road & railroads"), DeprecationLevel.ERROR)
|
||||||
|
DecreasedRoadMaintenanceDeprecated("Maintenance on roads & railroads reduced by [amount]%", UniqueTarget.Global),
|
||||||
|
@Deprecated("as of 3.18.17", ReplaceWith("[-amount]% maintenance cost for buildings [cityFilter]"), DeprecationLevel.ERROR)
|
||||||
|
DecreasedBuildingMaintenanceDeprecated("-[amount]% maintenance cost for buildings [cityFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
||||||
|
@Deprecated("as of 3.18.17", ReplaceWith("[+amount] Happiness from each type of luxury resource"), DeprecationLevel.ERROR)
|
||||||
|
BonusHappinessFromLuxuryDeprecated("+[amount] happiness from each type of luxury resource", UniqueTarget.Global),
|
||||||
|
@Deprecated("as of 3.18.17", ReplaceWith("[-amount]% Culture cost of adopting new Policies"), DeprecationLevel.ERROR)
|
||||||
|
LessPolicyCostDeprecated("Culture cost of adopting new Policies reduced by [amount]%", UniqueTarget.Global),
|
||||||
|
@Deprecated("as of 3.19.1", ReplaceWith("[amount]% Culture cost of adopting new Policies"), DeprecationLevel.ERROR)
|
||||||
|
LessPolicyCostDeprecated2("[amount]% Culture cost of adopting new policies", UniqueTarget.Global),
|
||||||
|
@Deprecated("as of 3.18.17", ReplaceWith("[+amount]% resources gifted by City-States"), DeprecationLevel.ERROR)
|
||||||
|
CityStateResourcesDeprecated("Quantity of Resources gifted by City-States increased by [amount]%", UniqueTarget.Global),
|
||||||
|
@Deprecated("as of 3.18.17", ReplaceWith("[-amount]% City-State Influence degradation"), DeprecationLevel.ERROR)
|
||||||
|
CityStateInfluenceDegradationDeprecated("City-State Influence degrades [amount]% slower", UniqueTarget.Global),
|
||||||
|
@Deprecated("as of 3.18.17", ReplaceWith("[+amount]% Happiness from luxury resources gifted by City-States"), DeprecationLevel.ERROR)
|
||||||
|
CityStateLuxuryHappinessDeprecated("Happiness from Luxury Resources gifted by City-States increased by [amount]%", UniqueTarget.Global),
|
||||||
|
@Deprecated("as of 3.18.17", ReplaceWith("[+amount]% [stat] from every [tileFilter/specialist/buildingName]"), DeprecationLevel.ERROR)
|
||||||
|
StatPercentSignedFromObject("+[amount]% [stat] from every [tileFilter/specialist/buildingName]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
||||||
|
@Deprecated("as of 3.18.17", ReplaceWith("[+amount]% Yield from every [tileFilter]"), DeprecationLevel.ERROR)
|
||||||
|
AllStatsSignedPercentFromObject("+[amount]% yield from every [tileFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
||||||
|
|
||||||
|
@Deprecated("as of 3.18.14", ReplaceWith("[stats] [in all cities] <before discovering [tech]>\" OR \"[stats] [in all cities] <before adopting [policy]>"), DeprecationLevel.ERROR)
|
||||||
StatsFromCitiesBefore("[stats] per turn from cities before [tech/policy]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
StatsFromCitiesBefore("[stats] per turn from cities before [tech/policy]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
||||||
|
|
||||||
@Deprecated("as of 3.18.12", ReplaceWith("[amount]% XP gained from combat"), DeprecationLevel.WARNING)
|
@Deprecated("as of 3.18.12", ReplaceWith("[amount]% XP gained from combat"), DeprecationLevel.WARNING)
|
||||||
@ -838,7 +841,7 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
|
|||||||
@Deprecated("Extremely old - used for auto-updates only", ReplaceWith("Can build [Land] improvements on tiles"), DeprecationLevel.ERROR)
|
@Deprecated("Extremely old - used for auto-updates only", ReplaceWith("Can build [Land] improvements on tiles"), DeprecationLevel.ERROR)
|
||||||
CanBuildImprovementsOnTiles("Can build improvements on tiles", UniqueTarget.Unit),
|
CanBuildImprovementsOnTiles("Can build improvements on tiles", UniqueTarget.Unit),
|
||||||
|
|
||||||
@Deprecated("Extremely old - used for auto-updates only", ReplaceWith("[+1] Happiness from each type of luxury resource"))
|
@Deprecated("Extremely old - used for auto-updates only", ReplaceWith("[+1] Happiness from each type of luxury resource"), DeprecationLevel.ERROR)
|
||||||
BonusHappinessFromLuxuryDeprecated2("+1 happiness from each type of luxury resource", UniqueTarget.Global),
|
BonusHappinessFromLuxuryDeprecated2("+1 happiness from each type of luxury resource", UniqueTarget.Global),
|
||||||
|
|
||||||
@Deprecated("Extremely old - used for auto-updates only", ReplaceWith("Science gained from research agreements [+50]%"), DeprecationLevel.ERROR)
|
@Deprecated("Extremely old - used for auto-updates only", ReplaceWith("Science gained from research agreements [+50]%"), DeprecationLevel.ERROR)
|
||||||
@ -848,7 +851,7 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
|
|||||||
DecreasedUnitMaintenanceCostsGlobally2("-33% unit upkeep costs", UniqueTarget.Global),
|
DecreasedUnitMaintenanceCostsGlobally2("-33% unit upkeep costs", UniqueTarget.Global),
|
||||||
@Deprecated("Extremely old - used for auto-updates only", ReplaceWith("[-50]% Food consumption by specialists [in all cities]"), DeprecationLevel.ERROR)
|
@Deprecated("Extremely old - used for auto-updates only", ReplaceWith("[-50]% Food consumption by specialists [in all cities]"), DeprecationLevel.ERROR)
|
||||||
FoodConsumptionBySpecialistsDeprecated2("-50% food consumption by specialists", UniqueTarget.Global),
|
FoodConsumptionBySpecialistsDeprecated2("-50% food consumption by specialists", UniqueTarget.Global),
|
||||||
@Deprecated("Extremely old - used for auto-updates only", ReplaceWith("[+50]% Strength for cities <with a garrison> <when attacking>"))
|
@Deprecated("Extremely old - used for auto-updates only", ReplaceWith("[+50]% Strength for cities <with a garrison> <when attacking>"), DeprecationLevel.ERROR)
|
||||||
StrengthForGarrisonedCitiesAttackingDeprecated("+50% attacking strength for cities with garrisoned units", UniqueTarget.Global),
|
StrengthForGarrisonedCitiesAttackingDeprecated("+50% attacking strength for cities with garrisoned units", UniqueTarget.Global),
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
@ -487,10 +487,6 @@ object UnitActions {
|
|||||||
action = {
|
action = {
|
||||||
// http://civilization.wikia.com/wiki/Great_Merchant_(Civ5)
|
// http://civilization.wikia.com/wiki/Great_Merchant_(Civ5)
|
||||||
var goldEarned = (350 + 50 * unit.civInfo.getEraNumber()) * unit.civInfo.gameInfo.gameParameters.gameSpeed.modifier
|
var goldEarned = (350 + 50 * unit.civInfo.getEraNumber()) * unit.civInfo.gameInfo.gameParameters.gameSpeed.modifier
|
||||||
// Deprecated since 3.18.17
|
|
||||||
if (unit.civInfo.hasUnique(UniqueType.DoubleGoldFromTradeMissions))
|
|
||||||
goldEarned *= 2f
|
|
||||||
//
|
|
||||||
for (goldUnique in unit.civInfo.getMatchingUniques(UniqueType.PercentGoldFromTradeMissions))
|
for (goldUnique in unit.civInfo.getMatchingUniques(UniqueType.PercentGoldFromTradeMissions))
|
||||||
goldEarned *= goldUnique.params[0].toPercent()
|
goldEarned *= goldUnique.params[0].toPercent()
|
||||||
unit.civInfo.addGold(goldEarned.toInt())
|
unit.civInfo.addGold(goldEarned.toInt())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user