From 5897ed6b16bc51233c15542bbc693950d65f6273 Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Wed, 30 Dec 2020 21:16:54 -0500 Subject: [PATCH] move empathy belly more into data --- js/003-data/slaveWearData.js | 119 ++++++++++++++++------------- src/endWeek/saChoosesOwnClothes.js | 9 ++- src/interaction/siWardrobe.js | 30 +++++--- src/js/rulesAssistantOptions.js | 2 +- 4 files changed, 90 insertions(+), 70 deletions(-) diff --git a/js/003-data/slaveWearData.js b/js/003-data/slaveWearData.js index c52b04062e5..24c164db4f8 100644 --- a/js/003-data/slaveWearData.js +++ b/js/003-data/slaveWearData.js @@ -1098,61 +1098,6 @@ App.Data.slaveWear = { ], ]), - bellyAccessory: new Map([ - ["none", {name: "None"}], - ["a corset", {name: "Tight corset"}], - ["an extreme corset", {name: "Extreme corset"}], - ["a support band", {name: "Supportive band"}], - ["a small empathy belly", - { - name: "1st Trimester belly", - fs: { - unlocks: "FSRepopulationFocus", - loves: new Set(["FSRepopulationFocus"]) - }, - get requirements() { - return V.boughtItem.clothing.belly === 1; - } - } - ], - ["a medium empathy belly", - { - name: "2nd Trimester belly", - fs: { - unlocks: "FSRepopulationFocus", - loves: new Set(["FSRepopulationFocus"]) - }, - get requirements() { - return V.boughtItem.clothing.belly === 1; - } - } - ], - ["a large empathy belly", - { - name: "3rd Trimester belly", - fs: { - unlocks: "FSRepopulationFocus", - loves: new Set(["FSRepopulationFocus"]) - }, - get requirements() { - return V.boughtItem.clothing.belly === 1; - } - } - ], - ["a huge empathy belly", - { - name: "3rd Trimester twins belly", - fs: { - unlocks: "FSRepopulationFocus", - loves: new Set(["FSRepopulationFocus"]) - }, - get requirements() { - return V.boughtItem.clothing.belly === 1; - } - } - ] - ]), - vaginalAttachment: new Map([ ["none", {name: "None"}], ["vibrator", @@ -1489,6 +1434,70 @@ App.Data.vaginalAccessory = new Map([ } ] ]); + +/** + * @typedef {slaveWear} bellyAccessory + * @property {1|2|3|4} empathyBelly + */ +/** @type {Map<string, bellyAccessory>} */ +App.Data.bellyAccessory = new Map([ + ["none", {name: "None"}], + ["a corset", {name: "Tight corset"}], + ["an extreme corset", {name: "Extreme corset"}], + ["a support band", {name: "Supportive band"}], + ["a small empathy belly", + { + name: "1st Trimester belly", + fs: { + unlocks: "FSRepopulationFocus", + loves: new Set(["FSRepopulationFocus"]) + }, + get requirements() { + return V.boughtItem.clothing.belly === 1; + }, + empathyBelly: 1 + } + ], + ["a medium empathy belly", + { + name: "2nd Trimester belly", + fs: { + unlocks: "FSRepopulationFocus", + loves: new Set(["FSRepopulationFocus"]) + }, + get requirements() { + return V.boughtItem.clothing.belly === 1; + }, + empathyBelly: 2 + } + ], + ["a large empathy belly", + { + name: "3rd Trimester belly", + fs: { + unlocks: "FSRepopulationFocus", + loves: new Set(["FSRepopulationFocus"]) + }, + get requirements() { + return V.boughtItem.clothing.belly === 1; + }, + empathyBelly: 3 + } + ], + ["a huge empathy belly", + { + name: "3rd Trimester twins belly", + fs: { + unlocks: "FSRepopulationFocus", + loves: new Set(["FSRepopulationFocus"]) + }, + get requirements() { + return V.boughtItem.clothing.belly === 1; + }, + empathyBelly: 4 + } + ] +]); /** * @typedef {object} slaveWearChastity * @property {string} name diff --git a/src/endWeek/saChoosesOwnClothes.js b/src/endWeek/saChoosesOwnClothes.js index f543bbbefb4..ed577c31981 100644 --- a/src/endWeek/saChoosesOwnClothes.js +++ b/src/endWeek/saChoosesOwnClothes.js @@ -1089,14 +1089,19 @@ App.SlaveAssignment.choosesOwnClothes = (function() { */ function todaysCorset(slave) { const belly = []; - const empathyBellies = ["a small empathy belly", "a medium empathy belly", "a large empathy belly", "a huge empathy belly"]; + const empathyBellies = []; + for (const [key, object] of App.Data.bellyAccessory) { + if (object.empathyBelly) { + empathyBellies.push(key); + } + } if (slave.fetish === "mindbroken") { if (V.arcologies[0].FSRepopulationFocus > 0 && slave.belly < 1500) { if (slave.weight > 130) { belly.push({text: `${He} notices the fake bellies; since every girl ${he} has ever met has a rounded middle, it's only natural ${he} is compelled to wear one. ${He} struggles to fit it around ${his} huge gut, only stopping when another slave takes it away from ${him} so ${he} moves on and stops blocking the wardrobe with ${his} fat ass.`, bellyAccessory: "none"}); } else { - belly.push({text: `${He} notices the fake bellies; since every girl ${he} has ever met has a rounded middle, it's only natural ${he} is compelled to wear one.`, bellyAccessory: jsEither(["a small empathy belly", "a medium empathy belly", "a large empathy belly", "a huge empathy belly"])}); + belly.push({text: `${He} notices the fake bellies; since every girl ${he} has ever met has a rounded middle, it's only natural ${he} is compelled to wear one.`, bellyAccessory: jsEither(empathyBellies)}); } } else { belly.push({text: "", bellyAccessory: slave.bellyAccessory}); /* compatibility for no output, will likely get deprecated in the future as content is added*/ diff --git a/src/interaction/siWardrobe.js b/src/interaction/siWardrobe.js index 9c742ba74f9..0ea18eb47f0 100644 --- a/src/interaction/siWardrobe.js +++ b/src/interaction/siWardrobe.js @@ -425,13 +425,18 @@ App.UI.SlaveInteract.wardrobe = function(slave) { function bellyAccessory() { let array = []; + let empathyArray = []; - for (const key of App.Data.slaveWear.bellyAccessory.keys()) { + for (const [key, object] of App.Data.bellyAccessory) { if (key === "none") { // skip none in set, we set the link elsewhere. continue; } - array.push(key); + if (object.empathyBelly) { + empathyArray.push(key); + } else { + array.push(key); + } } // Sort @@ -451,20 +456,21 @@ App.UI.SlaveInteract.wardrobe = function(slave) { } // Options - let links = document.createElement('div'); - links.className = "choices"; - const sortedMap = new Map([]); + let sortedMap = new Map([]); for (const name of array) { - sortedMap.set(name, App.Data.slaveWear.bellyAccessory.get(name)); + sortedMap.set(name, App.Data.bellyAccessory.get(name)); } - links.appendChild(generateRows(sortedMap, "bellyAccessory", true)); + App.UI.DOM.appendNewElement("div", el, generateRows(sortedMap, "bellyAccessory", true), "choices"); + + sortedMap = new Map([]); + for (const name of empathyArray) { + sortedMap.set(name, App.Data.bellyAccessory.get(name)); + } + App.UI.DOM.appendNewElement("div", el, generateRows(sortedMap, "bellyAccessory", true), "choices"); + if (slave.pregKnown === 1) { - let note = document.createElement('span'); - note.className = "note"; - note.textContent = ` Extreme corsets will endanger the life within ${him}.`; - links.appendChild(note); + App.UI.DOM.appendNewElement("div", el, ` Extreme corsets will endanger the life within ${him}.`, ["note", "choices"]); } - el.appendChild(links); return el; } diff --git a/src/js/rulesAssistantOptions.js b/src/js/rulesAssistantOptions.js index 78be3d3730f..b1305b98118 100644 --- a/src/js/rulesAssistantOptions.js +++ b/src/js/rulesAssistantOptions.js @@ -1882,7 +1882,7 @@ App.RA.options = (function() { class CorsetList extends ListSelector { constructor() { - super("Corsetage", isItemAccessible.array(App.Data.slaveWear.bellyAccessory)); + super("Corsetage", isItemAccessible.array(App.Data.bellyAccessory)); this.setValue(current_rule.set.bellyAccessory); this.onchange = (value) => current_rule.set.bellyAccessory = value; } -- GitLab