mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-10 04:43:29 +07:00
Special type for unit triggerables
This commit is contained in:
parent
8c9877365d
commit
a47864ecac
@ -11,6 +11,8 @@ enum class UniqueTarget(val inheritsFrom: UniqueTarget? = null) {
|
||||
|
||||
/** Only includes uniques that have immediate effects, caused by UniqueTriggerActivation */
|
||||
Triggerable,
|
||||
UnitTriggerable(Triggerable),
|
||||
|
||||
/** Buildings, units, nations, policies, religions, techs etc.
|
||||
* Basically anything caught by CivInfo.getMatchingUniques. */
|
||||
Global(Triggerable),
|
||||
@ -34,7 +36,7 @@ enum class UniqueTarget(val inheritsFrom: UniqueTarget? = null) {
|
||||
// they're all just Unit uniques in different places.
|
||||
// So there should be no uniqueType that has a Promotion or UnitType target.
|
||||
// Except meta-level uniques, such as 'incompatible with [promotion]', of course
|
||||
Unit,
|
||||
Unit(UnitTriggerable),
|
||||
UnitType(Unit),
|
||||
Promotion(Unit),
|
||||
|
||||
@ -689,11 +691,11 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
|
||||
OneTimeGlobalAlert("Triggers the following global alert: [comment]", UniqueTarget.Policy), // used in Policy
|
||||
OneTimeGlobalSpiesWhenEnteringEra("Every major Civilization gains a spy once a civilization enters this era", UniqueTarget.Era),
|
||||
|
||||
OneTimeUnitHeal("Heal this unit by [amount] HP", UniqueTarget.Unit),
|
||||
OneTimeUnitGainXP("This Unit gains [amount] XP", UniqueTarget.Ruins, UniqueTarget.Unit),
|
||||
OneTimeUnitUpgrade("This Unit upgrades for free", UniqueTarget.Global, UniqueTarget.Unit), // Not used in Vanilla
|
||||
OneTimeUnitHeal("Heal this unit by [amount] HP", UniqueTarget.UnitTriggerable),
|
||||
OneTimeUnitGainXP("This Unit gains [amount] XP", UniqueTarget.Ruins, UniqueTarget.UnitTriggerable),
|
||||
OneTimeUnitUpgrade("This Unit upgrades for free", UniqueTarget.Global, UniqueTarget.UnitTriggerable), // Not used in Vanilla
|
||||
OneTimeUnitSpecialUpgrade("This Unit upgrades for free including special upgrades", UniqueTarget.Ruins),
|
||||
OneTimeUnitGainPromotion("This Unit gains the [promotion] promotion", UniqueTarget.Triggerable, UniqueTarget.Unit), // Not used in Vanilla
|
||||
OneTimeUnitGainPromotion("This Unit gains the [promotion] promotion", UniqueTarget.UnitTriggerable), // Not used in Vanilla
|
||||
SkipPromotion("Doing so will consume this opportunity to choose a Promotion", UniqueTarget.Promotion),
|
||||
|
||||
UnitsGainPromotion("[mapUnitFilter] units gain the [promotion] promotion", UniqueTarget.Triggerable), // Not used in Vanilla
|
||||
|
@ -39,7 +39,7 @@ class UniqueDocsWriter {
|
||||
// The UniqueType are shown in enum order within their group, and groups are ordered
|
||||
// by their UniqueTarget.ordinal as well - source code order.
|
||||
val targetTypesToUniques: Map<UniqueTarget, List<UniqueType>> =
|
||||
if(showUniqueOnOneTarget)
|
||||
if (showUniqueOnOneTarget)
|
||||
UniqueType.values().asSequence()
|
||||
.groupBy { it.targetTypes.minOrNull()!! }
|
||||
.toSortedMap()
|
||||
|
Loading…
Reference in New Issue
Block a user