diff --git a/js/003-data/miscData.js b/js/003-data/miscData.js index 59950b47e384d6a125fe36c17c746262d246e00a..a3827577db64ead49252195fc27a1be019b1953d 100644 --- a/js/003-data/miscData.js +++ b/js/003-data/miscData.js @@ -2129,45 +2129,22 @@ App.Data.misc = { {name: "Uncomfortable straps", value: "uncomfortable straps"} ], - /* - // Collars - { name: "Cruel retirement counter", value: "cruel retirement counter", unlock: {seeAge: 1} }, - {name: "bowtie", value: "bowtie", fs: "FSGenderFundamentalist", unlock: {clothesBoughtBunny: 1} , comfort: "nice"}, - {name: "ancient Egyptian", value: "ancient Egyptian", fs: "FSEgyptianRevivalist", unlock: {clothesBoughtEgypt: 1} , comfort: "nice"}, - {name: "massive dildo gag", value: "massive dildo gag", fs: "", unlock: {: 1, : 1} }, - return (V.toysBoughtGags === 1); - - // Shoes - {name: "platform shoes", value: "platform shoes", fs: "FSStatuesqueGlorification", unlock: {shoesBoughtHeels: 1} , comfort: "nice"}, - {name: "platform heels", value: "platform heels", fs: "FSStatuesqueGlorification", unlock: {shoesBoughtHeels: 1} , comfort: "nice"}, - {name: "extreme platform heels", value: "extreme platform heels", fs: "FSStatuesqueGlorification", unlock: {shoesBoughtHeels: 1} , comfort: "nice"}, - - // Belly - {name: "a small empathy belly", value: "a small empathy belly", fs: "", unlock: {: 1, : 1} }, - {name: "a medium empathy belly", value: "a medium empathy belly", fs: "", unlock: {: 1, : 1} }, - {name: "a large empathy belly", value: "a large empathy belly", fs: "", unlock: {: 1, : 1} }, - {name: "a huge empathy belly", value: "a huge empathy belly", fs: "", unlock: {: 1, : 1} }, - return (V.arcologies[0].FSRepopulationFocus > 0 || V.clothesBoughtBelly === 1); - - // Sextoy - {name: "bullet vibrator", value: "bullet vibrator", fs: "", unlock: {: 1, : 1} }, - {name: "smart bullet vibrator", value: "smart bullet vibrator", fs: "", unlock: {: 1, : 1} }, - {name: "long dildo", value: "long dildo", fs: "", unlock: {: 1, : 1} }, - case "long, large dildo": - case "long, huge dildo": - return (V.toysBoughtDildos === 1); - {name: "vibrator", value: "vibrator", fs: "", unlock: {: 1, : 1} }, - return (V.toysBoughtVaginalAttachments === 1); - {name: "long plug", value: "long plug", fs: "", unlock: {: 1, : 1} }, - case "long, large plug": - case "long, huge plug": - return (V.toysBoughtButtPlugs === 1); - {name: "tail", value: "tail", fs: "", unlock: {: 1, : 1} }, - {name: "cow tail", value: "cow tail", fs: "", unlock: {: 1, : 1} }, - {name: "cat tail", value: "cat tail", fs: "", unlock: {: 1, : 1} }, - {name: "fox tail", value: "fox tail", fs: "", unlock: {: 1, : 1} }, - return (V.toysBoughtButtPlugTails === 1); - */ + niceCollars: [ + {name: "Stylish leather", value: "stylish leather"}, + {name: "Satin choker", value: "satin choker"}, + {name: "Silken ribbon", value: "silk ribbon"}, + {name: "Heavy gold", value: "heavy gold"}, + {name: "Pretty jewelry", value: "pretty jewelry"}, + {name: "Nice retirement counter", value: "nice retirement counter", rs: "seeAge"}, + {name: "Bell", value: "bell collar"}, + {name: "Cowbell", value: "leather with cowbell"}, + { + name: "Bowtie collar", value: "bowtie", fs: "FSGenderFundamentalist", rs: "clothesBoughtBunny" +}, + { + name: "Ancient Egyptian", value: "ancient Egyptian", fs: "FSEgyptianRevivalist", rs: "clothesBoughtEgypt" +}, + ], harshCollars: [ {name: "Tight steel", value: "tight steel"}, diff --git a/src/js/itemAvailability.js b/src/js/itemAvailability.js index d6c866328015f93013e22d391b24fd17979341c8..9053b3884c44593cbed941f16d61ce89012f50bc 100644 --- a/src/js/itemAvailability.js +++ b/src/js/itemAvailability.js @@ -211,13 +211,22 @@ window.isClothingAccessible = (function() { * @param {string} string Name of wearable item * @returns {boolean} */ - function entry(string) { + function entry(string, category="clothing") { if (V.cheatMode === 1) { return true; } - let item = App.Data.misc.niceClothes.find((i) => i.value === string); + let niceDB; + let harshDB; + if (category === "clothing") { + niceDB = App.Data.misc.niceClothes; + harshDB = App.Data.misc.harshClothes; + } else if (category === "collar") { + niceDB = App.Data.misc.niceCollars; + harshDB = App.Data.misc.harshCollars; + } + let item = niceDB.find((i) => i.value === string); if (!item) { - item = App.Data.misc.harshClothes.find((i) => i.value === string); + item = harshDB.find((i) => i.value === string); } if (!item) { console.log(`${string} is not a registered piece of clothing! Check App.Data.Misc.`); @@ -243,10 +252,15 @@ window.isClothingAccessible = (function() { return array; } function isAvailable(item) { - if (!(item.hasOwnProperty("unlock")) && !(item.hasOwnProperty("fs"))) { + if (!(item.hasOwnProperty("unlock")) && !(item.hasOwnProperty("fs")) && !(item.hasOwnProperty("rs"))) { // No restriction, this clothing item is available to everyone return true; } + if (item.hasOwnProperty("rs")) { + if (V.arcologies[0][item.rs] > 0) { + return true; + } + } if (item.hasOwnProperty("fs")) { if (V.arcologies[0][item.fs] > 0) { return true; diff --git a/src/js/wardrobeUse.js b/src/js/wardrobeUse.js index 6ff864ee5edf6f039c2fe835a23842b0d00b9134..f7dea2a3f401f1e11ca7a8988377c623d5a44d4b 100644 --- a/src/js/wardrobeUse.js +++ b/src/js/wardrobeUse.js @@ -95,7 +95,7 @@ App.UI.Wardrobe.clothes = function(slave) { break; } } - if (array[i].updateSlave.clothes === `choosing her own clothes` || isClothingAccessible.entry(array[i].updateSlave.clothes)) { + if (array[i].updateSlave.clothes === `choosing her own clothes` || isClothingAccessible.entry(array[i].updateSlave.clothes, "clothing")) { // is it just text? if (array[i].disabled) { link = App.UI.DOM.disabledLink(array[i].text, [array[i].disabled]); @@ -154,8 +154,157 @@ App.UI.Wardrobe.clothes = function(slave) { } }; +App.UI.Wardrobe.collar = function(slave) { + if (slave.fuckdoll !== 0) { + return; + } + + const + { + // eslint-disable-next-line no-unused-vars + he, him, his, hers, himself, boy, He, His + } = getPronouns(slave); + + let choiceOptionsArray= []; + choiceOptionsArray.push({text: `None`, updateSlave: {collar: `none`}}); + + let niceOptionsArray= []; + let harshOptionsArray= []; + + let clothingOption; + // Nice collar + App.Data.misc.niceCollars.forEach(item => { + clothingOption = { + text: item.name, + updateSlave: {collar: item.value} + }; + if (item.fs) { + clothingOption.FS = item.fs; + } + niceOptionsArray.push(clothingOption); + }); + // Harsh collar + App.Data.misc.harshCollars.forEach(item => { + clothingOption = { + text: item.name, + updateSlave: {collar: item.value} + }; + if (item.fs) { + clothingOption.FS = item.fs; + } + harshOptionsArray.push(clothingOption); + }); + + // Sort + niceOptionsArray = niceOptionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1); + harshOptionsArray = harshOptionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1); + + let el = document.createElement('div'); + + let label = document.createElement('div'); + label.append(`Collar: `); + + let choice = document.createElement('span'); + choice.style.fontWeight = "bold"; + choice.textContent = (`${slave.collar} `); + label.appendChild(choice); + + // Choose her own + label.appendChild(generateRows(choiceOptionsArray)); + + el.appendChild(label); + + + // Nice options + let links = document.createElement('div'); + links.className = "choices"; + links.append(`Nice: `); + links.appendChild(generateRows(niceOptionsArray)); + el.appendChild(links); + + // Harsh options + links = document.createElement('div'); + links.className = "choices"; + links.append(`Harsh: `); + links.appendChild(generateRows(harshOptionsArray)); + el.appendChild(links); + + return jQuery('#collar').empty().append(el); + + + function generateRows(array) { + let row = document.createElement('span'); + for (let i = 0; i < array.length; i++) { + let link; + const separator = document.createTextNode(` | `); + const keys = Object.keys(array[i]); + + // Test to see if there was a problem with the key + for (let j = 0; j < keys.length; j++) { + if (["FS", "text", "updateSlave", "update", "note", "disabled"].includes(keys[j])) { + continue; + } else { + array[i].text += " ERROR, THIS SCENE WAS NOT ENTERED CORRECTLY"; + console.log("Trash found while generateRows() was running: " + keys[j] + ": " + array[i][keys[j]]); + break; + } + } + if (array[i].updateSlave.collar === `none` || isClothingAccessible.entry(array[i].updateSlave.collar, "collar")) { + // is it just text? + if (array[i].disabled) { + link = App.UI.DOM.disabledLink(array[i].text, [array[i].disabled]); + } else { + link = document.createElement('span'); + + // Set up the link + link.appendChild( + App.UI.DOM.link( + `${array[i].text} `, + () => { click(array[i]); }, + ) + ); + + if (array[i].FS) { + let FS = array[i].FS.substring(2); // Given "FSEdoRevivalist", cut off the first two letters to start a user friendly tooltip + FS = FS.replace(/([A-Z])/g, ` $1`); // Given "EdoRevivalist", find every capital letter and put a space in front of it + FS = App.UI.DOM.disabledLink(`FS`, [FS]); // Tooltip should read "Edo Revivalist" + FS.style.fontStyle = "italic"; + link.appendChild(FS); + } + + // add a note node if required + if (array[i].note) { + let note = document.createElement('span'); + note.textContent = (` ${array[i].note}`); + note.className = "note"; + link.appendChild(note); + } + } + row.appendChild(link); + if (i < array.length-1) { + row.appendChild(separator); + } + } + } + + return row; + + function click(arrayOption) { + if (arrayOption.updateSlave) { + Object.assign(slave, arrayOption.updateSlave); + } + if (arrayOption.update) { + Object.assign(V, arrayOption.update); + } + App.UI.Wardrobe.refreshAll(slave); + return; + } + } +}; + App.UI.Wardrobe.refreshAll = function(slave) { App.UI.Wardrobe.clothes(slave); + App.UI.Wardrobe.collar(slave); return; }; diff --git a/src/uncategorized/slaveInteract.tw b/src/uncategorized/slaveInteract.tw index ecb00de61111f6bfc8d08be44145bc12dbc60ff7..eafafbf507d0aeba361a0d1ff8c3f80567fb61ac 100644 --- a/src/uncategorized/slaveInteract.tw +++ b/src/uncategorized/slaveInteract.tw @@ -198,47 +198,9 @@ <span id="clothes"></span> <script>App.UI.Wardrobe.clothes(V.activeSlave)</script> <</if>> - Collar: ''<span id="collar">$activeSlave.collar</span>.'' - <<link "None">><<set $activeSlave.collar = "none">><<replace "#collar">>$activeSlave.collar<</replace>><</link>> - <br> //Nice:// - <<link "Stylish leather">><<set $activeSlave.collar = "stylish leather">><<replace "#collar">>$activeSlave.collar<</replace>><</link>> - | <<link "Satin choker">><<set $activeSlave.collar = "satin choker">><<replace "#collar">>$activeSlave.collar<</replace>><</link>> - | <<link "Silken ribbon">><<set $activeSlave.collar = "silk ribbon">><<replace "#collar">>$activeSlave.collar<</replace>><</link>> - | <<link "Heavy gold">><<set $activeSlave.collar = "heavy gold">><<replace "#collar">>$activeSlave.collar<</replace>><</link>> - | <<link "Pretty jewelry">><<set $activeSlave.collar = "pretty jewelry">><<replace "#collar">>$activeSlave.collar<</replace>><</link>> - <<if ($seeAge != 0)>> - | <<link "Nice retirement counter">><<set $activeSlave.collar = "nice retirement counter">><<replace "#collar">>$activeSlave.collar<</replace>><</link>> - <</if>> - | <<link "Bell">><<set $activeSlave.collar = "bell collar">><<replace "#collar">>$activeSlave.collar<</replace>><</link>> - | <<link "Cowbell">><<set $activeSlave.collar = "leather with cowbell">><<replace "#collar">>$activeSlave.collar<</replace>><</link>> - <<if isItemAccessible("bowtie")>> - | //FS// <<link "Bowtie collar">><<set $activeSlave.collar = "bowtie">><<replace "#collar">>$activeSlave.collar<</replace>><</link>> - <</if>> - <<if isItemAccessible("ancient Egyptian")>> - | //FS// <<link "Ancient Egyptian">><<set $activeSlave.collar = "ancient Egyptian">><<replace "#collar">>$activeSlave.collar<</replace>><</link>> - <</if>> - <br> //Harsh:// - <<link "Tight steel">><<set $activeSlave.collar = "tight steel">><<replace "#collar">>$activeSlave.collar<</replace>><</link>> - <<if ($seeAge != 0)>> - | <<link "Cruel retirement counter">><<set $activeSlave.collar = "cruel retirement counter">><<replace "#collar">>$activeSlave.collar<</replace>><</link>> - <</if>> - | <<link "Uncomfortable leather">><<set $activeSlave.collar = "uncomfortable leather">><<replace "#collar">>$activeSlave.collar<</replace>><</link>> - <<if $activeSlave.preg > -1 && ($activeSlave.ovaries == 1 || $activeSlave.mpreg == 1) && $seePreg != 0>> - | <<link "Pregnancy biometrics">><<set $activeSlave.collar = "preg biometrics">><<replace "#collar">>$activeSlave.collar<</replace>><</link>> - <</if>> - | <<link "Shock punishment">><<set $activeSlave.collar = "shock punishment">><<replace "#collar">>$activeSlave.collar<</replace>><</link>> - | <<link "Dildo gag">><<set $activeSlave.collar = "dildo gag">><<replace "#collar">>$activeSlave.collar<</replace>><</link>> - <<if isItemAccessible("massive dildo gag")>> - <<if $activeSlave.skill.oral > 50>> - | <<link "Massive dildo gag">><<set $activeSlave.collar = "massive dildo gag">><<replace "#collar">>$activeSlave.collar<</replace>><</link>> - <<else>> - | Massive dildo gag - <</if>> - <</if>> - | <<link "Ball gag">><<set $activeSlave.collar = "ball gag">><<replace "#collar">>$activeSlave.collar<</replace>><</link>> - | <<link "Bit gag">><<set $activeSlave.collar = "bit gag">><<replace "#collar">>$activeSlave.collar<</replace>><</link>> - | <<link "Neck corset">><<set $activeSlave.collar = "neck corset">><<replace "#collar">>$activeSlave.collar<</replace>><</link>> - | <<link "Porcelain mask">><<set $activeSlave.collar = "porcelain mask">><<replace "#collar">>$activeSlave.collar<</replace>><</link>> + + <span id="collar"></span> + <script>App.UI.Wardrobe.collar(V.activeSlave)</script> <<if hasAnyArms($activeSlave)>> <br>Arm accessory: ''<span id="armAccessory">$activeSlave.armAccessory</span>.''