mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-13 12:27:40 +07:00
Added 'upon ending turn in tile' unit trigger
This commit is contained in:
parent
ec1b2b5077
commit
8361d68452
@ -6,6 +6,7 @@ import com.unciv.logic.civilization.LocationAction
|
|||||||
import com.unciv.logic.civilization.NotificationCategory
|
import com.unciv.logic.civilization.NotificationCategory
|
||||||
import com.unciv.logic.civilization.NotificationIcon
|
import com.unciv.logic.civilization.NotificationIcon
|
||||||
import com.unciv.logic.map.tile.RoadStatus
|
import com.unciv.logic.map.tile.RoadStatus
|
||||||
|
import com.unciv.models.ruleset.unique.UniqueTriggerActivation
|
||||||
import com.unciv.models.ruleset.unique.UniqueType
|
import com.unciv.models.ruleset.unique.UniqueType
|
||||||
|
|
||||||
class UnitTurnManager(val unit: MapUnit) {
|
class UnitTurnManager(val unit: MapUnit) {
|
||||||
@ -56,6 +57,11 @@ class UnitTurnManager(val unit: MapUnit) {
|
|||||||
doTerrainDamage()
|
doTerrainDamage()
|
||||||
|
|
||||||
unit.addMovementMemory()
|
unit.addMovementMemory()
|
||||||
|
|
||||||
|
for (unique in unit.getTriggeredUniques(UniqueType.TriggerUponEndingTurnInTile))
|
||||||
|
if (unique.conditionals.any { it.type == UniqueType.TriggerUponEndingTurnInTile
|
||||||
|
&& unit.getTile().matchesFilter(it.params[0]) })
|
||||||
|
UniqueTriggerActivation.triggerUnitwideUnique(unique, unit)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -736,6 +736,7 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
|
|||||||
TriggerUponDefeat("upon being defeated", UniqueTarget.UnitTriggerCondition),
|
TriggerUponDefeat("upon being defeated", UniqueTarget.UnitTriggerCondition),
|
||||||
TriggerUponPromotion("upon being promoted", UniqueTarget.UnitTriggerCondition),
|
TriggerUponPromotion("upon being promoted", UniqueTarget.UnitTriggerCondition),
|
||||||
TriggerUponLosingHealth("upon losing at least [amount] HP in a single attack", UniqueTarget.UnitTriggerCondition),
|
TriggerUponLosingHealth("upon losing at least [amount] HP in a single attack", UniqueTarget.UnitTriggerCondition),
|
||||||
|
TriggerUponEndingTurnInTile("upon ending a turn in a [tileFilter] tile", UniqueTarget.UnitTriggerCondition),
|
||||||
|
|
||||||
//endregion
|
//endregion
|
||||||
|
|
||||||
|
@ -92,9 +92,6 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
|
|||||||
|
|
||||||
Applicable to: Triggerable
|
Applicable to: Triggerable
|
||||||
|
|
||||||
??? example "Will not be displayed in Civilopedia"
|
|
||||||
Applicable to: Triggerable, UnitTriggerable, Global, Nation, Era, Tech, Policy, FounderBelief, FollowerBelief, Building, Wonder, Unit, UnitType, Promotion, Terrain, Improvement, Resource, Ruins, Speed, Tutorial, CityState, ModOptions, Conditional, TriggerCondition, UnitTriggerCondition
|
|
||||||
|
|
||||||
## UnitTriggerable uniques
|
## UnitTriggerable uniques
|
||||||
??? example "Heal this unit by [amount] HP"
|
??? example "Heal this unit by [amount] HP"
|
||||||
Example: "Heal this unit by [3] HP"
|
Example: "Heal this unit by [3] HP"
|
||||||
@ -841,6 +838,9 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
|
|||||||
|
|
||||||
Applicable to: Nation
|
Applicable to: Nation
|
||||||
|
|
||||||
|
??? example "Will not be displayed in Civilopedia"
|
||||||
|
Applicable to: Nation, Tech, Policy, Building, Unit, Promotion, Terrain, Improvement, Resource, Ruins
|
||||||
|
|
||||||
## Era uniques
|
## Era uniques
|
||||||
??? example "Starting in this era disables religion"
|
??? example "Starting in this era disables religion"
|
||||||
Applicable to: Era
|
Applicable to: Era
|
||||||
@ -1962,6 +1962,11 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
|
|||||||
|
|
||||||
Applicable to: UnitTriggerCondition
|
Applicable to: UnitTriggerCondition
|
||||||
|
|
||||||
|
??? example "<upon ending a turn in a [tileFilter] tile>"
|
||||||
|
Example: "<upon ending a turn in a [Farm] tile>"
|
||||||
|
|
||||||
|
Applicable to: UnitTriggerCondition
|
||||||
|
|
||||||
|
|
||||||
*[action]: An action that a unit can perform. Currently, there are only two actions part of this: 'Spread Religion' and 'Remove Foreign religions from your own cities'
|
*[action]: An action that a unit can perform. Currently, there are only two actions part of this: 'Spread Religion' and 'Remove Foreign religions from your own cities'
|
||||||
*[amount]: This indicates a whole number, possibly with a + or - sign, such as `2`, `+13`, or `-3`.
|
*[amount]: This indicates a whole number, possibly with a + or - sign, such as `2`, `+13`, or `-3`.
|
||||||
|
Loading…
Reference in New Issue
Block a user