diff --git a/OpenRa.Game/Game Code.cd b/OpenRa.Game/Game Code.cd index cef986620c..69f4f06f24 100644 --- a/OpenRa.Game/Game Code.cd +++ b/OpenRa.Game/Game Code.cd @@ -10,7 +10,7 @@ - AAaAACBBAAAAAiAAAIACBgAAAAAAAAAIAAAAAAgAAAA= + AAYAACABAAAAgAAAAIAABgAAAAAAAAAIAAAAAAAAAAA= World.cs @@ -21,10 +21,10 @@ Building.cs - + - AAEAEAAAAIAAAgAABAAAIAAQAAAAAQAAJAAAAABAQAA= + AAAAEAAAAIAAAAEEBAAAIAAQQAAAAQAAJAAAAABAQAA= Game.cs @@ -63,8 +63,8 @@ PathFinder.cs - - + + AAEAAAAAAAAAAAAAAAAAACAAAgAAAAAAAAAAAAAAAAA= Player.cs @@ -114,7 +114,7 @@ - + AAAAAAAAAAAAAAIAAAAAABAAAAAAAAAAAAAAAAAAAAA= TerrainCosts.cs @@ -174,14 +174,14 @@ - + AAAAAAAAAAAAAAIAAAEAAAAAAAAAAAQAAAAAAAAAAAA= PathFinder.cs - + AAAAAAAAAAAAAAQAAAIAQAAAAAAAAAAAAAAAAAAAAAA= PathFinder.cs diff --git a/OpenRa.Game/Game.cs b/OpenRa.Game/Game.cs index 043be2a03f..9e0d7c2a7b 100644 --- a/OpenRa.Game/Game.cs +++ b/OpenRa.Game/Game.cs @@ -49,8 +49,9 @@ namespace OpenRa.Game network = new Network(); buildingCreation.Add("proc", (location, owner) => new Refinery(location, owner, this)); + buildingCreation.Add("weap", (location, owner) => new WarFactory(location, owner, this)); - string[] buildings = { "fact", "powr", "apwr", "weap", "barr", "atek", "stek", "dome" }; + string[] buildings = { "fact", "powr", "apwr", "barr", "atek", "stek", "dome" }; foreach (string s in buildings) { var t = s; diff --git a/OpenRa.Game/Refinery.cs b/OpenRa.Game/Refinery.cs index 38721123a9..b71d304f1b 100644 --- a/OpenRa.Game/Refinery.cs +++ b/OpenRa.Game/Refinery.cs @@ -1,3 +1,5 @@ +using OpenRa.Game.Graphics; +using System.Linq; namespace OpenRa.Game { @@ -20,4 +22,37 @@ namespace OpenRa.Game }); } } + + class WarFactory : Building + { + Animation roof; + + public WarFactory(int2 location, Player owner, Game game) + : base("weap", location, owner, game) + { + + animation.PlayThen("make", () => + { + roof = new Animation("weap"); + animation.PlayRepeating("idle"); + roof.PlayRepeating("idle-top"); + }); + } + + public override Sprite[] CurrentImages + { + get + { + return (roof == null) + ? base.CurrentImages + : (base.CurrentImages.Concat( roof.Images ).ToArray()); + } + } + + public override void Tick(Game game, int t) + { + base.Tick(game, t); + if (roof != null) roof.Tick(t); + } + } } diff --git a/sequences.xml b/sequences.xml index 3856828cae..c57eaa2504 100644 --- a/sequences.xml +++ b/sequences.xml @@ -102,6 +102,10 @@ + + + +