cnc afld polish

This commit is contained in:
Paul Chote
2010-08-30 21:56:05 +12:00
parent 853ef12c8f
commit 178af8b849
3 changed files with 15 additions and 3 deletions

View File

@@ -14,6 +14,7 @@ using OpenRA.Mods.RA;
using OpenRA.Mods.RA.Activities;
using OpenRA.Traits;
using OpenRA.Traits.Activities;
using OpenRA.Mods.RA.Render;
namespace OpenRA.Mods.Cnc
{
@@ -39,6 +40,8 @@ namespace OpenRA.Mods.Cnc
var spawn = self.CenterLocation + Spawns.First().First;
var exit = self.Location + Spawns.First().Second;
var rb = self.Trait<RenderBuilding>();
rb.PlayCustomAnimRepeating(self, "active");
owner.World.AddFrameEndTask(w =>
{
var a = w.CreateActor("C17", new TypeDictionary
@@ -55,12 +58,13 @@ namespace OpenRA.Mods.Cnc
new OwnerInit( self.Owner ),
});
cargo.Load(a, newUnit);
a.QueueActivity(new Fly(self.Location + new int2(6,0)));
a.QueueActivity(new Land(Target.FromActor(self)));
a.QueueActivity(new CallFunc(() =>
{
if (self.IsDead())
return;
rb.PlayCustomAnimRepeating(self, "idle");
self.World.AddFrameEndTask(ww => DoProduction(self, cargo.Unload(self), exit, spawn));
}));
a.QueueActivity(new Fly(endPos));

View File

@@ -49,6 +49,12 @@ namespace OpenRA.Mods.RA.Render
anim.PlayThen(GetPrefix(self) + name,
() => { anim.PlayRepeating(GetPrefix(self) + "idle"); a(); });
}
public void PlayCustomAnimRepeating(Actor self, string name)
{
anim.PlayThen(GetPrefix(self) + name,
() => { PlayCustomAnimRepeating(self, name); });
}
public void PlayCustomAnimBackwards(Actor self, string name, Action a)
{

View File

@@ -62,8 +62,10 @@
</unit>
<!-- Nod Airfield -->
<unit name="afld">
<sequence name="idle" start="0" length="16" tick="120" />
<sequence name="damaged-idle" start="16" length="16" tick="120" />
<sequence name="idle" start="0" length="1" tick="120" />
<sequence name="active" start="0" length="16" tick="120" />
<sequence name="damaged-idle" start="16" length="1" tick="120" />
<sequence name="damaged-active" start="16" length="16" tick="120" />
<sequence name="dead" start="32" length="1" />
<sequence name="make" start="0" length="*" src="afldmake" />
</unit>