display soul amount and images

This commit is contained in:
ReznoRMichael 2021-07-07 12:14:46 +02:00
commit 1c6b009d75
5 changed files with 71 additions and 41 deletions

View file

@ -378,7 +378,7 @@ function CheckSaveFileVersion(section, saveVersion = HK.sections.intro.entries.s
*/
function CheckHealthMasks(section, masks = 5, permadeathMode = 0) {
section.entries.health.masks = masks;
section.entries.health.amountTotal = masks;
if (permadeathMode > 0) {
section.entries.health.permadeathMode = true;
@ -409,7 +409,7 @@ function CheckHealthMasks(section, masks = 5, permadeathMode = 0) {
*/
function CheckSoulOrbs(section, totalSoul) {
let icon = SYMBOL_EMPTY;
/* let icon = SYMBOL_EMPTY;
let textFill = "<span>Soul:</span>";
let soulImages = "";
let soulNormal = `<img src='${SOUL_ORB_IMAGE}' class='soul-orb' alt='soul orb image' title='Single Soul Orb (one spell cast)'>`;
@ -417,7 +417,9 @@ function CheckSoulOrbs(section, totalSoul) {
for (let i = 0, total = totalSoul / 33; i < total; i++) {
soulImages += soulImg;
}
} */
section.entries.soul.amountTotal = totalSoul;
// document.getElementById(section.id).innerHTML += divStartCenter + icon + textFill + soulImages + divEnd;
}

View file

@ -44,7 +44,7 @@ const HK = {
icon: "none",
name: "Health:",
spoiler: "",
masks: 5,
amountTotal: 5,
permadeathMode: false,
},
soul: {
@ -52,21 +52,23 @@ const HK = {
icon: "none",
name: "Soul:",
spoiler: "",
amount: 99
amountTotal: 99
},
notches: {
id: "notches",
icon: "none",
name: "Notches:",
spoiler: "",
amount: 3
amountTotal: 3
},
geo: {
id: "geo",
icon: "none",
name: "Geo:",
spoiler: "",
amount: 0
amount: 0,
amountShade: 0,
amountTotal: 0
}
},
},

View file

@ -277,10 +277,10 @@ function SingleEntryFill(section, entry) {
let textPrefix = "";
let textSuffix = "";
let textFill = "";
let maskImages = "";
let maskImg = "";
let Img = "";
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 soulNormal = `<img src='${SOUL_ORB_IMAGE}' class='soul-orb' alt='soul orb image' title='Single Soul Orb (one spell cast)'>`;
let wiki = "";
let div = `<div class='single-entry'>`;
@ -346,13 +346,26 @@ function SingleEntryFill(section, entry) {
div = divFlex;
span = ["", ""];
(entry.permadeathMode) ? maskImg = maskSteel: maskImg = maskNormal;
(entry.permadeathMode) ? Img = maskSteel: Img = maskNormal;
for (let i = 0; i < entry.masks; i++) {
textSuffix += maskImg;
for (let i = 0; i < entry.amountTotal; i++) {
textSuffix += Img;
}
textSuffix += `${p}<sup>(${entry.masks})</sup>`;
textSuffix += `${p}<sup>(${entry.amountTotal})</sup>`;
break;
case "soul":
div = divFlex;
span = ["", ""];
Img = soulNormal;
for (let i = 0, total = entry.amountTotal / 33; i < total; i++) {
textSuffix += Img;
}
textSuffix += `${p}<sup>(${entry.amountTotal / 33})</sup>`;
break;