diff --git a/src/facilities/bodyModification/bodyModification.js b/src/facilities/bodyModification/bodyModification.js index 6aac6e91ec8b3e3b24caabbeced5335fd4b25fcc..4975c4009184b594cf92850a2ac77179c4b3ac01 100644 --- a/src/facilities/bodyModification/bodyModification.js +++ b/src/facilities/bodyModification/bodyModification.js @@ -90,7 +90,7 @@ App.UI.bodyModification = function(slave, cheat = false) { } r.push(` become scarred`); } - r.push(`.`); + r.push(r.pop() + "."); } r.push(`No matter how you chose to apply it, scarring so much of ${his} body has <span class="health.dec"> hurt ${his} health.</span>`); healthDamage(slave, 20); @@ -495,55 +495,18 @@ App.UI.bodyModification = function(slave, cheat = false) { r.push(App.UI.DOM.generateLinksStrip(linkArray)); App.Events.addNode(el, r, "div"); - // Custom - App.UI.DOM.appendNewElement("h3", el, "Custom Tattoos"); - r = []; - for (const location of validTattooLocations) { - const varName = tattooLocations.get(location); - if (varName) { - r.push(App.UI.DOM.makeElement("div", `${capFirstChar(location)}: `)); - r.push( - App.UI.DOM.makeElement( - "div", - App.UI.DOM.makeTextBox( - slave[`${varName}Tat`], - (v) => { - modReaction += App.Medicine.Modification.setTattoo(slave, varName, v); - refresh(); - } - ) - ) - ); - } - } - - // Custom - r.push(App.UI.DOM.makeElement("div", `Custom: `)); - r.push( - App.UI.DOM.makeElement( - "div", - App.UI.DOM.makeTextBox( - slave.custom.tattoo, - (v) => { - slave.custom.tattoo = v; - cashX(forceNeg(V.surgeryCost), "slaveMod", slave); - refresh(); - } - ) + const customEl = document.createElement("div"); + customEl.id = "custom-el"; + customEl.append( + App.UI.DOM.link( + "Show custom tattoo locations", + () => { + jQuery("#custom-el").empty().append(customTats()); + } ) ); - App.Events.addNode(el, r, "div", "grid-2columns-auto"); - if (slave.custom.tattoo !== "") { - el.append( - App.UI.DOM.link( - "Remove custom Tattoo", - () => { - slave.custom.tattoo = ""; - cashX(forceNeg(V.surgeryCost), "slaveMod", slave); - } - ) - ); - } + el.append(customEl); + return el; function applyTat(location) { @@ -553,11 +516,62 @@ App.UI.bodyModification = function(slave, cheat = false) { V.degradation += 1; } } + + function customTats() { + const el = new DocumentFragment(); + App.UI.DOM.appendNewElement("h3", el, "Custom Tattoos"); + const r = []; + for (const location of validTattooLocations) { + const varName = tattooLocations.get(location); + if (varName) { + r.push(App.UI.DOM.makeElement("div", `${capFirstChar(location)}: `)); + r.push( + App.UI.DOM.makeElement( + "div", + App.UI.DOM.makeTextBox( + slave[`${varName}Tat`], + (v) => { + modReaction += App.Medicine.Modification.setTattoo(slave, varName, v); + refresh(); + } + ) + ) + ); + } + } + + r.push(App.UI.DOM.makeElement("div", `Custom: `)); + r.push( + App.UI.DOM.makeElement( + "div", + App.UI.DOM.makeTextBox( + slave.custom.tattoo, + (v) => { + slave.custom.tattoo = v; + cashX(forceNeg(V.surgeryCost), "slaveMod", slave); + refresh(); + } + ) + ) + ); + App.Events.addNode(el, r, "div", "grid-2columns-auto"); + if (slave.custom.tattoo !== "") { + el.append( + App.UI.DOM.link( + "Remove custom Tattoo", + () => { + slave.custom.tattoo = ""; + cashX(forceNeg(V.surgeryCost), "slaveMod", slave); + } + ) + ); + } + return el; + } } function branding() { const el = new DocumentFragment(); - App.UI.DOM.appendNewElement("h2", el, "Branding"); const selection = document.createElement("span"); selection.id = "brand-selection"; selection.append(App.Medicine.Modification.Select.brand(slave, cheat)); @@ -840,12 +854,7 @@ App.UI.bodyModification = function(slave, cheat = false) { } ) ); - r.push(`with ${V.scarDesign.local} on the ${V.scarTarget.local}`); - if (slave.scar[V.scarTarget.local]) { - r.push(`, adding to the scars that are already there?`); - } else { - r.push(`.`); - } + r.push(`with ${V.scarDesign.local} on the ${V.scarTarget.local}${(slave.scar[V.scarTarget.local]) ? `, adding to the scars that are already there?`: `.`}`); } App.Events.addNode(el, r, "div"); diff --git a/src/facilities/bodyModification/createBrand.js b/src/facilities/bodyModification/createBrand.js index 8eaefc2dbecc76a64738bda0c345de86213cb6e3..fb7b5cc58e1fb92c777536573c4dc7d38f5921e1 100644 --- a/src/facilities/bodyModification/createBrand.js +++ b/src/facilities/bodyModification/createBrand.js @@ -4,6 +4,8 @@ App.Medicine.Modification.Select.brand = function(slave, cheat = false) { let div = document.createElement('div'); const {his, His, him, He} = getPronouns(slave); + App.UI.DOM.appendNewElement("h2", el, "Branding"); + for (const brandPlace in slave.brand) { div = document.createElement('div'); div.append(`${His} ${brandPlace} is marked with ${slave.brand[brandPlace]}`);