Remove the baked harvester animation from proc. Fixes #1009.
This commit is contained in:
@@ -34,8 +34,7 @@ namespace OpenRA.Mods.Cnc
|
||||
|
||||
readonly Actor proc;
|
||||
readonly Harvester harv;
|
||||
readonly HarvesterDocking dock;
|
||||
readonly RenderBuilding rb;
|
||||
readonly RenderUnit ru;
|
||||
State state;
|
||||
|
||||
int2 startDock;
|
||||
@@ -45,8 +44,7 @@ namespace OpenRA.Mods.Cnc
|
||||
this.proc = proc;
|
||||
state = State.Turn;
|
||||
harv = self.Trait<Harvester>();
|
||||
dock = self.Trait<HarvesterDocking>();
|
||||
rb = proc.Trait<RenderBuilding>();
|
||||
ru = self.Trait<RenderUnit>();
|
||||
startDock = self.Trait<IHasLocation>().PxPosition;
|
||||
endDock = proc.Trait<IHasLocation>().PxPosition + new int2(-15,8);
|
||||
}
|
||||
@@ -64,30 +62,16 @@ namespace OpenRA.Mods.Cnc
|
||||
state = State.Dock;
|
||||
return Util.SequenceActivities(new Drag(startDock, endDock, 12), this);
|
||||
case State.Dock:
|
||||
dock.Visible = false;
|
||||
if (rb.anim.CurrentSequence.Name == "idle" || rb.anim.CurrentSequence.Name == "damaged-idle")
|
||||
{
|
||||
rb.PlayCustomAnimThen(proc, "dock-start", () => {rb.PlayCustomAnimRepeating(proc, "dock-loop"); state = State.Loop;});
|
||||
state = State.Wait;
|
||||
}
|
||||
else
|
||||
state = State.Loop;
|
||||
ru.PlayCustomAnimation(self, "dock", () => {ru.PlayCustomAnimRepeating(self, "dock-loop"); state = State.Loop;});
|
||||
state = State.Wait;
|
||||
return this;
|
||||
case State.Loop:
|
||||
if (harv.TickUnload(self, proc))
|
||||
state = State.Undock;
|
||||
return this;
|
||||
case State.Undock:
|
||||
if (rb.anim.CurrentSequence.Name == "dock-loop" || rb.anim.CurrentSequence.Name == "damaged-dock-loop")
|
||||
{
|
||||
rb.PlayCustomAnimThen(proc, "dock-end", () => {dock.Visible = true; state = State.Dragout;});
|
||||
state = State.Wait;
|
||||
}
|
||||
else
|
||||
{
|
||||
state = State.Dragout;
|
||||
dock.Visible = true;
|
||||
}
|
||||
ru.PlayCustomAnimBackwards(self, "dock", () => state = State.Dragout);
|
||||
state = State.Wait;
|
||||
return this;
|
||||
case State.Dragout:
|
||||
return Util.SequenceActivities(new Drag(endDock, startDock, 12), NextActivity);
|
||||
|
||||
@@ -30,17 +30,4 @@ namespace OpenRA.Mods.Cnc
|
||||
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
BIN
mods/cnc/bits/harvdump.shp
Normal file
Binary file not shown.
@@ -55,7 +55,6 @@ HARV:
|
||||
Resources: Tiberium, Blue Tiberium
|
||||
PipCount: 5
|
||||
Capacity: 28
|
||||
HarvesterDocking:
|
||||
Mobile:
|
||||
Speed: 6
|
||||
Health:
|
||||
|
||||
@@ -44,18 +44,6 @@ proc:
|
||||
Start: 6
|
||||
Length: 6
|
||||
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:
|
||||
Start: 30
|
||||
Length: 6
|
||||
@@ -64,18 +52,6 @@ proc:
|
||||
Start: 36
|
||||
Length: 6
|
||||
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:
|
||||
Start: 60
|
||||
make: procmake
|
||||
|
||||
@@ -11,6 +11,12 @@ harv:
|
||||
Start: 32
|
||||
Length: 4
|
||||
Facings: 8
|
||||
dock: harvdump
|
||||
Start: 0
|
||||
Length: 7
|
||||
dock-loop: harvdump
|
||||
Start: 7
|
||||
Length: 1
|
||||
|
||||
bggy:
|
||||
idle:
|
||||
|
||||
Reference in New Issue
Block a user