Implement airburst support to Bullet.

This commit is contained in:
Zimmermann Gyula
2017-01-26 23:41:08 +01:00
parent 28e204a8ae
commit 902d2a0016

View File

@@ -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);