diff --git a/OpenRA.Mods.RA/Buildings/CustomBuildTimeValue.cs b/OpenRA.Mods.RA/Buildings/CustomBuildTimeValue.cs new file mode 100755 index 0000000000..f881894de8 --- /dev/null +++ b/OpenRA.Mods.RA/Buildings/CustomBuildTimeValue.cs @@ -0,0 +1,23 @@ +#region Copyright & License Information +/* + * Copyright 2007-2012 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, + * see COPYING. + */ +#endregion + +using OpenRA.Traits; + +namespace OpenRA.Mods.RA.Buildings +{ + // allow a nonstandard build time value for a cnc classic mod + + public class CustomBuildTimeValueInfo : TraitInfo + { + public readonly int Value = 0; //in milisecons + } + + public class CustomBuildTimeValue { } +} diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index bd04530279..cf6f8c3ed1 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -146,6 +146,7 @@ + diff --git a/OpenRA.Mods.RA/Player/ProductionQueue.cs b/OpenRA.Mods.RA/Player/ProductionQueue.cs index d5fc343382..06a31a31ec 100755 --- a/OpenRA.Mods.RA/Player/ProductionQueue.cs +++ b/OpenRA.Mods.RA/Player/ProductionQueue.cs @@ -254,6 +254,10 @@ namespace OpenRA.Mods.RA * Info.BuildSpeed * (25 * 60) /* frames per min */ /* todo: build acceleration, if we do that */ / 1000; + + if (unit.Traits.Contains()) + time = unit.Traits.Get().Value * (1 / Info.BuildSpeed); + return (int) time; } diff --git a/mods/cnc/rules/structures.yaml b/mods/cnc/rules/structures.yaml index 5029ed6479..502c0d51af 100644 --- a/mods/cnc/rules/structures.yaml +++ b/mods/cnc/rules/structures.yaml @@ -100,6 +100,8 @@ PROC: Bounds: 73,72 CustomSellValue: Value: 300 + CustomBuildTimeValue: + Value: 80 FreeActor: Actor: HARV InitialActivity: FindResources