Gruz Mother and Brooding Mawlek separate

This commit is contained in:
ReznoRMichael 2021-02-19 21:46:24 +01:00
parent 032e3ae569
commit 2a2aeaa785
2 changed files with 29 additions and 21 deletions

View file

@ -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.

View file

@ -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: {