Remove the baked harvester animation from proc. Fixes #1009.

This commit is contained in:
Paul Chote
2011-07-14 01:24:03 +12:00
parent 24d220213e
commit 089cdf14ad
6 changed files with 12 additions and 60 deletions

View File

@@ -34,8 +34,7 @@ namespace OpenRA.Mods.Cnc
readonly Actor proc; readonly Actor proc;
readonly Harvester harv; readonly Harvester harv;
readonly HarvesterDocking dock; readonly RenderUnit ru;
readonly RenderBuilding rb;
State state; State state;
int2 startDock; int2 startDock;
@@ -45,8 +44,7 @@ namespace OpenRA.Mods.Cnc
this.proc = proc; this.proc = proc;
state = State.Turn; state = State.Turn;
harv = self.Trait<Harvester>(); harv = self.Trait<Harvester>();
dock = self.Trait<HarvesterDocking>(); ru = self.Trait<RenderUnit>();
rb = proc.Trait<RenderBuilding>();
startDock = self.Trait<IHasLocation>().PxPosition; startDock = self.Trait<IHasLocation>().PxPosition;
endDock = proc.Trait<IHasLocation>().PxPosition + new int2(-15,8); endDock = proc.Trait<IHasLocation>().PxPosition + new int2(-15,8);
} }
@@ -64,30 +62,16 @@ namespace OpenRA.Mods.Cnc
state = State.Dock; state = State.Dock;
return Util.SequenceActivities(new Drag(startDock, endDock, 12), this); return Util.SequenceActivities(new Drag(startDock, endDock, 12), this);
case State.Dock: case State.Dock:
dock.Visible = false; ru.PlayCustomAnimation(self, "dock", () => {ru.PlayCustomAnimRepeating(self, "dock-loop"); state = State.Loop;});
if (rb.anim.CurrentSequence.Name == "idle" || rb.anim.CurrentSequence.Name == "damaged-idle") state = State.Wait;
{
rb.PlayCustomAnimThen(proc, "dock-start", () => {rb.PlayCustomAnimRepeating(proc, "dock-loop"); state = State.Loop;});
state = State.Wait;
}
else
state = State.Loop;
return this; return this;
case State.Loop: case State.Loop:
if (harv.TickUnload(self, proc)) if (harv.TickUnload(self, proc))
state = State.Undock; state = State.Undock;
return this; return this;
case State.Undock: case State.Undock:
if (rb.anim.CurrentSequence.Name == "dock-loop" || rb.anim.CurrentSequence.Name == "damaged-dock-loop") ru.PlayCustomAnimBackwards(self, "dock", () => state = State.Dragout);
{ state = State.Wait;
rb.PlayCustomAnimThen(proc, "dock-end", () => {dock.Visible = true; state = State.Dragout;});
state = State.Wait;
}
else
{
state = State.Dragout;
dock.Visible = true;
}
return this; return this;
case State.Dragout: case State.Dragout:
return Util.SequenceActivities(new Drag(endDock, startDock, 12), NextActivity); return Util.SequenceActivities(new Drag(endDock, startDock, 12), NextActivity);

View File

@@ -30,17 +30,4 @@ namespace OpenRA.Mods.Cnc
return new HarvesterDockSequence(harv, self); return new HarvesterDockSequence(harv, self);
} }
} }
public class HarvesterDockingInfo : TraitInfo<HarvesterDocking> { }
public class HarvesterDocking : IRenderModifier
{
[Sync]
public bool Visible = true;
static readonly Renderable[] Nothing = { };
public IEnumerable<Renderable> ModifyRender(Actor self, IEnumerable<Renderable> r)
{
return Visible ? r : Nothing;
}
}
} }

BIN
mods/cnc/bits/harvdump.shp Normal file

Binary file not shown.

View File

@@ -55,7 +55,6 @@ HARV:
Resources: Tiberium, Blue Tiberium Resources: Tiberium, Blue Tiberium
PipCount: 5 PipCount: 5
Capacity: 28 Capacity: 28
HarvesterDocking:
Mobile: Mobile:
Speed: 6 Speed: 6
Health: Health:

View File

@@ -44,18 +44,6 @@ proc:
Start: 6 Start: 6
Length: 6 Length: 6
Tick: 60 Tick: 60
dock-start:
Start: 12
Length: 7
Tick: 60
dock-loop:
Start: 19
Length: 5
Tick: 60
dock-end:
Start: 24
Length: 6
Tick: 60
damaged-idle: damaged-idle:
Start: 30 Start: 30
Length: 6 Length: 6
@@ -64,18 +52,6 @@ proc:
Start: 36 Start: 36
Length: 6 Length: 6
Tick: 60 Tick: 60
damaged-dock-start:
Start: 42
Length: 7
Tick: 60
damaged-dock-loop:
Start: 49
Length: 5
Tick: 60
damaged-dock-end:
Start: 54
Length: 6
Tick: 60
dead: dead:
Start: 60 Start: 60
make: procmake make: procmake

View File

@@ -11,6 +11,12 @@ harv:
Start: 32 Start: 32
Length: 4 Length: 4
Facings: 8 Facings: 8
dock: harvdump
Start: 0
Length: 7
dock-loop: harvdump
Start: 7
Length: 1
bggy: bggy:
idle: idle: