From 232a0bf197e292eed44cfcf34e035189e64fe2ad Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Sat, 19 Dec 2020 18:46:19 -0500 Subject: [PATCH] finish moving sluttiness and humiliation to be properties of clothing --- devTools/types/SugarCubeExtensions.d.ts | 3 -- js/003-data/miscData.js | 7 --- js/003-data/slaveWearData.js | 50 +++++++++++++++------ src/endWeek/saClothes.js | 4 +- src/events/eventUtils.js | 2 +- src/facilities/wardrobe/wardrobeShopping.js | 4 +- src/interaction/siWardrobe.js | 11 +++-- src/js/eventSelectionJS.js | 2 +- src/js/itemAvailability.js | 6 +-- src/js/rulesAssistantOptions.js | 4 +- src/js/statsChecker/statsChecker.js | 2 +- src/js/utilsFC.js | 12 +++++ 12 files changed, 66 insertions(+), 41 deletions(-) diff --git a/devTools/types/SugarCubeExtensions.d.ts b/devTools/types/SugarCubeExtensions.d.ts index 52eaed4fd5f..e8709b836ae 100644 --- a/devTools/types/SugarCubeExtensions.d.ts +++ b/devTools/types/SugarCubeExtensions.d.ts @@ -26,9 +26,6 @@ declare module "twine-sugarcube" { filterRegions: string[]; heightBoostingShoes: string[]; highHeels: string[]; - humiliatingClothes: string[]; - modestClothes: string[]; - sluttyClothes: string[]; pregData: Record<string, FC.PregnancyData>; diff --git a/js/003-data/miscData.js b/js/003-data/miscData.js index 6553024c97d..a79da32e166 100644 --- a/js/003-data/miscData.js +++ b/js/003-data/miscData.js @@ -1551,13 +1551,6 @@ App.Data.misc = { fakeBellies: ["a huge empathy belly", "a large empathy belly", "a medium empathy belly", "a small empathy belly"], /* lets fake bellies be separated from other .bellyAccessory */ - modestClothes: [], - - sluttyClothes: [], - - /* stuff that reveals genitals */ - humiliatingClothes: [], - highHeels: ["boots", "extreme heels", "extreme platform heels", "heels", "platform heels"], heightBoostingShoes: ["extreme heels", "extreme platform heels", "heels", "platform heels", "platform shoes", "pumps"], diff --git a/js/003-data/slaveWearData.js b/js/003-data/slaveWearData.js index b4c2cd628eb..8752951ce4a 100644 --- a/js/003-data/slaveWearData.js +++ b/js/003-data/slaveWearData.js @@ -1,21 +1,21 @@ /** - * @typedef {object} slaveWear + * @typedef {object} clothes * @property {string} name * @property {string} value * @property {FC.FutureSociety} [fs] Automatically unlocked with this FS. - * @property {boolean} [slutty] + * @property {boolean} slutty * @property {boolean} [humiliating] stuff that reveals genitals * @property {boolean} [requirements] */ /** - * @typedef {Array<slaveWear>|Array<slaveWearChastity>} slaveWearCategory + * @typedef {Array<clothes>} clothesCategory */ -/** @type {Object.<string, slaveWearCategory>} */ -App.Data.slaveWear = { +/** @type {Object.<string, clothesCategory>} */ +App.Data.clothes = { - niceClothes: [ + nice: [ { name: "Maternity lingerie", value: "attractive lingerie for a pregnant woman", @@ -40,7 +40,9 @@ App.Data.slaveWear = { fs: "FSPhysicalIdealist", get requirements() { return V.boughtItem.clothing.oil === 1; - } + }, + slutty: false, + humiliating: true }, { name: "Chattel habit", @@ -67,7 +69,9 @@ App.Data.slaveWear = { fs: "FSArabianRevivalist", get requirements() { return V.boughtItem.clothing.harem === 1; - } + }, + slutty: true, + humiliating: true }, { name: "Huipil", @@ -157,6 +161,7 @@ App.Data.slaveWear = { get requirements() { return V.boughtItem.clothing.western === 1; }, + slutty: true, humiliating: true }, { @@ -165,7 +170,8 @@ App.Data.slaveWear = { fs: "FSSlaveProfessionalism", get requirements() { return V.boughtItem.clothing.courtesan === 1; - } + }, + slutty: false }, { name: "Bimbo outfit", @@ -182,7 +188,8 @@ App.Data.slaveWear = { fs: "FSPetiteAdmiration", get requirements() { return V.boughtItem.clothing.petite === 1; - } + }, + slutty: false }, { name: "Battlearmor", @@ -293,7 +300,8 @@ App.Data.slaveWear = { value: "a Santa dress", get requirements() { return V.boughtItem.clothing.costume === 1; - } + }, + slutty: true }, { @@ -401,7 +409,8 @@ App.Data.slaveWear = { value: "a button-up shirt and panties", get requirements() { return V.boughtItem.clothing.casual === 1; - } + }, + slutty: true }, { name: "Button-up shirt", @@ -409,6 +418,7 @@ App.Data.slaveWear = { get requirements() { return V.boughtItem.clothing.casual === 1; }, + slutty: true, humiliating: true }, { @@ -850,7 +860,7 @@ App.Data.slaveWear = { } ], - harshClothes: [ + harsh: [ { name: "Chains", value: "chains", @@ -891,7 +901,21 @@ App.Data.slaveWear = { humiliating: true } ], +}; +/** + * @typedef {object} slaveWear + * @property {string} name + * @property {string} value + * @property {FC.FutureSociety} [fs] Automatically unlocked with this FS. + * @property {boolean} [requirements] + */ + +/** + * @typedef {Array<slaveWear>|Array<slaveWearChastity>} slaveWearCategory + */ +/** @type {Object.<string, slaveWearCategory>} */ +App.Data.slaveWear = { niceCollars: [ { name: "Stylish leather", diff --git a/src/endWeek/saClothes.js b/src/endWeek/saClothes.js index bf925dfc8df..31c41983d23 100644 --- a/src/endWeek/saClothes.js +++ b/src/endWeek/saClothes.js @@ -287,7 +287,7 @@ App.SlaveAssignment.clothes = (function() { r.push(`${He} pretends to be embarrassed by ${his} clearly exposed breasts but <span class="hotpink">secretly gets off on it.</span>`); slave.devotion += 1; } - } else if (slave.fetish === "humiliation" && setup.humiliatingClothes.includes(slave.clothes)) { + } else if (slave.fetish === "humiliation" && isThisHumiliating(slave.clothes)) { if (slave.fetishKnown === 0) { r.push(`${He} pretends to be embarrassed by ${his} extremely revealing clothing but seems to get off on it. <span class="lightcoral">${He}'s into humiliation.</span>`); slave.fetishKnown = 1; @@ -324,7 +324,7 @@ App.SlaveAssignment.clothes = (function() { // humiliating clothing effects if (slave.fetishKnown === 0 || slave.fetish === "none") { - if (setup.humiliatingClothes.includes(slave.clothes)) { + if (isThisHumiliating(slave.clothes)) { if (fetishChangeChance(slave) > jsRandom(0, 100)) { r.push(`Surprisingly, ${he} takes to ${his} extremely revealing clothing, and gets an obvious thrill from it. <span class="lightcoral">${He}'s become a humiliation fetishist!</span>`); slave.fetish = "humiliation"; diff --git a/src/events/eventUtils.js b/src/events/eventUtils.js index 6a117d3f283..1d944f7c58b 100644 --- a/src/events/eventUtils.js +++ b/src/events/eventUtils.js @@ -1,5 +1,5 @@ App.Events.drawEventArt = (function() { - const validSingleOutfits = App.Data.slaveWear.niceClothes.map(c => c.value).concat(App.Data.slaveWear.harshClothes.map(c => c.value)); + const validSingleOutfits = App.Data.clothes.nice.map(c => c.value).concat(App.Data.clothes.harsh.map(c => c.value)); /** draw event art, with the option to dress the slave in a particular way * @param {Node} node - DOM node to attach art to diff --git a/src/facilities/wardrobe/wardrobeShopping.js b/src/facilities/wardrobe/wardrobeShopping.js index c25b749e9cc..42616aafc38 100644 --- a/src/facilities/wardrobe/wardrobeShopping.js +++ b/src/facilities/wardrobe/wardrobeShopping.js @@ -8,8 +8,8 @@ App.UI.WardrobeShopping = function() { let r = []; r.push(`The room containing all the clothes and accessories you have available to dress your slaves in, as well as the supplies and tools your tailor needs to resize them to better fit your slaves. Several mirrors are set up for a slave to try on outfits should they be allowed to dress themselves. The selection includes`); const ownItAll = ( - App.Data.slaveWear.niceClothes.every((i) => isItemAccessible.entry(i.value, "clothing")) && - App.Data.slaveWear.harshClothes.every((i) => isItemAccessible.entry(i.value, "clothing")) + App.Data.clothes.nice.every((i) => isItemAccessible.entry(i.value, "clothing")) && + App.Data.clothes.harsh.every((i) => isItemAccessible.entry(i.value, "clothing")) ); if (ownItAll) { r.push(`outfits from all manner of cultures and societies; not a single style eludes you.`); diff --git a/src/interaction/siWardrobe.js b/src/interaction/siWardrobe.js index 805960ad548..682e044bed6 100644 --- a/src/interaction/siWardrobe.js +++ b/src/interaction/siWardrobe.js @@ -53,7 +53,7 @@ App.UI.SlaveInteract.wardrobe = function(slave) { let clothingOption; // Nice clothes - App.Data.slaveWear.niceClothes.forEach(item => { + App.Data.clothes.nice.forEach(item => { clothingOption = { text: item.name, updateSlave: {clothes: item.value, choosesOwnClothes: 0}, @@ -62,7 +62,7 @@ App.UI.SlaveInteract.wardrobe = function(slave) { niceOptionsArray.push(clothingOption); }); // Harsh clothes - App.Data.slaveWear.harshClothes.forEach(item => { + App.Data.clothes.harsh.forEach(item => { clothingOption = { text: item.name, updateSlave: {clothes: item.value, choosesOwnClothes: 0}, @@ -955,13 +955,12 @@ App.UI.SlaveInteract.wardrobe = function(slave) { /* assuming nice clothes, could actually add some sort of check to make sure. */ /* which clothes have these is decided in miscData.js */ let clothTooltip = Cloth + ""; - if (setup.humiliatingClothes.includes(cloth)) { + if (isThisHumiliating(cloth)) { clothTooltip += ", it's humiliating"; } - if (setup.sluttyClothes.includes(cloth)) { + if (isThisSlutty(cloth)) { clothTooltip += ", it's slutty"; - } - if (setup.modestClothes.includes(cloth)) { + } else { clothTooltip += ", it's modest"; } if (clothTooltip === Cloth + "") { diff --git a/src/js/eventSelectionJS.js b/src/js/eventSelectionJS.js index 7a00f5433c4..5da8ff226b4 100644 --- a/src/js/eventSelectionJS.js +++ b/src/js/eventSelectionJS.js @@ -618,7 +618,7 @@ globalThis.generateRandomEventPoolStandard = function(eventSlave) { if (eventSlave.trust > 20) { if (eventSlave.rules.speech !== "restrictive") { if (eventSlave.choosesOwnClothes !== 1) { - if (setup.modestClothes.includes(eventSlave.clothes)) { + if (!isThisSlutty(eventSlave.clothes)) { V.RESSevent.push("modest clothes"); } } diff --git a/src/js/itemAvailability.js b/src/js/itemAvailability.js index f0c5fc0cb1f..513b80631be 100644 --- a/src/js/itemAvailability.js +++ b/src/js/itemAvailability.js @@ -20,8 +20,8 @@ globalThis.isItemAccessible = (function() { switch (category) { case "clothing": case "clothes": - niceDB = App.Data.slaveWear.niceClothes; - harshDB = App.Data.slaveWear.harshClothes; + niceDB = App.Data.clothes.nice; + harshDB = App.Data.clothes.harsh; break; case "collar": niceDB = App.Data.slaveWear.niceCollars; @@ -68,7 +68,7 @@ globalThis.isItemAccessible = (function() { } /** * Returns array of wearable clothing in format [name, value], basically player facing / game data. - * @param {Array} db Array to look in (such as App.Data.slaveWear.niceClothes) + * @param {Array} db Array to look in (such as App.Data.clothes.nice) * @returns {Array} */ function array(db) { diff --git a/src/js/rulesAssistantOptions.js b/src/js/rulesAssistantOptions.js index ccc8b24aa8f..b6b68cb5862 100644 --- a/src/js/rulesAssistantOptions.js +++ b/src/js/rulesAssistantOptions.js @@ -1806,11 +1806,11 @@ globalThis.rulesAssistantOptions = (function() { ]; super("Clothes", items); - const nClothes = isItemAccessible.array(App.Data.slaveWear.niceClothes); + const nClothes = isItemAccessible.array(App.Data.clothes.nice); nClothes.sort(function(a, b) { if (a[0] < b[0]) { return -1; } if (a[0] > b[0]) { return 1; } return 0; }); this._nice = new ListSubSection(this, "Nice", nClothes); - const hClothes = isItemAccessible.array(App.Data.slaveWear.harshClothes); + const hClothes = isItemAccessible.array(App.Data.clothes.harsh); hClothes.sort(function(a, b) { if (a[0] < b[0]) { return -1; } if (a[0] > b[0]) { return 1; } return 0; }); this._harsh = new ListSubSection(this, "Harsh", hClothes); diff --git a/src/js/statsChecker/statsChecker.js b/src/js/statsChecker/statsChecker.js index 461e30fdb14..513a8f869f9 100644 --- a/src/js/statsChecker/statsChecker.js +++ b/src/js/statsChecker/statsChecker.js @@ -472,7 +472,7 @@ globalThis.bimboScore = function(slave) { if (slave.skin === "sun tanned" || slave.skin === "spray tanned") { degree++; } - if (setup.sluttyClothes.includes(slave.clothes)) { + if (isThisSlutty(slave.clothes)) { degree++; } diff --git a/src/js/utilsFC.js b/src/js/utilsFC.js index 779c965102f..f1c7e1ed04f 100644 --- a/src/js/utilsFC.js +++ b/src/js/utilsFC.js @@ -3084,3 +3084,15 @@ App.Utils.alphabetizeIterable = function(iterable) { const clonedArray = (Array.from(iterable)); return clonedArray.sort(compare); }; + +globalThis.isThisSlutty = function(clothing) { + const nice = App.Data.clothes.nice.find(c => c.value === clothing); + const harsh = App.Data.clothes.nice.find(c => c.value === clothing); + return (_.get(nice, "slutty") || _.get(harsh, "slutty")); +}; + +globalThis.isThisHumiliating = function(clothing) { + const nice = App.Data.clothes.nice.find(c => c.value === clothing); + const harsh = App.Data.clothes.nice.find(c => c.value === clothing); + return (_.get(nice, "humiliating") || _.get(harsh, "humiliating")); +}; \ No newline at end of file -- GitLab