mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-29 23:10:39 -04:00
Typed deprecated uniques so modders have warnings
This commit is contained in:
parent
ef2f2eccde
commit
8b2bb8e59b
@ -420,15 +420,15 @@ class CityStats(val cityInfo: CityInfo) {
|
|||||||
unhappinessFromCitizens *= 2f
|
unhappinessFromCitizens *= 2f
|
||||||
|
|
||||||
// Deprecated since 3.16.11
|
// Deprecated since 3.16.11
|
||||||
for (unique in civInfo.getMatchingUniques("Unhappiness from population decreased by []%"))
|
for (unique in civInfo.getMatchingUniques(UniqueType.UnhappinessFromPopulationPercentageChangeOld1))
|
||||||
unhappinessFromCitizens *= (1 - unique.params[0].toFloat() / 100)
|
unhappinessFromCitizens *= (1 - unique.params[0].toFloat() / 100)
|
||||||
|
|
||||||
for (unique in civInfo.getMatchingUniques("Unhappiness from population decreased by []% []"))
|
for (unique in civInfo.getMatchingUniques(UniqueType.UnhappinessFromPopulationPercentageChangeOld2))
|
||||||
if (cityInfo.matchesFilter(unique.params[1]))
|
if (cityInfo.matchesFilter(unique.params[1]))
|
||||||
unhappinessFromCitizens *= (1 - unique.params[0].toFloat() / 100)
|
unhappinessFromCitizens *= (1 - unique.params[0].toFloat() / 100)
|
||||||
//
|
//
|
||||||
|
|
||||||
for (unique in cityInfo.getMatchingUniques("[]% unhappiness from population []"))
|
for (unique in cityInfo.getMatchingUniques(UniqueType.UnhappinessFromPopulationPercentageChange))
|
||||||
if (cityInfo.matchesFilter(unique.params[1]))
|
if (cityInfo.matchesFilter(unique.params[1]))
|
||||||
unhappinessFromCitizens *= unique.params[0].toPercent()
|
unhappinessFromCitizens *= unique.params[0].toPercent()
|
||||||
|
|
||||||
|
@ -328,8 +328,8 @@ class MapUnit {
|
|||||||
|
|
||||||
// Deprecated since 3.16.11
|
// Deprecated since 3.16.11
|
||||||
if (isEmbarked()) {
|
if (isEmbarked()) {
|
||||||
movement += civInfo.getMatchingUniques("Increases embarked movement +1").count()
|
movement += civInfo.getMatchingUniques(UniqueType.EmbarkedUnitMovement1).count()
|
||||||
if (civInfo.hasUnique("+1 Movement for all embarked units")) movement += 1
|
if (civInfo.hasUnique(UniqueType.EmbarkedUnitMovement2)) movement += 1
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
|
||||||
|
@ -71,6 +71,14 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget) {
|
|||||||
BonusStatsFromCityStates("[amount]% [stat] from City-States", UniqueTarget.Global),
|
BonusStatsFromCityStates("[amount]% [stat] from City-States", UniqueTarget.Global),
|
||||||
|
|
||||||
RemoveAnnexUnhappiness("Remove extra unhappiness from annexed cities", UniqueTarget.Building),
|
RemoveAnnexUnhappiness("Remove extra unhappiness from annexed cities", UniqueTarget.Building),
|
||||||
|
UnhappinessFromPopulationPercentageChange("[amount]% unhappiness from population [cityFilter]", UniqueTarget.Global),
|
||||||
|
|
||||||
|
@Deprecated("As of 3.16.11", ReplaceWith("[amount]% unhappiness from population [cityFilter]"), DeprecationLevel.WARNING)
|
||||||
|
UnhappinessFromPopulationPercentageChangeOld1("Unhappiness from population decreased by [amount]%", UniqueTarget.Global),
|
||||||
|
@Deprecated("As of 3.16.11", ReplaceWith("[amount]% unhappiness from population [cityFilter]"), DeprecationLevel.WARNING)
|
||||||
|
UnhappinessFromPopulationPercentageChangeOld2("Unhappiness from population decreased by [amount]% [cityFilter]", UniqueTarget.Global),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
StatsFromSpecialist("[stats] from every specialist [cityFilter]", UniqueTarget.Global),
|
StatsFromSpecialist("[stats] from every specialist [cityFilter]", UniqueTarget.Global),
|
||||||
@Deprecated("As of 3.16.16", ReplaceWith("[stats] from every specialist [in all cities]"), DeprecationLevel.WARNING)
|
@Deprecated("As of 3.16.16", ReplaceWith("[stats] from every specialist [in all cities]"), DeprecationLevel.WARNING)
|
||||||
@ -178,6 +186,10 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget) {
|
|||||||
NormalVisionWhenEmbarked("Normal vision when embarked", UniqueTarget.Unit, UniqueTarget.Global),
|
NormalVisionWhenEmbarked("Normal vision when embarked", UniqueTarget.Unit, UniqueTarget.Global),
|
||||||
CannotAttack("Cannot attack", UniqueTarget.Unit),
|
CannotAttack("Cannot attack", UniqueTarget.Unit),
|
||||||
|
|
||||||
|
@Deprecated("As of 3.16.11", ReplaceWith("[+1] Movement <for [Embarked] units>"), DeprecationLevel.WARNING)
|
||||||
|
EmbarkedUnitMovement1("Increases embarked movement +1", UniqueTarget.Global),
|
||||||
|
@Deprecated("As of 3.16.11", ReplaceWith("[+1] Movement <for [Embarked] units>"), DeprecationLevel.WARNING)
|
||||||
|
EmbarkedUnitMovement2("+1 Movement for all embarked units", UniqueTarget.Global),
|
||||||
@Deprecated("As of 3.17.5", ReplaceWith("[amount] Movement <for [mapUnitFilter] units>"), DeprecationLevel.WARNING)
|
@Deprecated("As of 3.17.5", ReplaceWith("[amount] Movement <for [mapUnitFilter] units>"), DeprecationLevel.WARNING)
|
||||||
MovementUnits("+[amount] Movement for all [mapUnitFilter] units", UniqueTarget.Global),
|
MovementUnits("+[amount] Movement for all [mapUnitFilter] units", UniqueTarget.Global),
|
||||||
@Deprecated("As of 3.17.5", ReplaceWith("[amount] Movement <for [All] units> <during a Golden Age>"), DeprecationLevel.WARNING)
|
@Deprecated("As of 3.17.5", ReplaceWith("[amount] Movement <for [All] units> <during a Golden Age>"), DeprecationLevel.WARNING)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user