Make AcceptQuest/CompleteQuest skippable if their relevant quest has been accepted/completed
This commit is contained in:
parent
e6a9c21c0f
commit
07b4765478
@ -184,7 +184,8 @@
|
||||
"ChocoboUnlocked",
|
||||
"AetheryteShortcutIfInSameTerritory",
|
||||
"NotTargetable",
|
||||
"ItemNotInInventory"
|
||||
"ItemNotInInventory",
|
||||
"WakingSandsMainArea"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -13,5 +13,6 @@ public sealed class SkipConditionConverter() : EnumConverter<ESkipCondition>(Val
|
||||
{ ESkipCondition.AetheryteShortcutIfInSameTerritory, "AetheryteShortcutIfInSameTerritory" },
|
||||
{ ESkipCondition.NotTargetable, "NotTargetable" },
|
||||
{ ESkipCondition.ItemNotInInventory, "ItemNotInInventory" },
|
||||
{ ESkipCondition.WakingSandsMainArea, "WakingSandsMainArea" },
|
||||
};
|
||||
}
|
||||
|
@ -14,4 +14,7 @@ public enum ESkipCondition
|
||||
AetheryteShortcutIfInSameTerritory,
|
||||
NotTargetable,
|
||||
ItemNotInInventory,
|
||||
|
||||
// TODO: This is an indication the whole skip bit should be optimized/parameterized to some extent
|
||||
WakingSandsMainArea,
|
||||
}
|
||||
|
@ -28,7 +28,9 @@ internal static class SkipCondition
|
||||
step.SkipIf.Where(x => x != ESkipCondition.AetheryteShortcutIfInSameTerritory).ToList();
|
||||
if (relevantConditions.Count == 0 &&
|
||||
step.CompletionQuestVariablesFlags.Count == 0 &&
|
||||
step.RequiredQuestVariables.Count == 0)
|
||||
step.RequiredQuestVariables.Count == 0 &&
|
||||
step.PickUpQuestId == null &&
|
||||
step.NextQuestId == null)
|
||||
return null;
|
||||
|
||||
return serviceProvider.GetRequiredService<CheckTask>()
|
||||
@ -143,6 +145,28 @@ internal static class SkipCondition
|
||||
}
|
||||
}
|
||||
|
||||
if (Step.SkipIf.Contains(ESkipCondition.WakingSandsMainArea))
|
||||
{
|
||||
var position = clientState.LocalPlayer!.Position;
|
||||
if (position.X < 24)
|
||||
{
|
||||
logger.LogInformation("Skipping step, as we're not in the Solar");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (Step.PickUpQuestId != null && gameFunctions.IsQuestAcceptedOrComplete(Step.PickUpQuestId.Value))
|
||||
{
|
||||
logger.LogInformation("Skipping step, as we have already picked up the relevant quest");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Step.TurnInQuestId != null && gameFunctions.IsQuestComplete(Step.TurnInQuestId.Value))
|
||||
{
|
||||
logger.LogInformation("Skipping step, as we have already completed the relevant quest");
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -108,20 +108,26 @@ internal static class WaitAtEnd
|
||||
];
|
||||
|
||||
case EInteractionType.AcceptQuest:
|
||||
return
|
||||
[
|
||||
serviceProvider.GetRequiredService<WaitQuestAccepted>()
|
||||
.With(step.PickUpQuestId ?? quest.QuestId),
|
||||
serviceProvider.GetRequiredService<WaitDelay>()
|
||||
];
|
||||
{
|
||||
var accept = serviceProvider.GetRequiredService<WaitQuestAccepted>()
|
||||
.With(step.PickUpQuestId ?? quest.QuestId);
|
||||
var delay = serviceProvider.GetRequiredService<WaitDelay>();
|
||||
if (step.PickUpQuestId != null)
|
||||
return [accept, delay, Next(quest, sequence)];
|
||||
else
|
||||
return [accept, delay];
|
||||
}
|
||||
|
||||
case EInteractionType.CompleteQuest:
|
||||
return
|
||||
[
|
||||
serviceProvider.GetRequiredService<WaitQuestCompleted>()
|
||||
.With(step.TurnInQuestId ?? quest.QuestId),
|
||||
serviceProvider.GetRequiredService<WaitDelay>()
|
||||
];
|
||||
{
|
||||
var complete = serviceProvider.GetRequiredService<WaitQuestCompleted>()
|
||||
.With(step.TurnInQuestId ?? quest.QuestId);
|
||||
var delay = serviceProvider.GetRequiredService<WaitDelay>();
|
||||
if (step.NextQuestId != null)
|
||||
return [complete, delay, Next(quest, sequence)];
|
||||
else
|
||||
return [complete, delay];
|
||||
}
|
||||
|
||||
case EInteractionType.Interact:
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user