Rename ProductionQueue.BuildSpeed and change it's default value.

This commit is contained in:
Zimmermann Gyula
2016-05-18 11:14:51 +02:00
parent de10cb22e8
commit f80ac6e5c0
3 changed files with 13 additions and 4 deletions

View File

@@ -41,7 +41,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly int BuildDuration = -1; public readonly int BuildDuration = -1;
[Desc("Percentage modifier to apply to the build duration.")] [Desc("Percentage modifier to apply to the build duration.")]
public readonly int BuildDurationModifier = 150; public readonly int BuildDurationModifier = 60;
// TODO: UI fluff; doesn't belong here // TODO: UI fluff; doesn't belong here
public readonly int BuildPaletteOrder = 9999; public readonly int BuildPaletteOrder = 9999;

View File

@@ -35,7 +35,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly bool Sticky = true; public readonly bool Sticky = true;
[Desc("This percentage value is multiplied with actor cost to translate into build time (lower means faster).")] [Desc("This percentage value is multiplied with actor cost to translate into build time (lower means faster).")]
public readonly int BuildSpeed = 40; public readonly int BuildDurationModifier = 100;
[Desc("The build time is multiplied with this value on low power.")] [Desc("The build time is multiplied with this value on low power.")]
public readonly int LowPowerSlowdown = 3; public readonly int LowPowerSlowdown = 3;
@@ -327,7 +327,7 @@ namespace OpenRA.Mods.Common.Traits
time = valued != null ? valued.Cost : 0; time = valued != null ? valued.Cost : 0;
} }
time = time * bi.BuildDurationModifier * Info.BuildSpeed / 10000; time = time * bi.BuildDurationModifier * Info.BuildDurationModifier / 10000;
return time; return time;
} }

View File

@@ -321,12 +321,21 @@ namespace OpenRA.Mods.Common.UtilityCommands
var value = cbtv.Value.Nodes.First(n => n.Key == "Value"); var value = cbtv.Value.Nodes.First(n => n.Key == "Value");
value.Key = "BuildDuration"; value.Key = "BuildDuration";
bi.Value.Nodes.Add(value); bi.Value.Nodes.Add(value);
bi.Value.Nodes.Add(new MiniYamlNode("BuildDurationModifier", "100")); bi.Value.Nodes.Add(new MiniYamlNode("BuildDurationModifier", "40"));
} }
node.Value.Nodes.RemoveAll(n => n.Key == "CustomBuildTimeValue"); node.Value.Nodes.RemoveAll(n => n.Key == "CustomBuildTimeValue");
node.Value.Nodes.RemoveAll(n => n.Key == "-CustomBuildTimeValue"); node.Value.Nodes.RemoveAll(n => n.Key == "-CustomBuildTimeValue");
} }
// rename ProductionQueue.BuildSpeed
if (node.Key == "BuildSpeed")
{
node.Key = "BuildDurationModifier";
var oldValue = FieldLoader.GetValue<int>(node.Key, node.Value.Value);
oldValue = oldValue * 100 / 40;
node.Value.Value = oldValue.ToString();
}
} }
UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1); UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);