diff --git a/OpenRA.Mods.Common/Activities/Air/HeliFly.cs b/OpenRA.Mods.Common/Activities/Air/HeliFly.cs index 8c71abf7e1..55504ad586 100644 --- a/OpenRA.Mods.Common/Activities/Air/HeliFly.cs +++ b/OpenRA.Mods.Common/Activities/Air/HeliFly.cs @@ -21,6 +21,7 @@ namespace OpenRA.Mods.Common.Activities readonly Target target; readonly WDist maxRange; readonly WDist minRange; + bool playedSound; public HeliFly(Actor self, Target t) { @@ -53,6 +54,12 @@ namespace OpenRA.Mods.Common.Activities if (IsCanceled || !target.IsValidFor(self)) return NextActivity; + if (!playedSound && helicopter.Info.TakeoffSound != null && self.IsAtGroundLevel()) + { + Sound.Play(helicopter.Info.TakeoffSound); + playedSound = true; + } + if (AdjustAltitude(self, helicopter, helicopter.Info.CruiseAltitude)) return this; diff --git a/OpenRA.Mods.Common/Activities/Air/HeliLand.cs b/OpenRA.Mods.Common/Activities/Air/HeliLand.cs index 9f191f539d..509e4f98ef 100644 --- a/OpenRA.Mods.Common/Activities/Air/HeliLand.cs +++ b/OpenRA.Mods.Common/Activities/Air/HeliLand.cs @@ -16,14 +16,13 @@ namespace OpenRA.Mods.Common.Activities public class HeliLand : Activity { readonly Helicopter helicopter; - readonly WDist landAltitude; bool requireSpace; + bool playedSound; public HeliLand(Actor self, bool requireSpace) { this.requireSpace = requireSpace; helicopter = self.Trait(); - landAltitude = helicopter.Info.LandAltitude; } public override Activity Tick(Actor self) @@ -34,7 +33,13 @@ namespace OpenRA.Mods.Common.Activities if (requireSpace && !helicopter.CanLand(self.Location)) return this; - if (HeliFly.AdjustAltitude(self, helicopter, landAltitude)) + if (!playedSound && helicopter.Info.LandingSound != null && !self.IsAtGroundLevel()) + { + Sound.Play(helicopter.Info.LandingSound); + playedSound = true; + } + + if (HeliFly.AdjustAltitude(self, helicopter, helicopter.Info.LandAltitude)) return this; return NextActivity; diff --git a/OpenRA.Mods.Common/Traits/Air/Helicopter.cs b/OpenRA.Mods.Common/Traits/Air/Helicopter.cs index bcea3cbba0..0cf5cdfc13 100644 --- a/OpenRA.Mods.Common/Traits/Air/Helicopter.cs +++ b/OpenRA.Mods.Common/Traits/Air/Helicopter.cs @@ -30,6 +30,9 @@ namespace OpenRA.Mods.Common.Traits [Desc("How fast the helicopter ascends or descends.")] public readonly WDist AltitudeVelocity = new WDist(43); + public readonly string TakeoffSound = null; + public readonly string LandingSound = null; + public override object Create(ActorInitializer init) { return new Helicopter(init, this); } } diff --git a/mods/ts/rules/aircraft.yaml b/mods/ts/rules/aircraft.yaml index b780bce184..846b931d68 100644 --- a/mods/ts/rules/aircraft.yaml +++ b/mods/ts/rules/aircraft.yaml @@ -45,6 +45,8 @@ DSHP: Speed: 168 InitialFacing: 0 LandableTerrainTypes: Clear + TakeoffSound: dropup1.aud + LandingSound: dropdwn1.aud Health: HP: 200 Armor: @@ -144,12 +146,19 @@ ORCATRAN: Cost: 1200 Tooltip: Name: Orca Transport + Buildable: + Queue: Air + BuildPaletteOrder: 10 + Prerequisites: ~disabled + RenderSprites: Helicopter: LandWhenIdle: yes ROT: 5 Speed: 84 InitialFacing: 0 LandableTerrainTypes: Clear + TakeoffSound: dropup1.aud + LandingSound: dropdwn1.aud Health: HP: 200 Armor: @@ -181,6 +190,9 @@ TRNSPORT: Speed: 149 InitialFacing: 0 LandableTerrainTypes: Clear + TakeoffSound: dropup1.aud + LandingSound: dropdwn1.aud + AltitudeVelocity: 64 Health: HP: 175 Armor: diff --git a/mods/ts/sequences/aircraft.yaml b/mods/ts/sequences/aircraft.yaml index 0c346425cb..97811dcd46 100644 --- a/mods/ts/sequences/aircraft.yaml +++ b/mods/ts/sequences/aircraft.yaml @@ -16,4 +16,7 @@ apache: Length: 4 slow-rotor: lrotor Start: 4 - Length: 8 \ No newline at end of file + Length: 8 + +orcatran: + icon: crryicon \ No newline at end of file