From 5361b920ca2f05cf8e7bb78ee4596b3ac8380009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Tue, 4 Nov 2014 23:53:17 +0100 Subject: [PATCH] document various traits --- OpenRA.Game/Traits/Armor.cs | 1 + .../Traits/Power/AffectedByPowerOutage.cs | 1 + OpenRA.Mods.Common/Traits/Power/RequiresPower.cs | 1 + OpenRA.Mods.Common/Traits/World/SpawnMapActors.cs | 3 ++- OpenRA.Mods.Common/Upgrades/UpgradeManager.cs | 1 + OpenRA.Mods.RA/Activities/Hunt.cs | 1 + OpenRA.Mods.RA/AttackMove.cs | 1 + OpenRA.Mods.RA/BridgeHut.cs | 1 + OpenRA.Mods.RA/Buildings/BaseProvider.cs | 1 + OpenRA.Mods.RA/Chronoshiftable.cs | 1 + OpenRA.Mods.RA/CombatDebugOverlay.cs | 1 + OpenRA.Mods.RA/Disguise.cs | 2 ++ OpenRA.Mods.RA/EngineerRepair.cs | 4 +++- OpenRA.Mods.RA/Husk.cs | 1 + .../Infiltration/InfiltrateForExploration.cs | 2 +- OpenRA.Mods.RA/LeavesHusk.cs | 1 + OpenRA.Mods.RA/Render/RenderEditorOnly.cs | 1 + OpenRA.Mods.RA/RepairsBridges.cs | 3 ++- OpenRA.Mods.RA/StrategicVictoryConditions.cs | 14 ++++++++------ OpenRA.Mods.RA/Traits/Air/FallsToEarth.cs | 1 + 20 files changed, 32 insertions(+), 10 deletions(-) diff --git a/OpenRA.Game/Traits/Armor.cs b/OpenRA.Game/Traits/Armor.cs index f1ffd6998e..3db6a0ab2f 100644 --- a/OpenRA.Game/Traits/Armor.cs +++ b/OpenRA.Game/Traits/Armor.cs @@ -10,6 +10,7 @@ namespace OpenRA.Traits { + [Desc("Used to define weapon efficiency modifiers with different percentages per Type.")] public class ArmorInfo : TraitInfo { public readonly string Type = null; diff --git a/OpenRA.Mods.Common/Traits/Power/AffectedByPowerOutage.cs b/OpenRA.Mods.Common/Traits/Power/AffectedByPowerOutage.cs index e302e62956..f354937b36 100644 --- a/OpenRA.Mods.Common/Traits/Power/AffectedByPowerOutage.cs +++ b/OpenRA.Mods.Common/Traits/Power/AffectedByPowerOutage.cs @@ -13,6 +13,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Power { + [Desc("Disables the actor when a power outage is triggered (see `InfiltrateForPowerOutage` for more information).")] public class AffectedByPowerOutageInfo : ITraitInfo { public object Create(ActorInitializer init) { return new AffectedByPowerOutage(init.self); } diff --git a/OpenRA.Mods.Common/Traits/Power/RequiresPower.cs b/OpenRA.Mods.Common/Traits/Power/RequiresPower.cs index 26be0a5d64..41a9ddfdef 100644 --- a/OpenRA.Mods.Common/Traits/Power/RequiresPower.cs +++ b/OpenRA.Mods.Common/Traits/Power/RequiresPower.cs @@ -12,6 +12,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Power { + [Desc("Needs power to operate.")] class RequiresPowerInfo : ITraitInfo { public object Create(ActorInitializer init) { return new RequiresPower(init.self); } diff --git a/OpenRA.Mods.Common/Traits/World/SpawnMapActors.cs b/OpenRA.Mods.Common/Traits/World/SpawnMapActors.cs index 0aa4edcec8..a64fb62ffd 100644 --- a/OpenRA.Mods.Common/Traits/World/SpawnMapActors.cs +++ b/OpenRA.Mods.Common/Traits/World/SpawnMapActors.cs @@ -15,6 +15,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common { + [Desc("Spawns the initial units for each player upon game start.")] public class SpawnMapActorsInfo : TraitInfo { } public class SpawnMapActors : IWorldLoaded @@ -40,5 +41,5 @@ namespace OpenRA.Mods.Common } } - public class SkipMakeAnimsInit : IActorInit {} + public class SkipMakeAnimsInit : IActorInit { } } diff --git a/OpenRA.Mods.Common/Upgrades/UpgradeManager.cs b/OpenRA.Mods.Common/Upgrades/UpgradeManager.cs index ebf257eab1..0e8ce1f7e0 100644 --- a/OpenRA.Mods.Common/Upgrades/UpgradeManager.cs +++ b/OpenRA.Mods.Common/Upgrades/UpgradeManager.cs @@ -18,6 +18,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common { + [Desc("Attach this to a unit to enable dynamic upgrades by warheads, experience, crates, support powers, etc.")] public class UpgradeManagerInfo : ITraitInfo { public object Create(ActorInitializer init) { return new UpgradeManager(init); } diff --git a/OpenRA.Mods.RA/Activities/Hunt.cs b/OpenRA.Mods.RA/Activities/Hunt.cs index dc42038c9e..a4352b5de9 100644 --- a/OpenRA.Mods.RA/Activities/Hunt.cs +++ b/OpenRA.Mods.RA/Activities/Hunt.cs @@ -41,6 +41,7 @@ namespace OpenRA.Mods.RA.Activities } } + [Desc("Can be targeted by the Hunt activity.")] public class HuntableInfo : TraitInfo { } public class Huntable { } } \ No newline at end of file diff --git a/OpenRA.Mods.RA/AttackMove.cs b/OpenRA.Mods.RA/AttackMove.cs index 05e55bd639..9d9077d98f 100644 --- a/OpenRA.Mods.RA/AttackMove.cs +++ b/OpenRA.Mods.RA/AttackMove.cs @@ -14,6 +14,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("Provides access to the attack-move command, which will make the actor automatically engage viable targets while moving to the destination.")] class AttackMoveInfo : ITraitInfo { public object Create(ActorInitializer init) { return new AttackMove(init.self, this); } diff --git a/OpenRA.Mods.RA/BridgeHut.cs b/OpenRA.Mods.RA/BridgeHut.cs index 416bc7c15b..447ec5fc91 100644 --- a/OpenRA.Mods.RA/BridgeHut.cs +++ b/OpenRA.Mods.RA/BridgeHut.cs @@ -14,6 +14,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("Allows bridges to be targeted for demolition and repair.")] class BridgeHutInfo : IDemolishableInfo, ITraitInfo { public bool IsValidTarget(ActorInfo actorInfo, Actor saboteur) { return false; } // TODO: bridges don't support frozen under fog diff --git a/OpenRA.Mods.RA/Buildings/BaseProvider.cs b/OpenRA.Mods.RA/Buildings/BaseProvider.cs index 484134bdd6..289146c57c 100755 --- a/OpenRA.Mods.RA/Buildings/BaseProvider.cs +++ b/OpenRA.Mods.RA/Buildings/BaseProvider.cs @@ -16,6 +16,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA.Buildings { + [Desc("Limits the zone where buildings can be constructed to a radius around this actor.")] public class BaseProviderInfo : ITraitInfo { public readonly int Range = 10; diff --git a/OpenRA.Mods.RA/Chronoshiftable.cs b/OpenRA.Mods.RA/Chronoshiftable.cs index 77c96f321b..42df972a36 100755 --- a/OpenRA.Mods.RA/Chronoshiftable.cs +++ b/OpenRA.Mods.RA/Chronoshiftable.cs @@ -14,6 +14,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("Can be teleported via Chronoshift power.")] public class ChronoshiftableInfo : ITraitInfo { public readonly bool ExplodeInstead = false; diff --git a/OpenRA.Mods.RA/CombatDebugOverlay.cs b/OpenRA.Mods.RA/CombatDebugOverlay.cs index 9c4624f0f6..7d21c375cc 100644 --- a/OpenRA.Mods.RA/CombatDebugOverlay.cs +++ b/OpenRA.Mods.RA/CombatDebugOverlay.cs @@ -17,6 +17,7 @@ using OpenRA.Mods.RA.Effects; namespace OpenRA.Mods.RA { + [Desc("Displays fireports, muzzle offsets, and hit areas in developer mode.")] public class CombatDebugOverlayInfo : ITraitInfo { public object Create(ActorInitializer init) { return new CombatDebugOverlay(init.self); } diff --git a/OpenRA.Mods.RA/Disguise.cs b/OpenRA.Mods.RA/Disguise.cs index d7d51bee79..1917cb4e42 100644 --- a/OpenRA.Mods.RA/Disguise.cs +++ b/OpenRA.Mods.RA/Disguise.cs @@ -61,6 +61,7 @@ namespace OpenRA.Mods.RA } } + [Desc("Provides access to the disguise command, which makes the actor appear to be another player's actor.")] class DisguiseInfo : TraitInfo { } class Disguise : IEffectiveOwner, IIssueOrder, IResolveOrder, IOrderVoice, IRadarColorModifier, INotifyAttack @@ -135,6 +136,7 @@ namespace OpenRA.Mods.RA public void Attacking(Actor self, Target target, Armament a, Barrel barrel) { DisguiseAs(self, null); } } + [Desc("Allows automatic targeting of disguised actors.")] class IgnoresDisguiseInfo : TraitInfo { } class IgnoresDisguise { } } \ No newline at end of file diff --git a/OpenRA.Mods.RA/EngineerRepair.cs b/OpenRA.Mods.RA/EngineerRepair.cs index 15f469c96d..e0ce938568 100644 --- a/OpenRA.Mods.RA/EngineerRepair.cs +++ b/OpenRA.Mods.RA/EngineerRepair.cs @@ -16,7 +16,8 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { - class EngineerRepairInfo : TraitInfo {} + [Desc("Can instantly repair other actors, but gets consumed afterwards.")] + class EngineerRepairInfo : TraitInfo { } class EngineerRepair : IIssueOrder, IResolveOrder, IOrderVoice { @@ -116,6 +117,7 @@ namespace OpenRA.Mods.RA } } + [Desc("Eligible for instant repair.")] class EngineerRepairableInfo : TraitInfo { } class EngineerRepairable { } diff --git a/OpenRA.Mods.RA/Husk.cs b/OpenRA.Mods.RA/Husk.cs index 711939ae66..17f2481d63 100644 --- a/OpenRA.Mods.RA/Husk.cs +++ b/OpenRA.Mods.RA/Husk.cs @@ -16,6 +16,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("Spawns remains of a husk actor with the correct facing.")] class HuskInfo : ITraitInfo, IOccupySpaceInfo, IFacingInfo { public readonly string[] AllowedTerrain = { }; diff --git a/OpenRA.Mods.RA/Infiltration/InfiltrateForExploration.cs b/OpenRA.Mods.RA/Infiltration/InfiltrateForExploration.cs index 1d08f8a28b..4a84990cf8 100644 --- a/OpenRA.Mods.RA/Infiltration/InfiltrateForExploration.cs +++ b/OpenRA.Mods.RA/Infiltration/InfiltrateForExploration.cs @@ -12,13 +12,13 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA.Infiltration { + [Desc("Steal and reset the owner's exploration.")] class InfiltrateForExplorationInfo : TraitInfo { } class InfiltrateForExploration : INotifyInfiltrated { public void Infiltrated(Actor self, Actor infiltrator) { - // Steal and reset the owners exploration infiltrator.Owner.Shroud.Explore(self.Owner.Shroud); if (!self.Owner.Shroud.HasFogVisibility()) self.Owner.Shroud.ResetExploration(); diff --git a/OpenRA.Mods.RA/LeavesHusk.cs b/OpenRA.Mods.RA/LeavesHusk.cs index ae9a13ba57..b9524c3677 100644 --- a/OpenRA.Mods.RA/LeavesHusk.cs +++ b/OpenRA.Mods.RA/LeavesHusk.cs @@ -16,6 +16,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("Spawn another actor immediately upon death.")] public class LeavesHuskInfo : ITraitInfo { [ActorReference] diff --git a/OpenRA.Mods.RA/Render/RenderEditorOnly.cs b/OpenRA.Mods.RA/Render/RenderEditorOnly.cs index 37390fb273..5160e22cd9 100644 --- a/OpenRA.Mods.RA/Render/RenderEditorOnly.cs +++ b/OpenRA.Mods.RA/Render/RenderEditorOnly.cs @@ -14,6 +14,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA.Render { + [Desc("Invisible during games.")] class RenderEditorOnlyInfo : RenderSimpleInfo { public override object Create(ActorInitializer init) { return new RenderEditorOnly(init.self); } diff --git a/OpenRA.Mods.RA/RepairsBridges.cs b/OpenRA.Mods.RA/RepairsBridges.cs index 48f0ca6c50..631821668e 100644 --- a/OpenRA.Mods.RA/RepairsBridges.cs +++ b/OpenRA.Mods.RA/RepairsBridges.cs @@ -16,7 +16,8 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { - class RepairsBridgesInfo : TraitInfo {} + [Desc("Can enter a BridgeHut to trigger a repair.")] + class RepairsBridgesInfo : TraitInfo { } class RepairsBridges : IIssueOrder, IResolveOrder, IOrderVoice { diff --git a/OpenRA.Mods.RA/StrategicVictoryConditions.cs b/OpenRA.Mods.RA/StrategicVictoryConditions.cs index 53eacda40f..8b89bd953c 100644 --- a/OpenRA.Mods.RA/StrategicVictoryConditions.cs +++ b/OpenRA.Mods.RA/StrategicVictoryConditions.cs @@ -14,19 +14,21 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { - public class StrategicPointInfo : TraitInfo {} - public class StrategicPoint {} + [Desc("Used to mark a place that needs to be in possession for StrategicVictoryConditions.")] + public class StrategicPointInfo : TraitInfo { } + public class StrategicPoint { } + [Desc("Allows King of the Hill (KotH) style gameplay.")] public class StrategicVictoryConditionsInfo : ITraitInfo, Requires { - [Desc("Amount of time (in game ticks) that the player has to hold all the strategic points.")] - public readonly int TicksToHold = 25 * 60 * 5; // ~5 minutes + [Desc("Amount of time (in game ticks) that the player has to hold all the strategic points.", "Defaults to 5 minutes.")] + public readonly int TicksToHold = 25 * 60 * 5; [Desc("Should the timer reset when the player loses hold of a strategic point.")] public readonly bool ResetOnHoldLost = true; - [Desc("Percentage of strategic points the player has to hold to win.")] - public readonly float RatioRequired = 0.5f; // 50% required of all koth locations + [Desc("Percentage of all strategic points the player has to hold to win.")] + public readonly float RatioRequired = 0.5f; [Desc("Delay for the end game notification in milliseconds.")] public int NotificationDelay = 1500; diff --git a/OpenRA.Mods.RA/Traits/Air/FallsToEarth.cs b/OpenRA.Mods.RA/Traits/Air/FallsToEarth.cs index 2f89eeaef4..00dd699d59 100644 --- a/OpenRA.Mods.RA/Traits/Air/FallsToEarth.cs +++ b/OpenRA.Mods.RA/Traits/Air/FallsToEarth.cs @@ -16,6 +16,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA.Traits { + [Desc("Causes aircraft husks that are spawned in the air to crash to the ground.")] public class FallsToEarthInfo : ITraitInfo { [WeaponReference]