mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-05 21:11:35 +07:00
Fix build errors (#11000)
* Fix build errors * [+30%]% * Apparently I need to specify cities or units * Screw it, add "vs [combatantFilter]" * Accidental listing twice * case
This commit is contained in:
parent
74ca1d43e8
commit
cc8a0ab9eb
@ -653,7 +653,7 @@
|
||||
"innerColor": [255,120,0],
|
||||
"favoredReligion": "Tengriism",
|
||||
"uniqueName": "Mongol Terror",
|
||||
"uniques": ["+30% Strength when fighting City-State units and cities", "[+1] Movement <for [Mounted] units>"],
|
||||
"uniques": ["[+30]% Strength <vs [City-States]>", "[+1] Movement <for [Mounted] units>"],
|
||||
"cities": ["Karakorum","Beshbalik","Turfan","Hsia","Old Sarai","New Sarai","Tabriz","Tiflis","Otrar","Sanchu","Kazan",
|
||||
"Almarikh","Ulaanbaatar","Hovd","Darhan","Dalandzadgad","Mandalgovi","Choybalsan","Erdenet","Tsetserieg",
|
||||
"Baruun-Urt","Ereen","Batshireet","Choyr","Ulaangom","Tosontsengel","Altay","Uliastay","Bayanhongor",
|
||||
|
@ -607,7 +607,7 @@
|
||||
"outerColor": [81,0,9],
|
||||
"innerColor": [255,120,0],
|
||||
"uniqueName": "Mongol Terror",
|
||||
"uniques": ["+30% Strength when fighting City-State units and cities", "[+1] Movement <for [Mounted] units>"],
|
||||
"uniques": ["[+30]% Strength <vs [City-States]>", "[+1] Movement <for [Mounted] units>"],
|
||||
"cities": ["Karakorum","Beshbalik","Turfan","Hsia","Old Sarai","New Sarai","Tabriz","Tiflis","Otrar","Sanchu","Kazan",
|
||||
"Almarikh","Ulaanbaatar","Hovd","Darhan","Dalandzadgad","Mandalgovi","Choybalsan","Erdenet","Tsetserieg",
|
||||
"Baruun-Urt","Ereen","Batshireet","Choyr","Ulaangom","Tosontsengel","Altay","Uliastay","Bayanhongor",
|
||||
|
@ -109,12 +109,6 @@ object BattleDamage {
|
||||
if (strengthMalus != null) {
|
||||
modifiers.add("Adjacent enemy units", strengthMalus.params[0].toInt())
|
||||
}
|
||||
|
||||
// e.g., Mongolia - https://civilization.fandom.com/wiki/Mongolian_(Civ5)
|
||||
if (enemy.getCivInfo().isCityState()
|
||||
&& civInfo.hasUnique(UniqueType.StrengthBonusVsCityStates)
|
||||
)
|
||||
modifiers["vs [City-States]"] = 30
|
||||
}
|
||||
|
||||
private fun addResourceLackingMalus(combatant: MapUnitCombatant, modifiers: Counter<String>) {
|
||||
|
@ -34,8 +34,7 @@ class TileImprovement : RulesetStatsObject() {
|
||||
|
||||
fun getTurnsToBuild(civInfo: Civilization, unit: MapUnit): Int {
|
||||
val state = StateForConditionals(civInfo, unit = unit)
|
||||
val buildSpeedUniques = unit.getMatchingUniques(UniqueType.TileImprovementTime, state, checkCivInfoUniques = true) +
|
||||
unit.getMatchingUniques(UniqueType.SpecificImprovementTime, state, checkCivInfoUniques = true)
|
||||
val buildSpeedUniques = unit.getMatchingUniques(UniqueType.SpecificImprovementTime, state, checkCivInfoUniques = true)
|
||||
.filter { matchesFilter(it.params[1]) }
|
||||
return buildSpeedUniques
|
||||
.fold(turnsToBuild.toFloat() * civInfo.gameInfo.speed.improvementBuildLengthModifier) { calculatedTurnsToBuild, unique ->
|
||||
|
@ -300,7 +300,7 @@ class Unique(val text: String, val sourceObjectType: UniqueTarget? = null, val s
|
||||
checkOnCity { getCenterTile().militaryUnit?.canGarrison() == true }
|
||||
|
||||
UniqueType.ConditionalVsCity -> state.theirCombatant?.matchesFilter("City") == true
|
||||
UniqueType.ConditionalVsUnits -> state.theirCombatant?.matchesFilter(condition.params[0]) == true
|
||||
UniqueType.ConditionalVsUnits, UniqueType.ConditionalVsCombatant -> state.theirCombatant?.matchesFilter(condition.params[0]) == true
|
||||
UniqueType.ConditionalOurUnit, UniqueType.ConditionalOurUnitOnUnit ->
|
||||
relevantUnit?.matchesFilter(condition.params[0]) == true
|
||||
UniqueType.ConditionalUnitWithPromotion -> relevantUnit?.promotions?.promotions?.contains(condition.params[0]) == true
|
||||
|
@ -83,9 +83,12 @@ enum class UniqueParameterType(
|
||||
/** Implemented by [ICombatant.matchesCategory][com.unciv.logic.battle.ICombatant.matchesFilter] */
|
||||
CombatantFilter("combatantFilter", "City", "This indicates a combatant, which can either be a unit or a city (when bombarding). Must either be `City` or a `mapUnitFilter`") {
|
||||
override fun getErrorSeverity(parameterText: String, ruleset: Ruleset):
|
||||
UniqueType.UniqueParameterErrorSeverity? {
|
||||
if (parameterText == "City") return null // City also recognizes "All" but that's covered by BaseUnitFilter too
|
||||
return MapUnitFilter.getErrorSeverity(parameterText, ruleset)
|
||||
UniqueType.UniqueParameterErrorSeverity? = getErrorSeverityForFilter(parameterText, ruleset)
|
||||
|
||||
override fun isKnownValue(parameterText: String, ruleset: Ruleset): Boolean {
|
||||
if (parameterText == "City") return true // MapUnitFilter covers CivFilter
|
||||
if (MapUnitFilter.isKnownValue(parameterText, ruleset)) return true
|
||||
return false
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -344,7 +344,7 @@ enum class UniqueType(
|
||||
Strength("[relativeAmount]% Strength", UniqueTarget.Unit, UniqueTarget.Global),
|
||||
StrengthNearCapital("[relativeAmount]% Strength decreasing with distance from the capital", UniqueTarget.Unit, UniqueTarget.Global),
|
||||
FlankAttackBonus("[relativeAmount]% to Flank Attack bonuses", UniqueTarget.Unit, UniqueTarget.Global),
|
||||
@Deprecated("as of 4.9.0",ReplaceWith("[+30%]% Strength <vs []>"), DeprecationLevel.ERROR)
|
||||
@Deprecated("as of 4.9.0",ReplaceWith("[+30]% Strength <vs [City-States]>"), DeprecationLevel.ERROR)
|
||||
StrengthBonusVsCityStates("+30% Strength when fighting City-State units and cities", UniqueTarget.Global),
|
||||
StrengthForAdjacentEnemies("[relativeAmount]% Strength for enemy [combatantFilter] units in adjacent [tileFilter] tiles", UniqueTarget.Unit),
|
||||
StrengthWhenStacked("[relativeAmount]% Strength when stacked with [mapUnitFilter]", UniqueTarget.Unit), // candidate for conditional!
|
||||
@ -664,6 +664,7 @@ enum class UniqueType(
|
||||
ConditionalUnitWithoutPromotion("for units without [promotion]", UniqueTarget.Conditional),
|
||||
ConditionalVsCity("vs cities", UniqueTarget.Conditional),
|
||||
ConditionalVsUnits("vs [mapUnitFilter] units", UniqueTarget.Conditional),
|
||||
ConditionalVsCombatant("vs [combatantFilter]", UniqueTarget.Conditional),
|
||||
ConditionalVsLargerCiv("when fighting units from a Civilization with more Cities than you", UniqueTarget.Conditional),
|
||||
ConditionalAttacking("when attacking", UniqueTarget.Conditional),
|
||||
ConditionalDefending("when defending", UniqueTarget.Conditional),
|
||||
|
Loading…
Reference in New Issue
Block a user