diff --git a/OpenRA.Mods.Common/Projectiles/GravityBomb.cs b/OpenRA.Mods.Common/Projectiles/GravityBomb.cs index 9c5498f652..e4ea012f70 100644 --- a/OpenRA.Mods.Common/Projectiles/GravityBomb.cs +++ b/OpenRA.Mods.Common/Projectiles/GravityBomb.cs @@ -34,10 +34,11 @@ namespace OpenRA.Mods.Common.Projectiles [PaletteReference] public readonly string ShadowPalette = "shadow"; - public readonly WDist Speed = WDist.Zero; + [Desc("Projectile movement vector per tick (forward, right, up), use negative values for opposite directions.")] + public readonly WVec Velocity = WVec.Zero; - [Desc("Value added to speed every tick.")] - public readonly WDist Acceleration = new WDist(15); + [Desc("Value added to Velocity every tick.")] + public readonly WVec Acceleration = new WVec(0, 0, -15); public IProjectile Create(ProjectileArgs args) { return new GravityBomb(this, args); } } @@ -47,17 +48,18 @@ namespace OpenRA.Mods.Common.Projectiles readonly GravityBombInfo info; readonly Animation anim; readonly ProjectileArgs args; + readonly WVec acceleration; [Sync] WVec velocity; [Sync] WPos pos; - [Sync] WVec acceleration; public GravityBomb(GravityBombInfo info, ProjectileArgs args) { this.info = info; this.args = args; pos = args.Source; - velocity = new WVec(WDist.Zero, WDist.Zero, -info.Speed); - acceleration = new WVec(WDist.Zero, WDist.Zero, info.Acceleration); + var convertedVelocity = new WVec(info.Velocity.Y, -info.Velocity.X, info.Velocity.Z); + velocity = convertedVelocity.Rotate(WRot.FromFacing(args.Facing)); + acceleration = new WVec(info.Acceleration.Y, -info.Acceleration.X, info.Acceleration.Z); if (!string.IsNullOrEmpty(info.Image)) { @@ -72,7 +74,7 @@ namespace OpenRA.Mods.Common.Projectiles public void Tick(World world) { - velocity -= acceleration; + velocity += acceleration; pos += velocity; if (pos.Z <= args.PassiveTarget.Z) diff --git a/mods/d2k/weapons/other.yaml b/mods/d2k/weapons/other.yaml index f8261044c4..a76d6b5a56 100644 --- a/mods/d2k/weapons/other.yaml +++ b/mods/d2k/weapons/other.yaml @@ -55,8 +55,8 @@ OrniBomb: Range: 2c0 Projectile: GravityBomb Image: BOMBS - Speed: 64 - Acceleration: 0 + Velocity: 0, 0, -64 + Acceleration: 0, 0, 0 Shadow: true Warhead@1Dam: SpreadDamage Spread: 320 diff --git a/mods/ra/weapons/superweapons.yaml b/mods/ra/weapons/superweapons.yaml index 176e77a215..dd42dec876 100644 --- a/mods/ra/weapons/superweapons.yaml +++ b/mods/ra/weapons/superweapons.yaml @@ -5,8 +5,8 @@ ParaBomb: Projectile: GravityBomb Image: PARABOMB OpenSequence: open - Speed: 86 - Acceleration: 0 + Velocity: 0, 0, -86 + Acceleration: 0, 0, 0 Warhead@1Dam: SpreadDamage Spread: 768 Damage: 300