fixed various sound bugs

This commit is contained in:
Chris Forbes
2010-01-25 20:40:04 +13:00
parent f0ae162fb0
commit 890ff42c70
4 changed files with 23 additions and 11 deletions

View File

@@ -34,7 +34,8 @@ namespace OpenRa.Traits
if (order.OrderString == "PowerDown")
{
IsDisabled = !IsDisabled;
Sound.Play((IsDisabled) ? "bleep12.aud" : "bleep11.aud");
if (self.Owner == self.World.LocalPlayer)
Sound.Play(IsDisabled ? "bleep12.aud" : "bleep11.aud");
}
}
}

View File

@@ -95,7 +95,9 @@ namespace OpenRa.Traits
}
}
isPrimary = true;
Sound.Play("pribldg1.aud");
if (self.Owner == self.World.LocalPlayer)
Sound.Play("pribldg1.aud");
}
}
}

View File

@@ -95,7 +95,9 @@ namespace OpenRa.Traits
public void Selling( Actor self )
{
anim.PlayBackwardsThen( "make", null );
Sound.Play("cashturn.aud");
if (self.Owner == self.World.LocalPlayer)
Sound.Play("cashturn.aud");
}
public void Sold(Actor self) { DoBib(self, true); }

View File

@@ -10,21 +10,28 @@ namespace OpenRa.Traits
public override object Create(Actor self) { return new SonarPulsePower(self, this); }
}
public class SonarPulsePower : SupportPower
public class SonarPulsePower : SupportPower, IResolveOrder
{
public SonarPulsePower(Actor self, SonarPulsePowerInfo info) : base(self, info) { }
protected override void OnBeginCharging() { }
protected override void OnFinishCharging() { Sound.Play("pulse1.aud"); }
protected override void OnActivate()
{
// Question: Is this method synced? or does it have to go via an order?
// TODO: Reveal submarines
// Should this play for all players?
Sound.Play("sonpulse.aud");
FinishActivate();
Game.orderManager.IssueOrder(new Order("SonarPulse", Owner.PlayerActor));
}
public void ResolveOrder(Actor self, Order order)
{
if (order.OrderString == "SonarPulse")
{
// TODO: Reveal submarines
// Should this play for all players?
Sound.Play("sonpulse.aud");
FinishActivate();
}
}
}
}