kourendlibrary: Don't reset state when not finding Varlamore Envoy

The Varlamore Envoy is a quest item which, while having a known location
in the library once a rotation is determined, cannot be found under
certain circumstances. (when the Depths of Despair quest has not been
started, has been collected while completing the quest, and after the
quest is completed) Previously searching a bookcase which could contain
this book and not finding it would cause a state reset. This commit
keeps those null finds from resetting the known library state.
This commit is contained in:
Jordan Atwood
2020-10-08 13:53:58 -07:00
parent d19405129a
commit d0589c80b9
2 changed files with 85 additions and 4 deletions

View File

@@ -122,8 +122,9 @@ class Library
if (bookcase.isBookSet())
{
// Bookcase is set from a previous mark
// Check for a mismatch, unless it is now null and had a dark manuscript
if (book != bookcase.getBook() && !(book == null && bookcase.getBook().isDarkManuscript()))
// Check for a mismatch, unless it is now null and had a dark manuscript or Varlamore Envoy
if (book != bookcase.getBook()
&& !(book == null && (bookcase.getBook().isDarkManuscript() || bookcase.getBook() == VARLAMORE_ENVOY)))
{
reset();
}
@@ -140,8 +141,11 @@ class Library
if (state == SolvedState.COMPLETE)
{
// Reset if we found nothing when we expected something that wasn't a Dark Manuscript, since the layout has changed
if (book == null && !bookcase.getPossibleBooks().isEmpty() && bookcase.getPossibleBooks().stream().noneMatch(Book::isDarkManuscript))
// Reset if we found nothing when we expected something that wasn't a Dark Manuscript or Varlamore Envoy
// since the layout has changed
if (book == null
&& !bookcase.getPossibleBooks().isEmpty()
&& bookcase.getPossibleBooks().stream().noneMatch(b -> b.isDarkManuscript() || b == VARLAMORE_ENVOY))
{
reset();
}