From 51db12467d082534398c68fef89f8a703a85be64 Mon Sep 17 00:00:00 2001 From: Zimmermann Gyula Date: Mon, 28 Nov 2016 14:43:13 +0100 Subject: [PATCH 1/2] Allow the missile to snap at the target at reach. --- OpenRA.Mods.Common/Projectiles/Missile.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Projectiles/Missile.cs b/OpenRA.Mods.Common/Projectiles/Missile.cs index 2342d10640..c26bbe9d43 100644 --- a/OpenRA.Mods.Common/Projectiles/Missile.cs +++ b/OpenRA.Mods.Common/Projectiles/Missile.cs @@ -136,6 +136,10 @@ namespace OpenRA.Mods.Common.Projectiles [Desc("Explodes when leaving the following terrain type, e.g., Water for torpedoes.")] public readonly string BoundToTerrainType = ""; + [Desc("Allow the missile to snap to the target, meaning jumping to the target immediately when", + "the missile enters the radius of the current speed around the target.")] + public readonly bool AllowSnapping = false; + [Desc("Explodes when inside this proximity radius to target.", "Note: If this value is lower than the missile speed, this check might", "not trigger fast enough, causing the missile to fly past the target.")] @@ -813,7 +817,10 @@ namespace OpenRA.Mods.Common.Projectiles // Move the missile var lastPos = pos; - pos += move; + if (info.AllowSnapping && state != States.Freefall && relTarDist < move.Length) + pos = targetPosition + offset; + else + pos += move; // Check for walls or other blocking obstacles var shouldExplode = false; From bf810cd934ab325d89693aabe338ced37104839e Mon Sep 17 00:00:00 2001 From: Zimmermann Gyula Date: Mon, 28 Nov 2016 14:45:20 +0100 Subject: [PATCH 2/2] Enable missile snapping in TS. --- mods/ts/weapons/missiles.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/mods/ts/weapons/missiles.yaml b/mods/ts/weapons/missiles.yaml index 3fe399d9eb..69024553e3 100644 --- a/mods/ts/weapons/missiles.yaml +++ b/mods/ts/weapons/missiles.yaml @@ -20,6 +20,7 @@ MaximumLaunchAngle: 192 VerticalRateOfTurn: 16 CruiseAltitude: 1c512 + AllowSnapping: true Warhead@1Dam: SpreadDamage Spread: 128 Damage: 25