draw health masks

This commit is contained in:
ReznoRMichael 2021-07-05 15:00:11 +02:00
commit 72e158237c
4 changed files with 36 additions and 3 deletions

View file

@ -42,7 +42,8 @@ const HK = {
icon: "none",
name: "Health:",
spoiler: "",
masks: 5
masks: 5,
permadeathMode: false,
},
soul: {
id: "soul",

View file

@ -279,6 +279,11 @@ function SingleEntryFill(section, entry) {
let textPrefix = "";
let textSuffix = "";
let textFill = "";
let maskImages = "";
let maskImg = "";
let maskNormal = `<img src='${HEALTH_MASK_IMAGE}' class='health-mask' alt='health mask image' title='Health Mask'>`;
let maskSteel = `<img src='${HEALTH_MASK_STEEL_IMAGE}' class='health-mask' alt='steel health mask image' title='Steel Health Mask'>`;
let wiki = "";
let b = ["<b>", "</b>"];
let p = "<span class='p-left-small'></span>";
@ -330,9 +335,20 @@ 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} %`;
break;
case "health":
(entry.permadeathMode) ? maskImg = maskSteel: maskImg = maskNormal;
for (let i = 0; i < entry.masks; i++) {
textSuffix += maskImg;
}
break;
default: