"by consuming this unit" is better

This commit is contained in:
Yair Morgenstern
2023-03-01 16:35:06 +02:00
parent ae501c3750
commit 5e85c3ca72
6 changed files with 22 additions and 36 deletions

View File

@ -1600,7 +1600,7 @@
"name": "Great Artist",
"unitType": "Civilian",
"uniques": ["Can start an [8]-turn golden age",
"Can instantly construct a [Landmark] improvement <consuming this unit>",
"Can instantly construct a [Landmark] improvement <by consuming this unit>",
"Great Person - [Culture]", "Unbuildable", "Uncapturable"],
"movement": 2
},
@ -1608,7 +1608,7 @@
"name": "Great Scientist",
"unitType": "Civilian",
"uniques": ["Can hurry technology research",
"Can instantly construct a [Academy] improvement <consuming this unit>",
"Can instantly construct a [Academy] improvement <by consuming this unit>",
"Great Person - [Science]", "Unbuildable", "Uncapturable"],
"movement": 2
},
@ -1616,7 +1616,7 @@
"name": "Great Merchant",
"unitType": "Civilian",
"uniques": ["Can undertake a trade mission with City-State, giving a large sum of gold and [30] Influence",
"Can instantly construct a [Customs house] improvement <consuming this unit>",
"Can instantly construct a [Customs house] improvement <by consuming this unit>",
"Great Person - [Gold]", "Unbuildable", "Uncapturable"],
"movement": 2
},
@ -1624,7 +1624,7 @@
"name": "Great Engineer",
"unitType": "Civilian",
"uniques": ["Can speed up construction of a building",
"Can instantly construct a [Manufactory] improvement <consuming this unit>",
"Can instantly construct a [Manufactory] improvement <by consuming this unit>",
"Great Person - [Production]", "Unbuildable", "Uncapturable"],
"movement": 2
},
@ -1632,7 +1632,7 @@
"name": "Great Prophet",
"unitType": "Civilian",
"uniques": [
"Can instantly construct a [Holy site] improvement <consuming this unit> <if it hasn't used other actions yet>",
"Can instantly construct a [Holy site] improvement <by consuming this unit> <if it hasn't used other actions yet>",
"Can [Spread Religion] [4] times",
"Removes other religions when spreading religion",
"May found a religion",
@ -1647,7 +1647,7 @@
"name": "Great General",
"unitType": "Civilian",
"uniques": ["Can start an [8]-turn golden age", "[+15]% Strength bonus for [Military] units within [2] tiles",
"Can instantly construct a [Citadel] improvement <consuming this unit>",
"Can instantly construct a [Citadel] improvement <by consuming this unit>",
"Great Person - [War]", "Unbuildable", "Uncapturable"],
"movement": 2
},
@ -1658,7 +1658,7 @@
"replaces": "Great General",
"uniques": ["Can start an [8]-turn golden age","[+15]% Strength bonus for [Military] units within [2] tiles",
"All adjacent units heal [+15] HP when healing", "[+15] HP when healing",
"Can instantly construct a [Citadel] improvement <consuming this unit>",
"Can instantly construct a [Citadel] improvement <by consuming this unit>",
"Great Person - [War]", "Unbuildable", "Uncapturable"],
"movement": 5
},

View File

@ -1259,7 +1259,7 @@
"name": "Great Artist",
"unitType": "Civilian",
"uniques": ["Can start an [8]-turn golden age",
"Can instantly construct a [Landmark] improvement <consuming this unit>",
"Can instantly construct a [Landmark] improvement <by consuming this unit>",
"Great Person - [Culture]", "Unbuildable", "Uncapturable"],
"movement": 2
},
@ -1267,7 +1267,7 @@
"name": "Great Scientist",
"unitType": "Civilian",
"uniques": ["Can hurry technology research",
"Can instantly construct a [Academy] improvement <consuming this unit>",
"Can instantly construct a [Academy] improvement <by consuming this unit>",
"Great Person - [Science]", "Unbuildable", "Uncapturable"],
"movement": 2
},
@ -1275,7 +1275,7 @@
"name": "Great Merchant",
"unitType": "Civilian",
"uniques": ["Can undertake a trade mission with City-State, giving a large sum of gold and [30] Influence",
"Can instantly construct a [Customs house] improvement <consuming this unit>",
"Can instantly construct a [Customs house] improvement <by consuming this unit>",
"Great Person - [Gold]", "Unbuildable", "Uncapturable"],
"movement": 2
},
@ -1283,7 +1283,7 @@
"name": "Great Engineer",
"unitType": "Civilian",
"uniques": ["Can speed up construction of a building",
"Can instantly construct a [Manufactory] improvement <consuming this unit>",
"Can instantly construct a [Manufactory] improvement <by consuming this unit>",
"Great Person - [Production]", "Unbuildable", "Uncapturable"],
"movement": 2
},
@ -1291,7 +1291,7 @@
"name": "Great Prophet",
"unitType": "Civilian",
"uniques": [
"Can instantly construct a [Holy site] improvement <consuming this unit> <if it hasn't used other actions yet>",
"Can instantly construct a [Holy site] improvement <by consuming this unit> <if it hasn't used other actions yet>",
"Can [Spread Religion] [4] times",
"Removes other religions when spreading religion",
"May found a religion",
@ -1306,7 +1306,7 @@
"name": "Great General",
"unitType": "Civilian",
"uniques": ["Can start an [8]-turn golden age", "[+15]% Strength bonus for [Military] units within [2] tiles",
"Can instantly construct a [Citadel] improvement <consuming this unit>",
"Can instantly construct a [Citadel] improvement <by consuming this unit>",
"Great Person - [War]", "Unbuildable", "Uncapturable"],
"movement": 2
},
@ -1317,7 +1317,7 @@
"replaces": "Great General",
"uniques": ["Can start an [8]-turn golden age", "[+15]% Strength bonus for [Military] units within [2] tiles",
"All adjacent units heal [+15] HP when healing", "[+15] HP when healing",
"Can instantly construct a [Citadel] improvement <consuming this unit>",
"Can instantly construct a [Citadel] improvement <by consuming this unit>",
"Great Person - [War]", "Unbuildable", "Uncapturable"],
"movement": 5
},

View File

@ -542,15 +542,6 @@ class RulesetValidator(val ruleset: Ruleset) {
rulesetErrors.add(deprecationText, severity)
}
if (unique.type.targetTypes.none { uniqueTarget.canAcceptUniqueTarget(it) }
// the 'consume unit' conditional causes a triggerable unique to become a unit action
&& !(uniqueTarget== UniqueTarget.Unit
&& unique.isTriggerable
&& unique.conditionals.any { it.type == UniqueType.UnitActionConsumeUnit }))
rulesetErrors.add(
"$name's unique \"${unique.text}\" cannot be put on this type of object!",
RulesetErrorSeverity.Warning
)
return rulesetErrors
}
}

View File

@ -351,7 +351,7 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
FoundCity("Founds a new city", UniqueTarget.Unit),
ConstructImprovementInstantly("Can instantly construct a [improvementName] improvement", UniqueTarget.Unit),
@Deprecated("as of 4.5.2", ReplaceWith("Can instantly construct a [improvementName] improvement"))
@Deprecated("as of 4.5.2", ReplaceWith("Can instantly construct a [improvementName] improvement <by consuming this unit>"))
ConstructImprovementConsumingUnit("Can construct [improvementName]", UniqueTarget.Unit),
BuildImprovements("Can build [improvementFilter/terrainFilter] improvements on tiles", UniqueTarget.Unit),
CreateWaterImprovements("May create improvements on water resources", UniqueTarget.Unit),
@ -505,10 +505,7 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
///////////////////////////////////////// region UNIT ACTION MODIFIERS /////////////////////////////////////////
UnitActionConsumeUnit("consuming this unit", UniqueTarget.UnitActionModifier),
UnitActionTriggerUnitUnique("as an action", UniqueTarget.UnitActionModifier),
@Deprecated("as of 4.5.2", ReplaceWith("consuming this unit"))
UnitActionConsumeUnitOld("by consuming this unit", UniqueTarget.UnitActionModifier),
UnitActionConsumeUnit("by consuming this unit", UniqueTarget.UnitActionModifier),
// endregion

View File

@ -19,6 +19,7 @@ import com.unciv.models.UnitAction
import com.unciv.models.UnitActionType
import com.unciv.models.ruleset.unique.StateForConditionals
import com.unciv.models.ruleset.unique.Unique
import com.unciv.models.ruleset.unique.UniqueTarget
import com.unciv.models.ruleset.unique.UniqueTriggerActivation
import com.unciv.models.ruleset.unique.UniqueType
import com.unciv.models.translations.removeConditionals
@ -642,7 +643,7 @@ object UnitActions {
private fun addTriggerUniqueActions(unit: MapUnit, actionList: ArrayList<UnitAction>){
for (unique in unit.getUniques()) {
if (!unique.conditionals.any { it.type == UniqueType.UnitActionTriggerUnitUnique }) continue
if (unique.conditionals.none { it.type?.targetTypes?.contains(UniqueTarget.UnitActionModifier) == true }) continue
val unitAction = UnitAction(type = UnitActionType.TriggerUnique, unique.text.removeConditionals()){
UniqueTriggerActivation.triggerUnitwideUnique(unique, unit)
@ -674,11 +675,14 @@ object UnitActions {
}
fun activateSideEffects(unit: MapUnit, actionUnique: Unique){
var conditionalsWithNoSideEffect = 0
for (conditional in actionUnique.conditionals){
when (conditional.type){
UniqueType.UnitActionConsumeUnit -> unit.consume()
else -> unit.useMovementPoints(1f)
else -> conditionalsWithNoSideEffect++
}
}
if (conditionalsWithNoSideEffect == actionUnique.conditionals.size)
unit.useMovementPoints(1f)
}
}

View File

@ -1975,12 +1975,6 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: UnitTriggerCondition
## UnitActionModifier uniques
??? example "&lt;consuming this unit&gt;"
Applicable to: UnitActionModifier
??? example "&lt;as an action&gt;"
Applicable to: UnitActionModifier
??? example "&lt;by consuming this unit&gt;"
Applicable to: UnitActionModifier