From 902d2a0016325ae5c08398be10bc114678524f8c Mon Sep 17 00:00:00 2001 From: Zimmermann Gyula Date: Thu, 26 Jan 2017 23:41:08 +0100 Subject: [PATCH] Implement airburst support to Bullet. --- OpenRA.Mods.Common/Projectiles/Bullet.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OpenRA.Mods.Common/Projectiles/Bullet.cs b/OpenRA.Mods.Common/Projectiles/Bullet.cs index 461454e983..c5666d2d88 100644 --- a/OpenRA.Mods.Common/Projectiles/Bullet.cs +++ b/OpenRA.Mods.Common/Projectiles/Bullet.cs @@ -79,6 +79,9 @@ namespace OpenRA.Mods.Common.Projectiles [Desc("Delay in ticks until trail animation is spawned.")] public readonly int TrailDelay = 1; + [Desc("Altitude above terrain below which to explode. Zero effectively deactivates airburst.")] + public readonly WDist AirburstAltitude = WDist.Zero; + [Desc("Palette used to render the trail sequence.")] [PaletteReference("TrailUsePlayerPalette")] public readonly string TrailPalette = "effect"; @@ -142,6 +145,9 @@ namespace OpenRA.Mods.Common.Projectiles target += WVec.FromPDF(world.SharedRandom, 2) * maxOffset / 1024; } + if (info.AirburstAltitude > WDist.Zero) + target += new WVec(WDist.Zero, WDist.Zero, info.AirburstAltitude); + facing = (target - pos).Yaw.Facing; length = Math.Max((target - pos).Length / speed.Length, 1);