From 0a4a4251eebd43c17554c3e7b69df12ceace212f Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Mon, 30 Nov 2020 11:51:05 -0500 Subject: [PATCH] tweaks --- .../bodyModification/bodyModification.js | 38 +++++++++++-------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/src/facilities/bodyModification/bodyModification.js b/src/facilities/bodyModification/bodyModification.js index abf07c9f304..8589c0eac16 100644 --- a/src/facilities/bodyModification/bodyModification.js +++ b/src/facilities/bodyModification/bodyModification.js @@ -1,3 +1,8 @@ +/** + * + * @param {App.Entity.SlaveState} slave + * @param {boolean} cheat + */ App.UI.bodyModification = function(slave, cheat = false) { const container = document.createElement("span"); container.id = "body-modification"; @@ -191,7 +196,7 @@ App.UI.bodyModification = function(slave, cheat = false) { const el = new DocumentFragment(); let r = []; const piercingLocations = ["ear", "nose", "eyebrow", "lips", "tongue", "nipples", "areolae", "navel", "corset", "clit", "vagina", "dick", "anus"]; - /* DESCRIPTIONS */ + // DESCRIPTIONS App.UI.DOM.appendNewElement("h2", el, "Piercings"); for (const piercing of piercingLocations.concat(["chastity"])) { @@ -203,7 +208,7 @@ App.UI.bodyModification = function(slave, cheat = false) { App.Events.addNode(el, r); r = []; - /* Apply piercings */ + // Apply piercings r.push(`Choose piercing style:`); const piercingLevelNames = new Map([ ["Remove", 0], @@ -212,15 +217,15 @@ App.UI.bodyModification = function(slave, cheat = false) { ["Smart", 3] ]); let linkArray = []; - for (const [weight, i] of piercingLevelNames) { - if (piercingLevel === i) { - linkArray.push(App.UI.DOM.disabledLink(weight, ["Currently selected"])); + for (const [title, num] of piercingLevelNames) { + if (piercingLevel === num) { + linkArray.push(App.UI.DOM.disabledLink(title, ["Currently selected"])); } else { linkArray.push( App.UI.DOM.link( - weight, + title, () => { - piercingLevel = i; + piercingLevel = num; refresh(); } ) @@ -245,7 +250,7 @@ App.UI.bodyModification = function(slave, cheat = false) { } } - if (!(slave.dick > 0)) { + if (slave.dick === 0) { removePiercingLocation("dick"); } @@ -254,14 +259,15 @@ App.UI.bodyModification = function(slave, cheat = false) { validPiercingLocations.splice(index, 1); } - if (piercingLevel === 0) { - r.push(`Remove piercings from:`); - } else if (piercingLevel === 1) { - r.push(`Lightly pierce ${his}:`); - } else if (piercingLevel === 2) { - r.push(`Heavily pierce ${his}:`); - } if (piercingLevel < 3) { + if (piercingLevel === 0) { + r.push(`Remove piercings from:`); + } else if (piercingLevel === 1) { + r.push(`Lightly pierce ${his}:`); + } else if (piercingLevel === 2) { + r.push(`Heavily pierce ${his}:`); + } + // Entire body linkArray = []; linkArray.push( App.UI.DOM.link( @@ -281,6 +287,7 @@ App.UI.bodyModification = function(slave, cheat = false) { ) ); + // Each individual piercing for (const location of validPiercingLocations) { if (slave[`${location}Piercing`] !== piercingLevel) { linkArray.push( @@ -300,6 +307,7 @@ App.UI.bodyModification = function(slave, cheat = false) { } r.push(App.UI.DOM.generateLinksStrip(linkArray)); } else if (piercingLevel === 3) { + // Smart piercings if (slave.vagina !== -1 || slave.dick !== 0) { if (slave.clitPiercing !== 3) { r.push(`Give ${him} a`); -- GitLab