Add ability to have randomised reports for weapons
This commit is contained in:
@@ -86,7 +86,7 @@ namespace OpenRA.GameRules
|
||||
public class WeaponInfo
|
||||
{
|
||||
public readonly float Range = 0;
|
||||
public readonly string Report = null;
|
||||
public readonly string[] Report = null;
|
||||
public readonly int ROF = 1;
|
||||
public readonly int Burst = 1;
|
||||
public readonly bool Charges = false;
|
||||
|
||||
@@ -56,8 +56,8 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
self.World.Add(args.weapon.Projectile.Create(args));
|
||||
|
||||
if (!string.IsNullOrEmpty(args.weapon.Report))
|
||||
Sound.Play(args.weapon.Report + ".aud", self.CenterLocation);
|
||||
if (args.weapon.Report != null)
|
||||
Sound.Play(args.weapon.Report.Random(self.World.SharedRandom) + ".aud", self.CenterLocation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace OpenRA.Mods.RA
|
||||
};
|
||||
|
||||
if (args.weapon.Report != null)
|
||||
Sound.Play(args.weapon.Report + ".aud", pos);
|
||||
Sound.Play(args.weapon.Report.Random(attacker.World.SharedRandom) + ".aud", pos);
|
||||
|
||||
DoImpacts(args);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#region Copyright & License Information
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
@@ -148,8 +148,8 @@ namespace OpenRA.Mods.RA
|
||||
if (projectile != null)
|
||||
self.World.Add(projectile);
|
||||
|
||||
if (!string.IsNullOrEmpty(args.weapon.Report))
|
||||
Sound.Play(args.weapon.Report + ".aud", self.CenterLocation);
|
||||
if (args.weapon.Report != null)
|
||||
Sound.Play(args.weapon.Report.Random(self.World.SharedRandom) + ".aud", self.CenterLocation);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user