Aircraft Takeoff & Landing Sounds (Fixed-Wing)
Added Takeoff & Landing sounds to planes. Changed Aircraft Trait, TakeoffSounds & LandingSounds are now arrays & accept a list of sound files & it will randomly select one to play. Changed/fixed take off & landing sounds to originate from the aircraft location, rather than play a global sound.
This commit is contained in:
@@ -20,6 +20,8 @@ namespace OpenRA.Mods.Common.Activities
|
||||
readonly Target target;
|
||||
readonly Aircraft aircraft;
|
||||
|
||||
bool soundPlayed;
|
||||
|
||||
public Land(Actor self, Target t)
|
||||
{
|
||||
target = t;
|
||||
@@ -34,6 +36,12 @@ namespace OpenRA.Mods.Common.Activities
|
||||
if (IsCanceled)
|
||||
return NextActivity;
|
||||
|
||||
if (!soundPlayed && aircraft.Info.LandingSounds.Length > 0 && !self.IsAtGroundLevel())
|
||||
{
|
||||
Game.Sound.Play(SoundType.World, aircraft.Info.LandingSounds.Random(self.World.SharedRandom), aircraft.CenterPosition);
|
||||
soundPlayed = true;
|
||||
}
|
||||
|
||||
var d = target.CenterPosition - self.CenterPosition;
|
||||
|
||||
// The next move would overshoot, so just set the final position
|
||||
|
||||
Reference in New Issue
Block a user