Added smudge chance.

This commit is contained in:
Andre Mohren
2018-11-12 15:35:12 +01:00
committed by reaperrr
parent e01953afa3
commit 99de33bbe3

View File

@@ -28,9 +28,16 @@ namespace OpenRA.Mods.Common.Warheads
[Desc("How close to ground must the impact happen to spawn smudges.")] [Desc("How close to ground must the impact happen to spawn smudges.")]
public readonly WDist AirThreshold = new WDist(128); 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<int> damageModifiers) public override void DoImpact(Target target, Actor firedBy, IEnumerable<int> damageModifiers)
{ {
var world = firedBy.World; var world = firedBy.World;
if (Chance < world.LocalRandom.Next(100))
return;
var pos = target.CenterPosition; var pos = target.CenterPosition;
var dat = world.Map.DistanceAboveTerrain(pos); var dat = world.Map.DistanceAboveTerrain(pos);