From 2a2aeaa785a1464c75b8f341fd530916933a2eb7 Mon Sep 17 00:00:00 2001 From: ReznoRMichael Date: Fri, 19 Feb 2021 21:46:24 +0100 Subject: [PATCH] Gruz Mother and Brooding Mawlek separate --- src/js/HKCheckCompletion.js | 19 ++++++++++--------- src/js/hk-database.js | 31 +++++++++++++++++++------------ 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/src/js/HKCheckCompletion.js b/src/js/HKCheckCompletion.js index 9a7f3ca..34f4752 100644 --- a/src/js/HKCheckCompletion.js +++ b/src/js/HKCheckCompletion.js @@ -130,11 +130,7 @@ function HKCheckCompletion(jsonObject) { // ---------------- Bosses (Base Game) --------------------- // - CheckIfDataTrue(HK.DIV_ID.bosses, HK.BOSSES, HKPlayerData); - - // ---------------- Gruz Mother and Mawlek (World Map) --------------------- // - - if (HKWorldItems) CheckWorldDataTrue(HK.DIV_ID.bosses, "Battle Scene", HK.BOSSES_WORLD, HKWorldItems); + CheckIfDataTrue(HK.DIV_ID.bosses, HK.BOSSES, HKPlayerData, HKWorldItems); // ---------------- Charms --------------------- // @@ -479,9 +475,10 @@ function CheckNotches(divId, totalNotches = 3, filledNotches = 0) { * Verifies if the data in a specific object is true or false, and appends HTML accordingly. * @param {object} divId ID of the HTML element for data appending * @param {object} dataObject Object containing data to be verified (use copy - data inside this object will be deleted) - * @param {object} playerData Reference/pointer to specific data where to search + * @param {object} playerData Reference/pointer to specific data where to search (playerData) + * @param {Array} worldData Reference/pointer to specific data where to search (sceneData.persistentBoolItems) */ -function CheckIfDataTrue(divId, dataObject, playerData) { +function CheckIfDataTrue(divId, dataObject, playerData, worldData = []) { let { textPrefix, @@ -522,6 +519,10 @@ function CheckIfDataTrue(divId, dataObject, playerData) { } (playerData[i] === true) ? CurrentDataTrue(divId): CurrentDataFalse(); break; + case "bossGruzMother": + case "bossBroodingMawlek": + (WorldDataActivated(dataObject[i].id, dataObject[i].sceneName, worldData)) ? CurrentDataTrue(divId): CurrentDataFalse(); + break; default: (playerData[i] === true) ? CurrentDataTrue(divId): CurrentDataFalse(); } @@ -652,7 +653,7 @@ function CheckNailUpgrades(divId, dataObject, playerData) { * @param {string} sceneNameText Map codename of the Interactable (sceneName in sceneData) * @param {Array} worldData Array of Interactable data to search in (sceneData.persistentBoolItems) */ -/* function WorldDataActivated(idText, sceneNameText, worldData) { +function WorldDataActivated(idText, sceneNameText, worldData) { // Search for the Interactable for (let i = 0, length = worldData.length; i < length; i++) { @@ -663,7 +664,7 @@ function CheckNailUpgrades(divId, dataObject, playerData) { return false; } } -} */ +} /** * Verifies if the data in a specific object are true or false, and appends HTML accordingly. Creates a copy of dataObject. diff --git a/src/js/hk-database.js b/src/js/hk-database.js index 1f50704..5e89682 100644 --- a/src/js/hk-database.js +++ b/src/js/hk-database.js @@ -180,6 +180,22 @@ const HK = { }, // hk-bosses BOSSES: { + // killedBigFly + bossGruzMother: { + name: "Gruz Mother", + spoiler: "Forgotten Crossroads", + id: "Battle Scene", + sceneName: "Crossroads_04", + wiki: "Gruz_Mother" + }, + // killedMawlek + bossBroodingMawlek: { + name: "Brooding Mawlek", + spoiler: "Forgotten Crossroads", + id: "Battle Scene", + sceneName: "Crossroads_09", + wiki: "Brooding_Mawlek" + }, falseKnightDefeated: { name: "False Knight", spoiler: "Forgotten Crossroads", @@ -211,8 +227,8 @@ const HK = { wiki: "Collector" }, defeatedMantisLords: { - name: "Mantis Lords", - spoiler: "Mantis Village", + name: "P#2 Mantis Lords", + spoiler: "Fungal Wastes: Mantis Village", wiki: "Mantis_Lords" }, defeatedMegaJelly: { @@ -244,16 +260,7 @@ const HK = { // hk-bosses // "Battle Scene" sceneData.persistentBoolItems.id BOSSES_WORLD: { - Crossroads_04: { - name: "Gruz Mother", - spoiler: "Forgotten Crossroads", - wiki: "Gruz_Mother" - }, // killedBigFly - Crossroads_09: { - name: "Brooding Mawlek", - spoiler: "Forgotten Crossroads", - wiki: "Brooding_Mawlek" - } // killedMawlek + }, // reference: https://radiance.host/apidocs/Charms.html CHARMS: {