add the Tiberian Sun harvest animation

This commit is contained in:
Matthias Mailänder
2014-12-27 09:15:51 +01:00
parent 4edb937401
commit e694692b97
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")]
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<IBodyOrientation>();
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)

View File

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

View File

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