Require force move for all undeploy-triggering orders.

This commit is contained in:
Paul Chote
2019-06-07 23:08:11 +00:00
committed by reaperrr
parent 5d886b79f1
commit ebe37a44ad
19 changed files with 249 additions and 90 deletions

View File

@@ -257,7 +257,7 @@ namespace OpenRA.Mods.Common.Traits
yield return new CarryallPickupOrderTargeter();
yield return new DeployOrderTargeter("Unload", 10,
() => CanUnload() ? Info.UnloadCursor : Info.UnloadBlockedCursor);
yield return new CarryallDeliverUnitTargeter(aircraftInfo, Info, CarryableOffset);
yield return new CarryallDeliverUnitTargeter(aircraftInfo, Info);
}
}
@@ -355,23 +355,23 @@ namespace OpenRA.Mods.Common.Traits
}
}
class CarryallDeliverUnitTargeter : AircraftMoveOrderTargeter
class CarryallDeliverUnitTargeter : IOrderTargeter
{
readonly AircraftInfo aircraftInfo;
readonly CarryallInfo info;
readonly WVec carryableOffset;
public CarryallDeliverUnitTargeter(AircraftInfo aircraftInfo, CarryallInfo info, WVec carryableOffset)
: base(aircraftInfo)
public string OrderID { get { return "DeliverUnit"; } }
public int OrderPriority { get { return 6; } }
public bool IsQueued { get; protected set; }
public bool TargetOverridesSelection(TargetModifiers modifiers) { return true; }
public CarryallDeliverUnitTargeter(AircraftInfo aircraftInfo, CarryallInfo info)
{
OrderID = "DeliverUnit";
OrderPriority = 6;
this.carryableOffset = carryableOffset;
this.aircraftInfo = aircraftInfo;
this.info = info;
}
public override bool CanTarget(Actor self, Target target, List<Actor> othersAtTarget, ref TargetModifiers modifiers, ref string cursor)
public bool CanTarget(Actor self, Target target, List<Actor> othersAtTarget, ref TargetModifiers modifiers, ref string cursor)
{
if (!info.AllowDropOff || !modifiers.HasModifier(TargetModifiers.ForceMove))
return false;