Merge pull request #9708 from r34ch/chronotank-extra-bar
Charge now using ticks and fixed extra bar time formula.
This commit is contained in:
@@ -2253,6 +2253,19 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ChargeTime is now replaced by ChargeDelay.
|
||||||
|
// ChargeDelay uses 500 as a default now.
|
||||||
|
if (engineVersion < 20151022)
|
||||||
|
{
|
||||||
|
if (depth == 2 && parentKey == "PortableChrono" && node.Key == "ChargeTime")
|
||||||
|
{
|
||||||
|
node.Key = "ChargeDelay";
|
||||||
|
|
||||||
|
if (node.Value.Value != null)
|
||||||
|
node.Value.Value = (Exts.ParseIntegerInvariant(node.Value.Value) * 25).ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1);
|
UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ namespace OpenRA.Mods.RA.Traits
|
|||||||
{
|
{
|
||||||
class PortableChronoInfo : ITraitInfo
|
class PortableChronoInfo : ITraitInfo
|
||||||
{
|
{
|
||||||
[Desc("Cooldown in seconds until the unit can teleport.")]
|
[Desc("Cooldown in ticks until the unit can teleport.")]
|
||||||
public readonly int ChargeTime = 20;
|
public readonly int ChargeDelay = 500;
|
||||||
|
|
||||||
[Desc("Can the unit teleport only a certain distance?")]
|
[Desc("Can the unit teleport only a certain distance?")]
|
||||||
public readonly bool HasDistanceLimit = true;
|
public readonly bool HasDistanceLimit = true;
|
||||||
@@ -97,7 +97,7 @@ namespace OpenRA.Mods.RA.Traits
|
|||||||
|
|
||||||
public void ResetChargeTime()
|
public void ResetChargeTime()
|
||||||
{
|
{
|
||||||
chargeTick = 25 * Info.ChargeTime;
|
chargeTick = Info.ChargeDelay;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanTeleport
|
public bool CanTeleport
|
||||||
@@ -107,7 +107,7 @@ namespace OpenRA.Mods.RA.Traits
|
|||||||
|
|
||||||
public float GetValue()
|
public float GetValue()
|
||||||
{
|
{
|
||||||
return (float)((chargeTick - (25 * Info.ChargeTime)) * (Info.ChargeTime * -0.0001));
|
return (float)(Info.ChargeDelay - chargeTick) / Info.ChargeDelay;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Color GetColor() { return Color.Magenta; }
|
public Color GetColor() { return Color.Magenta; }
|
||||||
|
|||||||
Reference in New Issue
Block a user