From 291b0950a4fda5943a2e9eabe118b28cc6568183 Mon Sep 17 00:00:00 2001 From: ReznoRMichael Date: Fri, 19 Feb 2021 19:20:16 +0100 Subject: [PATCH] WorldDataActivated() function, Soul Warrior data --- src/js/HKCheckCompletion.js | 19 +++++++++++++++++++ src/js/hk-database.js | 9 ++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/js/HKCheckCompletion.js b/src/js/HKCheckCompletion.js index 3328fc9..4207b8c 100644 --- a/src/js/HKCheckCompletion.js +++ b/src/js/HKCheckCompletion.js @@ -646,6 +646,25 @@ function CheckNailUpgrades(divId, dataObject, playerData) { AppendHTML(divId, sFillText); } +/** + * Verifies if the specific Interactable is activated. Returns true or false. + * @param {string} idText Text string inside save data to search for + * @param {object} worldData Reference/pointer to specific data where to search (sceneData.persistentBoolItems) + */ +function WorldDataActivated(idText, sceneNameText, worldData) { + + // Search for the Interactable + for (let i = 0, length = worldData.length; i < length; i++) { + // Verify if the Interactable is activated and return the result + if (worldData[i].id === idText && worldData[i].sceneName === sceneNameText && worldData[i].activated === true) { + return true; + } + else { + return false; + } + } +} + /** * Verifies if the data in a specific object are true or false, and appends HTML accordingly. Creates a copy of dataObject. * @param {object} divId ID of the HTML element for data appending diff --git a/src/js/hk-database.js b/src/js/hk-database.js index e9d8715..913c429 100644 --- a/src/js/hk-database.js +++ b/src/js/hk-database.js @@ -984,7 +984,14 @@ const HK = { name: "P#1 Massive Moss Charger", spoiler: "Greenpath, near Fog Canyon", wiki: "Massive_Moss_Charger" - } + }, + pantheonSoulWarrior: { + name: "P#1 Soul Warrior", + spoiler: "City of Tears, Soul Sanctum", + id: "Battle Scene v2", + sceneName: "Ruins1_23", + wiki: "Soul_Warrior" + }, }, GRUBS_LIST: ["Crossroads_35", "Crossroads_03", "Crossroads_05", "Crossroads_48", "Crossroads_31", "Fungus1_06", "Fungus1_07", "Fungus1_21", "Fungus1_28", "Fungus2_18", "Ruins1_05", "Mines_04", "Mines_03", "Mines_31", "Mines_19", "Ruins1_32", "RestingGrounds_10", "Ruins_House_01", "Mines_35", "Mines_16", "Waterways_04", "Waterways_13", "Abyss_19", "Abyss_17", "Mines_24", "Fungus1_13", "Fungus3_47", "Fungus3_10", "Fungus3_48", "Fungus3_22", "Ruins2_07", "Ruins2_11", "Ruins2_11", "Ruins2_11", "Deepnest_East_11", "Deepnest_East_14", "Fungus2_20", "Ruins2_03", "Deepnest_36", "Deepnest_03", "Deepnest_31", "Deepnest_39", "Deepnest_Spider_Town", "Waterways_14", "Hive_03", "Hive_04"], ACHIEVEMENTS: {