muffin v6.19
This commit is contained in:
parent
4f297245f2
commit
d8da668e38
10 changed files with 1212 additions and 122 deletions
|
@ -1,7 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using Questionable.Model;
|
||||
using Questionable.Model.Questing;
|
||||
|
||||
|
@ -11,18 +9,15 @@ internal sealed class UniqueStartStopValidator : IQuestValidator
|
|||
{
|
||||
public IEnumerable<ValidationIssue> Validate(Quest quest)
|
||||
{
|
||||
ElementId id = quest.Id;
|
||||
if ((id is SatisfactionSupplyNpcId || id is AlliedSocietyDailyId) ? true : false)
|
||||
bool flag = !(quest.Id is QuestId);
|
||||
if (!flag)
|
||||
{
|
||||
yield break;
|
||||
ElementId id = quest.Id;
|
||||
bool flag2 = ((id is SatisfactionSupplyNpcId || id is AlliedSocietyDailyId) ? true : false);
|
||||
flag = flag2;
|
||||
}
|
||||
int num = 1;
|
||||
List<EInteractionType> list = new List<EInteractionType>(num);
|
||||
CollectionsMarshal.SetCount(list, num);
|
||||
Span<EInteractionType> span = CollectionsMarshal.AsSpan(list);
|
||||
int index = 0;
|
||||
span[index] = EInteractionType.AcceptQuest;
|
||||
List<(QuestSequence Sequence, int StepId, QuestStep Step)> questAccepts = (from x in FindQuestStepsWithInteractionType(quest, list)
|
||||
bool skipMissingStartStop = flag;
|
||||
List<(QuestSequence Sequence, int StepId, QuestStep Step)> questAccepts = (from x in FindQuestStepsWithInteractionType(quest, new List<EInteractionType> { EInteractionType.AcceptQuest })
|
||||
where x.Step.PickUpQuestId == null
|
||||
select x).ToList();
|
||||
foreach (var item in questAccepts)
|
||||
|
@ -40,7 +35,7 @@ internal sealed class UniqueStartStopValidator : IQuestValidator
|
|||
};
|
||||
}
|
||||
}
|
||||
if (quest.FindSequence(0) != null && questAccepts.Count == 0)
|
||||
if (!skipMissingStartStop && quest.FindSequence(0) != null && questAccepts.Count == 0)
|
||||
{
|
||||
yield return new ValidationIssue
|
||||
{
|
||||
|
@ -52,13 +47,7 @@ internal sealed class UniqueStartStopValidator : IQuestValidator
|
|||
Description = "No AcceptQuest step"
|
||||
};
|
||||
}
|
||||
index = 1;
|
||||
List<EInteractionType> list2 = new List<EInteractionType>(index);
|
||||
CollectionsMarshal.SetCount(list2, index);
|
||||
span = CollectionsMarshal.AsSpan(list2);
|
||||
num = 0;
|
||||
span[num] = EInteractionType.CompleteQuest;
|
||||
List<(QuestSequence Sequence, int StepId, QuestStep Step)> questCompletes = (from x in FindQuestStepsWithInteractionType(quest, list2)
|
||||
List<(QuestSequence Sequence, int StepId, QuestStep Step)> questCompletes = (from x in FindQuestStepsWithInteractionType(quest, new List<EInteractionType> { EInteractionType.CompleteQuest })
|
||||
where x.Step.TurnInQuestId == null
|
||||
select x).ToList();
|
||||
foreach (var item2 in questCompletes)
|
||||
|
@ -76,7 +65,7 @@ internal sealed class UniqueStartStopValidator : IQuestValidator
|
|||
};
|
||||
}
|
||||
}
|
||||
if (quest.FindSequence(byte.MaxValue) != null && questCompletes.Count == 0)
|
||||
if (!skipMissingStartStop && quest.FindSequence(byte.MaxValue) != null && questCompletes.Count == 0)
|
||||
{
|
||||
yield return new ValidationIssue
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue