From e910e8bec491c8c3b05fffa1fc2a498dee4be522 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 29 Nov 2014 17:29:46 +0100 Subject: [PATCH 1/6] add lore to the description --- mods/d2k/rules/aircraft.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/d2k/rules/aircraft.yaml b/mods/d2k/rules/aircraft.yaml index d0e0f3a433..3ec21780ac 100644 --- a/mods/d2k/rules/aircraft.yaml +++ b/mods/d2k/rules/aircraft.yaml @@ -4,7 +4,7 @@ Cost: 1200 Tooltip: Name: Carryall - Description: Fully automated Carryall.\n Automatically transports your harvesters. + Description: Large winged, planet-bound ship\n Automatically lifts harvesters. Health: HP: 250 Armor: From 003838de3f7fb9257c970eea4f6a3c4d4dc4543a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 29 Nov 2014 17:30:23 +0100 Subject: [PATCH 2/6] make carryalls initially lift-off from high tech factories --- mods/d2k/rules/aircraft.yaml | 2 ++ mods/d2k/rules/structures.yaml | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/mods/d2k/rules/aircraft.yaml b/mods/d2k/rules/aircraft.yaml index 3ec21780ac..f068ece6b8 100644 --- a/mods/d2k/rules/aircraft.yaml +++ b/mods/d2k/rules/aircraft.yaml @@ -5,6 +5,8 @@ Tooltip: Name: Carryall Description: Large winged, planet-bound ship\n Automatically lifts harvesters. + Buildable: + BuildAtProductionType: Aircraft Health: HP: 250 Armor: diff --git a/mods/d2k/rules/structures.yaml b/mods/d2k/rules/structures.yaml index 91a3ca9f29..27367efc1b 100644 --- a/mods/d2k/rules/structures.yaml +++ b/mods/d2k/rules/structures.yaml @@ -601,6 +601,11 @@ WALL: Tooltip: Name: High Tech Facility Description: Unlocks advanced technology + Production: + Produces: Aircraft + Exit: + SpawnOffset: 0,0,728 + ExitCell: 0,0 Building: Footprint: _x_ xxx xxx Dimensions: 3,3 From bfcc52c87116b78ef3d7980501cdbd0f101b842a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 29 Nov 2014 18:19:30 +0100 Subject: [PATCH 3/6] enable high tech factory welding --- mods/d2k/rules/structures.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/d2k/rules/structures.yaml b/mods/d2k/rules/structures.yaml index 27367efc1b..76f0b4282f 100644 --- a/mods/d2k/rules/structures.yaml +++ b/mods/d2k/rules/structures.yaml @@ -602,7 +602,7 @@ WALL: Name: High Tech Facility Description: Unlocks advanced technology Production: - Produces: Aircraft + Produces: Aircraft, Armor Exit: SpawnOffset: 0,0,728 ExitCell: 0,0 @@ -618,8 +618,8 @@ WALL: Range: 4c0 ProvidesCustomPrerequisite: Prerequisite: hightech -# WithProductionOverlay@WELDING: -# Sequence: production-welding + WithProductionOverlay@WELDING: + Sequence: production-welding Power: Amount: -40 From 6ecc6d67cd7fe78a687a8d7645d05ebb3d156d7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 30 Nov 2014 10:48:29 +0100 Subject: [PATCH 4/6] fix overlapping shadows --- OpenRA.Mods.D2k/AutoCarryall/AutoCarryall.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/OpenRA.Mods.D2k/AutoCarryall/AutoCarryall.cs b/OpenRA.Mods.D2k/AutoCarryall/AutoCarryall.cs index e01c3769f5..394296c425 100644 --- a/OpenRA.Mods.D2k/AutoCarryall/AutoCarryall.cs +++ b/OpenRA.Mods.D2k/AutoCarryall/AutoCarryall.cs @@ -151,6 +151,7 @@ namespace OpenRA.Mods.D2k // Create a new animation for our carryable unit anim = new Animation(self.World, RenderSprites.GetImage(carryable.Info), RenderSprites.MakeFacingFunc(self)); anim.PlayRepeating("idle"); + anim.IsDecoration = true; } // Called when released From 34bedeb71fd16795f2510f8ecb5a4f58559d04bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 29 Nov 2014 22:23:19 +0100 Subject: [PATCH 5/6] split Hovers from WithShadow fixes #4508 --- OpenRA.Mods.RA/OpenRA.Mods.RA.csproj | 1 + OpenRA.Mods.RA/Render/Hovers.cs | 52 ++++++++++++++++++++++++++++ OpenRA.Mods.RA/Render/WithShadow.cs | 13 +------ mods/cnc/rules/aircraft.yaml | 8 ----- mods/cnc/rules/defaults.yaml | 3 ++ mods/ra/rules/aircraft.yaml | 8 ----- mods/ra/rules/defaults.yaml | 2 ++ mods/ts/rules/aircraft.yaml | 6 ++++ mods/ts/rules/vehicles.yaml | 1 + 9 files changed, 66 insertions(+), 28 deletions(-) create mode 100644 OpenRA.Mods.RA/Render/Hovers.cs diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index 9f77b2cc82..2ce510b302 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -460,6 +460,7 @@ + diff --git a/OpenRA.Mods.RA/Render/Hovers.cs b/OpenRA.Mods.RA/Render/Hovers.cs new file mode 100644 index 0000000000..357fa5e58e --- /dev/null +++ b/OpenRA.Mods.RA/Render/Hovers.cs @@ -0,0 +1,52 @@ +#region Copyright & License Information +/* + * Copyright 2007-2014 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 COPYING. + */ +#endregion + +using System; +using System.Collections.Generic; +using System.Linq; +using OpenRA.Graphics; +using OpenRA.Mods.RA.Activities; +using OpenRA.Mods.RA.Traits; +using OpenRA.Traits; + +namespace OpenRA.Mods.RA.Render +{ + [Desc("Changes the visual Z position periodically.")] + class HoversInfo : ITraitInfo, Requires + { + [Desc("Amount of Z axis changes in world units.")] + public readonly int OffsetModifier = -43; + + public object Create(ActorInitializer init) { return new Hovers(this, init.self); } + } + + class Hovers : IRenderModifier + { + readonly HoversInfo info; + readonly bool aircraft; + + public Hovers(HoversInfo info, Actor self) + { + this.info = info; + aircraft = self.HasTrait(); + } + + public IEnumerable ModifyRender(Actor self, WorldRenderer wr, IEnumerable r) + { + if (self.World.Paused) + return r; + + var visualOffset = !aircraft || self.CenterPosition.Z > 0 ? (int)Math.Abs((self.ActorID + Game.LocalTick) / 5 % 4 - 1) - 1 : 0; + var worldVisualOffset = new WVec(0, 0, info.OffsetModifier * visualOffset); + + return r.Select(a => a.OffsetBy(worldVisualOffset)); + } + } +} diff --git a/OpenRA.Mods.RA/Render/WithShadow.cs b/OpenRA.Mods.RA/Render/WithShadow.cs index 7a32064b1a..a48e655c6d 100644 --- a/OpenRA.Mods.RA/Render/WithShadow.cs +++ b/OpenRA.Mods.RA/Render/WithShadow.cs @@ -37,13 +37,6 @@ namespace OpenRA.Mods.RA.Render public IEnumerable ModifyRender(Actor self, WorldRenderer wr, IEnumerable r) { - var ios = self.Trait(); - - /* rude hack */ - var flying = ios.CenterPosition.Z > 0; - var visualOffset = (ios is Helicopter && flying) - ? (int)Math.Abs((self.ActorID + Game.LocalTick) / 5 % 4 - 1) - 1 : 0; - // Contrails shouldn't cast shadows var shadowSprites = r.Where(s => !s.IsDecoration) .Select(a => a.WithPalette(wr.Palette(info.Palette)) @@ -51,11 +44,7 @@ namespace OpenRA.Mods.RA.Render .WithZOffset(a.ZOffset + a.Pos.Z) .AsDecoration()); - var worldVisualOffset = new WVec(0,0,-43*visualOffset); - var flyingSprites = !flying ? r : - r.Select(a => a.OffsetBy(worldVisualOffset)); - - return shadowSprites.Concat(flyingSprites); + return shadowSprites.Concat(r); } } } diff --git a/mods/cnc/rules/aircraft.yaml b/mods/cnc/rules/aircraft.yaml index 5f149a947a..dec4cdf776 100644 --- a/mods/cnc/rules/aircraft.yaml +++ b/mods/cnc/rules/aircraft.yaml @@ -32,7 +32,6 @@ TRAN: WithRotor@SECONDARY: Id: rotor_2 Offset: 597,0,85 - WithShadow: Cargo: Types: Infantry MaxWeight: 10 @@ -87,7 +86,6 @@ HELI: WithRotor: Offset: 0,0,85 WithMuzzleFlash: - WithShadow: LeavesHusk: HuskActor: HELI.Husk AutoTarget: @@ -133,7 +131,6 @@ ORCA: Count: 2 Period: 100 RenderUnit: - WithShadow: LeavesHusk: HuskActor: ORCA.Husk AutoTarget: @@ -159,7 +156,6 @@ C17: Armor: Type: Heavy RenderUnit: - WithShadow: Cargo: MaxWeight: 10 PipCount: 10 @@ -198,7 +194,6 @@ A10: Armor: Type: Heavy RenderUnit: - WithShadow: AttackBomber: Armaments: gun, bombs Guns: gun @@ -240,7 +235,6 @@ TRAN.Husk: Offset: 597,0,85 RenderUnit: Image: tran - WithShadow: HELI.Husk: Inherits: ^HelicopterHusk @@ -255,7 +249,6 @@ HELI.Husk: Offset: 0,0,85 RenderUnit: Image: heli - WithShadow: ORCA.Husk: Inherits: ^HelicopterHusk @@ -268,5 +261,4 @@ ORCA.Husk: Range: 10c0 RenderUnit: Image: orca - WithShadow: diff --git a/mods/cnc/rules/defaults.yaml b/mods/cnc/rules/defaults.yaml index 2656b3150e..3aaf0fdfd6 100644 --- a/mods/cnc/rules/defaults.yaml +++ b/mods/cnc/rules/defaults.yaml @@ -149,6 +149,8 @@ UpgradeTypes: selfheal UpgradeMinEnabledLevel: 1 UpgradeManager: + WithShadow: + Hovers: ^Infantry: AppearsOnRadar: @@ -340,6 +342,7 @@ UpgradeTypes: selfheal UpgradeMinEnabledLevel: 1 UpgradeManager: + WithShadow: ^Ship: AppearsOnRadar: diff --git a/mods/ra/rules/aircraft.yaml b/mods/ra/rules/aircraft.yaml index aa4d76f978..704beba94a 100644 --- a/mods/ra/rules/aircraft.yaml +++ b/mods/ra/rules/aircraft.yaml @@ -11,7 +11,6 @@ BADR: Speed: 149 Repulsable: False RenderUnit: - WithShadow: Cargo: MaxWeight: 10 -Selectable: @@ -51,7 +50,6 @@ BADR.Bomber: Ammo: 7 RenderUnit: Image: badr - WithShadow: -Selectable: -GainsExperience: Tooltip: @@ -108,7 +106,6 @@ MIG: EnableStances: false RenderUnit: CameraPitch: 99 - WithShadow: LimitedAmmo: Ammo: 8 ReturnOnIdle: @@ -165,7 +162,6 @@ YAK: EnableStances: false RenderUnit: CameraPitch: 99 - WithShadow: LimitedAmmo: Ammo: 18 PipCount: 6 @@ -215,7 +211,6 @@ TRAN: WithRotor@SECONDARY: Id: rotor_2 Offset: 597,0,213 - WithShadow: Cargo: Types: Infantry MaxWeight: 8 @@ -262,7 +257,6 @@ HELI: RenderUnit: WithRotor: Offset: 0,0,85 - WithShadow: LimitedAmmo: Ammo: 8 Selectable: @@ -313,7 +307,6 @@ HIND: EnableStances: false RenderUnit: WithRotor: - WithShadow: LimitedAmmo: Ammo: 24 PipCount: 6 @@ -337,7 +330,6 @@ U2: Speed: 373 Repulsable: False RenderUnit: - WithShadow: AttackBomber: -Selectable: -GainsExperience: diff --git a/mods/ra/rules/defaults.yaml b/mods/ra/rules/defaults.yaml index c71ab69a48..8208eb26b3 100644 --- a/mods/ra/rules/defaults.yaml +++ b/mods/ra/rules/defaults.yaml @@ -341,6 +341,7 @@ UpgradeMaxAcceptedLevel: 2 TimedUpgradeBar: Upgrade: invulnerability + WithShadow: ^Helicopter: Inherits: ^Plane @@ -348,6 +349,7 @@ GenericName: Helicopter GpsDot: String: Helicopter + Hovers: ^Building: AppearsOnRadar: diff --git a/mods/ts/rules/aircraft.yaml b/mods/ts/rules/aircraft.yaml index 6e1a86e246..8f90e7bed3 100644 --- a/mods/ts/rules/aircraft.yaml +++ b/mods/ts/rules/aircraft.yaml @@ -67,6 +67,7 @@ DSHP: RenderSprites: RenderVoxels: WithVoxelBody: + Hovers: ORCA: Inherits: ^Helicopter @@ -105,6 +106,7 @@ ORCA: RenderSprites: RenderVoxels: WithVoxelBody: + Hovers: ORCAB: Inherits: ^Helicopter @@ -142,6 +144,7 @@ ORCAB: RenderSprites: RenderVoxels: WithVoxelBody: + Hovers: ORCATRAN: Inherits: ^Helicopter @@ -173,6 +176,7 @@ ORCATRAN: RenderSprites: RenderVoxels: WithVoxelBody: + Hovers: TRNSPORT: Inherits: ^Helicopter @@ -200,6 +204,7 @@ TRNSPORT: RenderSprites: RenderVoxels: WithVoxelBody: + Hovers: SCRIN: Inherits: ^Helicopter @@ -277,4 +282,5 @@ APACHE: RenderSprites: RenderVoxels: WithVoxelBody: + Hovers: diff --git a/mods/ts/rules/vehicles.yaml b/mods/ts/rules/vehicles.yaml index e40f326ec0..9fd5e53224 100644 --- a/mods/ts/rules/vehicles.yaml +++ b/mods/ts/rules/vehicles.yaml @@ -156,6 +156,7 @@ HVR: RenderVoxels: WithVoxelBody: WithVoxelTurret: + Hovers: 4TNK: Inherits: ^Tank From 2ae93f44aa0b83bbeec64054d9fa38160ce01ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 6 Dec 2014 20:31:15 +0100 Subject: [PATCH 6/6] move carryall to it's own aircraft queue --- mods/d2k/rules/aircraft.yaml | 3 ++- mods/d2k/rules/atreides.yaml | 4 +--- mods/d2k/rules/harkonnen.yaml | 4 +--- mods/d2k/rules/ordos.yaml | 4 +--- mods/d2k/rules/structures.yaml | 2 +- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/mods/d2k/rules/aircraft.yaml b/mods/d2k/rules/aircraft.yaml index f068ece6b8..6e281ba59b 100644 --- a/mods/d2k/rules/aircraft.yaml +++ b/mods/d2k/rules/aircraft.yaml @@ -6,7 +6,8 @@ Name: Carryall Description: Large winged, planet-bound ship\n Automatically lifts harvesters. Buildable: - BuildAtProductionType: Aircraft + Queue: Aircraft + BuildPaletteOrder: 10 Health: HP: 250 Armor: diff --git a/mods/d2k/rules/atreides.yaml b/mods/d2k/rules/atreides.yaml index ab8e0dbfa0..c551ef0371 100644 --- a/mods/d2k/rules/atreides.yaml +++ b/mods/d2k/rules/atreides.yaml @@ -123,9 +123,7 @@ CARRYALLA: RenderUnit: Image: CARRYALL Buildable: - Queue: Armor - Prerequisites: ~heavya, refinery, hightech - BuildPaletteOrder: 10 + Prerequisites: refinery, ~hightecha CARRYALLA.starport: Inherits: CARRYALLA diff --git a/mods/d2k/rules/harkonnen.yaml b/mods/d2k/rules/harkonnen.yaml index c3a359d195..2a66d72cd8 100644 --- a/mods/d2k/rules/harkonnen.yaml +++ b/mods/d2k/rules/harkonnen.yaml @@ -127,9 +127,7 @@ CARRYALLH: RenderUnit: Image: CARRYALL Buildable: - Queue: Armor - Prerequisites: ~heavyh, refinery, hightech - BuildPaletteOrder: 10 + Prerequisites: refinery, ~hightechh CARRYALLH.starport: Inherits: CARRYALLH diff --git a/mods/d2k/rules/ordos.yaml b/mods/d2k/rules/ordos.yaml index 2545190566..d5c95157aa 100644 --- a/mods/d2k/rules/ordos.yaml +++ b/mods/d2k/rules/ordos.yaml @@ -203,9 +203,7 @@ CARRYALLO: RenderUnit: Image: CARRYALL Buildable: - Queue: Armor - Prerequisites: ~heavyo, refinery, hightech - BuildPaletteOrder: 10 + Prerequisites: refinery, ~hightecho CARRYALLO.starport: Inherits: CARRYALLO diff --git a/mods/d2k/rules/structures.yaml b/mods/d2k/rules/structures.yaml index 76f0b4282f..1cd31969d9 100644 --- a/mods/d2k/rules/structures.yaml +++ b/mods/d2k/rules/structures.yaml @@ -602,7 +602,7 @@ WALL: Name: High Tech Facility Description: Unlocks advanced technology Production: - Produces: Aircraft, Armor + Produces: Aircraft Exit: SpawnOffset: 0,0,728 ExitCell: 0,0