diff --git a/OpenRA.FileFormats/WRange.cs b/OpenRA.FileFormats/WRange.cs index fbcaa0eeed..c49be11a67 100644 --- a/OpenRA.FileFormats/WRange.cs +++ b/OpenRA.FileFormats/WRange.cs @@ -68,6 +68,10 @@ namespace OpenRA default: return false; } + // Propagate sign to fractional part + if (cell < 0) + subcell = -subcell; + result = new WRange(1024*cell + subcell); return true; } diff --git a/OpenRA.Game/Effects/FlashTarget.cs b/OpenRA.Game/Effects/FlashTarget.cs index a3fffc49b8..a48f4e4547 100755 --- a/OpenRA.Game/Effects/FlashTarget.cs +++ b/OpenRA.Game/Effects/FlashTarget.cs @@ -35,12 +35,15 @@ namespace OpenRA.Effects public IEnumerable Render(WorldRenderer wr) { - if (!target.IsInWorld) - yield break; + if (target.IsInWorld && remainingTicks % 2 == 0) + { + var palette = wr.Palette("highlight"); + return target.Render(wr) + .Where(r => !r.IsDecoration) + .Select(r => r.WithPalette(palette)); + } - if (remainingTicks % 2 == 0) - foreach (var r in target.Render(wr)) - yield return r.WithPalette(wr.Palette("highlight")); + return SpriteRenderable.None; } } } diff --git a/OpenRA.Game/Graphics/Animation.cs b/OpenRA.Game/Graphics/Animation.cs index dd2354ceb9..2b85cb28b4 100644 --- a/OpenRA.Game/Graphics/Animation.cs +++ b/OpenRA.Game/Graphics/Animation.cs @@ -17,6 +17,7 @@ namespace OpenRA.Graphics { string name; public Sequence CurrentSequence { get; private set; } + public bool IsDecoration = false; int frame = 0; bool backwards = false; bool tickAlways; @@ -43,10 +44,10 @@ namespace OpenRA.Graphics if (CurrentSequence.ShadowStart >= 0) { var shadow = CurrentSequence.GetShadow(CurrentFrame, facingFunc()); - yield return new SpriteRenderable(shadow, pos, offset, CurrentSequence.ShadowZOffset + zOffset, palette, scale); + yield return new SpriteRenderable(shadow, pos, offset, CurrentSequence.ShadowZOffset + zOffset, palette, scale, true); } - yield return new SpriteRenderable(Image, pos, offset, CurrentSequence.ZOffset + zOffset, palette, scale); + yield return new SpriteRenderable(Image, pos, offset, CurrentSequence.ZOffset + zOffset, palette, scale, IsDecoration); } public IEnumerable Render(WPos pos, PaletteReference palette) diff --git a/OpenRA.Game/Graphics/BeamRenderable.cs b/OpenRA.Game/Graphics/BeamRenderable.cs index 7aa3c23955..83773bd443 100644 --- a/OpenRA.Game/Graphics/BeamRenderable.cs +++ b/OpenRA.Game/Graphics/BeamRenderable.cs @@ -34,11 +34,13 @@ namespace OpenRA.Graphics public float Scale { get { return 1f; } } public PaletteReference Palette { get { return null; } } public int ZOffset { get { return zOffset; } } + public bool IsDecoration { get { return true; } } public IRenderable WithScale(float newScale) { return new BeamRenderable(pos, zOffset, length, width, color); } public IRenderable WithPalette(PaletteReference newPalette) { return new BeamRenderable(pos, zOffset, length, width, color); } public IRenderable WithZOffset(int newOffset) { return new BeamRenderable(pos, zOffset, length, width, color); } public IRenderable OffsetBy(WVec vec) { return new BeamRenderable(pos + vec, zOffset, length, width, color); } + public IRenderable AsDecoration() { return this; } public void BeforeRender(WorldRenderer wr) {} public void Render(WorldRenderer wr) diff --git a/OpenRA.Game/Graphics/ContrailRenderable.cs b/OpenRA.Game/Graphics/ContrailRenderable.cs index 2569433f74..ef428044e0 100644 --- a/OpenRA.Game/Graphics/ContrailRenderable.cs +++ b/OpenRA.Game/Graphics/ContrailRenderable.cs @@ -46,11 +46,13 @@ namespace OpenRA.Graphics public float Scale { get { return 1f; } } public PaletteReference Palette { get { return null; } } public int ZOffset { get { return zOffset; } } + public bool IsDecoration { get { return true; } } public IRenderable WithScale(float newScale) { return new ContrailRenderable(world, (WPos[])trail.Clone(), next, length, skip, color, zOffset); } public IRenderable WithPalette(PaletteReference newPalette) { return new ContrailRenderable(world, (WPos[])trail.Clone(), next, length, skip, color, zOffset); } public IRenderable WithZOffset(int newOffset) { return new ContrailRenderable(world, (WPos[])trail.Clone(), next, length, skip, color, newOffset); } public IRenderable OffsetBy(WVec vec) { return new ContrailRenderable(world, trail.Select(pos => pos + vec).ToArray(), next, length, skip, color, zOffset); } + public IRenderable AsDecoration() { return this; } public void BeforeRender(WorldRenderer wr) {} public void Render(WorldRenderer wr) diff --git a/OpenRA.Game/Graphics/Renderable.cs b/OpenRA.Game/Graphics/Renderable.cs index d656312883..072251ee46 100644 --- a/OpenRA.Game/Graphics/Renderable.cs +++ b/OpenRA.Game/Graphics/Renderable.cs @@ -36,11 +36,14 @@ namespace OpenRA.Graphics float Scale { get; } PaletteReference Palette { get; } int ZOffset { get; } + bool IsDecoration { get; } IRenderable WithScale(float newScale); IRenderable WithPalette(PaletteReference newPalette); IRenderable WithZOffset(int newOffset); IRenderable OffsetBy(WVec offset); + IRenderable AsDecoration(); + void BeforeRender(WorldRenderer wr); void Render(WorldRenderer wr); void RenderDebugGeometry(WorldRenderer wr); @@ -56,8 +59,9 @@ namespace OpenRA.Graphics readonly int zOffset; readonly PaletteReference palette; readonly float scale; + readonly bool isDecoration; - public SpriteRenderable(Sprite sprite, WPos pos, WVec offset, int zOffset, PaletteReference palette, float scale) + public SpriteRenderable(Sprite sprite, WPos pos, WVec offset, int zOffset, PaletteReference palette, float scale, bool isDecoration) { this.sprite = sprite; this.pos = pos; @@ -65,25 +69,21 @@ namespace OpenRA.Graphics this.zOffset = zOffset; this.palette = palette; this.scale = scale; + this.isDecoration = isDecoration; } - public SpriteRenderable(Sprite sprite, WPos pos, int zOffset, PaletteReference palette, float scale) - : this(sprite, pos, WVec.Zero, zOffset, palette, scale) { } - - // Provided for legacy support only - Don't use for new things! - public SpriteRenderable(Sprite sprite, float2 pos, PaletteReference palette, int z) - : this(sprite, new PPos((int)pos.X, (int)pos.Y).ToWPos(0), z, palette, 1f) { } - public WPos Pos { get { return pos + offset; } } public WVec Offset { get { return offset; } } public float Scale { get { return scale; } } public PaletteReference Palette { get { return palette; } } public int ZOffset { get { return zOffset; } } + public bool IsDecoration { get { return isDecoration; } } - public IRenderable WithScale(float newScale) { return new SpriteRenderable(sprite, pos, offset, zOffset, palette, newScale); } - public IRenderable WithPalette(PaletteReference newPalette) { return new SpriteRenderable(sprite, pos, offset, zOffset, newPalette, scale); } - public IRenderable WithZOffset(int newOffset) { return new SpriteRenderable(sprite, pos, offset, newOffset, palette, scale); } - public IRenderable OffsetBy(WVec vec) { return new SpriteRenderable(sprite, pos + vec, offset, zOffset, palette, scale); } + public IRenderable WithScale(float newScale) { return new SpriteRenderable(sprite, pos, offset, zOffset, palette, newScale, isDecoration); } + public IRenderable WithPalette(PaletteReference newPalette) { return new SpriteRenderable(sprite, pos, offset, zOffset, newPalette, scale, isDecoration); } + public IRenderable WithZOffset(int newOffset) { return new SpriteRenderable(sprite, pos, offset, newOffset, palette, scale, isDecoration); } + public IRenderable OffsetBy(WVec vec) { return new SpriteRenderable(sprite, pos + vec, offset, zOffset, palette, scale, isDecoration); } + public IRenderable AsDecoration() { return new SpriteRenderable(sprite, pos, offset, zOffset, palette, scale, true); } float2 ScreenPosition(WorldRenderer wr) { diff --git a/OpenRA.Game/Graphics/Sequence.cs b/OpenRA.Game/Graphics/Sequence.cs index 0d00f3c6d9..56176750a7 100644 --- a/OpenRA.Game/Graphics/Sequence.cs +++ b/OpenRA.Game/Graphics/Sequence.cs @@ -82,12 +82,20 @@ namespace OpenRA.Graphics ShadowStart = -1; if (d.ContainsKey("ShadowZOffset")) - ShadowZOffset = int.Parse(d["ShadowZOffset"].Value); + { + WRange r; + if (WRange.TryParse(d["ShadowZOffset"].Value, out r)) + ShadowZOffset = r.Range; + } else ShadowZOffset = -5; if (d.ContainsKey("ZOffset")) - ZOffset = int.Parse(d["ZOffset"].Value); + { + WRange r; + if (WRange.TryParse(d["ZOffset"].Value, out r)) + ZOffset = r.Range; + } if (Length > Stride) throw new InvalidOperationException( diff --git a/OpenRA.Game/Graphics/TextRenderable.cs b/OpenRA.Game/Graphics/TextRenderable.cs index 3c169d4a69..1b2fa08da1 100644 --- a/OpenRA.Game/Graphics/TextRenderable.cs +++ b/OpenRA.Game/Graphics/TextRenderable.cs @@ -35,11 +35,13 @@ namespace OpenRA.Graphics public float Scale { get { return 1f; } } public PaletteReference Palette { get { return null; } } public int ZOffset { get { return zOffset; } } + public bool IsDecoration { get { return true; } } public IRenderable WithScale(float newScale) { return new TextRenderable(font, pos, zOffset, color, text); } public IRenderable WithPalette(PaletteReference newPalette) { return new TextRenderable(font, pos, zOffset, color, text); } public IRenderable WithZOffset(int newOffset) { return new TextRenderable(font, pos, zOffset, color, text); } public IRenderable OffsetBy(WVec vec) { return new TextRenderable(font, pos + vec, zOffset, color, text); } + public IRenderable AsDecoration() { return this; } public void BeforeRender(WorldRenderer wr) {} public void Render(WorldRenderer wr) diff --git a/OpenRA.Game/Graphics/VoxelRenderable.cs b/OpenRA.Game/Graphics/VoxelRenderable.cs index 70d0635ba1..f8b6631508 100644 --- a/OpenRA.Game/Graphics/VoxelRenderable.cs +++ b/OpenRA.Game/Graphics/VoxelRenderable.cs @@ -54,6 +54,7 @@ namespace OpenRA.Graphics public float Scale { get { return scale; } } public PaletteReference Palette { get { return palette; } } public int ZOffset { get { return zOffset; } } + public bool IsDecoration { get { return false; } } public IRenderable WithScale(float newScale) { @@ -83,6 +84,8 @@ namespace OpenRA.Graphics palette, normalsPalette, shadowPalette); } + public IRenderable AsDecoration() { return this; } + // This will need generalizing once we support TS/RA2 terrain static readonly float[] groundNormal = new float[] {0,0,1,1}; public void BeforeRender(WorldRenderer wr) diff --git a/OpenRA.Game/Graphics/WorldRenderer.cs b/OpenRA.Game/Graphics/WorldRenderer.cs index dff248e944..fe75a8fa0c 100644 --- a/OpenRA.Game/Graphics/WorldRenderer.cs +++ b/OpenRA.Game/Graphics/WorldRenderer.cs @@ -77,8 +77,11 @@ namespace OpenRA.Graphics bounds.TopLeftAsCPos(), bounds.BottomRightAsCPos()); - var worldRenderables = actors.SelectMany(a => a.Render(this)) - .OrderBy(r => r, comparer); + var worldRenderables = actors.SelectMany(a => a.Render(this)); + if (world.OrderGenerator != null) + worldRenderables = worldRenderables.Concat(world.OrderGenerator.Render(this, world)); + + worldRenderables = worldRenderables.OrderBy(r => r, comparer); // Effects are drawn on top of all actors // TODO: Allow effects to be interleaved with actors @@ -112,16 +115,8 @@ namespace OpenRA.Graphics foreach (var r in a.Trait.RenderAsTerrain(this, a.Actor)) r.Render(this); - foreach (var a in world.Selection.Actors) - if (!a.Destroyed) - foreach (var t in a.TraitsImplementing()) - t.RenderBeforeWorld(this, a); - Game.Renderer.Flush(); - if (world.OrderGenerator != null) - world.OrderGenerator.RenderBeforeWorld(this, world); - for (var i = 0; i < renderables.Count; i++) renderables[i].Render(this); diff --git a/OpenRA.Game/Orders/GenericSelectTarget.cs b/OpenRA.Game/Orders/GenericSelectTarget.cs index 481f19e925..250eaaa9fd 100644 --- a/OpenRA.Game/Orders/GenericSelectTarget.cs +++ b/OpenRA.Game/Orders/GenericSelectTarget.cs @@ -1,4 +1,4 @@ -#region Copyright & License Information +#region Copyright & License Information /* * Copyright 2007-2011 The OpenRA Developers (see AUTHORS) * This file is part of OpenRA, which is free software. It is made @@ -66,7 +66,7 @@ namespace OpenRA.Orders } public virtual void Tick(World world) { } - public void RenderBeforeWorld(WorldRenderer wr, World world) { } + public IEnumerable Render(WorldRenderer wr, World world) { yield break; } public void RenderAfterWorld(WorldRenderer wr, World world) { } public string GetCursor(World world, CPos xy, MouseInput mi) { return world.Map.IsInMap(xy) ? cursor : "generic-blocked"; } } diff --git a/OpenRA.Game/Orders/IOrderGenerator.cs b/OpenRA.Game/Orders/IOrderGenerator.cs index 7de5a38ee6..db0c3c768a 100644 --- a/OpenRA.Game/Orders/IOrderGenerator.cs +++ b/OpenRA.Game/Orders/IOrderGenerator.cs @@ -17,7 +17,7 @@ namespace OpenRA { IEnumerable Order(World world, CPos xy, MouseInput mi); void Tick(World world); - void RenderBeforeWorld(WorldRenderer wr, World world); + IEnumerable Render(WorldRenderer wr, World world); void RenderAfterWorld(WorldRenderer wr, World world); string GetCursor(World world, CPos xy, MouseInput mi); } diff --git a/OpenRA.Game/Orders/UnitOrderGenerator.cs b/OpenRA.Game/Orders/UnitOrderGenerator.cs index d3344ce9af..2c2a75950d 100644 --- a/OpenRA.Game/Orders/UnitOrderGenerator.cs +++ b/OpenRA.Game/Orders/UnitOrderGenerator.cs @@ -42,7 +42,7 @@ namespace OpenRA.Orders } public void Tick(World world) { } - public void RenderBeforeWorld(WorldRenderer wr, World world) { } + public IEnumerable Render(WorldRenderer wr, World world) { yield break; } public void RenderAfterWorld(WorldRenderer wr, World world) { } public string GetCursor(World world, CPos xy, MouseInput mi) diff --git a/OpenRA.Game/Traits/Player/DeveloperMode.cs b/OpenRA.Game/Traits/Player/DeveloperMode.cs index 51b33a0211..fbeed556af 100644 --- a/OpenRA.Game/Traits/Player/DeveloperMode.cs +++ b/OpenRA.Game/Traits/Player/DeveloperMode.cs @@ -84,6 +84,7 @@ namespace OpenRA.Traits case "DevShroudDisable": { DisableShroud ^= true; + self.Owner.Shroud.Disabled = DisableShroud; if (self.World.LocalPlayer == self.Owner) self.World.RenderPlayer = DisableShroud ? null : self.Owner; break; diff --git a/OpenRA.Game/Traits/TraitsInterfaces.cs b/OpenRA.Game/Traits/TraitsInterfaces.cs index 8bbc5db90d..a625a5e030 100755 --- a/OpenRA.Game/Traits/TraitsInterfaces.cs +++ b/OpenRA.Game/Traits/TraitsInterfaces.cs @@ -83,7 +83,6 @@ namespace OpenRA.Traits { string Name(); Player Owner(); - Stance Stance(); } public interface IDisable { bool Disabled { get; } } @@ -144,6 +143,13 @@ namespace OpenRA.Traits void SetVisualPosition(Actor self, WPos pos); } + public interface IMove + { + Activity MoveTo(CPos cell, int nearEnough); + Activity MoveTo(CPos cell, Actor ignoredActor); + Activity MoveWithinRange(Target target, WRange range); + } + public interface INotifyBlockingMove { void OnNotifyBlockingMove(Actor self, Actor blocking); } public interface IFacing @@ -187,7 +193,6 @@ namespace OpenRA.Traits public interface IPostRender { void RenderAfterWorld(WorldRenderer wr, Actor self); } public interface IPostRenderSelection { void RenderAfterWorld(WorldRenderer wr); } - public interface IPreRenderSelection { void RenderBeforeWorld(WorldRenderer wr, Actor self); } public interface IRenderAsTerrain { IEnumerable RenderAsTerrain(WorldRenderer wr, Actor self); } public interface IBodyOrientation { diff --git a/OpenRA.Game/Traits/World/Shroud.cs b/OpenRA.Game/Traits/World/Shroud.cs index 86fb52a6a5..27ab347083 100644 --- a/OpenRA.Game/Traits/World/Shroud.cs +++ b/OpenRA.Game/Traits/World/Shroud.cs @@ -23,6 +23,8 @@ namespace OpenRA.Traits public class Shroud { + [Sync] public bool Disabled = false; + Actor self; Map map; @@ -248,7 +250,7 @@ namespace OpenRA.Traits if (!map.IsInMap(x, y)) return false; - if (!self.World.LobbyInfo.GlobalSettings.Shroud) + if (Disabled || !self.World.LobbyInfo.GlobalSettings.Shroud) return true; return explored[x, y] && (generatedShroudCount[x, y] == 0 || visibleCount[x, y] > 0); @@ -267,7 +269,7 @@ namespace OpenRA.Traits if (x < 0 || x >= map.MapSize.X || y < 0 || y >= map.MapSize.Y) return false; - if (!self.World.LobbyInfo.GlobalSettings.Fog) + if (Disabled || !self.World.LobbyInfo.GlobalSettings.Fog) return true; return visibleCount[x, y] > 0; diff --git a/OpenRA.Mods.RA/Air/Helicopter.cs b/OpenRA.Mods.RA/Air/Helicopter.cs index 33c5a2d89e..f83dbe344b 100755 --- a/OpenRA.Mods.RA/Air/Helicopter.cs +++ b/OpenRA.Mods.RA/Air/Helicopter.cs @@ -25,7 +25,7 @@ namespace OpenRA.Mods.RA.Air public override object Create(ActorInitializer init) { return new Helicopter(init, this); } } - class Helicopter : Aircraft, ITick, IResolveOrder + class Helicopter : Aircraft, ITick, IResolveOrder, IMove { public HelicopterInfo Info; bool firstTick = true; @@ -149,5 +149,9 @@ namespace OpenRA.Mods.RA.Air return (d * 1024 * 8) / (int)distSq; } + + public Activity MoveTo(CPos cell, int nearEnough) { return new HeliFly(cell); } + public Activity MoveTo(CPos cell, Actor ignoredActor) { return new HeliFly(cell); } + public Activity MoveWithinRange(Target target, WRange range) { return new HeliFly(target.CenterPosition); } } } diff --git a/OpenRA.Mods.RA/Air/Plane.cs b/OpenRA.Mods.RA/Air/Plane.cs index 9c90191f72..4fc91ed44d 100755 --- a/OpenRA.Mods.RA/Air/Plane.cs +++ b/OpenRA.Mods.RA/Air/Plane.cs @@ -21,7 +21,7 @@ namespace OpenRA.Mods.RA.Air public override object Create(ActorInitializer init) { return new Plane(init, this); } } - public class Plane : Aircraft, IResolveOrder, ITick, ISync + public class Plane : Aircraft, IResolveOrder, IMove, ITick, ISync { public readonly PlaneInfo Info; [Sync] public WPos RTBPathHash; @@ -89,5 +89,9 @@ namespace OpenRA.Mods.RA.Air UnReserve(); } } + + public Activity MoveTo(CPos cell, int nearEnough) { return Fly.ToCell(cell); } + public Activity MoveTo(CPos cell, Actor ignoredActor) { return Fly.ToCell(cell); } + public Activity MoveWithinRange(Target target, WRange range) { return Fly.ToPos(target.CenterPosition); } } } diff --git a/OpenRA.Mods.RA/Bridge.cs b/OpenRA.Mods.RA/Bridge.cs index ec2d7545f0..8a13908a43 100644 --- a/OpenRA.Mods.RA/Bridge.cs +++ b/OpenRA.Mods.RA/Bridge.cs @@ -151,7 +151,7 @@ namespace OpenRA.Mods.RA } foreach (var t in TileSprites[currentTemplate]) - yield return new SpriteRenderable(t.Value, t.Key.CenterPosition, 0, terrainPalette, 1f); + yield return new SpriteRenderable(t.Value, t.Key.CenterPosition, WVec.Zero, 0, terrainPalette, 1f, true); } void KillUnitsOnBridge() diff --git a/OpenRA.Mods.RA/Buildings/BaseProvider.cs b/OpenRA.Mods.RA/Buildings/BaseProvider.cs index d5c0f33254..880a3b0089 100755 --- a/OpenRA.Mods.RA/Buildings/BaseProvider.cs +++ b/OpenRA.Mods.RA/Buildings/BaseProvider.cs @@ -24,7 +24,7 @@ namespace OpenRA.Mods.RA.Buildings public object Create(ActorInitializer init) { return new BaseProvider(init.self, this); } } - public class BaseProvider : ITick, IPreRenderSelection, ISelectionBar + public class BaseProvider : ITick, IPostRenderSelection, ISelectionBar { public readonly BaseProviderInfo Info; DeveloperMode devMode; @@ -57,7 +57,7 @@ namespace OpenRA.Mods.RA.Buildings } // Range circle - public void RenderBeforeWorld(WorldRenderer wr, Actor self) + public void RenderAfterWorld(WorldRenderer wr) { // Visible to player and allies if (!self.Owner.IsAlliedWith(self.World.RenderPlayer)) diff --git a/OpenRA.Mods.RA/Buildings/Bib.cs b/OpenRA.Mods.RA/Buildings/Bib.cs new file mode 100755 index 0000000000..6f7dd14d70 --- /dev/null +++ b/OpenRA.Mods.RA/Buildings/Bib.cs @@ -0,0 +1,68 @@ +#region Copyright & License Information +/* + * Copyright 2007-2013 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.Collections.Generic; +using System.Linq; +using OpenRA.Graphics; +using OpenRA.Traits; + +namespace OpenRA.Mods.RA.Buildings +{ + public class BibInfo : ITraitInfo, Requires, Requires + { + public readonly string Sequence = "bib"; + public readonly string Palette = "terrain"; + + public object Create(ActorInitializer init) { return new Bib(init.self, this); } + } + + public class Bib : IRender + { + readonly BibInfo info; + readonly List tiles; + + public Bib(Actor self, BibInfo info) + { + this.info = info; + + var rs = self.Trait(); + var building = self.Info.Traits.Get(); + var width = building.Dimensions.X; + var bibOffset = building.Dimensions.Y - 1; + var centerOffset = FootprintUtils.CenterOffset(building); + + tiles = new List(); + for (var i = 0; i < 2*width; i++) + { + var index = i; + var anim = new Animation(rs.GetImage(self)); + anim.PlayFetchIndex(info.Sequence, () => index); + anim.IsDecoration = true; + + // Z-order is one set to the top of the footprint + var offset = new CVec(i % width, i / width + bibOffset).ToWVec() - centerOffset; + tiles.Add(new AnimationWithOffset(anim, () => offset, null, -(offset.Y + centerOffset.Y + 512))); + } + } + + bool paletteInitialized; + PaletteReference palette; + public virtual IEnumerable Render(Actor self, WorldRenderer wr) + { + if (!paletteInitialized) + { + palette = wr.Palette(info.Palette); + paletteInitialized = true; + } + + return tiles.SelectMany(t => t.Render(self, wr, palette, 1f)); + } + } +} diff --git a/OpenRA.Mods.RA/Buildings/BibLayer.cs b/OpenRA.Mods.RA/Buildings/BibLayer.cs deleted file mode 100755 index 503d7dc400..0000000000 --- a/OpenRA.Mods.RA/Buildings/BibLayer.cs +++ /dev/null @@ -1,154 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2013 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.Drawing; -using System.Linq; -using OpenRA.FileFormats; -using OpenRA.Graphics; -using OpenRA.Traits; - -namespace OpenRA.Mods.RA.Buildings -{ - class BibLayerInfo : ITraitInfo - { - public object Create(ActorInitializer init) { return new BibLayer(init.self); } - } - - struct CachedBib - { - public Dictionary Tiles; - public IEnumerable Footprint; - public bool Visible; - public bool Immediate; - } - - class BibLayer : IRenderOverlay, ITickRender - { - World world; - Dictionary visible; - Dictionary dirty; - Cache sprites; - - public BibLayer(Actor self) - { - world = self.World; - visible = new Dictionary(); - dirty = new Dictionary(); - sprites = new Cache(x => Game.modData.SpriteLoader.LoadAllSprites(x)); - } - - public void Update(Actor a, CachedBib bib) - { - dirty[a] = bib; - } - - public Sprite[] LoadSprites(string bibType) - { - return sprites[bibType]; - } - - public void TickRender(WorldRenderer wr, Actor self) - { - var remove = new List(); - foreach (var kv in dirty) - { - if (kv.Value.Immediate || kv.Value.Footprint.Any(c => !self.World.FogObscures(c))) - { - if (kv.Value.Visible) - visible[kv.Key] = kv.Value; - else - visible.Remove(kv.Key); - - remove.Add(kv.Key); - } - } - - foreach (var r in remove) - dirty.Remove(r); - } - - public void Render(WorldRenderer wr) - { - var pal = wr.Palette("terrain"); - var cliprect = Game.viewport.WorldBounds(world); - - foreach (var bib in visible.Values) - { - foreach (var kv in bib.Tiles) - { - if (!cliprect.Contains(kv.Key.X, kv.Key.Y)) - continue; - - if (world.ShroudObscures(kv.Key)) - continue; - - kv.Value.DrawAt(wr.ScreenPxPosition(kv.Key.CenterPosition) - 0.5f * kv.Value.size, pal); - } - } - } - } - - public class BibInfo : ITraitInfo, Requires - { - public readonly string Sprite = "bib3"; - - public object Create(ActorInitializer init) { return new Bib(init.self, this); } - } - - public class Bib : INotifyAddedToWorld, INotifyRemovedFromWorld - { - readonly BibInfo info; - readonly BibLayer bibLayer; - bool firstAdd; - - public Bib(Actor self, BibInfo info) - { - this.info = info; - bibLayer = self.World.WorldActor.Trait(); - firstAdd = true; - } - - void DoBib(Actor self, bool add) - { - var buildingInfo = self.Info.Traits.Get(); - var size = buildingInfo.Dimensions.X; - var bibOffset = buildingInfo.Dimensions.Y - 1; - var sprites = bibLayer.LoadSprites(info.Sprite); - - if (sprites.Length != 2*size) - throw new InvalidOperationException("{0} is an invalid bib for a {1}-wide building".F(info.Sprite, size)); - - var immediate = !self.HasTrait() || - (firstAdd && self.Info.Traits.GetOrDefault().StartsRevealed); - - var dirty = new CachedBib() - { - Footprint = FootprintUtils.Tiles(self), - Tiles = new Dictionary(), - Visible = add, - Immediate = immediate - }; - - for (var i = 0; i < 2 * size; i++) - { - var cell = self.Location + new CVec(i % size, i / size + bibOffset); - dirty.Tiles.Add(cell, sprites[i]); - } - - firstAdd = false; - bibLayer.Update(self, dirty); - } - - public void AddedToWorld(Actor self) { DoBib(self, true); } - public void RemovedFromWorld(Actor self) { DoBib(self, false); } - } -} diff --git a/OpenRA.Mods.RA/ChronoshiftDeploy.cs b/OpenRA.Mods.RA/ChronoshiftDeploy.cs index 0a6c5bb7a6..8f9b768e39 100644 --- a/OpenRA.Mods.RA/ChronoshiftDeploy.cs +++ b/OpenRA.Mods.RA/ChronoshiftDeploy.cs @@ -143,8 +143,9 @@ namespace OpenRA.Mods.RA if (!self.IsInWorld || self.IsDead()) world.CancelInputMode(); } - public void RenderAfterWorld(WorldRenderer wr, World world) { } - public void RenderBeforeWorld(WorldRenderer wr, World world) + + public IEnumerable Render(WorldRenderer wr, World world) { yield break; } + public void RenderAfterWorld(WorldRenderer wr, World world) { if (!self.IsInWorld) return; diff --git a/OpenRA.Mods.RA/Effects/InvulnEffect.cs b/OpenRA.Mods.RA/Effects/InvulnEffect.cs index bd0b856fc9..f7ca41773c 100644 --- a/OpenRA.Mods.RA/Effects/InvulnEffect.cs +++ b/OpenRA.Mods.RA/Effects/InvulnEffect.cs @@ -38,6 +38,7 @@ namespace OpenRA.Mods.RA.Effects yield break; foreach (var r in a.Render(wr)) + if (!r.IsDecoration) yield return r.WithPalette(wr.Palette("invuln")); } } diff --git a/OpenRA.Mods.RA/Effects/Parachute.cs b/OpenRA.Mods.RA/Effects/Parachute.cs index 2a94bf07d8..b9904fc2e6 100644 --- a/OpenRA.Mods.RA/Effects/Parachute.cs +++ b/OpenRA.Mods.RA/Effects/Parachute.cs @@ -72,7 +72,9 @@ namespace OpenRA.Mods.RA.Effects var shadow = wr.Palette("shadow"); foreach (var c in rc) { - yield return c.WithPalette(shadow).WithZOffset(-1); + if (!c.IsDecoration) + yield return c.WithPalette(shadow).WithZOffset(c.ZOffset - 1).AsDecoration(); + yield return c.OffsetBy(pos - c.Pos); } diff --git a/OpenRA.Mods.RA/GainsExperience.cs b/OpenRA.Mods.RA/GainsExperience.cs index 4ed7f070d7..135e4ba4b1 100644 --- a/OpenRA.Mods.RA/GainsExperience.cs +++ b/OpenRA.Mods.RA/GainsExperience.cs @@ -118,8 +118,8 @@ namespace OpenRA.Mods.RA yield break; var bounds = self.Bounds.Value; - var pos = new float2(bounds.Right, bounds.Bottom - 2); - yield return new SpriteRenderable(RankAnim.Image, pos, wr.Palette("effect"), self.CenterLocation.Y); + var pos = new PPos(bounds.Right, bounds.Bottom - 2).ToWPos(0); + yield return new SpriteRenderable(RankAnim.Image, pos, WVec.Zero, 0, wr.Palette("effect"), 1f, true); } } diff --git a/OpenRA.Mods.RA/Guard.cs b/OpenRA.Mods.RA/Guard.cs index 355976d44b..8550b0017c 100644 --- a/OpenRA.Mods.RA/Guard.cs +++ b/OpenRA.Mods.RA/Guard.cs @@ -1,4 +1,4 @@ -#region Copyright & License Information +#region Copyright & License Information /* * Copyright 2007-2013 The OpenRA Developers (see AUTHORS) * This file is part of OpenRA, which is free software. It is made @@ -74,7 +74,7 @@ namespace OpenRA.Mods.RA world.CancelInputMode(); } - public void RenderBeforeWorld(WorldRenderer wr, World world) { } + public IEnumerable Render(WorldRenderer wr, World world) { yield break; } public void RenderAfterWorld(WorldRenderer wr, World world) { } public string GetCursor(World world, CPos xy, MouseInput mi) diff --git a/OpenRA.Mods.RA/Minelayer.cs b/OpenRA.Mods.RA/Minelayer.cs index f6d25c367f..2030368a42 100644 --- a/OpenRA.Mods.RA/Minelayer.cs +++ b/OpenRA.Mods.RA/Minelayer.cs @@ -125,6 +125,7 @@ namespace OpenRA.Mods.RA } CPos lastMousePos; + public IEnumerable Render(WorldRenderer wr, World world) { yield break; } public void RenderAfterWorld(WorldRenderer wr, World world) { if (!minelayer.IsInWorld) @@ -138,8 +139,6 @@ namespace OpenRA.Mods.RA wr.DrawLocus(Color.Cyan, minefield); } - public void RenderBeforeWorld(WorldRenderer wr, World world) { } - public string GetCursor(World world, CPos xy, MouseInput mi) { lastMousePos = xy; return "ability"; } /* TODO */ } diff --git a/OpenRA.Mods.RA/Modifiers/FrozenUnderFog.cs b/OpenRA.Mods.RA/Modifiers/FrozenUnderFog.cs index e9bacfb9a7..8544ae2ffa 100644 --- a/OpenRA.Mods.RA/Modifiers/FrozenUnderFog.cs +++ b/OpenRA.Mods.RA/Modifiers/FrozenUnderFog.cs @@ -59,7 +59,10 @@ namespace OpenRA.Mods.RA } if (visible) - proxy.SetRenderables(self.Render(wr)); + { + var comparer = new RenderableComparer(wr); + proxy.SetRenderables(self.Render(wr).OrderBy(r => r, comparer)); + } } public IEnumerable ModifyRender(Actor self, WorldRenderer wr, IEnumerable r) diff --git a/OpenRA.Mods.RA/Move/Mobile.cs b/OpenRA.Mods.RA/Move/Mobile.cs index 86ef2231a8..0da1ec50b1 100755 --- a/OpenRA.Mods.RA/Move/Mobile.cs +++ b/OpenRA.Mods.RA/Move/Mobile.cs @@ -144,7 +144,7 @@ namespace OpenRA.Mods.RA.Move public int GetInitialFacing() { return InitialFacing; } } - public class Mobile : IIssueOrder, IResolveOrder, IOrderVoice, IPositionable, IFacing, ISync + public class Mobile : IIssueOrder, IResolveOrder, IOrderVoice, IPositionable, IMove, IFacing, ISync { public readonly Actor self; public readonly MobileInfo Info; diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index d56fd0fe6b..df808b0ea2 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -154,7 +154,6 @@ - @@ -462,6 +461,7 @@ + diff --git a/OpenRA.Mods.RA/Orders/PlaceBuildingOrderGenerator.cs b/OpenRA.Mods.RA/Orders/PlaceBuildingOrderGenerator.cs index 2954df5ce7..2677892789 100755 --- a/OpenRA.Mods.RA/Orders/PlaceBuildingOrderGenerator.cs +++ b/OpenRA.Mods.RA/Orders/PlaceBuildingOrderGenerator.cs @@ -68,8 +68,8 @@ namespace OpenRA.Mods.RA.Orders } public void Tick(World world) {} - public void RenderAfterWorld(WorldRenderer wr, World world) {} - public void RenderBeforeWorld(WorldRenderer wr, World world) + public IEnumerable Render(WorldRenderer wr, World world) { yield break; } + public void RenderAfterWorld(WorldRenderer wr, World world) { var position = Game.viewport.ViewToWorld(Viewport.LastMousePos); var topLeft = position - FootprintUtils.AdjustForBuildingSize(BuildingInfo); @@ -110,7 +110,10 @@ namespace OpenRA.Mods.RA.Orders var pal = wr.Palette("terrain"); foreach (var c in cells) - (c.Value ? buildOk : buildBlocked).DrawAt(c.Key.ToPPos().ToFloat2(), pal); + { + var tile = c.Value ? buildOk : buildBlocked; + tile.DrawAt(wr.ScreenPxPosition(c.Key.CenterPosition) - 0.5f * tile.size, pal); + } } public string GetCursor(World world, CPos xy, MouseInput mi) { return "default"; } diff --git a/OpenRA.Mods.RA/Orders/PowerDownOrderGenerator.cs b/OpenRA.Mods.RA/Orders/PowerDownOrderGenerator.cs index a56769227c..2a0eecc226 100755 --- a/OpenRA.Mods.RA/Orders/PowerDownOrderGenerator.cs +++ b/OpenRA.Mods.RA/Orders/PowerDownOrderGenerator.cs @@ -1,4 +1,4 @@ -#region Copyright & License Information +#region Copyright & License Information /* * Copyright 2007-2011 The OpenRA Developers (see AUTHORS) * This file is part of OpenRA, which is free software. It is made @@ -55,8 +55,8 @@ namespace OpenRA.Mods.RA.Orders world.CancelInputMode(); } + public IEnumerable Render(WorldRenderer wr, World world) { yield break; } public void RenderAfterWorld(WorldRenderer wr, World world) { } - public void RenderBeforeWorld(WorldRenderer wr, World world) { } public string GetCursor(World world, CPos xy, MouseInput mi) { diff --git a/OpenRA.Mods.RA/Orders/RepairOrderGenerator.cs b/OpenRA.Mods.RA/Orders/RepairOrderGenerator.cs index 1b6745752b..d57d624c36 100644 --- a/OpenRA.Mods.RA/Orders/RepairOrderGenerator.cs +++ b/OpenRA.Mods.RA/Orders/RepairOrderGenerator.cs @@ -1,4 +1,4 @@ -#region Copyright & License Information +#region Copyright & License Information /* * Copyright 2007-2011 The OpenRA Developers (see AUTHORS) * This file is part of OpenRA, which is free software. It is made @@ -49,8 +49,8 @@ namespace OpenRA.Mods.RA.Orders world.CancelInputMode(); } + public IEnumerable Render(WorldRenderer wr, World world) { yield break; } public void RenderAfterWorld(WorldRenderer wr, World world) { } - public void RenderBeforeWorld(WorldRenderer wr, World world) { } public string GetCursor(World world, CPos xy, MouseInput mi) { diff --git a/OpenRA.Mods.RA/Orders/SetChronoTankDestination.cs b/OpenRA.Mods.RA/Orders/SetChronoTankDestination.cs index 3b4d2f3ab5..16315395f0 100644 --- a/OpenRA.Mods.RA/Orders/SetChronoTankDestination.cs +++ b/OpenRA.Mods.RA/Orders/SetChronoTankDestination.cs @@ -38,13 +38,12 @@ namespace OpenRA.Mods.RA.Orders } public void Tick( World world ) { } + public IEnumerable Render(WorldRenderer wr, World world) { yield break; } public void RenderAfterWorld( WorldRenderer wr, World world ) { wr.DrawSelectionBox(self, Color.White); } - public void RenderBeforeWorld( WorldRenderer wr, World world ) { } - public string GetCursor(World world, CPos xy, MouseInput mi) { if (!world.LocalPlayer.Shroud.IsExplored(xy)) diff --git a/OpenRA.Mods.RA/Production.cs b/OpenRA.Mods.RA/Production.cs index ad6c8241e3..dd9108fb18 100755 --- a/OpenRA.Mods.RA/Production.cs +++ b/OpenRA.Mods.RA/Production.cs @@ -94,19 +94,11 @@ namespace OpenRA.Mods.RA if (rp == null) return exitLocation; - var mobile = newUnit.TraitOrDefault(); - if (mobile != null) + var move = newUnit.TraitOrDefault(); + if (move != null) { newUnit.QueueActivity(new AttackMove.AttackMoveActivity( - newUnit, mobile.MoveTo(rp.rallyPoint, rp.nearEnough))); - return rp.rallyPoint; - } - - // TODO: don't talk about HeliFly here. - var helicopter = newUnit.TraitOrDefault(); - if (helicopter != null) - { - newUnit.QueueActivity(new HeliFly(rp.rallyPoint)); + newUnit, move.MoveTo(rp.rallyPoint, rp.nearEnough))); return rp.rallyPoint; } diff --git a/OpenRA.Mods.RA/Render/RenderBuilding.cs b/OpenRA.Mods.RA/Render/RenderBuilding.cs index b3e70badc8..46e98d5a65 100755 --- a/OpenRA.Mods.RA/Render/RenderBuilding.cs +++ b/OpenRA.Mods.RA/Render/RenderBuilding.cs @@ -32,7 +32,7 @@ namespace OpenRA.Mods.RA.Render return; foreach (var a in w.ActorsWithTrait()) - a.Trait.RenderBeforeWorld(wr, a.Actor); + a.Trait.RenderAfterWorld(wr); } } @@ -63,8 +63,10 @@ namespace OpenRA.Mods.RA.Render foreach (var a in r) { yield return a; - if (disabled) - yield return a.WithPalette(wr.Palette("disabled")).WithZOffset(1); + if (disabled && !a.IsDecoration) + yield return a.WithPalette(wr.Palette("disabled")) + .WithZOffset(a.ZOffset + 1) + .AsDecoration(); } } diff --git a/OpenRA.Mods.RA/Render/WithShadow.cs b/OpenRA.Mods.RA/Render/WithShadow.cs index 96b6ee3d9e..11c5653439 100644 --- a/OpenRA.Mods.RA/Render/WithShadow.cs +++ b/OpenRA.Mods.RA/Render/WithShadow.cs @@ -31,9 +31,11 @@ namespace OpenRA.Mods.RA.Render ? (int)Math.Abs((self.ActorID + Game.LocalTick) / 5 % 4 - 1) - 1 : 0; // Contrails shouldn't cast shadows - var shadowSprites = r.Where(s => !(s is ContrailRenderable)) + var shadowSprites = r.Where(s => !s.IsDecoration) .Select(a => a.WithPalette(wr.Palette("shadow")) - .OffsetBy(new WVec(0, 0, -a.Pos.Z)).WithZOffset(a.ZOffset + a.Pos.Z)); + .OffsetBy(new WVec(0, 0, -a.Pos.Z)) + .WithZOffset(a.ZOffset + a.Pos.Z) + .AsDecoration()); var worldVisualOffset = new WVec(0,0,-43*visualOffset); var flyingSprites = !flying ? r : diff --git a/OpenRA.Mods.RA/RenderDetectionCircle.cs b/OpenRA.Mods.RA/RenderDetectionCircle.cs index 8e8d0b90b1..9dcc897164 100644 --- a/OpenRA.Mods.RA/RenderDetectionCircle.cs +++ b/OpenRA.Mods.RA/RenderDetectionCircle.cs @@ -14,10 +14,18 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { - class RenderDetectionCircleInfo : TraitInfo { } - class RenderDetectionCircle : IPreRenderSelection + class RenderDetectionCircleInfo : ITraitInfo { - public void RenderBeforeWorld(WorldRenderer wr, Actor self) + public object Create(ActorInitializer init) { return new RenderDetectionCircle(init.self); } + } + + class RenderDetectionCircle : IPostRenderSelection + { + Actor self; + + public RenderDetectionCircle(Actor self) { this.self = self; } + + public void RenderAfterWorld(WorldRenderer wr) { if (self.Owner != self.World.LocalPlayer) return; diff --git a/OpenRA.Mods.RA/RenderJammerCircle.cs b/OpenRA.Mods.RA/RenderJammerCircle.cs index 7d156b18ac..18522955d2 100644 --- a/OpenRA.Mods.RA/RenderJammerCircle.cs +++ b/OpenRA.Mods.RA/RenderJammerCircle.cs @@ -15,7 +15,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { //todo: remove all the Render*Circle duplication - class RenderJammerCircleInfo : TraitInfo, IPlaceBuildingDecoration + class RenderJammerCircleInfo : ITraitInfo, IPlaceBuildingDecoration { public void Render(WorldRenderer wr, World w, ActorInfo ai, WPos centerPosition) { @@ -29,13 +29,19 @@ namespace OpenRA.Mods.RA foreach (var a in w.ActorsWithTrait()) if (a.Actor.Owner == a.Actor.World.LocalPlayer) - a.Trait.RenderBeforeWorld(wr, a.Actor); + a.Trait.RenderAfterWorld(wr); } + + public object Create(ActorInitializer init) { return new RenderJammerCircle(init.self); } } - public class RenderJammerCircle : IPreRenderSelection + class RenderJammerCircle : IPostRenderSelection { - public void RenderBeforeWorld(WorldRenderer wr, Actor self) + Actor self; + + public RenderJammerCircle(Actor self) { this.self = self; } + + public void RenderAfterWorld(WorldRenderer wr) { if (self.Owner != self.World.LocalPlayer) return; diff --git a/OpenRA.Mods.RA/RenderRangeCircle.cs b/OpenRA.Mods.RA/RenderRangeCircle.cs index 480b177ac2..6238ac68a2 100644 --- a/OpenRA.Mods.RA/RenderRangeCircle.cs +++ b/OpenRA.Mods.RA/RenderRangeCircle.cs @@ -20,7 +20,7 @@ namespace OpenRA.Mods.RA void Render(WorldRenderer wr, World w, ActorInfo ai, WPos centerPosition); } - class RenderRangeCircleInfo : TraitInfo, IPlaceBuildingDecoration + class RenderRangeCircleInfo : ITraitInfo, IPlaceBuildingDecoration { public readonly string RangeCircleType = null; @@ -36,13 +36,19 @@ namespace OpenRA.Mods.RA foreach (var a in w.ActorsWithTrait()) if (a.Actor.Owner == a.Actor.World.LocalPlayer) if (a.Actor.Info.Traits.Get().RangeCircleType == RangeCircleType) - a.Trait.RenderBeforeWorld(wr, a.Actor); + a.Trait.RenderAfterWorld(wr); } + + public object Create(ActorInitializer init) { return new RenderRangeCircle(init.self); } } - class RenderRangeCircle : IPreRenderSelection + class RenderRangeCircle : IPostRenderSelection { - public void RenderBeforeWorld(WorldRenderer wr, Actor self) + Actor self; + + public RenderRangeCircle(Actor self) { this.self = self; } + + public void RenderAfterWorld(WorldRenderer wr) { if (self.Owner != self.World.LocalPlayer) return; diff --git a/OpenRA.Mods.RA/RenderShroudCircle.cs b/OpenRA.Mods.RA/RenderShroudCircle.cs index 27b0db8552..25aa7678a4 100644 --- a/OpenRA.Mods.RA/RenderShroudCircle.cs +++ b/OpenRA.Mods.RA/RenderShroudCircle.cs @@ -14,7 +14,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { - class RenderShroudCircleInfo : TraitInfo, IPlaceBuildingDecoration + class RenderShroudCircleInfo : ITraitInfo, IPlaceBuildingDecoration { public void Render(WorldRenderer wr, World w, ActorInfo ai, WPos centerPosition) { @@ -27,13 +27,19 @@ namespace OpenRA.Mods.RA foreach (var a in w.ActorsWithTrait()) if (a.Actor.Owner == a.Actor.World.LocalPlayer) - a.Trait.RenderBeforeWorld(wr, a.Actor); + a.Trait.RenderAfterWorld(wr); } + + public object Create(ActorInitializer init) { return new RenderShroudCircle(init.self); } } - class RenderShroudCircle : IPreRenderSelection + class RenderShroudCircle : IPostRenderSelection { - public void RenderBeforeWorld(WorldRenderer wr, Actor self) + Actor self; + + public RenderShroudCircle(Actor self) { this.self = self; } + + public void RenderAfterWorld(WorldRenderer wr) { if (self.Owner != self.World.LocalPlayer) return; diff --git a/OpenRA.Mods.RA/Spy.cs b/OpenRA.Mods.RA/Spy.cs index 7b7553ae60..d0d0459d28 100644 --- a/OpenRA.Mods.RA/Spy.cs +++ b/OpenRA.Mods.RA/Spy.cs @@ -51,17 +51,6 @@ namespace OpenRA.Mods.RA return self.Owner; } - public Stance Stance() - { - if (spy.Disguised) - { - if (self.Owner == self.World.LocalPlayer) - return self.World.LocalPlayer.Stances[self.Owner]; - return self.World.LocalPlayer.Stances[spy.disguisedAsPlayer]; - } - return self.World.LocalPlayer.Stances[self.Owner]; - } - public SpyToolTip( Actor self, TooltipInfo info ) { this.self = self; diff --git a/OpenRA.Mods.RA/SupportPowers/ChronoshiftPower.cs b/OpenRA.Mods.RA/SupportPowers/ChronoshiftPower.cs index 22e74e5be5..284765b004 100755 --- a/OpenRA.Mods.RA/SupportPowers/ChronoshiftPower.cs +++ b/OpenRA.Mods.RA/SupportPowers/ChronoshiftPower.cs @@ -140,20 +140,18 @@ namespace OpenRA.Mods.RA { var xy = Game.viewport.ViewToWorld(Viewport.LastMousePos); var targetUnits = power.UnitsInRange(xy); - foreach (var unit in targetUnits) { - if (manager.self.Owner.Shroud.IsTargetable(unit) || manager.self.Owner.HasFogVisibility()) { + foreach (var unit in targetUnits) + if (manager.self.Owner.Shroud.IsTargetable(unit) || manager.self.Owner.HasFogVisibility()) wr.DrawSelectionBox(unit, Color.Red); - } - } } - public void RenderBeforeWorld(WorldRenderer wr, World world) + public IEnumerable Render(WorldRenderer wr, World world) { var xy = Game.viewport.ViewToWorld(Viewport.LastMousePos); var tiles = world.FindTilesInCircle(xy, range); var pal = wr.Palette("terrain"); foreach (var t in tiles) - tile.DrawAt(t.ToPPos().ToFloat2(), pal); + yield return new SpriteRenderable(tile, t.CenterPosition, WVec.Zero, -511, pal, 1f, true); } public string GetCursor(World world, CPos xy, MouseInput mi) @@ -221,25 +219,23 @@ namespace OpenRA.Mods.RA public void RenderAfterWorld(WorldRenderer wr, World world) { - foreach (var unit in power.UnitsInRange(sourceLocation)) { - if (manager.self.Owner.Shroud.IsTargetable(unit) || manager.self.Owner.HasFogVisibility()) { + foreach (var unit in power.UnitsInRange(sourceLocation)) + if (manager.self.Owner.Shroud.IsTargetable(unit) || manager.self.Owner.HasFogVisibility()) wr.DrawSelectionBox(unit, Color.Red); - } - } } - public void RenderBeforeWorld(WorldRenderer wr, World world) + public IEnumerable Render(WorldRenderer wr, World world) { var xy = Game.viewport.ViewToWorld(Viewport.LastMousePos); var pal = wr.Palette("terrain"); // Source tiles foreach (var t in world.FindTilesInCircle(sourceLocation, range)) - sourceTile.DrawAt(t.ToPPos().ToFloat2(), pal); + yield return new SpriteRenderable(sourceTile, t.CenterPosition, WVec.Zero, -511, pal, 1f, true); // Destination tiles foreach (var t in world.FindTilesInCircle(xy, range)) - sourceTile.DrawAt(t.ToPPos().ToFloat2(), pal); + yield return new SpriteRenderable(sourceTile, t.CenterPosition, WVec.Zero, -511, pal, 1f, true); // Unit previews foreach (var unit in power.UnitsInRange(sourceLocation)) @@ -247,7 +243,7 @@ namespace OpenRA.Mods.RA var offset = (xy - sourceLocation).ToWVec(); if (manager.self.Owner.Shroud.IsTargetable(unit)) foreach (var r in unit.Render(wr)) - r.OffsetBy(offset).Render(wr); + yield return r.OffsetBy(offset); } // Unit tiles @@ -259,7 +255,7 @@ namespace OpenRA.Mods.RA var canEnter = ((manager.self.Owner.Shroud.IsExplored(targetCell) || manager.self.Owner.HasFogVisibility()) && unit.Trait().CanChronoshiftTo(unit,targetCell)); var tile = canEnter ? validTile : invalidTile; - tile.DrawAt(targetCell.ToPPos().ToFloat2(), pal); + yield return new SpriteRenderable(tile, targetCell.CenterPosition, WVec.Zero, -511, pal, 1f, true); } } } @@ -276,7 +272,8 @@ namespace OpenRA.Mods.RA break; } } - if (!canTeleport) { + if (!canTeleport) + { // Check the terrain types. This will allow chronoshifts to occur on empty terrain to terrain of // a similar type. This also keeps the cursor from changing in non-visible property, alerting the // chronoshifter of enemy unit presence diff --git a/OpenRA.Mods.RA/SupportPowers/IronCurtainPower.cs b/OpenRA.Mods.RA/SupportPowers/IronCurtainPower.cs index 50e5a47d17..ffa0d71892 100755 --- a/OpenRA.Mods.RA/SupportPowers/IronCurtainPower.cs +++ b/OpenRA.Mods.RA/SupportPowers/IronCurtainPower.cs @@ -95,12 +95,12 @@ namespace OpenRA.Mods.RA wr.DrawSelectionBox(unit, Color.Red); } - public void RenderBeforeWorld(WorldRenderer wr, World world) + public IEnumerable Render(WorldRenderer wr, World world) { var xy = Game.viewport.ViewToWorld(Viewport.LastMousePos); var pal = wr.Palette("terrain"); foreach (var t in world.FindTilesInCircle(xy, range)) - tile.DrawAt(t.ToPPos().ToFloat2(), pal); + yield return new SpriteRenderable(tile, t.CenterPosition, WVec.Zero, -511, pal, 1f, true); } public string GetCursor(World world, CPos xy, MouseInput mi) diff --git a/OpenRA.Mods.RA/SupportPowers/SupportPowerManager.cs b/OpenRA.Mods.RA/SupportPowers/SupportPowerManager.cs index bb9ba10718..2e3437e499 100755 --- a/OpenRA.Mods.RA/SupportPowers/SupportPowerManager.cs +++ b/OpenRA.Mods.RA/SupportPowers/SupportPowerManager.cs @@ -221,7 +221,7 @@ namespace OpenRA.Mods.RA world.CancelInputMode(); } - public void RenderBeforeWorld(WorldRenderer wr, World world) { } + public IEnumerable Render(WorldRenderer wr, World world) { yield break; } public void RenderAfterWorld(WorldRenderer wr, World world) { } public string GetCursor(World world, CPos xy, MouseInput mi) { return world.Map.IsInMap(xy) ? cursor : "generic-blocked"; } } diff --git a/OpenRA.Mods.RA/TeslaZapRenderable.cs b/OpenRA.Mods.RA/TeslaZapRenderable.cs index 27c0bb04f1..0389fd0a81 100755 --- a/OpenRA.Mods.RA/TeslaZapRenderable.cs +++ b/OpenRA.Mods.RA/TeslaZapRenderable.cs @@ -60,11 +60,13 @@ namespace OpenRA.Mods.RA public float Scale { get { return 1f; } } public PaletteReference Palette { get { return null; } } public int ZOffset { get { return zOffset; } } + public bool IsDecoration { get { return true; } } public IRenderable WithScale(float newScale) { return new TeslaZapRenderable(pos, zOffset, length, image, brightZaps, dimZaps); } public IRenderable WithPalette(PaletteReference newPalette) { return new TeslaZapRenderable(pos, zOffset, length, image, brightZaps, dimZaps); } public IRenderable WithZOffset(int newOffset) { return new TeslaZapRenderable(pos, zOffset, length, image, brightZaps, dimZaps); } public IRenderable OffsetBy(WVec vec) { return new TeslaZapRenderable(pos + vec, zOffset, length, image, brightZaps, dimZaps); } + public IRenderable AsDecoration() { return this; } public void BeforeRender(WorldRenderer wr) { } public void RenderDebugGeometry(WorldRenderer wr) { } @@ -132,8 +134,8 @@ namespace OpenRA.Mods.RA var step = steps.Where(t => (to - (z + new float2(t[0], t[1]))).LengthSquared < (to - z).LengthSquared) .OrderBy(t => Math.Abs(float2.Dot(z + new float2(t[0], t[1]), q) + c)).First(); - rs.Add(new SpriteRenderable(s.GetSprite(step[4]), z + new float2(step[2], step[3]), - wr.Palette("effect"), (int)from.Y)); + var pos = new PPos((int)(z.X + step[2]), (int)(z.Y + step[3])).ToWPos(0); + rs.Add(new SpriteRenderable(s.GetSprite(step[4]), pos, WVec.Zero, 0, wr.Palette("effect"), 1f, true)); z += new float2(step[0], step[1]); if (rs.Count >= 1000) diff --git a/OpenRA.Mods.RA/Valued.cs b/OpenRA.Mods.RA/Valued.cs index 6df5487125..483c6cc23b 100755 --- a/OpenRA.Mods.RA/Valued.cs +++ b/OpenRA.Mods.RA/Valued.cs @@ -40,7 +40,6 @@ namespace OpenRA.Mods.RA public string Name() { return Info.Name; } public Player Owner() { return self.Owner; } - public Stance Stance() { return self.World.LocalPlayer.Stances[self.Owner]; } public Tooltip(Actor self, TooltipInfo info) { diff --git a/mods/cnc/rules/structures.yaml b/mods/cnc/rules/structures.yaml index a85745651d..c8c49ade2e 100644 --- a/mods/cnc/rules/structures.yaml +++ b/mods/cnc/rules/structures.yaml @@ -23,7 +23,6 @@ FACT: RevealsShroud: Range: 10 Bib: - Sprite: bib2 Production: Produces: Building,Defense Transforms: @@ -73,7 +72,6 @@ NUKE: RevealsShroud: Range: 4 Bib: - Sprite: bib3 NUK2: Inherits: ^Building @@ -98,7 +96,6 @@ NUK2: RevealsShroud: Range: 4 Bib: - Sprite: bib3 PROC: Inherits: ^Building @@ -121,7 +118,6 @@ PROC: RevealsShroud: Range: 6 Bib: - Sprite: bib2 TiberiumRefinery: DockOffset: 0,2 TickRate: 15 @@ -195,7 +191,6 @@ PYLE: RevealsShroud: Range: 5 Bib: - Sprite: bib3 RallyPoint: Exit@1: SpawnOffset: -10,2 @@ -235,7 +230,6 @@ HAND: RevealsShroud: Range: 5 Bib: - Sprite: bib3 RallyPoint: Exit@1: SpawnOffset: 12,24 @@ -272,10 +266,8 @@ AFLD: RevealsShroud: Range: 7 Bib: - Sprite: bib1 RallyPoint: RallyPoint: 4,2 - BelowUnits: Exit@1: SpawnOffset: -24,0 ExitCell: 3,1 @@ -312,7 +304,6 @@ WEAP: RevealsShroud: Range: 4 Bib: - Sprite: bib2 -RenderBuilding: RenderBuildingWarFactory: RallyPoint: @@ -353,7 +344,6 @@ HPAD: SpawnOffset: 0,-6 Production: Produces: Aircraft - BelowUnits: Reservable: RepairsUnits: RallyPoint: @@ -389,7 +379,6 @@ HQ: RevealsShroud: Range: 10 Bib: - Sprite: bib3 ProvidesRadar: RenderDetectionCircle: DetectCloaked: @@ -424,7 +413,6 @@ FIX: HP: 400 RevealsShroud: Range: 5 - BelowUnits: Reservable: RepairsUnits: RallyPoint: @@ -454,7 +442,6 @@ EYE: RevealsShroud: Range: 10 Bib: - Sprite: bib3 ProvidesRadar: RenderDetectionCircle: DetectCloaked: @@ -495,7 +482,6 @@ TMPL: RevealsShroud: Range: 6 Bib: - Sprite: bib2 NukePower: Image: atomicnh ChargeTime: 300 diff --git a/mods/cnc/rules/system.yaml b/mods/cnc/rules/system.yaml index 18506ba034..1f1d4c1268 100644 --- a/mods/cnc/rules/system.yaml +++ b/mods/cnc/rules/system.yaml @@ -275,7 +275,6 @@ World: Race: nod ProductionQueueFromSelection: ProductionTabsWidget: PRODUCTION_TABS - BibLayer: DomainIndex: ResourceLayer: ResourceClaimLayer: @@ -403,7 +402,6 @@ CRATE: NoBaseSelectionShares: 120 Unit: mcv RenderSimple: - BelowUnits: BodyOrientation: mpspawn: diff --git a/mods/cnc/sequences/misc.yaml b/mods/cnc/sequences/misc.yaml index b7cece7f73..0617455d36 100644 --- a/mods/cnc/sequences/misc.yaml +++ b/mods/cnc/sequences/misc.yaml @@ -165,8 +165,10 @@ allyrepair: crate: idle: wcrate Start: 0 + ZOffset: -511 land: wcrate Start: 0 + ZOffset: -511 crate-effects: airstrike: deviator diff --git a/mods/cnc/sequences/structures.yaml b/mods/cnc/sequences/structures.yaml index 91cc44e92f..eb8fa9b1bf 100644 --- a/mods/cnc/sequences/structures.yaml +++ b/mods/cnc/sequences/structures.yaml @@ -21,6 +21,9 @@ fact: Start: 0 Length: * Tick: 80 + bib: bib2 + Start: 0 + Length: * nuke: idle: @@ -38,6 +41,9 @@ nuke: Start: 0 Length: * Tick: 80 + bib: bib3 + Start: 0 + Length: * proc: idle: @@ -62,6 +68,9 @@ proc: Start: 6 Length: 6 Offset: -32,-21 + bib: bib2 + Start: 0 + Length: * silo: idle: @@ -76,6 +85,9 @@ silo: Start: 0 Length: * Tick: 80 + bib: bib3 + Start: 0 + Length: * hand: idle: @@ -88,6 +100,9 @@ hand: Start: 0 Length: * Tick: 80 + bib: bib3 + Start: 0 + Length: * pyle: idle: @@ -105,6 +120,9 @@ pyle: Start: 0 Length: * Tick: 80 + bib: bib3 + Start: 0 + Length: * weap: idle: @@ -127,28 +145,39 @@ weap: Start: 0 Length: * Tick: 80 + bib: bib2 + Start: 0 + Length: * afld: idle: Start: 0 Tick: 120 + ZOffset: -1023 active: Start: 0 Length: 16 Tick: 120 + ZOffset: -1023 damaged-idle: Start: 16 Tick: 120 + ZOffset: -1023 damaged-active: Start: 16 Length: 16 Tick: 120 + ZOffset: -1023 dead: Start: 32 + ZOffset: -1023 make: afldmake Start: 0 Length: * Tick: 80 + bib: bib1 + Start: 0 + Length: * hq: idle: @@ -165,6 +194,9 @@ hq: Start: 0 Length: * Tick: 80 + bib: bib3 + Start: 0 + Length: * nuk2: idle: @@ -181,22 +213,30 @@ nuk2: Start: 0 Length: * Tick: 80 + bib: bib3 + Start: 0 + Length: * hpad: idle: Start: 0 + ZOffset: -1023 damaged-idle: Start: 7 + ZOffset: -1023 active: Start: 1 Length: 6 Tick: 100 + ZOffset: -1023 damaged-active: Start: 8 Length: 6 Tick: 100 + ZOffset: -1023 dead: Start: 14 + ZOffset: -1023 make: hpadmake Start: 0 Length: * @@ -205,16 +245,20 @@ hpad: fix: idle: Start: 0 + ZOffset: -1c511 damaged-idle: Start: 7 active: Start: 0 Length: 7 + ZOffset: -1c511 damaged-active: Start: 7 Length: 7 + ZOffset: -1c511 dead: Start: 14 + ZOffset: -1c511 make: fixmake Start: 0 Length: 14 @@ -235,6 +279,9 @@ eye: Start: 0 Length: * Tick: 80 + bib: bib3 + Start: 0 + Length: * tmpl: idle: @@ -253,6 +300,9 @@ tmpl: Start: 0 Length: * Tick: 60 + bib: bib2 + Start: 0 + Length: * obli: idle: diff --git a/mods/d2k/rules/structures.yaml b/mods/d2k/rules/structures.yaml index cfdcb23cbd..bf20b23870 100644 --- a/mods/d2k/rules/structures.yaml +++ b/mods/d2k/rules/structures.yaml @@ -6,7 +6,6 @@ Dimensions: 3,2 Adjacent: 4 Bib: - Sprite: bib3x Buildable: Queue: Building BuildPaletteOrder: 1000 @@ -54,7 +53,6 @@ Footprint: xx xx Dimensions: 2,2 Bib: - Sprite: bib2x Health: HP: 400 Armor: @@ -83,7 +81,6 @@ Footprint: =x xx Dimensions: 2,2 Bib: - Sprite: bib2x Health: HP: 800 Armor: @@ -126,7 +123,6 @@ Footprint: xxx x== Dimensions: 3,2 Bib: - Sprite: bib3x Health: HP: 900 Armor: @@ -201,7 +197,6 @@ Footprint: xxx xx= Dimensions: 3,2 Bib: - Sprite: bib3x Health: HP: 750 Armor: @@ -240,7 +235,6 @@ Footprint: _x_ xxx =xx Dimensions: 3,3 Bib: - Sprite: bib3x Health: HP: 1500 Armor: @@ -281,7 +275,6 @@ Footprint: xxx xxx Dimensions: 3,2 Bib: - Sprite: bib3x Health: HP: 1000 Armor: @@ -312,7 +305,6 @@ Footprint: xxx x=x =x= Dimensions: 3,3 Bib: - Sprite: bib3x Health: HP: 1000 Armor: @@ -321,7 +313,6 @@ Range: 7 RallyPoint: RallyPoint: 1,3 - BelowUnits: Exit@1: SpawnOffset: 0,-15 ExitCell: 2,2 @@ -526,7 +517,6 @@ REPAIR: Type: Concrete RevealsShroud: Range: 5 - BelowUnits: Reservable: RepairsUnits: Interval: 15 @@ -553,7 +543,6 @@ REPAIR: Footprint: _x_ xxx xxx Dimensions: 3,3 Bib: - Sprite: bib3x Health: HP: 1500 Armor: @@ -595,7 +584,6 @@ RESEARCH: Footprint: xxx xxx Dimensions: 3,2 Bib: - Sprite: bib3x Health: HP: 1000 Armor: @@ -624,7 +612,6 @@ RESEARCH: Footprint: _x_ xxx =xx Dimensions: 3,3 Bib: - Sprite: bib3x Health: HP: 2000 Armor: @@ -672,8 +659,6 @@ PALACEC: Building: Footprint: xxx xxx Dimensions: 3,2 - Bib: - Sprite: bib3x RenderBuilding: HasMakeAnimation: false @@ -695,7 +680,6 @@ HEAVYC: # Building: # TerrainTypes: Rock # Footprint: = -# BelowUnits: # LineBuild: # Range: 4 # RenderBuildingWall: @@ -720,7 +704,6 @@ HEAVYC: # Building: # TerrainTypes: Rock # Footprint: = -# BelowUnits: # LineBuild: # Range: 6 # RenderBuildingWall: diff --git a/mods/d2k/rules/system.yaml b/mods/d2k/rules/system.yaml index 240dfc6826..2d6a543416 100644 --- a/mods/d2k/rules/system.yaml +++ b/mods/d2k/rules/system.yaml @@ -354,7 +354,6 @@ World: Country@Ordos: Name: Ordos Race: ordos - BibLayer: DomainIndex: ResourceLayer: ResourceClaimLayer: @@ -480,7 +479,6 @@ CRATE: UncloakSound: STEALTH2.WAV Effect: cloak RenderSimple: - BelowUnits: ProximityCaptor: Types:Crate Passenger: @@ -506,7 +504,6 @@ SPICEBLOOM: RelativeToTopLeft: yes ProximityCaptor: Types:Tree - BelowUnits: Tooltip: Name: Spice Bloom SeedsResource: @@ -547,7 +544,6 @@ SPICEBLOOM: # AttackLeap: # CanAttackGround: no # RenderInfantry: -# BelowUnits: # GivesExperience: # GivesBounty: # DrawLineToTarget: diff --git a/mods/d2k/sequences/map.yaml b/mods/d2k/sequences/map.yaml index 3b1e0c3ea0..49f56711f4 100644 --- a/mods/d2k/sequences/map.yaml +++ b/mods/d2k/sequences/map.yaml @@ -1,8 +1,10 @@ crate: idle: crates Start: 0 + ZOffset: -511 land: crates Start: 0 + ZOffset: -511 spicebloom: make: @@ -11,8 +13,10 @@ spicebloom: active: Start: 2 Length: 1 + ZOffset: -511 idle: Start: 2 + ZOffset: -511 sandworm: stand: wormsigns1 diff --git a/mods/d2k/sequences/structures.yaml b/mods/d2k/sequences/structures.yaml index 58f287ea10..96f71aea6e 100644 --- a/mods/d2k/sequences/structures.yaml +++ b/mods/d2k/sequences/structures.yaml @@ -54,6 +54,9 @@ conyarda: Length: * damaged-idle: Start: 1 + bib: bib3x + Start: 0 + Length: * #build: cranea # Start: 0 # Length: 14 @@ -66,33 +69,44 @@ conyarda: repair: idle: Start: 0 + ZOffset: -1c511 active: Start: 0 Length: 10 Tick: 60 + ZOffset: -1c511 + damaged-idle: + Start: 10 + ZOffset: -1c511 damaged-active: Start: 10 Length: 10 Tick: 60 + ZOffset: -1c511 make: repairmake Start: 0 Length: * - damaged-idle: - Start: 10 starporta: idle: Start: 0 + ZOffset: -1c511 active: Start: 0 Length: 1 + ZOffset: -1c511 damaged-idle: Start: 1 + ZOffset: -1c511 damaged-active: Start: 1 + ZOffset: -1c511 make: starportmake Start: 0 Length: * + bib: bib3x + Start: 0 + Length: * pwra: idle: @@ -104,6 +118,9 @@ pwra: Length: * damaged-idle: Start: 6 + bib: bib2x + Start: 0 + Length: * barra: idle: @@ -113,6 +130,9 @@ barra: Length: * damaged-idle: Start: 1 + bib: bib2x + Start: 0 + Length: * radara: idle: @@ -122,6 +142,9 @@ radara: Length: * damaged-idle: Start: 1 + bib: bib3x + Start: 0 + Length: * refa: idle: @@ -142,6 +165,9 @@ refa: Start: 1 damaged-idle-top: Start: 2 + bib: bib3x + Start: 0 + Length: * siloa: idle: @@ -162,6 +188,9 @@ hightecha: Length: * damaged-idle: Start: 1 + bib: bib3x + Start: 0 + Length: * research: idle: @@ -175,6 +204,9 @@ research: Start: 20 Length: 20 Tick: 80 + bib: bib3x + Start: 0 + Length: * palacea: idle: @@ -184,7 +216,9 @@ palacea: Length: * damaged-idle: Start: 1 - + bib: bib3x + Start: 0 + Length: * lighta: idle: @@ -205,6 +239,9 @@ lighta: Start: 1 damaged-idle-top: Start: 2 + bib: bib3x + Start: 0 + Length: * heavya: idle: @@ -225,6 +262,9 @@ heavya: Start: 1 damaged-idle-top: Start: 2 + bib: bib3x + Start: 0 + Length: * conyardh: idle: @@ -234,20 +274,30 @@ conyardh: Length: * damaged-idle: Start: 1 + bib: bib3x + Start: 0 + Length: * starporth: idle: Start: 0 + ZOffset: -1c511 active: Start: 0 Length: 1 + ZOffset: -1c511 damaged-idle: Start: 1 + ZOffset: -1c511 damaged-active: Start: 1 + ZOffset: -1c511 make: starportmake Start: 0 Length: * + bib: bib3x + Start: 0 + Length: * pwrh: idle: @@ -259,6 +309,9 @@ pwrh: Length: * damaged-idle: Start: 6 + bib: bib2x + Start: 0 + Length: * barrh: idle: @@ -268,6 +321,9 @@ barrh: Length: * damaged-idle: Start: 1 + bib: bib2x + Start: 0 + Length: * radarh: idle: @@ -277,6 +333,9 @@ radarh: Length: * damaged-idle: Start: 1 + bib: bib3x + Start: 0 + Length: * refh: idle: @@ -297,6 +356,9 @@ refh: Start: 1 damaged-idle-top: Start: 2 + bib: bib3x + Start: 0 + Length: * siloh: idle: @@ -317,6 +379,9 @@ hightechh: Length: * damaged-idle: Start: 1 + bib: bib3x + Start: 0 + Length: * palaceh: idle: @@ -334,6 +399,9 @@ palaceh: Start: 8 Length: 6 Tick: 160 + bib: bib3x + Start: 0 + Length: * lighth: idle: @@ -354,6 +422,9 @@ lighth: Start: 1 damaged-idle-top: Start: 2 + bib: bib3x + Start: 0 + Length: * heavyh: idle: @@ -374,6 +445,9 @@ heavyh: Start: 1 damaged-idle-top: Start: 2 + bib: bib3x + Start: 0 + Length: * conyardo: idle: @@ -383,20 +457,30 @@ conyardo: Length: * damaged-idle: Start: 1 + bib: bib3x + Start: 0 + Length: * starporto: idle: Start: 0 + ZOffset: -1c511 active: Start: 0 Length: 1 + ZOffset: -1c511 damaged-idle: Start: 1 + ZOffset: -1c511 damaged-active: Start: 1 + ZOffset: -1c511 make: starportmake Start: 0 Length: * + bib: bib3x + Start: 0 + Length: * pwro: idle: @@ -408,6 +492,9 @@ pwro: Length: * damaged-idle: Start: 6 + bib: bib2x + Start: 0 + Length: * barro: idle: @@ -417,6 +504,9 @@ barro: Length: * damaged-idle: Start: 1 + bib: bib2x + Start: 0 + Length: * radaro: idle: @@ -426,6 +516,9 @@ radaro: Length: * damaged-idle: Start: 1 + bib: bib3x + Start: 0 + Length: * refo: idle: @@ -446,6 +539,9 @@ refo: Start: 1 damaged-idle-top: Start: 2 + bib: bib3x + Start: 0 + Length: * siloo: idle: @@ -466,6 +562,9 @@ hightecho: Length: * damaged-idle: Start: 1 + bib: bib3x + Start: 0 + Length: * palaceo: idle: @@ -475,7 +574,9 @@ palaceo: Length: * damaged-idle: Start: 1 - + bib: bib3x + Start: 0 + Length: * lighto: idle: @@ -496,6 +597,9 @@ lighto: Start: 1 damaged-idle-top: Start: 2 + bib: bib3x + Start: 0 + Length: * heavyo: idle: @@ -516,26 +620,39 @@ heavyo: Start: 1 damaged-idle-top: Start: 2 + bib: bib3x + Start: 0 + Length: * palacec: idle: Start: 0 damaged-idle: Start: 1 + bib: bib3x + Start: 0 + Length: * starportc: idle: Start: 0 + ZOffset: -1c511 active: Start: 0 Length: 1 + ZOffset: -1c511 damaged-idle: Start: 1 + ZOffset: -1c511 damaged-active: Start: 1 + ZOffset: -1c511 make: starportmake Start: 0 Length: * + bib: bib3x + Start: 0 + Length: * heavyc: idle: @@ -555,4 +672,7 @@ heavyc: idle-top: Start: 1 damaged-idle-top: - Start: 2 \ No newline at end of file + Start: 2 + bib: bib3x + Start: 0 + Length: * diff --git a/mods/ra/maps/Fort-Lonestar/map.yaml b/mods/ra/maps/Fort-Lonestar/map.yaml index a047367bd4..ae6717ca6c 100644 --- a/mods/ra/maps/Fort-Lonestar/map.yaml +++ b/mods/ra/maps/Fort-Lonestar/map.yaml @@ -521,7 +521,6 @@ Rules: Armor: Type: Wood Bib: - Sprite: bib3 RevealsShroud: Range: 3 Capturable: diff --git a/mods/ra/rules/civilian.yaml b/mods/ra/rules/civilian.yaml index 2b961ce769..9ab9f9dcfe 100644 --- a/mods/ra/rules/civilian.yaml +++ b/mods/ra/rules/civilian.yaml @@ -69,7 +69,6 @@ FCOM: RevealsShroud: Range: 10 Bib: - Sprite: bib3 HOSP: Inherits: ^TechBuilding @@ -301,7 +300,6 @@ MISS: Tooltip: Name: Technology Center Bib: - Sprite: bib2 BIO: Inherits: ^TechBuilding @@ -321,7 +319,6 @@ OILB: Health: HP: 1000 Bib: - Sprite: bib3 RevealsShroud: Range: 3 Capturable: diff --git a/mods/ra/rules/structures.yaml b/mods/ra/rules/structures.yaml index 5466a579c8..3980dd451a 100644 --- a/mods/ra/rules/structures.yaml +++ b/mods/ra/rules/structures.yaml @@ -378,7 +378,6 @@ DOME: RevealsShroud: Range: 10 Bib: - Sprite: bib3 ProvidesRadar: IronCurtainable: Infiltratable: @@ -853,7 +852,6 @@ ATEK: RevealsShroud: Range: 10 Bib: - Sprite: bib3 IronCurtainable: GpsPower: Image: gpssicon @@ -890,7 +888,6 @@ WEAP: RevealsShroud: Range: 4 Bib: - Sprite: bib2 -RenderBuilding: RenderBuildingWarFactory: RallyPoint: @@ -920,7 +917,6 @@ FACT: RevealsShroud: Range: 5 Bib: - Sprite: bib2 Production: Produces: Building,Defense IronCurtainable: @@ -964,7 +960,6 @@ PROC: RevealsShroud: Range: 6 Bib: - Sprite: bib2 OreRefinery: StoresOre: PipCount: 17 @@ -1040,13 +1035,11 @@ HPAD: RevealsShroud: Range: 5 Bib: - Sprite: bib3 Exit@1: SpawnOffset: 0,-6 ExitCell: 0,0 Production: Produces: Helicopter - BelowUnits: Reservable: IronCurtainable: ProductionBar: @@ -1081,7 +1074,6 @@ AFLD: Facing:192 Production: Produces: Plane - BelowUnits: Reservable: IronCurtainable: SpyPlanePower: @@ -1128,7 +1120,6 @@ POWR: RevealsShroud: Range: 4 Bib: - Sprite: bib3 IronCurtainable: DeadBuildingState: @@ -1158,7 +1149,6 @@ APWR: RevealsShroud: Range: 4 Bib: - Sprite: bib2 IronCurtainable: DeadBuildingState: @@ -1188,7 +1178,6 @@ STEK: RevealsShroud: Range: 4 Bib: - Sprite: bib2 IronCurtainable: BARR: @@ -1215,7 +1204,6 @@ BARR: RevealsShroud: Range: 5 Bib: - Sprite: bib3 RallyPoint: Exit@1: SpawnOffset: -4,19 @@ -1253,7 +1241,6 @@ TENT: RevealsShroud: Range: 5 Bib: - Sprite: bib3 RallyPoint: Exit@1: SpawnOffset: -1,19 @@ -1307,7 +1294,6 @@ FIX: Type: Wood RevealsShroud: Range: 5 - BelowUnits: Reservable: RallyPoint: IronCurtainable: @@ -1336,7 +1322,6 @@ FACF: RevealsShroud: Range: 4 Bib: - Sprite: bib2 RenderBuilding: Image: FACT Fake: @@ -1366,7 +1351,6 @@ WEAF: RevealsShroud: Range: 4 Bib: - Sprite: bib2 -RenderBuilding: RenderBuildingWarFactory: Image: WEAP @@ -1459,7 +1443,6 @@ DOMF: RevealsShroud: Range: 4 Bib: - Sprite: bib3 RenderBuilding: Image: DOME Fake: diff --git a/mods/ra/rules/system.yaml b/mods/ra/rules/system.yaml index d93ff73c0b..6529debd7f 100644 --- a/mods/ra/rules/system.yaml +++ b/mods/ra/rules/system.yaml @@ -610,7 +610,6 @@ World: Country@1: Name: Soviet Race: soviet - BibLayer: DomainIndex: ResourceLayer: ResourceClaimLayer: @@ -796,7 +795,6 @@ CRATE: SelectionShares: 3 Unit: 4tnk RenderSimple: - BelowUnits: ProximityCaptor: Types:Crate Passenger: diff --git a/mods/ra/sequences/misc.yaml b/mods/ra/sequences/misc.yaml index 15a784eaec..d8a96aa2c1 100644 --- a/mods/ra/sequences/misc.yaml +++ b/mods/ra/sequences/misc.yaml @@ -221,12 +221,15 @@ fb4: crate: idle: scrate Start: 0 + ZOffset: -511 water: wwcrate Start: 0 Length: * Tick: 500 + ZOffset: -511 land: sh-crate Start: 0 + ZOffset: -511 crate-effects: speed: speed diff --git a/mods/ra/sequences/structures.yaml b/mods/ra/sequences/structures.yaml index 1d5131e4d1..5f971ba1af 100644 --- a/mods/ra/sequences/structures.yaml +++ b/mods/ra/sequences/structures.yaml @@ -6,6 +6,9 @@ fcom: make: fcommake Start: 0 Length: * + bib: bib3 + Start: 0 + Length: * hosp: idle: @@ -35,7 +38,9 @@ oilb: Length: * make: Start: 0 - + bib: bib3 + Start: 0 + Length: * fact: idle: Start: 0 @@ -52,6 +57,9 @@ fact: Length: 25 dead: factdead Start: 0 + bib: bib2 + Start: 0 + Length: * proc: idle: @@ -63,6 +71,9 @@ proc: Length: * dead: procdead Start: 0 + bib: bib2 + Start: 0 + Length: * silo: idle: silo2 @@ -85,6 +96,9 @@ powr: Length: * dead: powrdead Start: 0 + bib: bib3 + Start: 0 + Length: * apwr: idle: @@ -96,6 +110,9 @@ apwr: Length: * dead: apwrdead Start: 0 + bib: bib2 + Start: 0 + Length: * barr: idle: @@ -107,6 +124,9 @@ barr: make: barrmake Start: 0 Length: * + bib: bib3 + Start: 0 + Length: * tent: idle: @@ -118,6 +138,9 @@ tent: make: tentmake Start: 0 Length: * + bib: bib3 + Start: 0 + Length: * kenn: idle: @@ -136,6 +159,9 @@ dome: make: domemake Start: 0 Length: * + bib: bib3 + Start: 0 + Length: * atek: idle: @@ -149,6 +175,9 @@ atek: Start: 0 Length: * Offset: -4,0 + bib: bib3 + Start: 0 + Length: * stek: idle: @@ -158,6 +187,9 @@ stek: make: stekmake Start: 0 Length: * + bib: bib2 + Start: 0 + Length: * weap: idle: @@ -177,42 +209,56 @@ weap: Start: 0 damaged-idle-top: weap2 Start: 4 + bib: bib2 + Start: 0 + Length: * hpad: idle: Start: 0 + ZOffset: -1023 damaged-idle: Start: 7 - make: hpadmake - Start: 0 - Length: * + ZOffset: -1023 active: Start: 1 Length: 6 + ZOffset: -1023 damaged-active: Start: 8 Length: 6 + ZOffset: -1023 + make: hpadmake + Start: 0 + Length: * + bib: bib3 + Start: 0 + Length: * afld: idle: afldidle Start: 0 Length: 8 Tick: 160 + ZOffset: -1023 damaged-idle: afldidle Start: 8 Length: 8 Tick: 160 - make: afldmake - Start: 0 - Length: * + ZOffset: -1023 active: Start: 0 Length: 8 Tick: 160 + ZOffset: -1023 damaged-active: Start: 8 Length: 8 Tick: 160 + ZOffset: -1023 + make: afldmake + Start: 0 + Length: * spen: idle: @@ -235,17 +281,21 @@ syrd: fix: idle: Start: 0 + ZOffset: -1c511 damaged-idle: Start: 7 - make: fixmake - Start: 0 - Length: * + ZOffset: -1c511 active: Start: 1 Length: 6 + ZOffset: -1c511 damaged-active: Start: 8 Length: 6 + ZOffset: -1c511 + make: fixmake + Start: 0 + Length: * gun: idle: @@ -424,6 +474,9 @@ miss: make: missmake Start: 0 Length: * + bib: bib2 + Start: 0 + Length: * brik: idle: