From 56284e7bab673ee20aa446e8e89f2e2d20b5661a Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Wed, 19 Feb 2020 18:57:38 -0500 Subject: [PATCH] move old variables to new function system fix --- js/003-data/miscData.js | 336 ++++++++++++++++++++++++++----------- src/js/itemAvailability.js | 26 +-- src/js/wardrobeUse.js | 7 +- 3 files changed, 250 insertions(+), 119 deletions(-) diff --git a/js/003-data/miscData.js b/js/003-data/miscData.js index fdff05b911f..b1c46086059 100644 --- a/js/003-data/miscData.js +++ b/js/003-data/miscData.js @@ -1912,180 +1912,288 @@ App.Data.misc = { name: "Maternity lingerie", value: "attractive lingerie for a pregnant woman", fs: "FSRepopulationFocus", - unlock: {clothesBoughtMaternityLingerie: 1} + unlock: function(slave) { if (V.clothesBoughtMaternityLingerie > 0) { return true; } } }, { name: "Bunny outfit", value: "a bunny outfit", fs: "FSGenderFundamentalist", - unlock: {clothesBoughtBunny: 1} + unlock: function(slave) { if (V.clothesBoughtBunny > 0) { return true; } } }, { name: "Body oil", value: "body oil", fs: "FSPhysicalIdealist", - unlock: {clothesBoughtOil: 1} + unlock: function(slave) { if (V.clothesBoughtOil > 0) { return true; } } }, { name: "Chattel habit", value: "a chattel habit", fs: "FSChattelReligionist", - unlock: {clothesBoughtHabit: 1} + unlock: function(slave) { if (V.clothesBoughtHabit > 0) { return true; } } }, { name: "Conservative clothing", value: "conservative clothing", fs: "FSPaternalist", - unlock: {clothesBoughtConservative: 1} + unlock: function(slave) { if (V.clothesBoughtConservative > 0) { return true; } } }, { name: "Harem gauze", value: "harem gauze", fs: "FSArabianRevivalist", - unlock: {clothesBoughtHarem: 1} + unlock: function(slave) { if (V.clothesBoughtHarem > 0) { return true; } } }, { name: "Huipil", value: "a huipil", fs: "FSAztecRevivalist", - unlock: {clothesBoughtHuipil: 1} + unlock: function(slave) { if (V.clothesBoughtHuipil > 0) { return true; } } }, { name: "Kimono", value: "a kimono", fs: "FSEdoRevivalist", - unlock: {clothesBoughtKimono: 1, continent: "Japan"} + unlock: function(slave) { + if (V.clothesBoughtKimono > 0 || V.continent === "Japan"){ + return true; + } + } }, { name: "Maternity dress", value: "a maternity dress", fs: "FSRepopulationFocus", - unlock: {clothesBoughtMaternityDress: 1} + unlock: function(slave) { if (V.clothesBoughtMaternityDress > 0) { return true; } } }, { name: "Qipao (slutty)", value: "a slutty qipao", fs: "FSChineseRevivalist", - unlock: {clothesBoughtQipao: 1} + unlock: function(slave) { if (V.clothesBoughtQipao > 0) { return true; } } }, { name: "Qipao (long)", value: "a long qipao", fs: "FSChineseRevivalist", - unlock: {clothesBoughtCultural: 1} + unlock: function(slave) { if (V.clothesBoughtCultural > 0) { return true; } } }, { name: "Stretch pants and a crop-top", value: "stretch pants and a crop-top", fs: "FSHedonisticDecadence", - unlock: {clothesBoughtLazyClothes: 1} + unlock: function(slave) { if (V.clothesBoughtLazyClothes > 0) { return true; } } }, { name: "Toga", value: "a toga", fs: "FSRomanRevivalist", - unlock: {clothesBoughtToga: 1} + unlock: function(slave) { if (V.clothesBoughtToga > 0) { return true; } } }, { name: "Western clothing", value: "Western clothing", fs: "FSPastoralist", - unlock: {clothesBoughtWestern: 1} + unlock: function(slave) { if (V.clothesBoughtWestern > 0) { return true; } } }, { name: "Courtesan dress", value: "a courtesan dress", fs: "FSSlaveProfessionalism", - unlock: {clothesBoughtCourtesan: 1} + unlock: function(slave) { if (V.clothesBoughtCourtesan > 0) { return true; } } }, { name: "Bimbo outfit", value: "a bimbo outfit", fs: "FSIntellectualDependency", - unlock: {clothesBoughtBimbo: 1} + unlock: function(slave) { if (V.clothesBoughtBimbo > 0) { return true; } } }, { name: "Petite admi outfit", value: "petite admi outfit", fs: "FSPetiteAdmiration", - unlock: {clothesBoughtPetite: 1} - }, - {name: "Battlearmor", value: "battlearmor", unlock: {clothesBoughtMilitary: 1}}, - {name: "Military uniform", value: "a military uniform", unlock: {clothesBoughtMilitary: 1}}, - {name: "Red Army uniform", value: "a red army uniform", unlock: {clothesBoughtMilitary: 1}}, - {name: "Battledress", value: "battledress", unlock: {clothesBoughtMilitary: 1}}, - {name: "Biyelgee costume", value: "a biyelgee costume", unlock: {clothesBoughtCultural: 1}}, - {name: "Dirndl", value: "a dirndl", unlock: {clothesBoughtCultural: 1}}, - {name: "Lederhosen", value: "lederhosen", unlock: {clothesBoughtCultural: 1}}, - {name: "Mounty outfit", value: "a mounty outfit", unlock: {clothesBoughtCultural: 1}}, - {name: "Hanbok", value: "a hanbok", unlock: {clothesBoughtCultural: 1}}, - {name: "Burqa", value: "a burqa", unlock: {clothesBoughtMiddleEastern: 1, continent: "the Middle East"}}, - {name: "Niqab and abaya", value: "a niqab and abaya", unlock: {clothesBoughtMiddleEastern: 1, continent: "the Middle East"}}, - {name: "Hijab and blouse", value: "a hijab and blouse", unlock: {clothesBoughtMiddleEastern: 1, clothesBoughtConservative: 1, continent: "the Middle East"}}, - {name: "Burkini", value: "a burkini", unlock: {clothesBoughtMiddleEastern: 1, clothesBoughtSwimwear: 1, continent: "the Middle East"}}, - {name: "Santa dress", value: "a Santa dress", unlock: {clothesBoughtCostume: 1}}, - - {name: "Klan robe", value: "a klan robe", unlock: {clothesBoughtPol: 1}}, - {name: "Slutty klan robe", value: "a slutty klan robe", unlock: {clothesBoughtPol: 1}}, - {name: "Schutzstaffel uniform", value: "a schutzstaffel uniform", unlock: {clothesBoughtPol: 1}}, - {name: "Slutty schutzstaffel uniform", value: "a slutty schutzstaffel uniform", unlock: {clothesBoughtPol: 1}}, - - {name: "Nice business attire", value: "nice business attire", unlock: {clothesBoughtCareer: 1}}, - {name: "Nurse (nice)", value: "a nice nurse outfit", unlock: {clothesBoughtCareer: 1}}, - {name: "Police uniform", value: "a police uniform", unlock: {clothesBoughtCareer: 1}}, - {name: "Maid (nice)", value: "a nice maid outfit", unlock: {clothesBoughtCareer: 1, "PC.career": "servant"}}, - - {name: "Ballgown", value: "a ball gown", unlock: {clothesBoughtDresses: 1}}, - {name: "Gothic lolita dress", value: "a gothic lolita dress", unlock: {clothesBoughtDresses: 1}}, - - {name: "Cybersuit", value: "a cybersuit", unlock: {clothesBoughtBodysuits: 1}}, - {name: "Latex catsuit", value: "a latex catsuit", unlock: {clothesBoughtBodysuits: 1}}, - - {name: "Button-up shirt and panties", value: "a button-up shirt and panties", unlock: {clothesBoughtCasual: 1}}, - {name: "Button-up shirt", value: "a button-up shirt", unlock: {clothesBoughtCasual: 1}}, - {name: "Cutoffs", value: "cutoffs", unlock: {clothesBoughtCasual: 1}}, - {name: "Jeans", value: "jeans", unlock: {clothesBoughtCasual: 1}}, - {name: "Leather pants and a tube top", value: "leather pants and a tube top", unlock: {clothesBoughtCasual: 1}}, - {name: "Leather pants", value: "leather pants", unlock: {clothesBoughtCasual: 1}}, - {name: "Oversized t-shirt", value: "an oversized t-shirt", unlock: {clothesBoughtCasual: 1}}, - {name: "Sweater and cutoffs", value: "a sweater and cutoffs", unlock: {clothesBoughtCasual: 1}}, - {name: "Sweater and panties", value: "a sweater and panties", unlock: {clothesBoughtCasual: 1}}, - {name: "Sweater", value: "a sweater", unlock: {clothesBoughtCasual: 1}}, - {name: "T-shirt and jeans", value: "a t-shirt and jeans", unlock: {clothesBoughtCasual: 1}}, - {name: "T-shirt and panties", value: "a t-shirt and panties", unlock: {clothesBoughtCasual: 1}}, - {name: "T-shirt", value: "a t-shirt", unlock: {clothesBoughtCasual: 1}}, - {name: "Tank-top and panties", value: "a tank-top and panties", unlock: {clothesBoughtCasual: 1}}, - {name: "Tank-top", value: "a tank-top", unlock: {clothesBoughtCasual: 1}}, - {name: "Tube top", value: "a tube top", unlock: {clothesBoughtCasual: 1}}, - - {name: "Boyshorts", value: "boyshorts", unlock: {clothesBoughtUnderwear: 1}}, - {name: "Bra", value: "a bra", unlock: {clothesBoughtUnderwear: 1}}, - {name: "Kitty lingerie", value: "kitty lingerie", unlock: {clothesBoughtUnderwear: 1}}, - {name: "Panties and pasties", value: "panties and pasties", unlock: {clothesBoughtUnderwear: 1}}, - {name: "Skimpy loincloth", value: "a skimpy loincloth", unlock: {clothesBoughtUnderwear: 1}}, - {name: "Thong", value: "a thong", unlock: {clothesBoughtUnderwear: 1}}, - {name: "Pasties", value: "pasties", unlock: {clothesBoughtUnderwear: 1}}, - - {name: "Leather pants and pasties", value: "leather pants and pasties", unlock: {clothesBoughtUnderwear: 1, clothesBoughtCasual: 1}}, - {name: "T-shirt and thong", value: "a t-shirt and thong", unlock: {clothesBoughtUnderwear: 1, clothesBoughtCasual: 1}}, - {name: "Tube top and thong", value: "a tube top and thong", unlock: {clothesBoughtUnderwear: 1, clothesBoughtCasual: 1}}, - {name: "Oversized t-shirt and boyshorts", value: "an oversized t-shirt and boyshorts", unlock: {clothesBoughtUnderwear: 1, clothesBoughtCasual: 1}}, - - {name: "Sport shorts and a sports bra", value: "sport shorts and a sports bra", unlock: {clothesBoughtSports: 1}}, - {name: "Sport shorts", value: "sport shorts", unlock: {clothesBoughtSports: 1}}, - {name: "Sports bra", value: "a sports bra", unlock: {clothesBoughtSports: 1}}, - - {name: "Sport shorts and a t-shirt", value: "sport shorts and a t-shirt", unlock: {clothesBoughtSports: 1, clothesBoughtCasual: 1}}, // note both unlocks should be met for this one, not just either. - - {name: "Pony outfit (nice)", value: "a nice pony outfit", unlock: {clothesBoughtPony: 1}}, - {name: "Pony outfit (slutty)", value: "a slutty pony outfit", unlock: {clothesBoughtPony: 1}}, - - {name: "Monokini", value: "a monokini", unlock: {clothesBoughtSwimwear: 1}}, - {name: "One-piece swimsuit", value: "a one-piece swimsuit", unlock: {clothesBoughtSwimwear: 1}}, - - {name: "Striped bra", value: "a striped bra", unlock: {clothesBoughtPantsu: 1, continent: "Japan"}}, - {name: "Striped panties", value: "striped panties", unlock: {clothesBoughtPantsu: 1, continent: "Japan"}}, - {name: "Striped underwear", value: "striped underwear", unlock: {clothesBoughtPantsu: 1, continent: "Japan"}}, + unlock: function(slave) { if (V.clothesBoughtPetite > 0) { return true; } } + }, + {name: "Battlearmor", value: "battlearmor", unlock: function(slave) { if (V.clothesBoughtMilitary > 0) { return true; } }}, + {name: "Military uniform", value: "a military uniform", unlock: function(slave) { if (V.clothesBoughtMilitary > 0) { return true; } }}, + {name: "Red Army uniform", value: "a red army uniform", unlock: function(slave) { if (V.clothesBoughtMilitary > 0) { return true; } }}, + {name: "Battledress", value: "battledress", unlock: function(slave) { if (V.clothesBoughtMilitary > 0) { return true; } }}, + {name: "Biyelgee costume", value: "a biyelgee costume", unlock: function(slave) { if (V.clothesBoughtCultural > 0) { return true; } }}, + {name: "Dirndl", value: "a dirndl", unlock: function(slave) { if (V.clothesBoughtCultural > 0) { return true; } }}, + {name: "Lederhosen", value: "lederhosen", unlock: function(slave) { if (V.clothesBoughtCultural > 0) { return true; } }}, + {name: "Mounty outfit", value: "a mounty outfit", unlock: function(slave) { if (V.clothesBoughtCultural > 0) { return true; } }}, + {name: "Hanbok", value: "a hanbok", unlock: function(slave) { if (V.clothesBoughtCultural > 0) { return true; } }}, + { + name: "Burqa", + value: "a burqa", + unlock: function(slave) { + if (V.clothesBoughtMiddleEastern > 0 || V.continent === "the Middle East") { + return true; + } + } + }, + { + name: "Niqab and abaya", + value: "a niqab and abaya", + unlock: function(slave) { + if (V.clothesBoughtMiddleEastern > 0 || V.continent === "the Middle East") { + return true; + } + } + }, + { + name: "Hijab and blouse", + value: "a hijab and blouse", + unlock: function(slave) { + if (V.clothesBoughtConservative > 0 && (V.clothesBoughtMiddleEastern > 0 || V.continent === "the Middle East")){ + return true; + } + } + }, + { + name: "Burkini", + value: "a burkini", + unlock: function(slave) { + if (V.clothesBoughtSwimwear > 0 && (V.clothesBoughtMiddleEastern > 0 || V.continent === "the Middle East")) { + return true; + } + } + }, + {name: "Santa dress", value: "a Santa dress", unlock: function(slave) { if (V.clothesBoughtCostume > 0) { return true; } }}, + + {name: "Klan robe", value: "a klan robe", unlock: function(slave) { if (V.clothesBoughtPol > 0) { return true; } }}, + {name: "Slutty klan robe", value: "a slutty klan robe", unlock: function(slave) { if (V.clothesBoughtPol > 0) { return true; } }}, + {name: "Schutzstaffel uniform", value: "a schutzstaffel uniform", unlock: function(slave) { if (V.clothesBoughtPol > 0) { return true; } }}, + {name: "Slutty schutzstaffel uniform", value: "a slutty schutzstaffel uniform", unlock: function(slave) { if (V.clothesBoughtPol > 0) { return true; } }}, + + {name: "Nice business attire", value: "nice business attire", unlock: function(slave) { if (V.clothesBoughtCareer > 0) { return true; } }}, + {name: "Nurse (nice)", value: "a nice nurse outfit", unlock: function(slave) { if (V.clothesBoughtCareer > 0) { return true; } }}, + {name: "Police uniform", value: "a police uniform", unlock: function(slave) { if (V.clothesBoughtCareer > 0) { return true; } }}, + { + name: "Maid (nice)", + value: "a nice maid outfit", + unlock: function(slave) { + if (V.clothesBoughtCareer > 0 || V.PC.career === "servant") { + return true; + } + } + }, + + {name: "Ballgown", value: "a ball gown", unlock: function(slave) { if (V.clothesBoughtDresses > 0) { return true; } }}, + {name: "Gothic lolita dress", value: "a gothic lolita dress", unlock: function(slave) { if (V.clothesBoughtDresses > 0) { return true; } }}, + + {name: "Cybersuit", value: "a cybersuit", unlock: function(slave) { if (V.clothesBoughtBodysuits > 0) { return true; } }}, + {name: "Latex catsuit", value: "a latex catsuit", unlock: function(slave) { if (V.clothesBoughtBodysuits > 0) { return true; } }}, + + {name: "Button-up shirt and panties", value: "a button-up shirt and panties", unlock: function(slave) { if (V.clothesBoughtCasual > 0) { return true; } }}, + {name: "Button-up shirt", value: "a button-up shirt", unlock: function(slave) { if (V.clothesBoughtCasual > 0) { return true; } }}, + {name: "Cutoffs", value: "cutoffs", unlock: function(slave) { if (V.clothesBoughtCasual > 0) { return true; } }}, + {name: "Jeans", value: "jeans", unlock: function(slave) { if (V.clothesBoughtCasual > 0) { return true; } }}, + {name: "Leather pants and a tube top", value: "leather pants and a tube top", unlock: function(slave) { if (V.clothesBoughtCasual > 0) { return true; } }}, + {name: "Leather pants", value: "leather pants", unlock: function(slave) { if (V.clothesBoughtCasual > 0) { return true; } }}, + {name: "Oversized t-shirt", value: "an oversized t-shirt", unlock: function(slave) { if (V.clothesBoughtCasual > 0) { return true; } }}, + {name: "Sweater and cutoffs", value: "a sweater and cutoffs", unlock: function(slave) { if (V.clothesBoughtCasual > 0) { return true; } }}, + {name: "Sweater and panties", value: "a sweater and panties", unlock: function(slave) { if (V.clothesBoughtCasual > 0) { return true; } }}, + {name: "Sweater", value: "a sweater", unlock: function(slave) { if (V.clothesBoughtCasual > 0) { return true; } }}, + {name: "T-shirt and jeans", value: "a t-shirt and jeans", unlock: function(slave) { if (V.clothesBoughtCasual > 0) { return true; } }}, + {name: "T-shirt and panties", value: "a t-shirt and panties", unlock: function(slave) { if (V.clothesBoughtCasual > 0) { return true; } }}, + {name: "T-shirt", value: "a t-shirt", unlock: function(slave) { if (V.clothesBoughtCasual > 0) { return true; } }}, + {name: "Tank-top and panties", value: "a tank-top and panties", unlock: function(slave) { if (V.clothesBoughtCasual > 0) { return true; } }}, + {name: "Tank-top", value: "a tank-top", unlock: function(slave) { if (V.clothesBoughtCasual > 0) { return true; } }}, + {name: "Tube top", value: "a tube top", unlock: function(slave) { if (V.clothesBoughtCasual > 0) { return true; } }}, + + {name: "Boyshorts", value: "boyshorts", unlock: function(slave) { if (V.clothesBoughtUnderwear > 0) { return true; } }}, + {name: "Bra", value: "a bra", unlock: function(slave) { if (V.clothesBoughtUnderwear > 0) { return true; } }}, + {name: "Kitty lingerie", value: "kitty lingerie", unlock: function(slave) { if (V.clothesBoughtUnderwear > 0) { return true; } }}, + {name: "Panties and pasties", value: "panties and pasties", unlock: function(slave) { if (V.clothesBoughtUnderwear > 0) { return true; } }}, + {name: "Skimpy loincloth", value: "a skimpy loincloth", unlock: function(slave) { if (V.clothesBoughtUnderwear > 0) { return true; } }}, + {name: "Thong", value: "a thong", unlock: function(slave) { if (V.clothesBoughtUnderwear > 0) { return true; } }}, + {name: "Pasties", value: "pasties", unlock: function(slave) { if (V.clothesBoughtUnderwear > 0) { return true; } }}, + + { + name: "Leather pants and pasties", + value: "leather pants and pasties", + unlock: function(slave) { + if (V.clothesBoughtUnderwear > 0 && V.clothesBoughtCasual > 0) { + return true; + } + } + }, + { + name: "T-shirt and thong", + value: "a t-shirt and thong", + unlock: function(slave) { + if (V.clothesBoughtUnderwear > 0 && V.clothesBoughtCasual> 0) { + return true; + } + } + }, + { + name: "Tube top and thong", + value: "a tube top and thong", + unlock: function(slave) { + if (V.clothesBoughtUnderwear > 0 && V.clothesBoughtCasual > 0) { + return true; + } + } + }, + { + name: "Oversized t-shirt and boyshorts", + value: "an oversized t-shirt and boyshorts", + unlock: function(slave) { + if (V.clothesBoughtUnderwear > 0 && V.clothesBoughtCasual > 0) { + return true; + } + } + }, + + {name: "Sport shorts and a sports bra", value: "sport shorts and a sports bra", unlock: function(slave) { if (V.clothesBoughtSports > 0) { return true; } }}, + {name: "Sport shorts", value: "sport shorts", unlock: function(slave) { if (V.clothesBoughtSports > 0) { return true; } }}, + {name: "Sports bra", value: "a sports bra", unlock: function(slave) { if (V.clothesBoughtSports > 0) { return true; } }}, + + { + name: "Sport shorts and a t-shirt", + value: "sport shorts and a t-shirt", + unlock: function(slave) { + if (V.clothesBoughtSports && V.clothesBoughtCasual) { + return true; + } + } + }, + + {name: "Pony outfit (nice)", value: "a nice pony outfit", unlock: function(slave) { if (V.clothesBoughtPony > 0) { return true; } }}, + {name: "Pony outfit (slutty)", value: "a slutty pony outfit", unlock: function(slave) { if (V.clothesBoughtPony > 0) { return true; } }}, + + {name: "Monokini", value: "a monokini", unlock: function(slave) { if (V.clothesBoughtSwimwear > 0) { return true; } }}, + {name: "One-piece swimsuit", value: "a one-piece swimsuit", unlock: function(slave) { if (V.clothesBoughtSwimwear > 0) { return true; } }}, + + { + name: "Striped bra", + value: "a striped bra", + unlock: function(slave) { + if (V.clothesBoughtPantsu > 0 || V.continent === "Japan"){ + return true; + } + } + }, + { + name: "Striped panties", + value: "striped panties", + unlock: function(slave) { + if (V.clothesBoughtPantsu > 0 || V.continent === "Japan"){ + return true; + } + } + }, + { + name: "Striped underwear", + value: "striped underwear", + unlock: function(slave) { + if (V.clothesBoughtPantsu > 0 || continent ==="Japan") { + return true; + } + } + }, // "Normal" things: {name: "Apron", value: "an apron"}, @@ -2120,7 +2228,7 @@ App.Data.misc = { name: "Chains", value: "chains", fs: "FSDegradationist", - unlock: {clothesBoughtChains: 1} + unlock: function(slave) { if (V.clothesBoughtChains > 0) { return true; } } }, {name: "Go naked", value: "no clothing"}, {name: "Penitent nun", value: "a penitent nuns habit"}, @@ -2191,30 +2299,58 @@ App.Data.misc = { {name: "None", value: "none"}, {name: "Tight corset", value: "a corset"}, {name: "Extreme corset", value: "an extreme corset"}, - {name: "Supportive band", value: "a support band"}, + { + name: "Supportive band", + value: "a support band", + unlock: function(slave) { + if (slave.belly > 10000) { + return true; + } + } + }, { name: "1st Trimester belly", value: "a small empathy belly", fs: "FSRepopulationFocus", - rs: "boughtBelly" + rs: "boughtBelly", + unlock: function(slave) { + if (V.boughtBelly > 0 && (slave.belly < 1500 && slave.weight < 130)) { + return true; + } + } }, { name: "2nd Trimester belly", value: "a medium empathy belly", fs: "FSRepopulationFocus", - rs: "boughtBelly" + rs: "boughtBelly", + unlock: function(slave) { + if (V.boughtBelly > 0 || (slave.belly < 1500 && slave.weight < 130)) { + return true; + } + } }, { name: "3rd Trimester belly", value: "a large empathy belly", fs: "FSRepopulationFocus", - rs: "boughtBelly" + rs: "boughtBelly", + unlock: function(slave) { + if (V.boughtBelly > 0 || (slave.belly < 1500 && slave.weight < 130)) { + return true; + } + } }, { name: "3rd Trimester twins belly", value: "a huge empathy belly", fs: "FSRepopulationFocus", - rs: "boughtBelly" + rs: "boughtBelly", + unlock: function(slave) { + if (V.boughtBelly > 0 || (slave.belly < 1500 && slave.weight < 130)) { + return true; + } + } } ], diff --git a/src/js/itemAvailability.js b/src/js/itemAvailability.js index 56c38c033f3..1afbb299350 100644 --- a/src/js/itemAvailability.js +++ b/src/js/itemAvailability.js @@ -211,7 +211,7 @@ window.isClothingAccessible = (function() { * @param {string} string Name of wearable item * @returns {boolean} */ - function entry(string, category="clothing") { + function entry(string, category="clothing", slave) { if (V.cheatMode === 1) { return true; } @@ -249,7 +249,7 @@ window.isClothingAccessible = (function() { console.log(string); return false; /* couldn't be found */ } - return isAvailable(item); + return isAvailable(item, slave); } /** * Returns array of wearable clothing in format [name, value], basically player facing / game data. @@ -268,7 +268,7 @@ window.isClothingAccessible = (function() { }); return array; } - function isAvailable(item) { + function isAvailable(item, slave) { if (!(item.hasOwnProperty("unlock")) && !(item.hasOwnProperty("fs")) && !(item.hasOwnProperty("rs"))) { // No restriction, this clothing item is available to everyone return true; @@ -284,17 +284,17 @@ window.isClothingAccessible = (function() { } } if (item.hasOwnProperty("unlock")) { - let keys = Object.keys(item.unlock); - for (let key in keys) { - if (keys[key] === "continent" && V.continent === item.unlock[keys[key]]) { - return true; - } else if (V[keys[key]] > 0 ) { - return true; + if (typeof item.unlock === 'object') { + let keys = Object.keys(item.unlock); + for (let key in keys) { + if (keys[key] === "continent" && V.continent === item.unlock[keys[key]]) { + return true; + } else if (V[keys[key]] > 0 ) { + return true; + } } - } - // special case where they must both be true - if (item.unlock.clothesBoughtSports && item.unlock.clothesBoughtCasual) { - if (V.clothesBoughtSports && V.clothesBoughtCasual) { + } else if (typeof item.unlock === 'function') { + if (item.unlock(slave)) { return true; } } diff --git a/src/js/wardrobeUse.js b/src/js/wardrobeUse.js index 2d5b6a91c57..14001e59e98 100644 --- a/src/js/wardrobeUse.js +++ b/src/js/wardrobeUse.js @@ -313,11 +313,6 @@ App.UI.Wardrobe.bellyAccessory = function(slave) { if (item.fs) { clothingOption.FS = item.fs; } - if (item.value.endsWith("belly") && (slave.belly >= 1500 && slave.weight >= 130)) { - clothingOption.disabled = `${His} stomach is too big to fit an empathy belly around.`; - } else if (item.value === "a support band" && slave.belly <= 10000) { - clothingOption.disabled = `${His} stomach is too small to need this.`; - } if (item.value !== "none") { // skip none in set, we set the link elsewhere. optionsArray.push(clothingOption); @@ -528,7 +523,7 @@ App.UI.Wardrobe.generateRows = function(array, category, slave, ignoreAccessChec break; } } - if (ignoreAccessCheck === true || isClothingAccessible.entry(array[i].updateSlave[category], `${category}`)) { + if (ignoreAccessCheck === true || isClothingAccessible.entry(array[i].updateSlave[category], `${category}`, slave)) { // is it just text? if (array[i].disabled) { link = App.UI.DOM.disabledLink(array[i].text, [array[i].disabled]); -- GitLab