backwards compatibility and zote off detection

This commit is contained in:
ReznoRMichael 2021-08-06 00:17:24 +02:00
parent 11a125010d
commit a31bbeccac
3 changed files with 80 additions and 31 deletions

View file

@ -1843,9 +1843,31 @@ function CheckHallOfGods(db, playerData) {
for (var entry in entries) { for (var entry in entries) {
id = entries[entry].id; id = entries[entry].id;
/* Backwards compatibility, disable and skip to next when not found */
if (!playerData.hasOwnProperty("statueState".concat(id))) {
(0,_hk_functions_js__WEBPACK_IMPORTED_MODULE_2__.SetIconNone)(section, entry);
entries[entry].disabled = true;
continue;
}
check = entries[entry].check; check = entries[entry].check;
isUnlocked = playerData["statueState".concat(id)].isUnlocked; isUnlocked = playerData["statueState".concat(id)].isUnlocked;
switch (entry) {
case "GreyPrinceUnlocked":
case "GreyPrinceAttuned":
case "GreyPrinceAscended":
case "GreyPrinceRadiant":
/* When Zote OFF, disable entry and skip to next entry */
if (playerData.zoteRescuedBuzzer === false && playerData.hasWalljump === true) {
(0,_hk_functions_js__WEBPACK_IMPORTED_MODULE_2__.SetIconNone)(section, entry);
entries[entry].disabled = true;
continue;
}
}
if (playerData["statueState".concat(id)][check] === true) { if (playerData["statueState".concat(id)][check] === true) {
switch (check) { switch (check) {
case "isUnlocked": case "isUnlocked":

File diff suppressed because one or more lines are too long

View file

@ -493,7 +493,7 @@ function CheckExtendedCompletion(db) {
} }
} }
switch(entries[entry].icon) { switch (entries[entry].icon) {
case "red": case "red":
case "none": case "none":
@ -505,7 +505,7 @@ function CheckExtendedCompletion(db) {
intro.extendedCompletionDone++; intro.extendedCompletionDone++;
// console.info("Counted (Done):", entry); // console.info("Counted (Done):", entry);
} }
} }
@ -1150,11 +1150,11 @@ function CheckAdditionalThings(section, dataObject, playerData, worldData, scene
/* when Grimm Troupe is banished, max Journal entries will be 1 or 2 less */ /* when Grimm Troupe is banished, max Journal entries will be 1 or 2 less */
if (playerData.hasOwnProperty("destroyedNightmareLantern") && playerData.destroyedNightmareLantern === true) { if (playerData.hasOwnProperty("destroyedNightmareLantern") && playerData.destroyedNightmareLantern === true) {
dataObject[i].max --; // Subtract Nightmare King from max dataObject[i].max--; // Subtract Nightmare King from max
/* if the player didn't defeat any Grimmkin Nightmare before banishing, subtract it from max */ /* if the player didn't defeat any Grimmkin Nightmare before banishing, subtract it from max */
if (playerData.killedFlameBearerLarge === false) { if (playerData.killedFlameBearerLarge === false) {
dataObject[i].max --; // Subtract Grimmkin Nightmare from max dataObject[i].max--; // Subtract Grimmkin Nightmare from max
dataObject[i].spoiler = `${dataObject[i].spoilerDefault} (${dataObject[i].max} max)`; /* Change spoiler for less confusion */ dataObject[i].spoiler = `${dataObject[i].spoilerDefault} (${dataObject[i].max} max)`; /* Change spoiler for less confusion */
} }
} }
@ -1380,8 +1380,8 @@ function CheckAdditionalThings(section, dataObject, playerData, worldData, scene
break; break;
case "arcaneEggLifebloodCoreRoom": case "arcaneEggLifebloodCoreRoom":
(FindWorldItem(dataObject[i].id, dataObject[i].sceneName)) ? SetIconGreen(section, i): SetIconNone(section, i); (FindWorldItem(dataObject[i].id, dataObject[i].sceneName)) ? SetIconGreen(section, i): SetIconNone(section, i);
break; break;
case "pantheonHallownest": case "pantheonHallownest":
if (playerData.hasOwnProperty("bossDoorStateTier5") === false) { if (playerData.hasOwnProperty("bossDoorStateTier5") === false) {
@ -1881,7 +1881,7 @@ function CheckHuntersJournal(db, sectionName, playerData) {
case "FlameBearerLarge": case "FlameBearerLarge":
/* If the troupe was banished and the player didn't defeat any Grimmkin Nightmare, then it's entry cannot be obtained on this save */ /* If the troupe was banished and the player didn't defeat any Grimmkin Nightmare, then it's entry cannot be obtained on this save */
if (playerData.destroyedNightmareLantern === true && playerData.killedFlameBearerLarge === false) { if (playerData.destroyedNightmareLantern === true && playerData.killedFlameBearerLarge === false) {
entries[entry].disabled = true; entries[entry].disabled = true;
@ -1895,7 +1895,7 @@ function CheckHuntersJournal(db, sectionName, playerData) {
case "NightmareGrimm": case "NightmareGrimm":
/* if the troupe was banished, the Nightmare King entry cannot be obtained on this save */ /* if the troupe was banished, the Nightmare King entry cannot be obtained on this save */
if (playerData.destroyedNightmareLantern === true) { if (playerData.destroyedNightmareLantern === true) {
entries[entry].disabled = true; entries[entry].disabled = true;
@ -1915,7 +1915,7 @@ function CheckHuntersJournal(db, sectionName, playerData) {
SetIconPartialJournal(section, entry); SetIconPartialJournal(section, entry);
/* When not killed, the entry is undiscovered */ /* When not killed, the entry is undiscovered */
} else { } else {
SetIconRed(section, entry); SetIconRed(section, entry);
@ -1926,7 +1926,7 @@ function CheckHuntersJournal(db, sectionName, playerData) {
SetIconGreen(section, entry); SetIconGreen(section, entry);
/* If not, show how many remain to defeat in the name */ /* If not, show how many remain to defeat in the name */
} else { } else {
name += ` (${amountKillsLeft})`; name += ` (${amountKillsLeft})`;
@ -1935,15 +1935,15 @@ function CheckHuntersJournal(db, sectionName, playerData) {
/* Void Idol backwards compatibility */ /* Void Idol backwards compatibility */
if (entry === "VoidIdol_1") { if (entry === "VoidIdol_1") {
if (playerData.killedVoidIdol_1 === false if (playerData.killedVoidIdol_1 === false &&
&& (playerData.killedVoidIdol_2 === true || playerData.killedVoidIdol_3 === true)) { (playerData.killedVoidIdol_2 === true || playerData.killedVoidIdol_3 === true)) {
SetIconGreen(section, entry); SetIconGreen(section, entry);
entries[entry].name = nameDefault; entries[entry].name = nameDefault;
} }
} }
/* Earlier save files backwards compatibility (no undefined) */ /* Earlier save files backwards compatibility (no undefined) */
} else { } else {
amountKillsLeft = 0; amountKillsLeft = 0;
@ -1982,7 +1982,7 @@ function CheckPantheon(db, sectionName, playerData) {
if (playerData[property][entry] === true) { if (playerData[property][entry] === true) {
switch(entry) { switch (entry) {
case "boundNail": case "boundNail":
SetIcon(section, entry, "bindingNail"); SetIcon(section, entry, "bindingNail");
@ -2025,12 +2025,39 @@ function CheckHallOfGods(db, playerData) {
for (let entry in entries) { for (let entry in entries) {
id = entries[entry].id; id = entries[entry].id;
/* Backwards compatibility, disable and skip to next when not found */
if (!playerData.hasOwnProperty(`statueState${id}`)) {
SetIconNone(section, entry);
entries[entry].disabled = true;
continue;
}
check = entries[entry].check; check = entries[entry].check;
isUnlocked = playerData[`statueState${id}`].isUnlocked; isUnlocked = playerData[`statueState${id}`].isUnlocked;
switch (entry) {
case "GreyPrinceUnlocked":
case "GreyPrinceAttuned":
case "GreyPrinceAscended":
case "GreyPrinceRadiant":
/* When Zote OFF, disable entry and skip to next entry */
if (playerData.zoteRescuedBuzzer === false && playerData.hasWalljump === true) {
SetIconNone(section, entry);
entries[entry].disabled = true;
continue;
}
}
if (playerData[`statueState${id}`][check] === true) { if (playerData[`statueState${id}`][check] === true) {
switch(check) { switch (check) {
case "isUnlocked": case "isUnlocked":
SetIconGreen(section, entry); SetIconGreen(section, entry);