diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index 8ec5d2e577..bd04530279 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -283,6 +283,7 @@ + @@ -430,4 +431,4 @@ copy "$(TargetPath)" "$(SolutionDir)mods/ra/" cd "$(SolutionDir)" - \ No newline at end of file + diff --git a/OpenRA.Mods.RA/Render/RenderBuildingSeparateTurret.cs b/OpenRA.Mods.RA/Render/RenderBuildingSeparateTurret.cs new file mode 100644 index 0000000000..345b116947 --- /dev/null +++ b/OpenRA.Mods.RA/Render/RenderBuildingSeparateTurret.cs @@ -0,0 +1,43 @@ +#region Copyright & License Information +/* + * Copyright 2007-2012 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 OpenRA.Graphics; +using OpenRA.Traits; +using OpenRA.Mods.RA.Buildings; + +namespace OpenRA.Mods.RA.Render +{ + class RenderBuildingSeparateTurretInfo : RenderBuildingInfo, Requires, Requires + { + public override object Create(ActorInitializer init) { return new RenderBuildingSeparateTurret(init, this); } + } + + class RenderBuildingSeparateTurret : RenderBuilding + { + public RenderBuildingSeparateTurret(ActorInitializer init, RenderBuildingInfo info) + : base(init, info) + { + var turreted = init.self.Trait(); + var attack = init.self.Trait(); + + var turretAnim = new Animation(GetImage(init.self), () => turreted.turretFacing); + turretAnim.Play("turret"); + + for( var i = 0; i < attack.Turrets.Count; i++ ) + { + var turret = attack.Turrets[i]; + anims.Add( "turret_{0}".F(i), + new AnimationWithOffset(turretAnim, + () => Combat.GetTurretPosition(init.self, null, turret).ToFloat2(), + null)); + } + } + } +} \ No newline at end of file diff --git a/mods/d2k/rules/structures.yaml b/mods/d2k/rules/structures.yaml index e6cffea513..716711bc32 100644 --- a/mods/d2k/rules/structures.yaml +++ b/mods/d2k/rules/structures.yaml @@ -446,7 +446,7 @@ GUNTOWER: Range: 7 RenderRangeCircle: -RenderBuilding: - RenderBuildingTurreted: + RenderBuildingSeparateTurret: Turreted: ROT: 12 InitialFacing: 50