Merge pull request #7204 from Mailaender/ts-harvest-overlay

Added the Tiberian Sun harvest animation
This commit is contained in:
Matthias Mailänder
2015-01-18 12:58:46 +01:00
3 changed files with 10 additions and 1 deletions

View File

@@ -23,6 +23,8 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Position relative to body")] [Desc("Position relative to body")]
public readonly WVec Offset = WVec.Zero; public readonly WVec Offset = WVec.Zero;
public readonly string Palette = "effect";
public object Create(ActorInitializer init) { return new WithHarvestAnimation(init.Self, this); } public object Create(ActorInitializer init) { return new WithHarvestAnimation(init.Self, this); }
} }
@@ -39,12 +41,13 @@ namespace OpenRA.Mods.Common.Traits
var body = self.Trait<IBodyOrientation>(); var body = self.Trait<IBodyOrientation>();
anim = new Animation(self.World, rs.GetImage(self), RenderSimple.MakeFacingFunc(self)); anim = new Animation(self.World, rs.GetImage(self), RenderSimple.MakeFacingFunc(self));
anim.IsDecoration = true;
anim.Play(info.Sequence); anim.Play(info.Sequence);
rs.Add("harvest_{0}".F(info.Sequence), new AnimationWithOffset(anim, rs.Add("harvest_{0}".F(info.Sequence), new AnimationWithOffset(anim,
() => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))), () => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))),
() => !visible, () => !visible,
() => false, () => false,
p => ZOffsetFromCenter(self, p, 0))); p => ZOffsetFromCenter(self, p, 0)), info.Palette);
} }
public void Harvested(Actor self, ResourceType resource) public void Harvested(Actor self, ResourceType resource)

View File

@@ -114,6 +114,9 @@ HARV:
WithVoxelUnloadBody: WithVoxelUnloadBody:
Explodes: Explodes:
Weapon: TiberiumExplosion Weapon: TiberiumExplosion
WithHarvestAnimation:
Offset: 384,0,0
Palette: effect
HVR: HVR:
Inherits: ^Vehicle Inherits: ^Vehicle

View File

@@ -9,6 +9,9 @@ apc:
harv: harv:
icon: harvicon icon: harvicon
Start: 0 Start: 0
harvest: harvestr
Start: 0
Length: *
hvr: hvr:
icon: hovricon icon: hovricon