Add IMove.MoveOntoTarget interface

In `TraitsInterfaces` we expose offset as WPos instead of CPos. In an upcoming PR we'll translate the same change to yaml.
This commit is contained in:
Gustas
2023-01-20 21:29:50 +02:00
committed by Matthias Mailänder
parent ad683d9226
commit dc390a7301
13 changed files with 76 additions and 25 deletions

View File

@@ -22,14 +22,12 @@ namespace OpenRA.Mods.Common.Activities
{
public class HarvesterDockSequence : Activity
{
protected enum DockingState { Wait, Turn, Drag, Dock, Loop, Undock, Complete }
protected enum DockingState { Wait, Drag, Dock, Loop, Undock, Complete }
protected readonly Actor RefineryActor;
protected readonly Refinery Refinery;
protected readonly WithDockingOverlay DockHostSpriteOverlay;
protected readonly Harvester Harv;
protected readonly IDockClientBody DockClientBody;
protected readonly WAngle DockAngle;
protected readonly bool IsDragRequired;
protected readonly WVec DragOffset;
protected readonly int DragLength;
@@ -45,11 +43,9 @@ namespace OpenRA.Mods.Common.Activities
public HarvesterDockSequence(Actor self, Actor refineryActor, Refinery refinery)
{
dockingState = DockingState.Turn;
Refinery = refinery;
dockingState = DockingState.Drag;
RefineryActor = refineryActor;
DockHostSpriteOverlay = refineryActor.TraitOrDefault<WithDockingOverlay>();
DockAngle = refinery.DeliveryAngle;
IsDragRequired = refinery.IsDragRequired;
DragOffset = refinery.DragOffset;
DragLength = refinery.DragLength;
@@ -68,11 +64,6 @@ namespace OpenRA.Mods.Common.Activities
case DockingState.Wait:
return false;
case DockingState.Turn:
dockingState = DockingState.Drag;
QueueChild(new Turn(self, DockAngle));
return false;
case DockingState.Drag:
if (IsCanceling || !RefineryActor.IsInWorld || RefineryActor.IsDead || Harv.IsTraitDisabled)
return true;