Upgrade rules for increasing HP and damage by 10x for the D2K mod
This commit is contained in:
@@ -1301,15 +1301,18 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
}
|
||||
}
|
||||
|
||||
// Multiply all health and damage in the TD and RA mod by 100 to avoid issues caused by rounding
|
||||
// Multiply all health and damage in shipping mods by 100 to avoid issues caused by rounding
|
||||
if (engineVersion < 20171212)
|
||||
{
|
||||
var mod = modData.Manifest.Id;
|
||||
if (mod == "cnc" || mod == "ra")
|
||||
if (mod == "cnc" || mod == "ra" || mod == "d2k")
|
||||
{
|
||||
if (node.Key == "HP" && parent.Key == "Health")
|
||||
{
|
||||
var oldValue = FieldLoader.GetValue<int>(node.Key, node.Value.Value);
|
||||
if (mod == "d2k")
|
||||
node.Value.Value = MultiplyByFactor(oldValue, 10);
|
||||
else
|
||||
node.Value.Value = MultiplyByFactor(oldValue, 100);
|
||||
}
|
||||
|
||||
@@ -1321,6 +1324,9 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
else if (step != null)
|
||||
{
|
||||
var oldValue = FieldLoader.GetValue<int>(step.Key, step.Value.Value);
|
||||
if (mod == "d2k")
|
||||
step.Value.Value = MultiplyByFactor(oldValue, 10);
|
||||
else
|
||||
step.Value.Value = MultiplyByFactor(oldValue, 100);
|
||||
}
|
||||
}
|
||||
@@ -1333,6 +1339,9 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
else if (step != null)
|
||||
{
|
||||
var oldValue = FieldLoader.GetValue<int>(step.Key, step.Value.Value);
|
||||
if (mod == "d2k")
|
||||
step.Value.Value = MultiplyByFactor(oldValue, 10);
|
||||
else
|
||||
step.Value.Value = MultiplyByFactor(oldValue, 100);
|
||||
}
|
||||
}
|
||||
@@ -1345,6 +1354,9 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
else if (step != null)
|
||||
{
|
||||
var oldValue = FieldLoader.GetValue<int>(step.Key, step.Value.Value);
|
||||
if (mod == "d2k")
|
||||
step.Value.Value = MultiplyByFactor(oldValue, 10);
|
||||
else
|
||||
step.Value.Value = MultiplyByFactor(oldValue, 100);
|
||||
}
|
||||
}
|
||||
@@ -1357,6 +1369,9 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
else if (step != null)
|
||||
{
|
||||
var oldValue = FieldLoader.GetValue<int>(step.Key, step.Value.Value);
|
||||
if (mod == "d2k")
|
||||
step.Value.Value = MultiplyByFactor(oldValue, 10);
|
||||
else
|
||||
step.Value.Value = MultiplyByFactor(oldValue, 100);
|
||||
}
|
||||
}
|
||||
@@ -1367,6 +1382,9 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
if (step != null)
|
||||
{
|
||||
var oldValue = FieldLoader.GetValue<int>(step.Key, step.Value.Value);
|
||||
if (mod == "d2k")
|
||||
step.Value.Value = MultiplyByFactor(oldValue, 10);
|
||||
else
|
||||
step.Value.Value = MultiplyByFactor(oldValue, 100);
|
||||
}
|
||||
}
|
||||
@@ -1624,15 +1642,18 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
if (node.Key == "BurstDelay")
|
||||
node.Key = "BurstDelays";
|
||||
|
||||
// Multiply all health and damage in the TD and RA mod by 100 to avoid issues caused by rounding
|
||||
// Multiply all health and damage in shipping mods by 100 to avoid issues caused by rounding
|
||||
if (engineVersion < 20171212)
|
||||
{
|
||||
var mod = modData.Manifest.Id;
|
||||
if (mod == "cnc" || mod == "ra")
|
||||
if (mod == "cnc" || mod == "ra" || mod == "d2k")
|
||||
{
|
||||
if (node.Key == "Damage" && (parent.Value.Value == "SpreadDamage" || parent.Value.Value == "TargetDamage"))
|
||||
{
|
||||
var oldValue = FieldLoader.GetValue<int>(node.Key, node.Value.Value);
|
||||
if (mod == "d2k")
|
||||
node.Value.Value = MultiplyByFactor(oldValue, 10);
|
||||
else
|
||||
node.Value.Value = MultiplyByFactor(oldValue, 100);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user