diff --git a/OpenRA.Mods.Cnc/Activities/HarvesterDockSequence.cs b/OpenRA.Mods.Cnc/Activities/HarvesterDockSequence.cs index 5c4d04c68fca..964261cf00e3 100644 --- a/OpenRA.Mods.Cnc/Activities/HarvesterDockSequence.cs +++ b/OpenRA.Mods.Cnc/Activities/HarvesterDockSequence.cs @@ -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; @@ -45,8 +44,7 @@ public HarvesterDockSequence(Actor self, Actor proc) this.proc = proc; state = State.Turn; harv = self.Trait(); - dock = self.Trait(); - rb = proc.Trait(); + ru = self.Trait(); startDock = self.Trait().PxPosition; endDock = proc.Trait().PxPosition + new int2(-15,8); } @@ -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); diff --git a/OpenRA.Mods.Cnc/TiberiumRefinery.cs b/OpenRA.Mods.Cnc/TiberiumRefinery.cs index e0d549fdd402..18b7bea630c1 100644 --- a/OpenRA.Mods.Cnc/TiberiumRefinery.cs +++ b/OpenRA.Mods.Cnc/TiberiumRefinery.cs @@ -30,17 +30,4 @@ public override Activity DockSequence(Actor harv, Actor self) return new HarvesterDockSequence(harv, self); } } - - public class HarvesterDockingInfo : TraitInfo { } - public class HarvesterDocking : IRenderModifier - { - [Sync] - public bool Visible = true; - - static readonly Renderable[] Nothing = { }; - public IEnumerable ModifyRender(Actor self, IEnumerable r) - { - return Visible ? r : Nothing; - } - } } diff --git a/mods/cnc/bits/harvdump.shp b/mods/cnc/bits/harvdump.shp new file mode 100644 index 000000000000..6a18f02abe07 Binary files /dev/null and b/mods/cnc/bits/harvdump.shp differ diff --git a/mods/cnc/rules/vehicles.yaml b/mods/cnc/rules/vehicles.yaml index d1be12276c4b..0698a6a4dcc8 100644 --- a/mods/cnc/rules/vehicles.yaml +++ b/mods/cnc/rules/vehicles.yaml @@ -55,7 +55,6 @@ HARV: Resources: Tiberium, Blue Tiberium PipCount: 5 Capacity: 28 - HarvesterDocking: Mobile: Speed: 6 Health: diff --git a/mods/cnc/sequences/structures.yaml b/mods/cnc/sequences/structures.yaml index b06796eed5a1..08cde6a98cc6 100644 --- a/mods/cnc/sequences/structures.yaml +++ b/mods/cnc/sequences/structures.yaml @@ -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 diff --git a/mods/cnc/sequences/vehicles.yaml b/mods/cnc/sequences/vehicles.yaml index 12d286bc8dc6..fe8008d7e932 100644 --- a/mods/cnc/sequences/vehicles.yaml +++ b/mods/cnc/sequences/vehicles.yaml @@ -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: