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;
[Desc("Every time another production building of the same queue is",
"contructed, the build times of all actors in the queue",
"are divided by this value.")]
public readonly int BuildTimeSpeedUpDivisor = 2;
[Desc("You can still build more production buildings", "than this value, but the build time won't increase further.")]
public readonly int MaxBuildTimeReductionSteps = 6;
"decreased by a percentage of the original time.")]
public readonly int[] BuildTimeSpeedReduction = {100,85,75,65,60,55,50};
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.Actor.Owner == self.Owner).ToArray();
var BuildTimeReductionSteps = Math.Min(selfsameBuildings.Count(), Info.MaxBuildTimeReductionSteps);
for (int i = 1; i < BuildTimeReductionSteps; i++)
time /= Info.BuildTimeSpeedUpDivisor;
var speedModifier = Math.Min(selfsameBuildings.Count(), Info.BuildTimeSpeedReduction.Length - 1);
time = (time * Info.BuildTimeSpeedReduction[speedModifier]) / 100;
}
return time;