From da001385ae03f7ad7b744ea971fca34f86f38f00 Mon Sep 17 00:00:00 2001 From: Taryn Hill Date: Sat, 12 Jul 2014 12:43:38 -0500 Subject: [PATCH] Added some trait [Desc()]s. --- OpenRA.Mods.RA/Attack/AttackCharge.cs | 5 +++++ OpenRA.Mods.RA/Attack/AttackFollow.cs | 1 + OpenRA.Mods.RA/Attack/AttackGarrisoned.cs | 13 +++++++------ OpenRA.Mods.RA/Attack/AttackLeap.cs | 1 + OpenRA.Mods.RA/Attack/AttackPopupTurreted.cs | 2 ++ OpenRA.Mods.RA/Attack/AttackTurreted.cs | 1 + OpenRA.Mods.RA/Burns.cs | 1 + OpenRA.Mods.RA/C4Demolition.cs | 4 +++- OpenRA.Mods.RA/Cargo.cs | 1 + OpenRA.Mods.RA/Cloak.cs | 9 +++++++-- OpenRA.Mods.RA/DeathSounds.cs | 1 + OpenRA.Mods.RA/DetectCloaked.cs | 4 ++++ OpenRA.Mods.RA/Disguise.cs | 1 + OpenRA.Mods.RA/Effects/Contrail.cs | 8 +++++++- OpenRA.Mods.RA/EmitInfantryOnSell.cs | 2 ++ OpenRA.Mods.RA/GainsExperience.cs | 1 + OpenRA.Mods.RA/GainsUnitUpgrades.cs | 1 + OpenRA.Mods.RA/GivesExperience.cs | 3 ++- OpenRA.Mods.RA/Guard.cs | 3 ++- OpenRA.Mods.RA/InfiltrateForCash.cs | 1 + OpenRA.Mods.RA/Invulnerable.cs | 8 +++----- OpenRA.Mods.RA/LimitedAmmo.cs | 4 ++++ OpenRA.Mods.RA/Modifiers/FrozenUnderFog.cs | 3 ++- OpenRA.Mods.RA/ParaDrop.cs | 5 +++-- OpenRA.Mods.RA/Parachutable.cs | 5 +++++ OpenRA.Mods.RA/Passenger.cs | 15 ++++++++------- OpenRA.Mods.RA/ProvidesRadar.cs | 8 +++++++- OpenRA.Mods.RA/ProximityCaptor.cs | 1 + OpenRA.Mods.RA/ProximityCapturable.cs | 3 ++- OpenRA.Mods.RA/RenderRangeCircle.cs | 1 + OpenRA.Mods.RA/Repairable.cs | 1 + OpenRA.Mods.RA/StoresResources.cs | 1 + OpenRA.Mods.RA/TakeCover.cs | 8 +++++++- OpenRA.Mods.RA/TargetableUnit.cs | 2 ++ OpenRA.Mods.RA/Transforms.cs | 1 + 35 files changed, 99 insertions(+), 30 deletions(-) diff --git a/OpenRA.Mods.RA/Attack/AttackCharge.cs b/OpenRA.Mods.RA/Attack/AttackCharge.cs index 89c5401dac..58fb312e67 100644 --- a/OpenRA.Mods.RA/Attack/AttackCharge.cs +++ b/OpenRA.Mods.RA/Attack/AttackCharge.cs @@ -14,15 +14,20 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("Charges up before being able to attack.")] class AttackChargeInfo : AttackOmniInfo { public readonly int MaxCharges = 1; + [Desc("Reload time (for all charges).")] public readonly int ReloadTime = 120; + [Desc("Delay for first charge. Needs to match FireDelay for Obelisk.")] public readonly int InitialChargeDelay = 22; + [Desc("Delay for additional charges if MaxCharge is larger than 1.")] public readonly int ChargeDelay = 3; + public override object Create(ActorInitializer init) { return new AttackCharge(init.self, this); } } diff --git a/OpenRA.Mods.RA/Attack/AttackFollow.cs b/OpenRA.Mods.RA/Attack/AttackFollow.cs index cd7bbfaaeb..52540372ca 100644 --- a/OpenRA.Mods.RA/Attack/AttackFollow.cs +++ b/OpenRA.Mods.RA/Attack/AttackFollow.cs @@ -14,6 +14,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("Actor will follow units until in range to attack them.")] public class AttackFollowInfo : AttackBaseInfo { public override object Create(ActorInitializer init) { return new AttackFollow(init.self, this); } diff --git a/OpenRA.Mods.RA/Attack/AttackGarrisoned.cs b/OpenRA.Mods.RA/Attack/AttackGarrisoned.cs index 123f1dc0b5..f1ef7457c8 100644 --- a/OpenRA.Mods.RA/Attack/AttackGarrisoned.cs +++ b/OpenRA.Mods.RA/Attack/AttackGarrisoned.cs @@ -24,15 +24,16 @@ namespace OpenRA.Mods.RA public WAngle Cone; } + [Desc("Cargo can fire their weapons out of fire ports.")] public class AttackGarrisonedInfo : AttackFollowInfo, Requires { - [Desc("Fire port offsets in local coordinates")] + [Desc("Fire port offsets in local coordinates.")] public readonly WRange[] PortOffsets = {}; - [Desc("Fire port yaw angles")] + [Desc("Fire port yaw angles.")] public readonly WAngle[] PortYaws = {}; - [Desc("Fire port yaw cone angle")] + [Desc("Fire port yaw cone angle.")] public readonly WAngle[] PortCones = {}; public readonly string MuzzlePalette = "effect"; @@ -68,13 +69,13 @@ namespace OpenRA.Mods.RA if (info.PortOffsets.Length % 3 != 0 || info.PortOffsets.Length == 0) - throw new InvalidOperationException("PortOffsets array length must be a multiple of three"); + throw new InvalidOperationException("PortOffsets array length must be a multiple of three."); if (info.PortYaws.Length * 3 != info.PortOffsets.Length) - throw new InvalidOperationException("PortYaws must define an angle for each port"); + throw new InvalidOperationException("PortYaws must define an angle for each port."); if (info.PortCones.Length * 3 != info.PortOffsets.Length) - throw new InvalidOperationException("PortCones must define an angle for each port"); + throw new InvalidOperationException("PortCones must define an angle for each port."); var p = new List(); for (var i = 0; i < info.PortOffsets.Length / 3; i++) diff --git a/OpenRA.Mods.RA/Attack/AttackLeap.cs b/OpenRA.Mods.RA/Attack/AttackLeap.cs index a41409cc69..fdeea713b5 100644 --- a/OpenRA.Mods.RA/Attack/AttackLeap.cs +++ b/OpenRA.Mods.RA/Attack/AttackLeap.cs @@ -13,6 +13,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("Dogs use this attack model.")] class AttackLeapInfo : AttackFrontalInfo { [Desc("Leap speed (in units/tick).")] diff --git a/OpenRA.Mods.RA/Attack/AttackPopupTurreted.cs b/OpenRA.Mods.RA/Attack/AttackPopupTurreted.cs index 0ce1b7d171..6354a5e4e9 100644 --- a/OpenRA.Mods.RA/Attack/AttackPopupTurreted.cs +++ b/OpenRA.Mods.RA/Attack/AttackPopupTurreted.cs @@ -16,8 +16,10 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("Actor's turret rises from the ground before attacking.")] class AttackPopupTurretedInfo : AttackTurretedInfo, Requires, Requires { + [Desc("How many game ticks should pass before closing the actor's turret.")] public int CloseDelay = 125; public int DefaultFacing = 0; public float ClosedDamageMultiplier = 0.5f; diff --git a/OpenRA.Mods.RA/Attack/AttackTurreted.cs b/OpenRA.Mods.RA/Attack/AttackTurreted.cs index d8476439e4..717257bb62 100644 --- a/OpenRA.Mods.RA/Attack/AttackTurreted.cs +++ b/OpenRA.Mods.RA/Attack/AttackTurreted.cs @@ -13,6 +13,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("Actor has a visual turret used to attack.")] class AttackTurretedInfo : AttackFollowInfo, Requires { public override object Create(ActorInitializer init) { return new AttackTurreted(init.self, this); } diff --git a/OpenRA.Mods.RA/Burns.cs b/OpenRA.Mods.RA/Burns.cs index 967dc0bc26..a117f80a3f 100644 --- a/OpenRA.Mods.RA/Burns.cs +++ b/OpenRA.Mods.RA/Burns.cs @@ -13,6 +13,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("This actor will play a fire animation over its body and take damage over time.")] class BurnsInfo : ITraitInfo, Requires { public readonly string Anim = "1"; diff --git a/OpenRA.Mods.RA/C4Demolition.cs b/OpenRA.Mods.RA/C4Demolition.cs index 8824e75eda..445c81ae47 100644 --- a/OpenRA.Mods.RA/C4Demolition.cs +++ b/OpenRA.Mods.RA/C4Demolition.cs @@ -19,7 +19,9 @@ namespace OpenRA.Mods.RA { class C4DemolitionInfo : ITraitInfo { - public readonly int C4Delay = 45; // 1.8 seconds + [Desc("Delay to demolish the target once the C4 is planted." + + "Measured in game ticks. Default is 1.8 seconds.")] + public readonly int C4Delay = 45; public object Create(ActorInitializer init) { return new C4Demolition(this); } } diff --git a/OpenRA.Mods.RA/Cargo.cs b/OpenRA.Mods.RA/Cargo.cs index dc6e203643..620a3e1d52 100644 --- a/OpenRA.Mods.RA/Cargo.cs +++ b/OpenRA.Mods.RA/Cargo.cs @@ -17,6 +17,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("This actor can transport Passenger actors.")] public class CargoInfo : ITraitInfo, Requires { public readonly int MaxWeight = 0; diff --git a/OpenRA.Mods.RA/Cloak.cs b/OpenRA.Mods.RA/Cloak.cs index f2d8f07095..b8ccb4d671 100644 --- a/OpenRA.Mods.RA/Cloak.cs +++ b/OpenRA.Mods.RA/Cloak.cs @@ -17,10 +17,15 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("This unit can cloak and uncloak in specific situations.")] public class CloakInfo : ITraitInfo { - public readonly int InitialDelay = 10; // Ticks - public readonly int CloakDelay = 30; // Ticks + [Desc("Measured in game ticks.")] + public readonly int InitialDelay = 10; + + [Desc("Measured in game ticks.")] + public readonly int CloakDelay = 30; + public readonly bool UncloakOnAttack = true; public readonly bool UncloakOnMove = false; public readonly bool UncloakOnUnload = false; diff --git a/OpenRA.Mods.RA/DeathSounds.cs b/OpenRA.Mods.RA/DeathSounds.cs index ce047f9806..a769fd778e 100644 --- a/OpenRA.Mods.RA/DeathSounds.cs +++ b/OpenRA.Mods.RA/DeathSounds.cs @@ -13,6 +13,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("Sounds to play when killed.")] public class DeathSoundsInfo : ITraitInfo { [Desc("Death notification voice.")] diff --git a/OpenRA.Mods.RA/DetectCloaked.cs b/OpenRA.Mods.RA/DetectCloaked.cs index 27a79b2717..7de70e1bf2 100644 --- a/OpenRA.Mods.RA/DetectCloaked.cs +++ b/OpenRA.Mods.RA/DetectCloaked.cs @@ -12,9 +12,13 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("Actor can reveal Cloak actors in a specified range.")] class DetectCloakedInfo : TraitInfo { + [Desc("Specific cloak classifications I can reveal.")] public readonly string[] CloakTypes = { "Cloak" }; + + [Desc("Measured in cells.")] public readonly int Range = 5; } diff --git a/OpenRA.Mods.RA/Disguise.cs b/OpenRA.Mods.RA/Disguise.cs index 79e4d91654..cd70645053 100644 --- a/OpenRA.Mods.RA/Disguise.cs +++ b/OpenRA.Mods.RA/Disguise.cs @@ -16,6 +16,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("Overrides the default ToolTip when this actor is disguised (aids in deceiving enemy players).")] class DisguiseToolTipInfo : TooltipInfo, Requires { public override object Create (ActorInitializer init) { return new DisguiseToolTip(init.self, this); } diff --git a/OpenRA.Mods.RA/Effects/Contrail.cs b/OpenRA.Mods.RA/Effects/Contrail.cs index e947e02419..9353adce9d 100755 --- a/OpenRA.Mods.RA/Effects/Contrail.cs +++ b/OpenRA.Mods.RA/Effects/Contrail.cs @@ -1,6 +1,6 @@ #region Copyright & License Information /* - * Copyright 2007-2011 The OpenRA Developers (see AUTHORS) + * Copyright 2007-2014 The OpenRA Developers (see AUTHORS) * This file is part of OpenRA, which is free software. It is made * available to you under the terms of the GNU General Public License * as published by the Free Software Foundation. For more information, @@ -15,13 +15,19 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("Draw a colored contrail behind this actor when they move.")] class ContrailInfo : ITraitInfo, Requires { [Desc("Position relative to body")] public readonly WVec Offset = WVec.Zero; + [Desc("Measured in pixels.")] public readonly int TrailLength = 25; + + [Desc("RGB color of the contrail.")] public readonly Color Color = Color.White; + + [Desc("Use player remap color instead of a custom color?")] public readonly bool UsePlayerColor = true; public object Create(ActorInitializer init) { return new Contrail(init.self, this); } diff --git a/OpenRA.Mods.RA/EmitInfantryOnSell.cs b/OpenRA.Mods.RA/EmitInfantryOnSell.cs index cb931f486e..690d5919a5 100644 --- a/OpenRA.Mods.RA/EmitInfantryOnSell.cs +++ b/OpenRA.Mods.RA/EmitInfantryOnSell.cs @@ -15,12 +15,14 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("Spawn new actors when sold.")] class EmitInfantryOnSellInfo : TraitInfo { public readonly float ValuePercent = 40; public readonly float MinHpPercent = 30; [ActorReference] + [Desc("Be sure to use lowercase. Default value is \"e1\".")] public readonly string[] ActorTypes = { "e1" }; } diff --git a/OpenRA.Mods.RA/GainsExperience.cs b/OpenRA.Mods.RA/GainsExperience.cs index 7068735ef9..606df2a15d 100644 --- a/OpenRA.Mods.RA/GainsExperience.cs +++ b/OpenRA.Mods.RA/GainsExperience.cs @@ -15,6 +15,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("This actor's experience increases when it has killed a GivesExperience actor.")] public class GainsExperienceInfo : ITraitInfo, Requires { [Desc("XP requirements for each level, as multiples of our own cost.")] diff --git a/OpenRA.Mods.RA/GainsUnitUpgrades.cs b/OpenRA.Mods.RA/GainsUnitUpgrades.cs index db7f9d557a..3c75a0cfef 100644 --- a/OpenRA.Mods.RA/GainsUnitUpgrades.cs +++ b/OpenRA.Mods.RA/GainsUnitUpgrades.cs @@ -14,6 +14,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("This actor has properties that upgrade when a specific criteria is met.")] public class GainsUnitUpgradesInfo : ITraitInfo { public readonly int FirepowerMaxLevel = 15; diff --git a/OpenRA.Mods.RA/GivesExperience.cs b/OpenRA.Mods.RA/GivesExperience.cs index b36f74d244..947e34961a 100644 --- a/OpenRA.Mods.RA/GivesExperience.cs +++ b/OpenRA.Mods.RA/GivesExperience.cs @@ -12,6 +12,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("This actor gives experience to a GainsExperience actor when they are killed.")] class GivesExperienceInfo : TraitInfo { [Desc("If -1, use the value of the unit cost.")] @@ -23,7 +24,7 @@ namespace OpenRA.Mods.RA public void Killed(Actor self, AttackInfo e) { // Prevent TK from giving exp - if (e.Attacker == null || e.Attacker.Destroyed || e.Attacker.Owner.Stances[ self.Owner ] == Stance.Ally ) + if (e.Attacker == null || e.Attacker.Destroyed || e.Attacker.Owner.Stances[self.Owner] == Stance.Ally) return; var info = self.Info.Traits.Get(); diff --git a/OpenRA.Mods.RA/Guard.cs b/OpenRA.Mods.RA/Guard.cs index d7f4fdede1..423a872776 100644 --- a/OpenRA.Mods.RA/Guard.cs +++ b/OpenRA.Mods.RA/Guard.cs @@ -16,9 +16,9 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("The player can give this unit the order to follow and protect friendly units with the Guardable trait.")] class GuardInfo : TraitInfo { } - [Desc("The player can give this unit the order to follow and protect friendly units with the Guardable trait.")] class Guard : IResolveOrder, IOrderVoice { public void ResolveOrder(Actor self, Order order) @@ -102,6 +102,7 @@ namespace OpenRA.Mods.RA } } + [Desc("This unit can be guarded (followed and protected) by a Guard unit.")] class GuardableInfo : TraitInfo { public readonly int Range = 2; diff --git a/OpenRA.Mods.RA/InfiltrateForCash.cs b/OpenRA.Mods.RA/InfiltrateForCash.cs index 2f93cccb45..ad6a109152 100644 --- a/OpenRA.Mods.RA/InfiltrateForCash.cs +++ b/OpenRA.Mods.RA/InfiltrateForCash.cs @@ -14,6 +14,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("This structure can be infiltrated causing funds to be stolen.")] class InfiltrateForCashInfo : ITraitInfo, Requires { public readonly int Percentage = 50; diff --git a/OpenRA.Mods.RA/Invulnerable.cs b/OpenRA.Mods.RA/Invulnerable.cs index 59243f4a3c..6147c6aab3 100644 --- a/OpenRA.Mods.RA/Invulnerable.cs +++ b/OpenRA.Mods.RA/Invulnerable.cs @@ -13,13 +13,11 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { - class InvulnerableInfo : TraitInfo {} + [Desc("This unit cannot be damaged.")] + class InvulnerableInfo : TraitInfo { } class Invulnerable : IDamageModifier { - public float GetDamageModifier( Actor attacker, WarheadInfo warhead ) - { - return 0.0f; - } + public float GetDamageModifier(Actor attacker, WarheadInfo warhead) { return 0.0f; } } } diff --git a/OpenRA.Mods.RA/LimitedAmmo.cs b/OpenRA.Mods.RA/LimitedAmmo.cs index d195aae0b5..762a800606 100644 --- a/OpenRA.Mods.RA/LimitedAmmo.cs +++ b/OpenRA.Mods.RA/LimitedAmmo.cs @@ -13,13 +13,17 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("Actor has a limited amount of ammo, after using it all the actor must reload in some way.")] public class LimitedAmmoInfo : ITraitInfo { public readonly int Ammo = 0; + [Desc("Defaults to value in Ammo.")] public readonly int PipCount = 0; + public readonly PipType PipType = PipType.Green; public readonly PipType PipTypeEmpty = PipType.Transparent; + [Desc("Time to reload measured in ticks.")] public readonly int ReloadTicks = 25 * 2; diff --git a/OpenRA.Mods.RA/Modifiers/FrozenUnderFog.cs b/OpenRA.Mods.RA/Modifiers/FrozenUnderFog.cs index 75c1c39b75..5ee0ab5384 100644 --- a/OpenRA.Mods.RA/Modifiers/FrozenUnderFog.cs +++ b/OpenRA.Mods.RA/Modifiers/FrozenUnderFog.cs @@ -1,6 +1,6 @@ #region Copyright & License Information /* - * Copyright 2007-2013 The OpenRA Developers (see AUTHORS) + * Copyright 2007-2014 The OpenRA Developers (see AUTHORS) * This file is part of OpenRA, which is free software. It is made * available to you under the terms of the GNU General Public License * as published by the Free Software Foundation. For more information, @@ -17,6 +17,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("This actor will remain visible (but not updated visually) under fog, once discovered.")] public class FrozenUnderFogInfo : ITraitInfo, Requires, Requires { public readonly bool StartsRevealed = false; diff --git a/OpenRA.Mods.RA/ParaDrop.cs b/OpenRA.Mods.RA/ParaDrop.cs index 6c56c0fbae..1cadb153c3 100644 --- a/OpenRA.Mods.RA/ParaDrop.cs +++ b/OpenRA.Mods.RA/ParaDrop.cs @@ -17,12 +17,13 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("This unit can spawn and eject other actors while flying.")] public class ParaDropInfo : ITraitInfo, Requires { - [Desc("Distance around the drop-point to unload troops")] + [Desc("Distance around the drop-point to unload troops.")] public readonly WRange DropRange = WRange.FromCells(4); - [Desc("Sound to play when dropping")] + [Desc("Sound to play when dropping.")] public readonly string ChuteSound = "chute1.aud"; public object Create(ActorInitializer init) { return new ParaDrop(init.self, this); } diff --git a/OpenRA.Mods.RA/Parachutable.cs b/OpenRA.Mods.RA/Parachutable.cs index 2391db913e..ecf932d76e 100644 --- a/OpenRA.Mods.RA/Parachutable.cs +++ b/OpenRA.Mods.RA/Parachutable.cs @@ -14,8 +14,10 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("Can be paradropped by a ParaDrop actor.")] class ParachutableInfo : ITraitInfo { + [Desc("If we land on invalid terrain for my actor type should we be killed?")] public readonly bool KilledOnImpassableTerrain = true; public readonly string GroundImpactSound = "squishy2.aud"; @@ -28,8 +30,10 @@ namespace OpenRA.Mods.RA [Desc("Requires the sub-sequences \"open\" and \"idle\".")] public readonly string ParachuteSequence = null; + [Desc("Optional, otherwise defaults to the palette the actor is using.")] public readonly string ParachutePalette = null; + [Desc("Used to clone the actor with this palette and render it with a visual offset below.")] public readonly string ParachuteShadowPalette = "shadow"; @@ -39,6 +43,7 @@ namespace OpenRA.Mods.RA [Desc("Alternative to ParachuteShadowPalette which disables it and allows to set a custom sprite sequence instead.")] public readonly string ShadowSequence = null; + [Desc("Optional, otherwise defaults to the palette the actor is using.")] public readonly string ShadowPalette = null; diff --git a/OpenRA.Mods.RA/Passenger.cs b/OpenRA.Mods.RA/Passenger.cs index 54785a9567..64a61f5f61 100644 --- a/OpenRA.Mods.RA/Passenger.cs +++ b/OpenRA.Mods.RA/Passenger.cs @@ -17,19 +17,20 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("This actor can enter Cargo actors.")] public class PassengerInfo : ITraitInfo { public readonly string CargoType = null; public readonly PipType PipType = PipType.Green; public int Weight = 1; - public object Create( ActorInitializer init ) { return new Passenger( this ); } + public object Create(ActorInitializer init) { return new Passenger(this); } } public class Passenger : IIssueOrder, IResolveOrder, IOrderVoice { public readonly PassengerInfo info; - public Passenger( PassengerInfo info ) { this.info = info; } + public Passenger(PassengerInfo info) { this.info = info; } public Actor Transport; public IEnumerable Orders @@ -41,21 +42,21 @@ namespace OpenRA.Mods.RA } } - public Order IssueOrder( Actor self, IOrderTargeter order, Target target, bool queued ) + public Order IssueOrder(Actor self, IOrderTargeter order, Target target, bool queued) { - if( order.OrderID == "EnterTransport" ) + if (order.OrderID == "EnterTransport") return new Order(order.OrderID, self, queued) { TargetActor = target.Actor }; return null; } - bool IsCorrectCargoType( Actor target ) + bool IsCorrectCargoType(Actor target) { var ci = target.Info.Traits.Get(); - return ci.Types.Contains( info.CargoType ); + return ci.Types.Contains(info.CargoType); } - bool CanEnter( Actor target ) + bool CanEnter(Actor target) { var cargo = target.TraitOrDefault(); return cargo != null && cargo.HasSpace(info.Weight); diff --git a/OpenRA.Mods.RA/ProvidesRadar.cs b/OpenRA.Mods.RA/ProvidesRadar.cs index 20e435b162..f9174ee4ae 100755 --- a/OpenRA.Mods.RA/ProvidesRadar.cs +++ b/OpenRA.Mods.RA/ProvidesRadar.cs @@ -13,6 +13,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("This actor provides radar.")] public class ProvidesRadarInfo : TraitInfo { } public class ProvidesRadar : ITick @@ -33,7 +34,12 @@ namespace OpenRA.Mods.RA } } - class JamsRadarInfo : TraitInfo { public readonly int Range = 0; } + [Desc("Jams radar signal.")] + class JamsRadarInfo : TraitInfo + { + [Desc("Range for jamming.")] + public readonly int Range = 0; + } class JamsRadar { } } diff --git a/OpenRA.Mods.RA/ProximityCaptor.cs b/OpenRA.Mods.RA/ProximityCaptor.cs index 17f65c8ac8..4c767ba65f 100644 --- a/OpenRA.Mods.RA/ProximityCaptor.cs +++ b/OpenRA.Mods.RA/ProximityCaptor.cs @@ -13,6 +13,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("Actor can capture ProximityCapturable actors.")] public class ProximityCaptorInfo : ITraitInfo { public readonly string[] Types = {}; diff --git a/OpenRA.Mods.RA/ProximityCapturable.cs b/OpenRA.Mods.RA/ProximityCapturable.cs index ab7e1d38fc..274b7afcb1 100644 --- a/OpenRA.Mods.RA/ProximityCapturable.cs +++ b/OpenRA.Mods.RA/ProximityCapturable.cs @@ -1,6 +1,6 @@ #region Copyright & License Information /* - * Copyright 2007-2011 The OpenRA Developers (see AUTHORS) + * Copyright 2007-2014 The OpenRA Developers (see AUTHORS) * This file is part of OpenRA, which is free software. It is made * available to you under the terms of the GNU General Public License * as published by the Free Software Foundation. For more information, @@ -15,6 +15,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("Actor can be captured by units in a specified proximity.")] public class ProximityCapturableInfo : ITraitInfo { public readonly bool Permanent = false; diff --git a/OpenRA.Mods.RA/RenderRangeCircle.cs b/OpenRA.Mods.RA/RenderRangeCircle.cs index 375bf09d10..90c0b58597 100644 --- a/OpenRA.Mods.RA/RenderRangeCircle.cs +++ b/OpenRA.Mods.RA/RenderRangeCircle.cs @@ -20,6 +20,7 @@ namespace OpenRA.Mods.RA void Render(WorldRenderer wr, World w, ActorInfo ai, WPos centerPosition); } + [Desc("Draw a circle indicating my weapon's range.")] class RenderRangeCircleInfo : ITraitInfo, IPlaceBuildingDecoration, Requires { public readonly string RangeCircleType = null; diff --git a/OpenRA.Mods.RA/Repairable.cs b/OpenRA.Mods.RA/Repairable.cs index 14758a2f52..b030b518d0 100644 --- a/OpenRA.Mods.RA/Repairable.cs +++ b/OpenRA.Mods.RA/Repairable.cs @@ -18,6 +18,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("This actor can be sent to a structure for repairs.")] class RepairableInfo : ITraitInfo, Requires { public readonly string[] RepairBuildings = { "fix" }; diff --git a/OpenRA.Mods.RA/StoresResources.cs b/OpenRA.Mods.RA/StoresResources.cs index 3bcf761bb5..e16e24e7ed 100644 --- a/OpenRA.Mods.RA/StoresResources.cs +++ b/OpenRA.Mods.RA/StoresResources.cs @@ -13,6 +13,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("Used for silos.")] class StoresResourcesInfo : ITraitInfo { [Desc("Number of little squares used to display how filled unit is.")] diff --git a/OpenRA.Mods.RA/TakeCover.cs b/OpenRA.Mods.RA/TakeCover.cs index 8c4945a761..47caf44b2c 100644 --- a/OpenRA.Mods.RA/TakeCover.cs +++ b/OpenRA.Mods.RA/TakeCover.cs @@ -14,10 +14,16 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("This actor goes prone in an attempt to reduce damage.")] public class TakeCoverInfo : TurretedInfo { - public readonly int ProneTime = 100; /* ticks, =4s */ + [Desc("How long should we remain in the prone position?" + + "Measured in game ticks. Default is 4 seconds.")] + public readonly int ProneTime = 100; + + [Desc("How quickly we should go from standing to prone.")] public readonly decimal ProneSpeed = .5m; + public readonly WVec ProneOffset = new WVec(85, 0, -171); public override object Create(ActorInitializer init) { return new TakeCover(init, this); } diff --git a/OpenRA.Mods.RA/TargetableUnit.cs b/OpenRA.Mods.RA/TargetableUnit.cs index a90d4334c4..79620216c4 100755 --- a/OpenRA.Mods.RA/TargetableUnit.cs +++ b/OpenRA.Mods.RA/TargetableUnit.cs @@ -13,8 +13,10 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("Actor can be targeted.")] public class TargetableUnitInfo : ITraitInfo, ITargetableInfo { + [Desc("Target type. Used for filtering (in)valid targets.")] public readonly string[] TargetTypes = { }; public string[] GetTargetTypes() { return TargetTypes; } diff --git a/OpenRA.Mods.RA/Transforms.cs b/OpenRA.Mods.RA/Transforms.cs index 7ec82563ec..aca9bd65f7 100644 --- a/OpenRA.Mods.RA/Transforms.cs +++ b/OpenRA.Mods.RA/Transforms.cs @@ -17,6 +17,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { + [Desc("Actor becomes a specified actor type when this trait is triggered.")] class TransformsInfo : ITraitInfo { [ActorReference] public readonly string IntoActor = null;