"Z": -25.223206
},
"TerritoryId": 820,
- "InteractionType": "AcceptQuest",
- "Comment": "Quest is completed instantly"
+ "InteractionType": "AcceptQuest"
}
]
}
},
"TerritoryId": 1190,
"InteractionType": "Instruction",
- "Comment": "(from left to right) pump, middle of the connecting pipes, barrels"
+ "Comment": "Click (from left to right) pump, middle of the connecting pipes, barrels"
}
]
},
--- /dev/null
+{
+ "$schema": "https://carvel.li/questionable/quest-1.0",
+ "Author": "liza",
+ "QuestSequence": [
+ {
+ "Sequence": 0,
+ "Steps": [
+ {
+ "DataId": 1048390,
+ "Position": {
+ "X": 15.243713,
+ "Y": -14.000001,
+ "Z": 85.83191
+ },
+ "TerritoryId": 1185,
+ "InteractionType": "AcceptQuest"
+ }
+ ]
+ }
+ ]
+}
--- /dev/null
+{
+ "$schema": "https://carvel.li/questionable/quest-1.0",
+ "Author": "liza",
+ "QuestSequence": [
+ {
+ "Sequence": 0,
+ "Steps": [
+ {
+ "DataId": 1048510,
+ "Position": {
+ "X": 28.67163,
+ "Y": 50.13025,
+ "Z": -40.940002
+ },
+ "TerritoryId": 1185,
+ "InteractionType": "AcceptQuest"
+ }
+ ]
+ }
+ ]
+}
"Z": -52.99463
},
"TerritoryId": 1186,
- "InteractionType": "AcceptQuest",
- "Comment": "Quest is completed instantly"
+ "InteractionType": "AcceptQuest"
}
]
}
"Z": -38.132385
},
"TerritoryId": 1186,
- "InteractionType": "AcceptQuest",
- "Comment": "Quest is completed instantly"
+ "InteractionType": "AcceptQuest"
}
]
}
public QuestProgress? NextQuest => _nextQuest;
public string? DebugState { get; private set; }
- public string? Comment { get; private set; }
public void Reload()
{
if (questToRun == null)
{
DebugState = "No quest active";
- Comment = null;
Stop("No quest active");
return;
}
if (sequence == null)
{
DebugState = "Sequence not found";
- Comment = null;
Stop("Unknown sequence");
return;
}
if (questToRun.Step == 255)
{
DebugState = "Step completed";
- Comment = null;
if (_currentTask != null || _taskQueue.Count > 0)
Stop("Step complete", continueIfAutomatic: true);
return;
if (questToRun.Step >= sequence.Steps.Count)
{
DebugState = "Step not found";
- Comment = null;
Stop("Unknown step");
return;
}
- var step = sequence.Steps[questToRun.Step];
DebugState = null;
- Comment = step.Comment ?? sequence.Comment ?? q.Root.Comment;
}
}
QuestLocks = quest.QuestLock.Select(x => (ushort)(x.Row & 0xFFFFF)).Where(x => x != 0).ToImmutableList();
QuestLockJoin = (QuestJoin)quest.QuestLockJoin;
IsMainScenarioQuest = quest.JournalGenre?.Value?.JournalCategory?.Value?.JournalSection?.Row is 0 or 1;
+ CompletesInstantly = quest.ToDoCompleteSeq[0] == 0;
}
public ushort QuestId { get; }
public bool IsRepeatable { get; }
public ImmutableList<ushort> PreviousQuests { get; }
public QuestJoin PreviousQuestJoin { get; }
- public bool IsMainScenarioQuest { get; }
public ImmutableList<ushort> QuestLocks { get; set; }
public QuestJoin QuestLockJoin { get; set; }
+ public bool IsMainScenarioQuest { get; }
+ public bool CompletesInstantly { get; set; }
public string SimplifiedName => Name
.TrimStart(SeIconChar.QuestSync.ToIconChar(), SeIconChar.QuestRepeatable.ToIconChar(), ' ');
yield break;
}
- int maxSequence = sequences.Select(x => x.Sequence)
- .Where(x => x != 255)
- .Max();
-
- for (int i = 0; i < maxSequence; i++)
+ if (quest.Info.CompletesInstantly)
{
- var foundSequences = sequences.Where(x => x.Sequence == i).ToList();
- var issue = ValidateSequences(quest, i, foundSequences);
- if (issue != null)
- yield return issue;
- }
+ foreach (var sequence in sequences)
+ {
+ if (sequence == foundStart)
+ continue;
- // some quests finish instantly
- if (maxSequence > 0 || foundStart.Steps.Count > 1)
+ yield return new ValidationIssue
+ {
+ QuestId = quest.QuestId,
+ Sequence = (byte)sequence.Sequence,
+ Step = null,
+ Severity = EIssueSeverity.Error,
+ Description = "Instant quest should not have any sequences after the start",
+ };
+ }
+ }
+ else
{
+ int maxSequence = sequences.Select(x => x.Sequence)
+ .Where(x => x != 255)
+ .Max();
+
+ for (int i = 0; i < maxSequence; i++)
+ {
+ var foundSequences = sequences.Where(x => x.Sequence == i).ToList();
+ var issue = ValidateSequences(quest, i, foundSequences);
+ if (issue != null)
+ yield return issue;
+ }
+
var foundEnding = sequences.Where(x => x.Sequence == 255).ToList();
var endingIssue = ValidateSequences(quest, 255, foundEnding);
if (endingIssue != null)
ImGui.TextUnformatted("Repeatable");
}
- if (!_questRegistry.IsKnownQuest(quest.QuestId))
+ if (quest.CompletesInstantly)
+ {
+ ImGui.SameLine();
+ ImGui.TextUnformatted("Instant");
+ }
+
+ if (!isKnownQuest)
{
ImGui.SameLine();
ImGui.TextUnformatted("NoQuestPath");
else
{
ImGui.BeginDisabled();
- ImGui.TextUnformatted(_questController.DebugState ?? "--");
+ ImGui.TextUnformatted(_questController.DebugState ?? string.Empty);
ImGui.EndDisabled();
}
- ImGui.TextUnformatted(_questController.Comment ?? "--");
+ QuestSequence? currentSequence = currentQuest.Quest.FindSequence(currentQuest.Sequence);
+ QuestStep? currentStep = currentSequence?.FindStep(currentQuest.Step);
+ bool colored = currentStep is
+ { InteractionType: EInteractionType.Instruction or EInteractionType.WaitForManualProgress };
+ if (colored)
+ ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudOrange);
+ ImGui.TextUnformatted(currentStep?.Comment ?? currentSequence?.Comment ?? currentQuest.Quest.Root.Comment ?? string.Empty);
+ if (colored)
+ ImGui.PopStyleColor();
//var nextStep = _questController.GetNextStep();
//ImGui.BeginDisabled(nextStep.Step == null);
_questController.Stop("Manual");
}
- QuestStep? currentStep = currentQuest.Quest
- .FindSequence(currentQuest.Sequence)
- ?.FindStep(currentQuest.Step);
bool lastStep = currentStep ==
currentQuest.Quest.FindSequence(currentQuest.Sequence)?.Steps.LastOrDefault();
- bool colored = currentStep != null
- && !lastStep
- && currentStep.InteractionType == EInteractionType.Instruction
- && _questController.HasCurrentTaskMatching<WaitAtEnd.WaitNextStepOrSequence>();
+ colored = currentStep != null
+ && !lastStep
+ && currentStep.InteractionType == EInteractionType.Instruction
+ && _questController.HasCurrentTaskMatching<WaitAtEnd.WaitNextStepOrSequence>();
ImGui.BeginDisabled(lastStep);
if (colored)