show number of health masks

This commit is contained in:
ReznoRMichael 2021-07-05 15:18:21 +02:00
commit 0f1f00a0c2
4 changed files with 35 additions and 14 deletions

View file

@ -368,7 +368,15 @@ function CheckSaveFileVersion(divId, saveVersion = HK.SECTION.intro.entries.save
*/
function CheckHealthMasks(divId, masks = 5, permadeathMode = 0) {
let icon = SYMBOL_EMPTY;
divId.entries.health.masks = masks;
if (permadeathMode > 0) {
divId.entries.health.permadeathMode = true;
} else {
divId.entries.health.permadeathMode = false;
}
/* let icon = SYMBOL_EMPTY;
let textFill = "<span>Health:</span>";
let maskImages = "";
let maskNormal = `<img src='${HEALTH_MASK_IMAGE}' class='health-mask' alt='health mask image' title='Health Mask'>`;
@ -379,7 +387,7 @@ function CheckHealthMasks(divId, masks = 5, permadeathMode = 0) {
for (let i = 0; i < masks; i++) {
maskImages += maskImg;
}
} */
// document.getElementById(divId.id).innerHTML += divStartCenter + icon + textFill + maskImages + divEnd;
}

View file

@ -335,7 +335,7 @@ function SingleEntryFill(section, entry) {
span = ["<b>", "</b>"];
/* Different text and images for each entry in the "Game Status" section */
switch (entry.id) {
case "gameCompletion":
textSuffix = `${entry.spoiler} %`;
@ -343,12 +343,16 @@ function SingleEntryFill(section, entry) {
break;
case "health":
span = ["", ""];
(entry.permadeathMode) ? maskImg = maskSteel: maskImg = maskNormal;
for (let i = 0; i < entry.masks; i++) {
textSuffix += maskImg;
}
textSuffix += `${p}<sup>(${entry.masks})</sup>`;
break;
default: