From e694692b97b1f44621141133730d067240ada7ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 27 Dec 2014 09:15:51 +0100 Subject: [PATCH] add the Tiberian Sun harvest animation --- OpenRA.Mods.Common/Traits/Render/WithHarvestAnimation.cs | 5 ++++- mods/ts/rules/vehicles.yaml | 3 +++ mods/ts/sequences/vehicles.yaml | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/Render/WithHarvestAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithHarvestAnimation.cs index 281cca6fd0..da1a04326c 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithHarvestAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithHarvestAnimation.cs @@ -23,6 +23,8 @@ namespace OpenRA.Mods.Common.Traits [Desc("Position relative to body")] public readonly WVec Offset = WVec.Zero; + public readonly string Palette = "effect"; + public object Create(ActorInitializer init) { return new WithHarvestAnimation(init.Self, this); } } @@ -39,12 +41,13 @@ namespace OpenRA.Mods.Common.Traits var body = self.Trait(); anim = new Animation(self.World, rs.GetImage(self), RenderSimple.MakeFacingFunc(self)); + anim.IsDecoration = true; anim.Play(info.Sequence); rs.Add("harvest_{0}".F(info.Sequence), new AnimationWithOffset(anim, () => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))), () => !visible, () => false, - p => ZOffsetFromCenter(self, p, 0))); + p => ZOffsetFromCenter(self, p, 0)), info.Palette); } public void Harvested(Actor self, ResourceType resource) diff --git a/mods/ts/rules/vehicles.yaml b/mods/ts/rules/vehicles.yaml index 227358afcd..35f37d699e 100644 --- a/mods/ts/rules/vehicles.yaml +++ b/mods/ts/rules/vehicles.yaml @@ -114,6 +114,9 @@ HARV: WithVoxelUnloadBody: Explodes: Weapon: TiberiumExplosion + WithHarvestAnimation: + Offset: 384,0,0 + Palette: effect HVR: Inherits: ^Vehicle diff --git a/mods/ts/sequences/vehicles.yaml b/mods/ts/sequences/vehicles.yaml index 5e643d3f4c..17c49a50f8 100644 --- a/mods/ts/sequences/vehicles.yaml +++ b/mods/ts/sequences/vehicles.yaml @@ -9,6 +9,9 @@ apc: harv: icon: harvicon Start: 0 + harvest: harvestr + Start: 0 + Length: * hvr: icon: hovricon