diff --git a/OpenRA.Mods.Common/Projectiles/LaserZap.cs b/OpenRA.Mods.Common/Projectiles/LaserZap.cs index 64070d1f11..c4ec2473f4 100644 --- a/OpenRA.Mods.Common/Projectiles/LaserZap.cs +++ b/OpenRA.Mods.Common/Projectiles/LaserZap.cs @@ -32,7 +32,7 @@ namespace OpenRA.Mods.Common.Projectiles [Desc("Equivalent to sequence ZOffset. Controls Z sorting.")] public readonly int ZOffset = 0; - public readonly int BeamDuration = 10; + public readonly int Duration = 10; public readonly bool UsePlayerColor = false; @@ -94,7 +94,7 @@ namespace OpenRA.Mods.Common.Projectiles if (hitanim != null) hitanim.Tick(); - if (++ticks >= info.BeamDuration && animationComplete) + if (++ticks >= info.Duration && animationComplete) world.AddFrameEndTask(w => w.Remove(this)); } @@ -104,9 +104,9 @@ namespace OpenRA.Mods.Common.Projectiles wr.World.FogObscures(args.Source)) yield break; - if (ticks < info.BeamDuration) + if (ticks < info.Duration) { - var rc = Color.FromArgb((info.BeamDuration - ticks) * color.A / info.BeamDuration, color); + var rc = Color.FromArgb((info.Duration - ticks) * color.A / info.Duration, color); yield return new BeamRenderable(args.Source, info.ZOffset, target - args.Source, info.Shape, info.Width, rc); } diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index 486228374a..49f7adf1b4 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -422,6 +422,13 @@ namespace OpenRA.Mods.Common.UtilityCommands node.Key = "Speed"; } + // Rename LaserZap BeamDuration to just Duration + if (engineVersion < 20161009) + { + if (node.Key == "BeamDuration") + node.Key = "Duration"; + } + UpgradeWeaponRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1); } } diff --git a/mods/ts/weapons/energyweapons.yaml b/mods/ts/weapons/energyweapons.yaml index 8f0b71be88..4be40a3673 100644 --- a/mods/ts/weapons/energyweapons.yaml +++ b/mods/ts/weapons/energyweapons.yaml @@ -193,7 +193,7 @@ TurretLaserFire: Report: lastur1.aud Projectile: LaserZap Width: 50 - BeamDuration: 5 + Duration: 5 ZOffset: 2047 Color: FF000045 Warhead@1Dam: SpreadDamage