muffin v7.5.13
This commit is contained in:
parent
911ed68baa
commit
acf3e3cb18
69 changed files with 2731 additions and 1425 deletions
|
|
@ -5,21 +5,28 @@ using Microsoft.Extensions.Logging;
|
|||
using Questionable.Controller.CustomDelivery;
|
||||
using Questionable.Controller.Steps;
|
||||
using Questionable.Controller.Steps.Common;
|
||||
using Questionable.Controller.Steps.Interactions;
|
||||
using Questionable.Controller.Steps.Movement;
|
||||
using Questionable.Controller.Steps.Shared;
|
||||
using Questionable.Model.Questing;
|
||||
using SmartNav;
|
||||
|
||||
namespace Questionable.Navigation;
|
||||
|
||||
internal sealed class SmartNavReRouteService(ReRoutePolicy reRoutePolicy, SmartNavTaskMapper taskMapper, Configuration configuration, ILogger<SmartNavReRouteService> logger)
|
||||
{
|
||||
public void SetDestination(uint territoryId, Vector3 position)
|
||||
private ETravelMode _travelMode;
|
||||
|
||||
public void SetDestination(uint territoryId, Vector3 position, ETravelMode travelMode = ETravelMode.Auto)
|
||||
{
|
||||
reRoutePolicy.SetDestination(territoryId, position);
|
||||
_travelMode = travelMode;
|
||||
var (allowMount, allowFlight) = GetCapabilities(travelMode);
|
||||
reRoutePolicy.SetDestination(territoryId, position, allowMount, allowFlight);
|
||||
}
|
||||
|
||||
public void ClearDestination()
|
||||
{
|
||||
_travelMode = ETravelMode.Auto;
|
||||
reRoutePolicy.ClearDestination();
|
||||
}
|
||||
|
||||
|
|
@ -51,7 +58,7 @@ internal sealed class SmartNavReRouteService(ReRoutePolicy reRoutePolicy, SmartN
|
|||
if (reRouteDecision is ReRouteDecision.Replan replan)
|
||||
{
|
||||
taskQueue.Reset();
|
||||
foreach (ITask item2 in taskMapper.MapInstructions(replan.Instructions))
|
||||
foreach (ITask item2 in taskMapper.MapInstructions(replan.Instructions, null, _travelMode))
|
||||
{
|
||||
taskQueue.Enqueue(item2);
|
||||
}
|
||||
|
|
@ -79,10 +86,33 @@ internal sealed class SmartNavReRouteService(ReRoutePolicy reRoutePolicy, SmartN
|
|||
|
||||
private static bool IsMovementTask(ITask task)
|
||||
{
|
||||
if (task is MoveTask || task is LandTask || task is Mount.MountTask || task is AetheryteTeleport.Task || task is AethernetRide.Task || task is WaitNavmesh.Task || task is WaitCondition.Task || task is WarpInteract.Task || task is TaxiInteract.Task || task is SubRegionTransport.Task || task is TicketTeleport.Task)
|
||||
if (!(task is MoveTask))
|
||||
{
|
||||
return true;
|
||||
if (task is Dive.Task task2)
|
||||
{
|
||||
if (task2.SmartNavRouted)
|
||||
{
|
||||
goto IL_006c;
|
||||
}
|
||||
}
|
||||
else if (task is LandTask || task is Mount.MountTask || task is AetheryteTeleport.Task || task is AethernetRide.Task || task is WaitNavmesh.Task || task is WaitCondition.Task || task is WarpInteract.Task || task is TaxiInteract.Task || task is SubRegionTransport.Task || task is TicketTeleport.Task)
|
||||
{
|
||||
goto IL_006c;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
goto IL_006c;
|
||||
IL_006c:
|
||||
return true;
|
||||
}
|
||||
|
||||
internal static (bool AllowMount, bool AllowFlight) GetCapabilities(ETravelMode travelMode)
|
||||
{
|
||||
return travelMode switch
|
||||
{
|
||||
ETravelMode.OnFoot => (AllowMount: false, AllowFlight: false),
|
||||
ETravelMode.GroundMount => (AllowMount: true, AllowFlight: false),
|
||||
_ => (AllowMount: true, AllowFlight: true),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue