diff --git a/OpenRA.Mods.RA/Aircraft.cs b/OpenRA.Mods.RA/Aircraft.cs index 3b2a46d935..5b281aaeaa 100755 --- a/OpenRA.Mods.RA/Aircraft.cs +++ b/OpenRA.Mods.RA/Aircraft.cs @@ -16,7 +16,7 @@ namespace OpenRA.Mods.RA { public class AircraftInfo : ITraitInfo { - public readonly int CruiseAltitude = 20; + public readonly int CruiseAltitude = 30; [ActorReference] public readonly string[] RepairBuildings = { "fix" }; [ActorReference] diff --git a/OpenRA.Mods.RA/FallsToEarth.cs b/OpenRA.Mods.RA/FallsToEarth.cs new file mode 100644 index 0000000000..582fa69f80 --- /dev/null +++ b/OpenRA.Mods.RA/FallsToEarth.cs @@ -0,0 +1,57 @@ +#region Copyright & License Information +/* + * Copyright 2007-2010 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see LICENSE. + */ +#endregion + +using OpenRA.Traits; + +namespace OpenRA.Mods.RA +{ + class FallsToEarthInfo : TraitInfo { } + + class FallsToEarth : INotifyDamage + { + public void Damaged(Actor self, AttackInfo e) + { + if (self.IsDead()) + { + self.Trait().RemoveOnDeath = false; + + self.CancelActivity(); + self.QueueActivity(new FallToEarth()); + } + } + } + + class FallToEarth : CancelableActivity + { + int acceleration = 0; + int spin = 0; + + public override IActivity Tick(Actor self) + { + if (acceleration == 0) + acceleration = self.World.SharedRandom.Next(2) * 2 - 1; + + var aircraft = self.Trait(); + if (aircraft.Altitude <= 0) + { + self.Destroy(); + return null; + } + + spin += acceleration; + aircraft.Facing = (aircraft.Facing + spin) % 256; + aircraft.Altitude--; + + return this; + } + + protected override bool OnCancel() { return false; } + } +} diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index 783912ed81..78c8a21e3f 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -3,7 +3,7 @@ Debug AnyCPU - 9.0.21022 + 9.0.30729 2.0 {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E} Library @@ -91,6 +91,7 @@ + diff --git a/OpenRA.Mods.RA/Passenger.cs b/OpenRA.Mods.RA/Passenger.cs index 6854eaa004..c30c759813 100644 --- a/OpenRA.Mods.RA/Passenger.cs +++ b/OpenRA.Mods.RA/Passenger.cs @@ -8,14 +8,14 @@ */ #endregion +using System.Collections.Generic; using System.Drawing; +using System.Linq; using OpenRA.Effects; using OpenRA.Mods.RA.Activities; +using OpenRA.Mods.RA.Orders; using OpenRA.Traits; using OpenRA.Traits.Activities; -using System.Linq; -using System.Collections.Generic; -using OpenRA.Mods.RA.Orders; namespace OpenRA.Mods.RA { diff --git a/OpenRA.Mods.RA/Render/RenderUnitRotor.cs b/OpenRA.Mods.RA/Render/RenderUnitRotor.cs index 8eb6471d19..45d3ece7b0 100755 --- a/OpenRA.Mods.RA/Render/RenderUnitRotor.cs +++ b/OpenRA.Mods.RA/Render/RenderUnitRotor.cs @@ -51,8 +51,8 @@ namespace OpenRA.Mods.RA.Render public override void Tick(Actor self) { base.Tick(self); - - var isFlying = self.Trait().Altitude > 0; + + var isFlying = self.Trait().Altitude > 0 && !self.IsDead(); if (isFlying ^ (rotorAnim.CurrentSequence.Name != "rotor")) return; diff --git a/mods/ra/rules/vehicles.yaml b/mods/ra/rules/vehicles.yaml index 4830921f75..fb2753fb72 100644 --- a/mods/ra/rules/vehicles.yaml +++ b/mods/ra/rules/vehicles.yaml @@ -770,6 +770,7 @@ TRAN: Types: Infantry Passengers: 5 IronCurtainable: + FallsToEarth: HELI: Inherits: ^Plane @@ -807,6 +808,7 @@ HELI: LimitedAmmo: Ammo: 6 IronCurtainable: + FallsToEarth: HIND: Inherits: ^Plane @@ -847,6 +849,7 @@ HIND: Selectable: Bounds: 38,32,0,0 WithMuzzleFlash: + FallsToEarth: U2: Inherits: ^Plane