draw health masks

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

View file

@ -2504,7 +2504,8 @@ var HK = {
icon: "none",
name: "Health:",
spoiler: "",
masks: 5
masks: 5,
permadeathMode: false
},
soul: {
id: "soul",
@ -4987,6 +4988,11 @@ function SingleEntryFill(section, entry) {
var iconNull = SYMBOL_EMPTY;
var textPrefix = "";
var textSuffix = "";
var textFill = "";
var maskImages = "";
var maskImg = "";
var maskNormal = "<img src='".concat(_img_health_mask_png__WEBPACK_IMPORTED_MODULE_0__, "' class='health-mask' alt='health mask image' title='Health Mask'>");
var maskSteel = "<img src='".concat(_img_health_mask_steel_png__WEBPACK_IMPORTED_MODULE_1__, "' class='health-mask' alt='steel health mask image' title='Steel Health Mask'>");
var wiki = "";
var b = ["<b>", "</b>"];
var p = "<span class='p-left-small'></span>";
@ -5029,6 +5035,7 @@ function SingleEntryFill(section, entry) {
if (!textPrefix.length) b = ["", ""];
if (wiki.length) b = ["<a class=\"wiki\" href=\"".concat(WIKI_LINK).concat(wiki, "\" target=\"_blank\">"), "</a>"];
/* #################### Different behaviour depending on the section ####################### */
switch (section) {
case "intro":
@ -5041,6 +5048,15 @@ function SingleEntryFill(section, entry) {
textSuffix = "".concat(entry.spoiler, " %");
break;
case "health":
entry.permadeathMode ? maskImg = maskSteel : maskImg = maskNormal;
for (var i = 0; i < entry.masks; i++) {
textSuffix += maskImg;
}
break;
default:
}
/* Optimized only for the "intro" section! */

File diff suppressed because one or more lines are too long

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: