moved weapon report from bullet/missile to attackbase
This commit is contained in:
@@ -25,7 +25,7 @@ namespace OpenRa.Game
|
||||
ActorID = Game.world.NextAID();
|
||||
Info = (UnitInfo)info; // temporary
|
||||
Location = location;
|
||||
CenterLocation = new float2( 12, 12 ) + Game.CellSize * (float2)Location;
|
||||
CenterLocation = Traits.Util.CenterOfCell(Location);
|
||||
Owner = owner;
|
||||
Health = Info.Strength; /* todo: handle cases where this is not true! */
|
||||
|
||||
|
||||
@@ -50,10 +50,6 @@ namespace OpenRa.Game.Effects
|
||||
|
||||
public void Tick()
|
||||
{
|
||||
if (t == 0)
|
||||
if (!string.IsNullOrEmpty(Weapon.Report))
|
||||
Sound.Play(Weapon.Report + ".aud");
|
||||
|
||||
t += 40;
|
||||
|
||||
if (t > TotalTime()) /* remove finished bullets */
|
||||
|
||||
@@ -50,9 +50,6 @@ namespace OpenRa.Game.Effects
|
||||
|
||||
public void Tick()
|
||||
{
|
||||
if (t == 0)
|
||||
Sound.Play(Weapon.Report + ".aud");
|
||||
|
||||
t += 40;
|
||||
|
||||
Traits.Util.TickFacing(ref Facing,
|
||||
|
||||
@@ -94,6 +94,9 @@ namespace OpenRa.Game.Traits
|
||||
Game.world.Add(new Bullet(weaponName, self.Owner, self,
|
||||
firePos, target.CenterLocation.ToInt2()));
|
||||
|
||||
if (!string.IsNullOrEmpty(weapon.Report))
|
||||
Sound.Play(weapon.Report + ".aud");
|
||||
|
||||
foreach (var na in self.traits.WithInterface<INotifyAttack>())
|
||||
na.Attacking(self);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user