diff --git a/OpenRA.Mods.RA/Air/HeliLand.cs b/OpenRA.Mods.RA/Air/HeliLand.cs index 18fe3558be..00479cae7a 100755 --- a/OpenRA.Mods.RA/Air/HeliLand.cs +++ b/OpenRA.Mods.RA/Air/HeliLand.cs @@ -14,15 +14,20 @@ namespace OpenRA.Mods.RA.Air { class HeliLand : Activity { - public HeliLand(bool requireSpace) { this.requireSpace = requireSpace; } + public HeliLand(bool requireSpace, int minimalAltitude) + { + this.requireSpace = requireSpace; + this.minimalAltitude = minimalAltitude; + } bool requireSpace; + int minimalAltitude = 0; public override Activity Tick(Actor self) { if (IsCanceled) return NextActivity; var aircraft = self.Trait(); - if (aircraft.Altitude == 0) + if (aircraft.Altitude == minimalAltitude) return NextActivity; if (requireSpace && !aircraft.CanLand(self.Location)) diff --git a/OpenRA.Mods.RA/Air/HeliReturn.cs b/OpenRA.Mods.RA/Air/HeliReturn.cs index 597b5d5e22..7a7424fba3 100755 --- a/OpenRA.Mods.RA/Air/HeliReturn.cs +++ b/OpenRA.Mods.RA/Air/HeliReturn.cs @@ -40,7 +40,7 @@ namespace OpenRA.Mods.RA.Air .ClosestTo(self.CenterLocation); if (nearestHpad == null) - return Util.SequenceActivities(new Turn(initialFacing), new HeliLand(true), NextActivity); + return Util.SequenceActivities(new Turn(initialFacing), new HeliLand(true, 0), NextActivity); else return Util.SequenceActivities(new HeliFly(Util.CenterOfCell(nearestHpad.Location))); } @@ -56,7 +56,7 @@ namespace OpenRA.Mods.RA.Air return Util.SequenceActivities( new HeliFly(dest.Trait().PxPosition + offset), new Turn(initialFacing), - new HeliLand(false), + new HeliLand(false, 0), new Rearm(self), NextActivity); } diff --git a/OpenRA.Mods.RA/Air/Helicopter.cs b/OpenRA.Mods.RA/Air/Helicopter.cs index b7db4df50e..d65b3c06c6 100755 --- a/OpenRA.Mods.RA/Air/Helicopter.cs +++ b/OpenRA.Mods.RA/Air/Helicopter.cs @@ -19,6 +19,7 @@ namespace OpenRA.Mods.RA.Air { public readonly int IdealSeparation = 40; public readonly bool LandWhenIdle = true; + public readonly int MinimalLandAltitude = 0; public override object Create( ActorInitializer init ) { return new Helicopter( init, this); } } @@ -52,7 +53,7 @@ namespace OpenRA.Mods.RA.Air if (Info.LandWhenIdle) { self.QueueActivity(new Turn(Info.InitialFacing)); - self.QueueActivity(new HeliLand(true)); + self.QueueActivity(new HeliLand(true, Info.MinimalLandAltitude)); } } @@ -77,7 +78,7 @@ namespace OpenRA.Mods.RA.Air self.CancelActivity(); self.QueueActivity(new HeliFly(order.TargetActor.Trait().PxPosition + offset)); self.QueueActivity(new Turn(Info.InitialFacing)); - self.QueueActivity(new HeliLand(false)); + self.QueueActivity(new HeliLand(false, Info.MinimalLandAltitude)); self.QueueActivity(new ResupplyAircraft()); } } @@ -95,7 +96,7 @@ namespace OpenRA.Mods.RA.Air if (Info.LandWhenIdle) { self.QueueActivity(new Turn(Info.InitialFacing)); - self.QueueActivity(new HeliLand(true)); + self.QueueActivity(new HeliLand(true, Info.MinimalLandAltitude)); } } } diff --git a/OpenRA.Mods.RA/Cargo.cs b/OpenRA.Mods.RA/Cargo.cs index 0dc2d1b816..31c57b432a 100644 --- a/OpenRA.Mods.RA/Cargo.cs +++ b/OpenRA.Mods.RA/Cargo.cs @@ -24,6 +24,7 @@ namespace OpenRA.Mods.RA public readonly string[] Types = { }; public readonly int UnloadFacing = 0; public readonly string[] InitialUnits = { }; + public readonly int minimalUnloadAltitude = 0; public object Create( ActorInitializer init ) { return new Cargo( init, this ); } } @@ -92,7 +93,7 @@ namespace OpenRA.Mods.RA // Cannot unload mid-air var move = self.TraitOrDefault(); - if (move != null && move.Altitude > 0) + if (move != null && move.Altitude > info.minimalUnloadAltitude) return false; // Todo: Check if there is a free tile to unload to @@ -106,7 +107,7 @@ namespace OpenRA.Mods.RA // Cannot load mid-air var move = self.TraitOrDefault(); - return move == null || move.Altitude == 0; + return move == null || move.Altitude == info.minimalUnloadAltitude; } public string CursorForOrder(Actor self, Order order) diff --git a/OpenRA.Mods.RA/Missions/Allies01Script.cs b/OpenRA.Mods.RA/Missions/Allies01Script.cs index 5c0e39507d..48e63199b0 100644 --- a/OpenRA.Mods.RA/Missions/Allies01Script.cs +++ b/OpenRA.Mods.RA/Missions/Allies01Script.cs @@ -242,7 +242,7 @@ namespace OpenRA.Mods.RA.Missions einsteinChinook = self.World.CreateActor(chinookName, new TypeDictionary { new OwnerInit(allies), new LocationInit(extractionLZEntryPoint.Location) }); einsteinChinook.QueueActivity(new HeliFly(extractionLZ.CenterLocation)); einsteinChinook.QueueActivity(new Turn(0)); - einsteinChinook.QueueActivity(new HeliLand(true)); + einsteinChinook.QueueActivity(new HeliLand(true, 0)); einsteinChinook.QueueActivity(new WaitFor(() => einsteinChinook.Trait().Passengers.Contains(einstein))); einsteinChinook.QueueActivity(new Wait(150)); einsteinChinook.QueueActivity(new HeliFly(chinookExitPoint.CenterLocation)); @@ -256,7 +256,7 @@ namespace OpenRA.Mods.RA.Missions chinook.Trait().Load(chinook, tanya); chinook.QueueActivity(new HeliFly(insertionLZ.CenterLocation)); chinook.QueueActivity(new Turn(0)); - chinook.QueueActivity(new HeliLand(true)); + chinook.QueueActivity(new HeliLand(true, 0)); chinook.QueueActivity(new UnloadCargo(true)); chinook.QueueActivity(new CallFunc(() => Sound.Play("laugh1.aud"))); chinook.QueueActivity(new Wait(150)); diff --git a/mods/d2k/TODO b/mods/d2k/TODO deleted file mode 100644 index 804dd98eb9..0000000000 --- a/mods/d2k/TODO +++ /dev/null @@ -1,28 +0,0 @@ -# make structures appear earlier when errecting from ground -# too few DATA.R8 frames? -# carryalls should pickup vehicles not land so that things can roll in -# carryalls should automatically transport harvesters -# carryalls should automatically transport vehicles to repair pad if player uses the repair cursor -# windtrap animations missing -# outpost animations missing -# construction yard crane animations missing -# welding animation (factories) missing -# chimney animation (refinery) missing -# harvest animation missing (sand is spit out) -# add more spice tiles and make them fit -# add game logic for concrete plates (use terrain overlay from bridges/ressources) -# allow placing turrets on walls -# make sandworm behave like a moving anti-everything mine (currently not attacking anything) -# add muzzles and explosions (currently falls back to RA) -# create a shellmap (currently just a blank placeholder) -# add sonic tank weapon (currently uses tesla) -# last remap index is mapped to transparent (see Atreides Hightech Factory) -# gamefile extraction (setup/setup.z) from CD fails -# support patch 1.06 gamefiles: DATA.R8 has more frames and currently fails to extract, also featuring new terrain with white houses and new units: grenade thrower, stealth raider icon -# put TilesetBuilder.Export into OpenRA.Utility to call the functions directly when extracting game-files (instead of opening a GUI) -# group number metrics are off -# building offsets wrong (worst for towers) -# spice blooms should explode and create new spice field instead of growing spice -# fix BuiltAt to build vehicles at appropriate factories -# transpose breaks thumping animation (split into several SHPs) -# missile sound is wrong \ No newline at end of file diff --git a/mods/d2k/rules/aircraft.yaml b/mods/d2k/rules/aircraft.yaml index df60368282..46094fcb24 100644 --- a/mods/d2k/rules/aircraft.yaml +++ b/mods/d2k/rules/aircraft.yaml @@ -22,14 +22,16 @@ LandableTerrainTypes: Sand, Rock, Transition, Spice, Dune RepairBuildings: repaira,repairo,repairh RearmBuildings: starporta,starporto,starporth + MinimalLandAltitude: 25 RenderUnit: RenderCargo: - RelativeAltitude: 25 + RelativeAltitude: 20 WithShadow: Cargo: Types: Vehicle MaxWeight: 1 PipCount: 1 + minimalUnloadAltitude: 25 FallsToEarth: Spins: no Moves: yes