punish v6.8.18.0
This commit is contained in:
commit
cfb4dea47e
316 changed files with 554088 additions and 0 deletions
|
@ -0,0 +1,50 @@
|
|||
using System.Collections.Generic;
|
||||
using LLib.GameData;
|
||||
using Questionable.Data;
|
||||
using Questionable.Model;
|
||||
using Questionable.Model.Questing;
|
||||
|
||||
namespace Questionable.Validation.Validators;
|
||||
|
||||
internal sealed class ClassQuestShouldHaveShortcutValidator : IQuestValidator
|
||||
{
|
||||
private readonly HashSet<ElementId> _classJobQuests = new HashSet<ElementId>();
|
||||
|
||||
public ClassQuestShouldHaveShortcutValidator(QuestData questData)
|
||||
{
|
||||
foreach (EClassJob enumValue in typeof(EClassJob).GetEnumValues())
|
||||
{
|
||||
if (enumValue == EClassJob.Adventurer)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
foreach (QuestInfo classJobQuest in questData.GetClassJobQuests(enumValue))
|
||||
{
|
||||
if (classJobQuest.Level > 1)
|
||||
{
|
||||
_classJobQuests.Add(classJobQuest.QuestId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<ValidationIssue> Validate(Quest quest)
|
||||
{
|
||||
if (_classJobQuests.Contains(quest.Id))
|
||||
{
|
||||
QuestStep questStep = quest.FindSequence(0)?.FindStep(0);
|
||||
if (questStep != null && !questStep.IsTeleportableForPriorityQuests())
|
||||
{
|
||||
yield return new ValidationIssue
|
||||
{
|
||||
ElementId = quest.Id,
|
||||
Sequence = 0,
|
||||
Step = 0,
|
||||
Type = EIssueType.ClassQuestWithoutAetheryteShortcut,
|
||||
Severity = EIssueSeverity.Error,
|
||||
Description = "Class quest should have an aetheryte shortcut to be done automatically"
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue