diff --git a/OpenRA.Mods.Cnc/Effects/SatelliteLaunch.cs b/OpenRA.Mods.Cnc/Effects/SatelliteLaunch.cs index 3e6b92b03f..ef657dc5eb 100644 --- a/OpenRA.Mods.Cnc/Effects/SatelliteLaunch.cs +++ b/OpenRA.Mods.Cnc/Effects/SatelliteLaunch.cs @@ -45,7 +45,7 @@ namespace OpenRA.Mods.Cnc.Effects if (++frame == 19) { var palette = info.SatellitePaletteIsPlayerPalette ? info.SatellitePalette + launcher.Owner.InternalName : info.SatellitePalette; - world.AddFrameEndTask(w => w.Add(new GpsSatellite(world, pos, info.SatelliteImage, info.SatelliteSequence, palette, info.RevealDelay * 25, launcher.Owner))); + world.AddFrameEndTask(w => w.Add(new GpsSatellite(world, pos, info.SatelliteImage, info.SatelliteSequence, palette, info.RevealDelay, launcher.Owner))); } } diff --git a/OpenRA.Mods.Cnc/Traits/SupportPowers/ChronoshiftPower.cs b/OpenRA.Mods.Cnc/Traits/SupportPowers/ChronoshiftPower.cs index 49907a134f..bc7ededc1b 100644 --- a/OpenRA.Mods.Cnc/Traits/SupportPowers/ChronoshiftPower.cs +++ b/OpenRA.Mods.Cnc/Traits/SupportPowers/ChronoshiftPower.cs @@ -25,8 +25,8 @@ namespace OpenRA.Mods.Cnc.Traits [Desc("Target actor selection radius in cells.")] public readonly int Range = 1; - [Desc("Seconds until returning after teleportation.")] - public readonly int Duration = 30; + [Desc("Ticks until returning after teleportation.")] + public readonly int Duration = 750; [PaletteReference] public readonly string TargetOverlayPalette = TileSet.TerrainPaletteInternalName; @@ -70,7 +70,7 @@ namespace OpenRA.Mods.Cnc.Traits var cpi = Info as ChronoshiftPowerInfo; if (self.Owner.Shroud.IsExplored(targetCell) && cs.CanChronoshiftTo(target, targetCell)) - cs.Teleport(target, targetCell, cpi.Duration * 25, cpi.KillCargo, self); + cs.Teleport(target, targetCell, cpi.Duration, cpi.KillCargo, self); } } diff --git a/OpenRA.Mods.Cnc/Traits/SupportPowers/GpsPower.cs b/OpenRA.Mods.Cnc/Traits/SupportPowers/GpsPower.cs index f3b0d0a975..78d24efd2f 100644 --- a/OpenRA.Mods.Cnc/Traits/SupportPowers/GpsPower.cs +++ b/OpenRA.Mods.Cnc/Traits/SupportPowers/GpsPower.cs @@ -22,6 +22,7 @@ namespace OpenRA.Mods.Cnc.Traits [Desc("Requires `GpsWatcher` on the player actor.")] class GpsPowerInfo : SupportPowerInfo { + [Desc("Delay in ticks between launching and revealing the map.")] public readonly int RevealDelay = 0; public readonly string DoorImage = "atek"; diff --git a/OpenRA.Mods.Cnc/Traits/SupportPowers/IonCannonPower.cs b/OpenRA.Mods.Cnc/Traits/SupportPowers/IonCannonPower.cs index 526ad72d55..9324d03f62 100644 --- a/OpenRA.Mods.Cnc/Traits/SupportPowers/IonCannonPower.cs +++ b/OpenRA.Mods.Cnc/Traits/SupportPowers/IonCannonPower.cs @@ -24,7 +24,7 @@ namespace OpenRA.Mods.Cnc.Traits [Desc("Actor to spawn when the attack starts")] public readonly string CameraActor = null; - [Desc("Amount of time to keep the camera alive")] + [Desc("Number of ticks to keep the camera alive")] public readonly int CameraRemoveDelay = 25; [Desc("Effect sequence sprite image")] diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/SupportPower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/SupportPower.cs index 052a1fb267..3a4b6dda35 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/SupportPower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/SupportPower.cs @@ -15,8 +15,8 @@ namespace OpenRA.Mods.Common.Traits { public abstract class SupportPowerInfo : PausableConditionalTraitInfo { - [Desc("Measured in seconds.")] - public readonly int ChargeTime = 0; + [Desc("Measured in ticks.")] + public readonly int ChargeInterval = 0; public readonly string Icon = null; public readonly string Description = ""; public readonly string LongDesc = ""; diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/SupportPowerManager.cs b/OpenRA.Mods.Common/Traits/SupportPowers/SupportPowerManager.cs index a641af8d2e..948206dc72 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/SupportPowerManager.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/SupportPowerManager.cs @@ -62,8 +62,8 @@ namespace OpenRA.Mods.Common.Traits Powers.Add(key, new SupportPowerInstance(key, this) { Instances = new List(), - RemainingTime = t.Info.StartFullyCharged ? 0 : t.Info.ChargeTime * 25, - TotalTime = t.Info.ChargeTime * 25, + RemainingTime = t.Info.StartFullyCharged ? 0 : t.Info.ChargeInterval, + TotalTime = t.Info.ChargeInterval, }); if (t.Info.Prerequisites.Any()) diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index fc0e418094..e230523626 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -1606,6 +1606,35 @@ namespace OpenRA.Mods.Common.UtilityCommands } } + if (engineVersion < 20171228) + { + var chargeTime = node.Value.Nodes.FirstOrDefault(n => n.Key == "ChargeTime"); + if (chargeTime != null) + { + var chargeTimeValue = FieldLoader.GetValue("ChargeTime", chargeTime.Value.Value); + if (chargeTimeValue > 0) + chargeTime.Value.Value = (chargeTimeValue * 25).ToString(); + + RenameNodeKey(chargeTime, "ChargeInterval"); + } + + if (node.Key.StartsWith("GpsPower", StringComparison.Ordinal)) + { + var revealDelay = node.Value.Nodes.FirstOrDefault(n => n.Key == "RevealDelay"); + var revealDelayValue = revealDelay != null ? FieldLoader.GetValue("RevealDelay", revealDelay.Value.Value) : 0; + if (revealDelay != null && revealDelayValue > 0) + revealDelay.Value.Value = (revealDelayValue * 25).ToString(); + } + + if (node.Key.StartsWith("ChronoshiftPower", StringComparison.Ordinal)) + { + var duration = node.Value.Nodes.FirstOrDefault(n => n.Key == "Duration"); + var durationValue = duration != null ? FieldLoader.GetValue("Duration", duration.Value.Value) : 0; + if (duration != null && durationValue > 0) + duration.Value.Value = (durationValue * 25).ToString(); + } + } + UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1); } diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/SupportPowerTooltipLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/SupportPowerTooltipLogic.cs index fbcda205bc..3efba63b1c 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/SupportPowerTooltipLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/SupportPowerTooltipLogic.cs @@ -60,7 +60,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic var descSize = descFont.Measure(descLabel.Text); var remaining = WidgetUtils.FormatTime(sp.RemainingTime, world.Timestep); - var total = WidgetUtils.FormatTime(sp.Info.ChargeTime * 25, world.Timestep); + var total = WidgetUtils.FormatTime(sp.Info.ChargeInterval, world.Timestep); timeLabel.Text = "{0} / {1}".F(remaining, total); var timeSize = timeFont.Measure(timeLabel.Text);