Add StartBurstReport to WeaponInfo

The FS Juggernaut firing sound already contains 3 shots, so without this, players would hear a total of 9(!) shots per salvo.
This commit is contained in:
reaperrr
2017-03-31 14:00:08 +02:00
committed by Paul Chote
parent d502b296bb
commit b8c251cf41
2 changed files with 7 additions and 1 deletions

View File

@@ -39,9 +39,12 @@ namespace OpenRA.GameRules
[Desc("The maximum range the weapon can fire.")]
public readonly WDist Range = WDist.Zero;
[Desc("The sound played when the weapon is fired.")]
[Desc("The sound played each time the weapon is fired.")]
public readonly string[] Report = null;
[Desc("Sound played only on first burst in a salvo.")]
public readonly string[] StartBurstReport = null;
[Desc("The sound played when the weapon is reloaded.")]
public readonly string[] AfterFireSound = null;

View File

@@ -247,6 +247,9 @@ namespace OpenRA.Mods.Common.Traits
if (args.Weapon.Report != null && args.Weapon.Report.Any())
Game.Sound.Play(SoundType.World, args.Weapon.Report.Random(self.World.SharedRandom), self.CenterPosition);
if (Burst == args.Weapon.Burst && args.Weapon.StartBurstReport != null && args.Weapon.StartBurstReport.Any())
Game.Sound.Play(SoundType.World, args.Weapon.StartBurstReport.Random(self.World.SharedRandom), self.CenterPosition);
foreach (var na in self.TraitsImplementing<INotifyAttack>())
na.Attacking(self, target, this, barrel);