diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj index b9e1fe0516..fc98f2f131 100644 --- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -778,7 +778,6 @@ - diff --git a/OpenRA.Mods.Common/Traits/Conditions/ConditionManager.cs b/OpenRA.Mods.Common/Traits/Conditions/ConditionManager.cs index d626c183c8..2123c8896e 100644 --- a/OpenRA.Mods.Common/Traits/Conditions/ConditionManager.cs +++ b/OpenRA.Mods.Common/Traits/Conditions/ConditionManager.cs @@ -63,15 +63,9 @@ namespace OpenRA.Mods.Common.Traits /// Each granted condition receives a unique token that is used when revoking. Dictionary tokens = new Dictionary(); - /// Set of conditions that are monitored for stacked bonuses, and the bonus conditions that they grant. - readonly Dictionary stackedConditions = new Dictionary(); - - /// Tokens granted by the stacked condition bonuses defined in stackedConditions. - readonly Dictionary> stackedTokens = new Dictionary>(); - int nextToken = 1; - /// Cache of condition -> enabled state for quick evaluation of boolean conditions. + /// Cache of condition -> enabled state for quick evaluation of token counter conditions. readonly Dictionary conditionCache = new Dictionary(); /// Read-only version of conditionCache that is passed to IConditionConsumers. @@ -111,12 +105,6 @@ namespace OpenRA.Mods.Common.Traits conditionCache[kv.Value] = conditionState.Tokens.Count; } - foreach (var sc in self.Info.TraitInfos()) - { - stackedConditions[sc.Condition] = sc.StackedConditions; - stackedTokens[sc.Condition] = new Stack(); - } - // Update all traits with their initial condition state foreach (var consumer in allConsumers) consumer.ConditionsChanged(self, readOnlyConditionCache); @@ -137,26 +125,6 @@ namespace OpenRA.Mods.Common.Traits foreach (var t in conditionState.Consumers) t.ConditionsChanged(self, readOnlyConditionCache); - - string[] sc; - if (stackedConditions.TryGetValue(condition, out sc)) - { - var target = (conditionState.Tokens.Count - 1).Clamp(0, sc.Length); - var st = stackedTokens[condition]; - for (var i = st.Count; i < target; i++) - { - // Empty strings are used to skip unwanted levels - var t = !string.IsNullOrEmpty(sc[i]) ? GrantCondition(self, sc[i]) : InvalidConditionToken; - st.Push(t); - } - - for (var i = st.Count; i > target; i--) - { - var t = st.Pop(); - if (t != InvalidConditionToken) - RevokeCondition(self, t); - } - } } /// Grants a specified condition. diff --git a/OpenRA.Mods.Common/Traits/Conditions/StackedCondition.cs b/OpenRA.Mods.Common/Traits/Conditions/StackedCondition.cs deleted file mode 100644 index c2cd3574a8..0000000000 --- a/OpenRA.Mods.Common/Traits/Conditions/StackedCondition.cs +++ /dev/null @@ -1,34 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2017 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, either version 3 of - * the License, or (at your option) any later version. For more - * information, see COPYING. - */ -#endregion - -using OpenRA.Traits; - -namespace OpenRA.Mods.Common.Traits -{ - [Desc("Grant additional conditions when a specified condition has been granted multiple times.")] - public class StackedConditionInfo : TraitInfo - { - [FieldLoader.Require] - [ConsumedConditionReference] - [Desc("Condition to monitor.")] - public readonly string Condition = null; - - [FieldLoader.Require] - [FieldLoader.AllowEmptyEntries] - [GrantedConditionReference] - [Desc("Conditions to grant when the monitored condition is granted multiple times.", - "The first entry is activated at 2x grants, second entry at 3x grants, and so on.", - "Use empty entries to skip levels.")] - public readonly string[] StackedConditions = { }; - } - - public class StackedCondition { } -}