Add ability to have randomised reports for weapons

This commit is contained in:
Scott_NZ
2013-02-03 15:26:56 +13:00
parent e71135b511
commit f4da36065f
4 changed files with 7 additions and 7 deletions

View File

@@ -86,7 +86,7 @@ namespace OpenRA.GameRules
public class WeaponInfo public class WeaponInfo
{ {
public readonly float Range = 0; public readonly float Range = 0;
public readonly string Report = null; public readonly string[] Report = null;
public readonly int ROF = 1; public readonly int ROF = 1;
public readonly int Burst = 1; public readonly int Burst = 1;
public readonly bool Charges = false; public readonly bool Charges = false;

View File

@@ -56,8 +56,8 @@ namespace OpenRA.Mods.RA
self.World.Add(args.weapon.Projectile.Create(args)); self.World.Add(args.weapon.Projectile.Create(args));
if (!string.IsNullOrEmpty(args.weapon.Report)) if (args.weapon.Report != null)
Sound.Play(args.weapon.Report + ".aud", self.CenterLocation); Sound.Play(args.weapon.Report.Random(self.World.SharedRandom) + ".aud", self.CenterLocation);
} }
} }
} }

View File

@@ -154,7 +154,7 @@ namespace OpenRA.Mods.RA
}; };
if (args.weapon.Report != null) 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); DoImpacts(args);
} }

View File

@@ -1,4 +1,4 @@
#region Copyright & License Information #region Copyright & License Information
/* /*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS) * Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made * This file is part of OpenRA, which is free software. It is made
@@ -148,8 +148,8 @@ namespace OpenRA.Mods.RA
if (projectile != null) if (projectile != null)
self.World.Add(projectile); self.World.Add(projectile);
if (!string.IsNullOrEmpty(args.weapon.Report)) if (args.weapon.Report != null)
Sound.Play(args.weapon.Report + ".aud", self.CenterLocation); Sound.Play(args.weapon.Report.Random(self.World.SharedRandom) + ".aud", self.CenterLocation);
} }
}); });