diff --git a/OpenRA.Mods.Common/Lint/CheckConditions.cs b/OpenRA.Mods.Common/Lint/CheckConditions.cs index 1883741101..4f15bed87a 100644 --- a/OpenRA.Mods.Common/Lint/CheckConditions.cs +++ b/OpenRA.Mods.Common/Lint/CheckConditions.cs @@ -65,7 +65,7 @@ namespace OpenRA.Mods.Common.Lint emitError("Actor type `{0}` consumes conditions that are not granted: {1}".F(actorInfo.Key, ungranted.JoinWith(", "))); if ((consumed.Any() || granted.Any()) && actorInfo.Value.TraitInfoOrDefault() == null) - emitError("Actor type `{0}` defines conditions but does not include an UpgradeManager".F(actorInfo.Key)); + emitError("Actor type `{0}` defines conditions but does not include a ConditionManager".F(actorInfo.Key)); } } } diff --git a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs index d7831a1e2b..cbc8e97733 100644 --- a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs +++ b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs @@ -661,7 +661,7 @@ namespace OpenRA.Mods.Common.Traits OnAirborneAltitudeLeft(); } - #region Airborne upgrades + #region Airborne conditions void OnAirborneAltitudeReached() { @@ -685,7 +685,7 @@ namespace OpenRA.Mods.Common.Traits #endregion - #region Cruising upgrades + #region Cruising conditions void OnCruisingAltitudeReached() { diff --git a/OpenRA.Mods.Common/Traits/Crates/GrantExternalConditionCrateAction.cs b/OpenRA.Mods.Common/Traits/Crates/GrantExternalConditionCrateAction.cs index a8d2a8c695..b1d61bdf79 100644 --- a/OpenRA.Mods.Common/Traits/Crates/GrantExternalConditionCrateAction.cs +++ b/OpenRA.Mods.Common/Traits/Crates/GrantExternalConditionCrateAction.cs @@ -14,14 +14,14 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { - [Desc("Grants an upgrade to the collector.")] + [Desc("Grants a condition on the collector.")] public class GrantExternalConditionCrateActionInfo : CrateActionInfo { [FieldLoader.Require] [Desc("The condition to apply. Must be included in the target actor's ExternalConditions list.")] public readonly string Condition = null; - [Desc("Duration of the upgrade (in ticks). Set to 0 for a permanent upgrade.")] + [Desc("Duration of the condition (in ticks). Set to 0 for a permanent condition.")] public readonly int Duration = 0; [Desc("The range to search for extra collectors in.", "Extra collectors will also be granted the crate action.")] diff --git a/OpenRA.Mods.Common/Traits/Crates/LevelUpCrateAction.cs b/OpenRA.Mods.Common/Traits/Crates/LevelUpCrateAction.cs index dfc026fd05..ef212a608f 100644 --- a/OpenRA.Mods.Common/Traits/Crates/LevelUpCrateAction.cs +++ b/OpenRA.Mods.Common/Traits/Crates/LevelUpCrateAction.cs @@ -50,11 +50,11 @@ namespace OpenRA.Mods.Common.Traits { var inRange = self.World.FindActorsInCircle(self.CenterPosition, info.Range).Where(a => { - // Don't upgrade the same unit twice + // Don't touch the same unit twice if (a == collector) return false; - // Only upgrade the collecting player's units + // Only affect the collecting player's units // TODO: Also apply to allied units? if (a.Owner != collector.Owner) return false; diff --git a/OpenRA.Mods.Common/Traits/GainsExperience.cs b/OpenRA.Mods.Common/Traits/GainsExperience.cs index e84501d087..228e16ec83 100644 --- a/OpenRA.Mods.Common/Traits/GainsExperience.cs +++ b/OpenRA.Mods.Common/Traits/GainsExperience.cs @@ -24,7 +24,7 @@ namespace OpenRA.Mods.Common.Traits [FieldLoader.Require] [Desc("Condition to grant at each level.", "Key is the XP requirements for each level as a percentage of our own value.", - "Value is a list of the upgrade types to grant")] + "Value is the condition to grant.")] public readonly Dictionary Conditions = null; [GrantedConditionReference] diff --git a/OpenRA.Mods.Common/Traits/Plug.cs b/OpenRA.Mods.Common/Traits/Plug.cs index a17349043b..7ac97b50e4 100644 --- a/OpenRA.Mods.Common/Traits/Plug.cs +++ b/OpenRA.Mods.Common/Traits/Plug.cs @@ -16,7 +16,7 @@ namespace OpenRA.Mods.Common.Traits public class PlugInfo : TraitInfo { [FieldLoader.Require] - [Desc("Plug type (matched against Upgrades in Pluggable)")] + [Desc("Plug type (matched against Conditions in Pluggable)")] public readonly string Type = null; } diff --git a/OpenRA.Mods.Common/Traits/Render/TimedConditionBar.cs b/OpenRA.Mods.Common/Traits/Render/TimedConditionBar.cs index 03c7e666bd..21817c0e16 100644 --- a/OpenRA.Mods.Common/Traits/Render/TimedConditionBar.cs +++ b/OpenRA.Mods.Common/Traits/Render/TimedConditionBar.cs @@ -14,7 +14,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits.Render { - [Desc("Visualizes the remaining time for an upgrade.")] + [Desc("Visualizes the remaining time for a condition.")] class TimedConditionBarInfo : ITraitInfo, Requires { [FieldLoader.Require] diff --git a/OpenRA.Mods.Common/Traits/Render/WithIdleAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithIdleAnimation.cs index 98f6e9efdb..9236dabb4c 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithIdleAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithIdleAnimation.cs @@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Traits.Render public readonly int Interval = 750; - [Desc("Pause when the actor is disabled. Deprecated. Use upgrades instead.")] + [Desc("Pause when the actor is disabled. Deprecated. Use conditions instead.")] public readonly bool PauseOnLowPower = false; public override object Create(ActorInitializer init) { return new WithIdleAnimation(init.Self, this); } diff --git a/OpenRA.Mods.Common/Traits/Render/WithSpriteBody.cs b/OpenRA.Mods.Common/Traits/Render/WithSpriteBody.cs index 26bc9af9cc..c4a4eb1561 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithSpriteBody.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithSpriteBody.cs @@ -80,7 +80,7 @@ namespace OpenRA.Mods.Common.Traits.Render DefaultAnimation.PlayRepeating(NormalizeSequence(self, Info.Sequence)); } - // TODO: Get rid of INotifyBuildComplete in favor of using the upgrade system + // TODO: Get rid of INotifyBuildComplete in favor of using the condition system void INotifyBuildComplete.BuildingComplete(Actor self) { OnBuildComplete(self); diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/GrantExternalConditionPower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/GrantExternalConditionPower.cs index 409f30c7bb..b6af4a9c3e 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/GrantExternalConditionPower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/GrantExternalConditionPower.cs @@ -25,7 +25,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("The condition to apply. Must be included in the target actor's ExternalConditions list.")] public readonly string Condition = null; - [Desc("Duration of the upgrade (in ticks). Set to 0 for a permanent condition.")] + [Desc("Duration of the condition (in ticks). Set to 0 for a permanent condition.")] public readonly int Duration = 0; [Desc("Cells - affects whole cells only")] @@ -103,7 +103,7 @@ namespace OpenRA.Mods.Common.Traits readonly SupportPowerManager manager; readonly string order; - public SelectUpgradeTarget(World world, string order, SupportPowerManager manager, GrantExternalConditionPower power) + public SelectConditionTarget(World world, string order, SupportPowerManager manager, GrantExternalConditionPower power) { // Clear selection if using Left-Click Orders if (Game.Settings.Game.UseClassicMouseStyle) diff --git a/OpenRA.Mods.Common/Traits/Upgrades/ConditionManager.cs b/OpenRA.Mods.Common/Traits/Upgrades/ConditionManager.cs index 11940b4fd4..26e49a9eec 100644 --- a/OpenRA.Mods.Common/Traits/Upgrades/ConditionManager.cs +++ b/OpenRA.Mods.Common/Traits/Upgrades/ConditionManager.cs @@ -24,7 +24,7 @@ namespace OpenRA.Mods.Common.Traits void Update(int duration, int remaining); } - [Desc("Attach this to a unit to enable dynamic upgrades by warheads, experience, crates, support powers, etc.")] + [Desc("Attach this to a unit to enable dynamic conditions by warheads, experience, crates, support powers, etc.")] public class ConditionManagerInfo : TraitInfo, Requires { } public class ConditionManager : INotifyCreated, ITick diff --git a/OpenRA.Mods.Common/Traits/Upgrades/DisableOnCondition.cs b/OpenRA.Mods.Common/Traits/Upgrades/DisableOnCondition.cs index 225fd5d461..e310d83b89 100644 --- a/OpenRA.Mods.Common/Traits/Upgrades/DisableOnCondition.cs +++ b/OpenRA.Mods.Common/Traits/Upgrades/DisableOnCondition.cs @@ -13,7 +13,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { - [Desc("Disable the actor when this trait is enabled by an upgrade.")] + [Desc("Disable the actor when this trait is enabled by a condition.")] public class DisableOnConditionInfo : UpgradableTraitInfo { public override object Create(ActorInitializer init) { return new DisableOnCondition(this); } diff --git a/OpenRA.Mods.Common/Traits/Upgrades/GrantConditionOnDamageState.cs b/OpenRA.Mods.Common/Traits/Upgrades/GrantConditionOnDamageState.cs index f8e8a40ae9..4d13b6d778 100644 --- a/OpenRA.Mods.Common/Traits/Upgrades/GrantConditionOnDamageState.cs +++ b/OpenRA.Mods.Common/Traits/Upgrades/GrantConditionOnDamageState.cs @@ -13,7 +13,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { - [Desc("Applies an upgrade to the actor at specified damage states.")] + [Desc("Applies a condition to the actor at specified damage states.")] public class GrantConditionOnDamageStateInfo : ITraitInfo, Requires { [FieldLoader.Require] @@ -27,7 +27,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("Play a random sound from this list when disabled.")] public readonly string[] DisabledSounds = { }; - [Desc("Levels of damage at which to grant upgrades.")] + [Desc("Levels of damage at which to grant the condition.")] public readonly DamageState ValidDamageStates = DamageState.Heavy | DamageState.Critical; [Desc("Is the condition irrevocable once it has been activated?")] diff --git a/OpenRA.Mods.Common/Traits/Upgrades/GrantConditionOnDeploy.cs b/OpenRA.Mods.Common/Traits/Upgrades/GrantConditionOnDeploy.cs index 296e217418..18455ff0b7 100644 --- a/OpenRA.Mods.Common/Traits/Upgrades/GrantConditionOnDeploy.cs +++ b/OpenRA.Mods.Common/Traits/Upgrades/GrantConditionOnDeploy.cs @@ -30,8 +30,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("The condition to grant after deploying and revoke before undeploying.")] public readonly string DeployedCondition = null; - [Desc("The terrain types that this actor can deploy on to receive these upgrades. " + - "Leave empty to allow any.")] + [Desc("The terrain types that this actor can deploy on. Leave empty to allow any.")] public readonly HashSet AllowedTerrainTypes = new HashSet(); [Desc("Can this actor deploy on slopes?")] @@ -207,19 +206,19 @@ namespace OpenRA.Mods.Common.Traits if (!string.IsNullOrEmpty(info.DeploySound)) Game.Sound.Play(SoundType.World, info.DeploySound, self.CenterPosition); - // Revoke upgrades that are used while undeployed. + // Revoke condition that is applied while undeployed. if (!init) OnDeployStarted(); - // If there is no animation to play just grant the upgrades that are used while deployed. - // Alternatively, play the deploy animation and then grant the upgrades. + // If there is no animation to play just grant the condition that is used while deployed. + // Alternatively, play the deploy animation and then grant the condition. if (string.IsNullOrEmpty(info.DeployAnimation) || body.Value == null) OnDeployCompleted(); else body.Value.PlayCustomAnimation(self, info.DeployAnimation, OnDeployCompleted); } - /// Play undeploy sound and animation and after that revoke the upgrades. + /// Play undeploy sound and animation and after that revoke the condition. void Undeploy() { Undeploy(false); } void Undeploy(bool init) { @@ -233,8 +232,8 @@ namespace OpenRA.Mods.Common.Traits if (!init) OnUndeployStarted(); - // If there is no animation to play just grant the upgrades that are used while undeployed. - // Alternatively, play the undeploy animation and then grant the upgrades. + // If there is no animation to play just grant the condition that is used while undeployed. + // Alternatively, play the undeploy animation and then grant the condition. if (string.IsNullOrEmpty(info.DeployAnimation) || body.Value == null) OnUndeployCompleted(); else diff --git a/OpenRA.Mods.Common/Traits/Upgrades/GrantConditionOnMovement.cs b/OpenRA.Mods.Common/Traits/Upgrades/GrantConditionOnMovement.cs index 6240bf503a..e99784af06 100644 --- a/OpenRA.Mods.Common/Traits/Upgrades/GrantConditionOnMovement.cs +++ b/OpenRA.Mods.Common/Traits/Upgrades/GrantConditionOnMovement.cs @@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("Condition to grant.")] public readonly string Condition = null; - [Desc("Apply upgrades on straight vertical movement as well.")] + [Desc("Apply condition on straight vertical movement as well.")] public readonly bool ConsiderVerticalMovement = false; public override object Create(ActorInitializer init) { return new GrantConditionOnMovement(init.Self, this); } diff --git a/OpenRA.Mods.Common/Traits/Upgrades/GrantConditionOnTerrain.cs b/OpenRA.Mods.Common/Traits/Upgrades/GrantConditionOnTerrain.cs index 315e94509b..d942fc7990 100644 --- a/OpenRA.Mods.Common/Traits/Upgrades/GrantConditionOnTerrain.cs +++ b/OpenRA.Mods.Common/Traits/Upgrades/GrantConditionOnTerrain.cs @@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Traits public readonly string Condition = null; [FieldLoader.Require] - [Desc("Terrain names to trigger the upgrade.")] + [Desc("Terrain names to trigger the condition.")] public readonly string[] TerrainTypes = { }; public object Create(ActorInitializer init) { return new GrantConditionOnTerrain(init, this); } diff --git a/OpenRA.Mods.Common/Traits/Upgrades/ProximityExternalCondition.cs b/OpenRA.Mods.Common/Traits/Upgrades/ProximityExternalCondition.cs index 4e454d6883..6dab83061e 100644 --- a/OpenRA.Mods.Common/Traits/Upgrades/ProximityExternalCondition.cs +++ b/OpenRA.Mods.Common/Traits/Upgrades/ProximityExternalCondition.cs @@ -14,24 +14,24 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { - [Desc("Applies an upgrade to actors within a specified range.")] + [Desc("Applies a condition to actors within a specified range.")] public class ProximityExternalConditionInfo : ITraitInfo { [FieldLoader.Require] [Desc("The condition to apply. Must be included in the target actor's ExternalConditions list.")] public readonly string Condition = null; - [Desc("The range to search for actors to upgrade.")] + [Desc("The range to search for actors.")] public readonly WDist Range = WDist.FromCells(3); - [Desc("The maximum vertical range above terrain to search for actors to upgrade.", - "Ignored if 0 (actors are upgraded regardless of vertical distance).")] + [Desc("The maximum vertical range above terrain to search for actors.", + "Ignored if 0 (actors are selected regardless of vertical distance).")] public readonly WDist MaximumVerticalOffset = WDist.Zero; [Desc("What diplomatic stances are affected.")] public readonly Stance ValidStances = Stance.Ally; - [Desc("Grant the upgrades apply to this actor.")] + [Desc("Condition is applied permanently to this actor.")] public readonly bool AffectsParent = false; public readonly string EnableSound = null; @@ -119,7 +119,7 @@ namespace OpenRA.Mods.Common.Traits if (produced.OccupiesSpace == null) return; - // We don't grant upgrades when disabled + // We don't grant conditions when disabled if (self.IsDisabled()) return; diff --git a/OpenRA.Mods.Common/Traits/Upgrades/UpgradableTrait.cs b/OpenRA.Mods.Common/Traits/Upgrades/UpgradableTrait.cs index fb4247c00c..0033635bbb 100644 --- a/OpenRA.Mods.Common/Traits/Upgrades/UpgradableTrait.cs +++ b/OpenRA.Mods.Common/Traits/Upgrades/UpgradableTrait.cs @@ -28,7 +28,7 @@ namespace OpenRA.Mods.Common.Traits public abstract object Create(ActorInitializer init); // HACK: A shim for all the ActorPreview code that used to query UpgradeMinEnabledLevel directly - // This can go away after we introduce an InitialUpgrades ActorInit and have the traits query the + // This can go away after we introduce an InitialConditions ActorInit and have the traits query the // condition directly public bool EnabledByDefault { get; private set; } @@ -39,9 +39,9 @@ namespace OpenRA.Mods.Common.Traits } /// - /// Abstract base for enabling and disabling trait using upgrades. + /// Abstract base for enabling and disabling trait using conditions. /// Requires basing *Info on UpgradableTraitInfo and using base(info) constructor. - /// Note that EnabledByUpgrade is not called at creation even if this starts as enabled. + /// TraitEnabled will be called at creation if the trait starts enabled or does not use conditions. /// public abstract class UpgradableTrait : IConditionConsumer, IDisabledTrait, INotifyCreated, ISync where InfoType : UpgradableTraitInfo {