mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-11 00:08:58 +07:00
Added unique type documentation in wiki
This commit is contained in:
@ -8,54 +8,58 @@ import com.unciv.models.translations.getPlaceholderText
|
|||||||
|
|
||||||
/** inheritsFrom means that all such uniques are acceptable as well.
|
/** inheritsFrom means that all such uniques are acceptable as well.
|
||||||
* For example, all Global uniques are acceptable for Nations, Eras, etc. */
|
* For example, all Global uniques are acceptable for Nations, Eras, etc. */
|
||||||
enum class UniqueTarget(val inheritsFrom: UniqueTarget? = null) {
|
enum class UniqueTarget(val documentationString:String = "", val inheritsFrom: UniqueTarget? = null) {
|
||||||
|
|
||||||
/** Only includes uniques that have immediate effects, caused by UniqueTriggerActivation */
|
/** Only includes uniques that have immediate effects, caused by UniqueTriggerActivation */
|
||||||
Triggerable,
|
Triggerable("Uniques that have immediate, one-time effects." +
|
||||||
UnitTriggerable(Triggerable),
|
"These can be added to techs to trigger when researched, to policies to trigger when adpoted, " +
|
||||||
|
"to eras to trigger when reached, to buildings to trigger when built. " +
|
||||||
|
"Alternatively, you can add a TriggerCondition to them to make them into Global uniques that activate upon a specific event." +
|
||||||
|
"They can also be added to units to grant them the ability to trigger this effect as an action, " +
|
||||||
|
"which can be modified with UnitActionModifier and UnitTriggerCondition conditionals."),
|
||||||
|
|
||||||
|
UnitTriggerable("Uniques that have immediate, one-time effects on a unit." +
|
||||||
|
"They can be added to units to grant them the ability to trigger this effect as an action, " +
|
||||||
|
"which can be modified with UnitActionModifier and UnitTriggerCondition conditionals.", Triggerable),
|
||||||
|
|
||||||
/** Buildings, units, nations, policies, religions, techs etc.
|
/** Buildings, units, nations, policies, religions, techs etc.
|
||||||
* Basically anything caught by CivInfo.getMatchingUniques. */
|
* Basically anything caught by CivInfo.getMatchingUniques. */
|
||||||
Global(Triggerable),
|
Global("Uniques that apply globally. " +
|
||||||
|
"Civs gain the abilities of these uniques from nation uniques, reached eras, researched techs, adopted policies, " +
|
||||||
|
"built buildings, religion 'founder' uniques, owned resources, and ruleset-wide global uniques.", Triggerable),
|
||||||
|
|
||||||
// Civilization-specific
|
// Civilization-specific
|
||||||
Nation(Global),
|
Nation(inheritsFrom = Global),
|
||||||
Era(Global),
|
Era(inheritsFrom = Global),
|
||||||
Tech(Global),
|
Tech(inheritsFrom = Global),
|
||||||
Policy(Global),
|
Policy(inheritsFrom = Global),
|
||||||
FounderBelief(Global),
|
FounderBelief("Uniques that apply to the founder of this religion", inheritsFrom = Global),
|
||||||
/** These apply only to cities where the religion is the majority religion */
|
FollowerBelief("Uniques that apply to each city where the religion is the majority religion"),
|
||||||
FollowerBelief,
|
|
||||||
|
|
||||||
// City-specific
|
// City-specific
|
||||||
/** This is used as the base when checking buildings */
|
/** This is used as the base when checking buildings */
|
||||||
Building(Global),
|
Building("Uniques that can only be added to buildings", Global),
|
||||||
Wonder(Building),
|
Wonder(inheritsFrom = Building),
|
||||||
|
|
||||||
// Unit-specific
|
Unit("Uniques that can be added to units, unit types, or promotions", inheritsFrom = UnitTriggerable),
|
||||||
// These are a bit of a lie. There's no "Promotion only" or "UnitType only" uniques,
|
UnitType(inheritsFrom = Unit),
|
||||||
// they're all just Unit uniques in different places.
|
Promotion(inheritsFrom = Unit),
|
||||||
// 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(UnitTriggerable),
|
|
||||||
UnitType(Unit),
|
|
||||||
Promotion(Unit),
|
|
||||||
|
|
||||||
// Tile-specific
|
// Tile-specific
|
||||||
Terrain,
|
Terrain,
|
||||||
Improvement,
|
Improvement,
|
||||||
Resource(Global),
|
Resource(inheritsFrom = Global),
|
||||||
Ruins(UnitTriggerable),
|
Ruins(inheritsFrom = UnitTriggerable),
|
||||||
|
|
||||||
// Other
|
// Other
|
||||||
Speed,
|
Speed,
|
||||||
Tutorial,
|
Tutorial,
|
||||||
CityState(Global),
|
CityState(inheritsFrom = Global),
|
||||||
ModOptions,
|
ModOptions,
|
||||||
Conditional,
|
Conditional("Modifiers that can be added to other uniques to limit when they will be active"),
|
||||||
TriggerCondition(Global),
|
TriggerCondition("Special conditionals that can be added to Triggerable uniques, to make them activate upon specific actions.", inheritsFrom = Global),
|
||||||
UnitTriggerCondition(TriggerCondition),
|
UnitTriggerCondition("Special conditionals that can be added to UnitTriggerable uniques, to make them activate upon specific actions.", inheritsFrom = TriggerCondition),
|
||||||
UnitActionModifier,
|
UnitActionModifier("Modifiers that can be added to unit action uniques as conditionals"),
|
||||||
;
|
;
|
||||||
|
|
||||||
fun canAcceptUniqueTarget(uniqueTarget: UniqueTarget): Boolean {
|
fun canAcceptUniqueTarget(uniqueTarget: UniqueTarget): Boolean {
|
||||||
|
@ -642,7 +642,8 @@ class WorldScreen(
|
|||||||
debug("Next turn took %sms", System.currentTimeMillis() - startTime)
|
debug("Next turn took %sms", System.currentTimeMillis() - startTime)
|
||||||
|
|
||||||
// Special case: when you are the only alive human player, the game will always be up to date
|
// Special case: when you are the only alive human player, the game will always be up to date
|
||||||
if (gameInfo.gameParameters.isOnlineMultiplayer && gameInfoClone.civilizations.filter { it.isAlive() && it.playerType == PlayerType.Human }.size == 1) {
|
if (gameInfo.gameParameters.isOnlineMultiplayer
|
||||||
|
&& gameInfoClone.civilizations.count { it.isAlive() && it.playerType == PlayerType.Human } == 1) {
|
||||||
gameInfoClone.isUpToDate = true
|
gameInfoClone.isUpToDate = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,6 +63,10 @@ class UniqueDocsWriter {
|
|||||||
for ((targetType, uniqueTypes) in targetTypesToUniques) {
|
for ((targetType, uniqueTypes) in targetTypesToUniques) {
|
||||||
if (uniqueTypes.isEmpty()) continue
|
if (uniqueTypes.isEmpty()) continue
|
||||||
lines += "## " + targetType.name + " uniques"
|
lines += "## " + targetType.name + " uniques"
|
||||||
|
|
||||||
|
if (targetType.documentationString.isNotEmpty())
|
||||||
|
lines += "!!! note \"\"\n\n ${targetType.documentationString}"
|
||||||
|
|
||||||
for (uniqueType in uniqueTypes) {
|
for (uniqueType in uniqueTypes) {
|
||||||
if (uniqueType.getDeprecationAnnotation() != null) continue
|
if (uniqueType.getDeprecationAnnotation() != null) continue
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user