From 99de33bbe346f55028ab6aa6ae106195ab688a98 Mon Sep 17 00:00:00 2001 From: Andre Mohren Date: Mon, 12 Nov 2018 15:35:12 +0100 Subject: [PATCH] Added smudge chance. --- OpenRA.Mods.Common/Warheads/LeaveSmudgeWarhead.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/OpenRA.Mods.Common/Warheads/LeaveSmudgeWarhead.cs b/OpenRA.Mods.Common/Warheads/LeaveSmudgeWarhead.cs index 67a7cd9efe..289d54efec 100644 --- a/OpenRA.Mods.Common/Warheads/LeaveSmudgeWarhead.cs +++ b/OpenRA.Mods.Common/Warheads/LeaveSmudgeWarhead.cs @@ -28,9 +28,16 @@ namespace OpenRA.Mods.Common.Warheads [Desc("How close to ground must the impact happen to spawn smudges.")] public readonly WDist AirThreshold = new WDist(128); + [Desc("Percentual chance the smudge is created.")] + public readonly int Chance = 100; + public override void DoImpact(Target target, Actor firedBy, IEnumerable damageModifiers) { var world = firedBy.World; + + if (Chance < world.LocalRandom.Next(100)) + return; + var pos = target.CenterPosition; var dat = world.Map.DistanceAboveTerrain(pos);