Build Acceleration - Change BuildTimeSpeedReduction to be more configurable

This commit is contained in:
Curtis Shmyr
2013-06-12 17:45:43 -06:00
parent d898899de7
commit 3513e6538a

View File

@@ -26,10 +26,8 @@ namespace OpenRA.Mods.RA
public readonly bool SpeedUp = false; public readonly bool SpeedUp = false;
[Desc("Every time another production building of the same queue is", [Desc("Every time another production building of the same queue is",
"contructed, the build times of all actors in the queue", "contructed, the build times of all actors in the queue",
"are divided by this value.")] "decreased by a percentage of the original time.")]
public readonly int BuildTimeSpeedUpDivisor = 2; public readonly int[] BuildTimeSpeedReduction = {100,85,75,65,60,55,50};
[Desc("You can still build more production buildings", "than this value, but the build time won't increase further.")]
public readonly int MaxBuildTimeReductionSteps = 6;
public override object Create(ActorInitializer init) { return new ClassicProductionQueue(init.self, this); } public override object Create(ActorInitializer init) { return new ClassicProductionQueue(init.self, this); }
} }
@@ -108,10 +106,8 @@ namespace OpenRA.Mods.RA
.Where(p => p.Trait.Info.Produces.Contains(unit.Traits.Get<BuildableInfo>().Queue)) .Where(p => p.Trait.Info.Produces.Contains(unit.Traits.Get<BuildableInfo>().Queue))
.Where(p => p.Actor.Owner == self.Owner).ToArray(); .Where(p => p.Actor.Owner == self.Owner).ToArray();
var BuildTimeReductionSteps = Math.Min(selfsameBuildings.Count(), Info.MaxBuildTimeReductionSteps); var speedModifier = Math.Min(selfsameBuildings.Count(), Info.BuildTimeSpeedReduction.Length - 1);
time = (time * Info.BuildTimeSpeedReduction[speedModifier]) / 100;
for (int i = 1; i < BuildTimeReductionSteps; i++)
time /= Info.BuildTimeSpeedUpDivisor;
} }
return time; return time;