draw health masks
This commit is contained in:
parent
d828cc071f
commit
72e158237c
4 changed files with 36 additions and 3 deletions
|
|
@ -42,7 +42,8 @@ const HK = {
|
|||
icon: "none",
|
||||
name: "Health:",
|
||||
spoiler: "",
|
||||
masks: 5
|
||||
masks: 5,
|
||||
permadeathMode: false,
|
||||
},
|
||||
soul: {
|
||||
id: "soul",
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue