From 770e2bbae73efab7e6aac40319383b7a65fc9e4c Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Wed, 16 Dec 2020 17:53:48 -0500 Subject: [PATCH] Eyebrows, and move to data --- js/003-data/miscData.js | 2 + src/facilities/salon/salonPassage.js | 79 +++++++++++++++++++++++++++- src/js/rulesAssistantOptions.js | 23 +------- 3 files changed, 82 insertions(+), 22 deletions(-) diff --git a/js/003-data/miscData.js b/js/003-data/miscData.js index a0a906213fd..07531193cf1 100644 --- a/js/003-data/miscData.js +++ b/js/003-data/miscData.js @@ -264,6 +264,8 @@ App.Data.misc = { naturalSkins: ["pure white", "ivory", "white", "extremely pale", "very pale", "pale", "extremely fair", "very fair", "fair", "light", "light olive", "tan", "olive", "bronze", "dark olive", "dark", "light beige", "beige", "dark beige", "light brown", "brown", "dark brown", "black", "ebony", "pure black"], dyedSkins: ["camouflage patterned", "dyed blue", "dyed gray", "dyed green", "dyed pink", "dyed red", "tiger striped"], naturalNippleColors: ["black", "brown", "dark brown", "ebony", "ivory", "light brown", "pale pink", "pink"], + eyebrowStyles: new Set(["shaved", "straight", "rounded", "natural", "slanted inwards", "slanted outwards", "high-arched", "elongated", "shortened", "curved"]), + eyebrowFullness: new Set(["pencil-thin", "thin", "threaded", "natural", "tapered", "thick", "bushy"]), /* START Custom Nationalities region filter */ /* Not currently weighted, but will accept weights */ diff --git a/src/facilities/salon/salonPassage.js b/src/facilities/salon/salonPassage.js index 8165ec052c5..67da357ba99 100644 --- a/src/facilities/salon/salonPassage.js +++ b/src/facilities/salon/salonPassage.js @@ -33,6 +33,7 @@ App.UI.salon = function(slave, cheat = false) { el.append(hair()); el.append(makeup()); el.append(skin()); + el.append(bodyHair()); return el; } @@ -149,12 +150,13 @@ App.UI.salon = function(slave, cheat = false) { const el = new DocumentFragment(); App.UI.DOM.appendNewElement("h2", el, "Hair"); - el.append(App.Medicine.Salon.hair(slave, {cheat: cheat})); + el.append(App.Medicine.Salon.hair(slave, { cheat: cheat })); return el; } function skin() { const el = new DocumentFragment(); + let r; App.UI.DOM.appendNewElement("h2", el, "Skin"); const options = new App.UI.OptionsGroup(); let comment = []; @@ -204,11 +206,86 @@ App.UI.salon = function(slave, cheat = false) { } option.pulldown(); + if (slave.markings === "beauty mark") { + r = []; + r.push(`${He} has a prominent mole on ${his} face, which`); + if (slave.face > 40) { + r.push(`qualifies as a beauty mark and enhances ${his} attractiveness due to ${his} facial beauty.`); + } else if (slave.face < -10) { + r.push(`makes ${him} even less attractive.`); + } else { + r.push(`qualifies as a beauty mark since ${he}'s pretty, having no significant impact on ${his} beauty.`); + } + options.addOption(r.join(" "), "markings", slave) + .addValue("Remove it", "none", billMod); + } + if (slave.markings === "birthmark") { + r = []; + r.push(`${He} has a large birthmark, which`); + if (slave.prestige > 0 || slave.porn.prestige > 1) { + r.push(`enhances ${his} attractiveness due to ${his} prestige.`); + } else { + r.push(`detracts from ${his} attractiveness.`); + } + options.addOption(r.join(" "), "markings", slave) + .addValue("Bleach it", "none", billMod); + } + el.append(options.render()); return el; } + function bodyHair() { + const el = new DocumentFragment(); + const options = new App.UI.OptionsGroup(); + let option; + let r = []; + App.UI.DOM.appendNewElement("h2", el, "Body hair"); + if (slave.eyebrowHStyle !== "bald") { + // Describe and change color + r.push(`${His}`); + if (slave.eyebrowFullness !== "natural") { + r.push(slave.eyebrowFullness); + } + if (slave.eyebrowHStyle !== "natural") { + r.push(r.pop(), `, ${slave.eyebrowHStyle}`); + } + r.push(`eyebrows`); + if (slave.eyebrowHStyle === "shaved") { + r.push(`would be ${slave.eyebrowHColor} if present.`); + } else { + r.push(`are ${slave.eyebrowHColor}.`); + } + + option = options.addOption(r.join(" "), "eyebrowHColor", slave); + if (slave.eyebrowHColor !== slave.hColor) { + option.addValue("Match the hair", slave.hColor); + } + option.addValueList(makeAList(App.Medicine.Modification.Color.Primary.map(color => color.value))); + option.addCallbackToEach(billMod); + option.pulldown(); + + // Style + option = options.addOption(`Style ${his} eyebrow hair`, "eyebrowHStyle", slave); + for (const fullness of App.Data.misc.eyebrowStyles) { + option.addValue(capFirstChar(fullness), fullness, billMod); + } + option.pulldown(); + + // Fullness + option = options.addOption(`Shape ${his} eyebrow hair`, "eyebrowFullness", slave); + for (const fullness of App.Data.misc.eyebrowFullness) { + option.addValue(capFirstChar(fullness), fullness, billMod); + } + option.pulldown(); + } else { + options.addComment(`${His} eyebrows are completely hairless.`); + } + el.append(options.render()); + return el; + } + function billMod() { if (!cheat) { cashX(forceNeg(V.modCost), "slaveMod", slave); diff --git a/src/js/rulesAssistantOptions.js b/src/js/rulesAssistantOptions.js index 82a082bc044..330e60e70df 100644 --- a/src/js/rulesAssistantOptions.js +++ b/src/js/rulesAssistantOptions.js @@ -3081,18 +3081,7 @@ globalThis.rulesAssistantOptions = (function() { class EyebrowStyleList extends ListSelector { constructor() { - const pairs = [ - ["shaved"], - ["straight"], - ["rounded"], - ["natural"], - ["slanted inwards"], - ["slanted outwards"], - ["high-arched"], - ["elongated"], - ["shortened"], - ["curved"] - ]; + const pairs = Array.from(App.Data.misc.eyebrowStyles, style => [style]); super("Eyebrow style", pairs); this.setValue(current_rule.set.eyebrowHStyle); this.onchange = (value) => current_rule.set.eyebrowHStyle = value; @@ -3101,15 +3090,7 @@ globalThis.rulesAssistantOptions = (function() { class EyebrowFullnessList extends ListSelector { constructor() { - const pairs = [ - ["pencil-thin"], - ["thin"], - ["threaded"], - ["natural"], - ["tapered"], - ["thick"], - ["bushy"] - ]; + const pairs = Array.from(App.Data.misc.eyebrowFullness, fullness => [fullness]); super("Eyebrow fullness", pairs); this.setValue(current_rule.set.eyebrowFullness); this.onchange = (value) => current_rule.set.eyebrowFullness = value; -- GitLab