Skip to content

Commit

Permalink
Remove the baked harvester animation from proc. Fixes #1009.
Browse files Browse the repository at this point in the history
  • Loading branch information
pchote committed Jul 15, 2011
1 parent 24d2202 commit 089cdf1
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 60 deletions.
28 changes: 6 additions & 22 deletions OpenRA.Mods.Cnc/Activities/HarvesterDockSequence.cs
Expand Up @@ -34,8 +34,7 @@ enum State

readonly Actor proc;
readonly Harvester harv;
readonly HarvesterDocking dock;
readonly RenderBuilding rb;
readonly RenderUnit ru;
State state;

int2 startDock;
Expand All @@ -45,8 +44,7 @@ public HarvesterDockSequence(Actor self, Actor proc)
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);
}
Expand All @@ -64,30 +62,16 @@ public override Activity Tick(Actor self)
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);
Expand Down
13 changes: 0 additions & 13 deletions OpenRA.Mods.Cnc/TiberiumRefinery.cs
Expand Up @@ -30,17 +30,4 @@ public override Activity DockSequence(Actor harv, Actor 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;
}
}
}
Binary file added mods/cnc/bits/harvdump.shp
Binary file not shown.
1 change: 0 additions & 1 deletion mods/cnc/rules/vehicles.yaml
Expand Up @@ -55,7 +55,6 @@ HARV:
Resources: Tiberium, Blue Tiberium
PipCount: 5
Capacity: 28
HarvesterDocking:
Mobile:
Speed: 6
Health:
Expand Down
24 changes: 0 additions & 24 deletions mods/cnc/sequences/structures.yaml
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 6 additions & 0 deletions mods/cnc/sequences/vehicles.yaml
Expand Up @@ -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:
Expand Down

0 comments on commit 089cdf1

Please sign in to comment.