mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-12 10:59:55 +07:00
Resolved #5435 - all civ + unit uniques are accounted for in both ways
This commit is contained in:
parent
185050bd9f
commit
fd3bfbade4
@ -302,11 +302,13 @@ class MapUnit {
|
|||||||
if (isEmbarked()) 2
|
if (isEmbarked()) 2
|
||||||
else baseUnit.movement
|
else baseUnit.movement
|
||||||
|
|
||||||
movement += getMatchingUniques(UniqueType.Movement, StateForConditionals(civInfo = civInfo, unit = this))
|
movement += (getMatchingUniques(UniqueType.Movement, StateForConditionals(civInfo = civInfo, unit = this)) +
|
||||||
|
civInfo.getMatchingUniques(UniqueType.Movement, StateForConditionals(civInfo = civInfo, unit = this)))
|
||||||
.sumOf { it.params[0].toInt() }
|
.sumOf { it.params[0].toInt() }
|
||||||
|
|
||||||
// Deprecated since 3.17.5
|
// Deprecated since 3.17.5
|
||||||
for (unique in civInfo.getMatchingUniques(UniqueType.MovementUnits))
|
for (unique in civInfo.getMatchingUniques(UniqueType.MovementUnits)
|
||||||
|
+ getMatchingUniques(UniqueType.MovementUnits))
|
||||||
if (matchesFilter(unique.params[1]))
|
if (matchesFilter(unique.params[1]))
|
||||||
movement += unique.params[0].toInt()
|
movement += unique.params[0].toInt()
|
||||||
|
|
||||||
@ -335,12 +337,14 @@ class MapUnit {
|
|||||||
private fun getVisibilityRange(): Int {
|
private fun getVisibilityRange(): Int {
|
||||||
var visibilityRange = 2
|
var visibilityRange = 2
|
||||||
|
|
||||||
if (isEmbarked() && !hasUnique("Normal vision when embarked")) {
|
if (isEmbarked() && !hasUnique(UniqueType.NormalVisionWhenEmbarked)
|
||||||
|
&& !civInfo.hasUnique(UniqueType.NormalVisionWhenEmbarked)) {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
visibilityRange += getMatchingUniques(UniqueType.Sight, StateForConditionals(civInfo = civInfo, unit = this))
|
visibilityRange += (getMatchingUniques(UniqueType.Sight, StateForConditionals(civInfo = civInfo, unit = this))
|
||||||
.sumOf { it.params[0].toInt() }
|
+ civInfo.getMatchingUniques(UniqueType.Sight, StateForConditionals(civInfo = civInfo, unit = this))
|
||||||
|
).sumOf { it.params[0].toInt() }
|
||||||
|
|
||||||
// Deprecated since 3.17.5
|
// Deprecated since 3.17.5
|
||||||
for (unique in getMatchingUniques(UniqueType.SightUnits))
|
for (unique in getMatchingUniques(UniqueType.SightUnits))
|
||||||
@ -1098,7 +1102,8 @@ class MapUnit {
|
|||||||
pressureAdded *= unique.params[0].toPercent()
|
pressureAdded *= unique.params[0].toPercent()
|
||||||
//
|
//
|
||||||
|
|
||||||
for (unique in getMatchingUniques(UniqueType.SpreadReligionStrength, StateForConditionals(civInfo = civInfo, unit = this)))
|
for (unique in getMatchingUniques(UniqueType.SpreadReligionStrength, StateForConditionals(civInfo = civInfo, unit = this))
|
||||||
|
+ civInfo.getMatchingUniques(UniqueType.SpreadReligionStrength, StateForConditionals(civInfo = civInfo, unit = this)))
|
||||||
pressureAdded *= unique.params[0].toPercent()
|
pressureAdded *= unique.params[0].toPercent()
|
||||||
|
|
||||||
return pressureAdded.toInt()
|
return pressureAdded.toInt()
|
||||||
|
@ -167,6 +167,7 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget) {
|
|||||||
SpreadReligionStrength("[amount]% Spread Religion Strength", UniqueTarget.Unit, UniqueTarget.Global),
|
SpreadReligionStrength("[amount]% Spread Religion Strength", UniqueTarget.Unit, UniqueTarget.Global),
|
||||||
MayFoundReligion("May found a religion", UniqueTarget.Unit),
|
MayFoundReligion("May found a religion", UniqueTarget.Unit),
|
||||||
MayEnhanceReligion("May enhance a religion", UniqueTarget.Unit),
|
MayEnhanceReligion("May enhance a religion", UniqueTarget.Unit),
|
||||||
|
NormalVisionWhenEmbarked("Normal vision when embarked", UniqueTarget.Unit, 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),
|
||||||
|
Loading…
Reference in New Issue
Block a user