forked from liza/Questionable
Add diving condition to skip.StepIf
This commit is contained in:
parent
98aa8f2469
commit
58ec1259f5
QuestPathGenerator/RoslynElements
QuestPaths
Questionable.Model/Questing
Questionable/Controller/Steps/Shared
@ -48,6 +48,9 @@ internal static class SkipConditionsExtensions
|
||||
Assignment(nameof(SkipStepConditions.Flying), skipStepConditions.Flying,
|
||||
emptyStep.Flying)
|
||||
.AsSyntaxNodeOrToken(),
|
||||
Assignment(nameof(SkipStepConditions.Diving), skipStepConditions.Diving,
|
||||
emptyStep.Diving)
|
||||
.AsSyntaxNodeOrToken(),
|
||||
Assignment(nameof(SkipStepConditions.Chocobo), skipStepConditions.Chocobo,
|
||||
emptyStep.Chocobo)
|
||||
.AsSyntaxNodeOrToken(),
|
||||
|
@ -211,6 +211,9 @@
|
||||
"Unlocked"
|
||||
]
|
||||
},
|
||||
"Diving": {
|
||||
"type": ["boolean", "null"]
|
||||
},
|
||||
"NotTargetable": {
|
||||
"type": "boolean"
|
||||
},
|
||||
|
@ -12,6 +12,7 @@ public sealed class SkipStepConditions
|
||||
public IList<QuestWorkValue?> CompletionQuestVariablesFlags { get; set; } = new List<QuestWorkValue?>();
|
||||
public ELockedSkipCondition? Flying { get; set; }
|
||||
public ELockedSkipCondition? Chocobo { get; set; }
|
||||
public bool? Diving { get; set; }
|
||||
public bool NotTargetable { get; set; }
|
||||
public List<ushort> InTerritory { get; set; } = [];
|
||||
public List<ushort> NotInTerritory { get; set; } = [];
|
||||
@ -37,6 +38,7 @@ public sealed class SkipStepConditions
|
||||
return (CompletionQuestVariablesFlags.Count > 0 && CompletionQuestVariablesFlags.Any(x => x != null)) ||
|
||||
Flying != null ||
|
||||
Chocobo != null ||
|
||||
Diving != null ||
|
||||
NotTargetable ||
|
||||
InTerritory.Count > 0 ||
|
||||
NotInTerritory.Count > 0 ||
|
||||
@ -53,6 +55,6 @@ public sealed class SkipStepConditions
|
||||
public override string ToString()
|
||||
{
|
||||
return
|
||||
$"{nameof(Never)}: {Never}, {nameof(CompletionQuestVariablesFlags)}: {CompletionQuestVariablesFlags}, {nameof(Flying)}: {Flying}, {nameof(Chocobo)}: {Chocobo}, {nameof(NotTargetable)}: {NotTargetable}, {nameof(InTerritory)}: {string.Join(" ", InTerritory)}, {nameof(NotInTerritory)}: {string.Join(" ", NotInTerritory)}, {nameof(Item)}: {Item}, {nameof(QuestsAccepted)}: {string.Join(" ", QuestsAccepted)}, {nameof(QuestsCompleted)}: {string.Join(" ", QuestsCompleted)}, {nameof(NotNamePlateIconId)}: {string.Join(" ", NotNamePlateIconId)}, {nameof(NearPosition)}: {NearPosition}, {nameof(ExtraCondition)}: {ExtraCondition}";
|
||||
$"{nameof(Never)}: {Never}, {nameof(CompletionQuestVariablesFlags)}: {CompletionQuestVariablesFlags}, {nameof(Flying)}: {Flying}, {nameof(Chocobo)}: {Chocobo}, {nameof(Diving)}: {Diving}, {nameof(NotTargetable)}: {NotTargetable}, {nameof(InTerritory)}: {string.Join(" ", InTerritory)}, {nameof(NotInTerritory)}: {string.Join(" ", NotInTerritory)}, {nameof(Item)}: {Item}, {nameof(QuestsAccepted)}: {string.Join(" ", QuestsAccepted)}, {nameof(QuestsCompleted)}: {string.Join(" ", QuestsCompleted)}, {nameof(NotNamePlateIconId)}: {string.Join(" ", NotNamePlateIconId)}, {nameof(NearPosition)}: {NearPosition}, {nameof(ExtraCondition)}: {ExtraCondition}";
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using Dalamud.Game.ClientState.Conditions;
|
||||
using Dalamud.Game.ClientState.Objects.Types;
|
||||
using Dalamud.Plugin.Services;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game;
|
||||
@ -54,7 +55,8 @@ internal static class SkipCondition
|
||||
AetheryteFunctions aetheryteFunctions,
|
||||
GameFunctions gameFunctions,
|
||||
QuestFunctions questFunctions,
|
||||
IClientState clientState) : TaskExecutor<SkipTask>
|
||||
IClientState clientState,
|
||||
ICondition condition) : TaskExecutor<SkipTask>
|
||||
{
|
||||
protected override unsafe bool Start()
|
||||
{
|
||||
@ -85,6 +87,18 @@ internal static class SkipCondition
|
||||
return true;
|
||||
}
|
||||
|
||||
if (skipConditions.Diving == true && condition[ConditionFlag.Diving])
|
||||
{
|
||||
logger.LogInformation("Skipping step, as you're currently diving underwater");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (skipConditions.Diving == false && !condition[ConditionFlag.Diving])
|
||||
{
|
||||
logger.LogInformation("Skipping step, as you're not currently diving underwater");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (skipConditions.InTerritory.Count > 0 &&
|
||||
skipConditions.InTerritory.Contains(clientState.TerritoryType))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user