diff --git a/src/js/utilJS.js b/src/js/utilJS.js index 882eb2dc6b901908ab2a61af56168227dd3defa7..c06363b153afe4b2a087818432b313afc076431d 100644 --- a/src/js/utilJS.js +++ b/src/js/utilJS.js @@ -935,7 +935,12 @@ window.dickToInchString = function(s) { // takes a dick value e.g. $activeSlave.dick, returns an int of the dick length in cm window.dickToCM = function(s) { - return (s<9?s*5:(s===9?50:s*6)); + if (s < 9) { + return s*5; + } else if (s === 9) { + return 50; + } + return s*6; }; // takes a ball value e.g. $activeSlave.balls, returns a string in the format 3 inches @@ -1620,82 +1625,77 @@ window.randomRaceHair = function(raceName) { window.skinToneLevel = function(skinTone) { if (!setup.naturalSkins.includes(skinTone)) { return undefined; - } else { - let skinNumber; - let skinToMelanin = { - "pure black": 25, - "ebony": 24, - "black": 23, - "dark brown": 22, - "brown": 21, - "light brown": 20, - "dark beige": 19, - "beige": 18, - "light beige": 17, - "dark": 16, - "dark olive": 15, - "bronze": 14, - "olive": 13, - "tan": 12, - "light olive": 11, - "light": 10, - "fair": 9, - "very fair": 8, - "extremely fair": 7, - "pale": 6, - "very pale": 5, - "extremely pale": 4, - "white": 3, - "ivory": 2, - "pure white": 1 - }; - skinNumber = skinToMelanin[skinTone]; - return skinNumber; } + const skinToMelanin = { + "pure black": 25, + "ebony": 24, + "black": 23, + "dark brown": 22, + "brown": 21, + "light brown": 20, + "dark beige": 19, + "beige": 18, + "light beige": 17, + "dark": 16, + "dark olive": 15, + "bronze": 14, + "olive": 13, + "tan": 12, + "light olive": 11, + "light": 10, + "fair": 9, + "very fair": 8, + "extremely fair": 7, + "pale": 6, + "very pale": 5, + "extremely pale": 4, + "white": 3, + "ivory": 2, + "pure white": 1 + }; + return skinToMelanin[skinTone]; }; window.changeSkinTone = function(skin, value) { if (!setup.naturalSkins.includes(skin)) { return skin; - } else { - let skinToMelanin = { - "pure black": 25, - "ebony": 24, - "black": 23, - "dark brown": 22, - "brown": 21, - "light brown": 20, - "dark beige": 19, - "beige": 18, - "light beige": 17, - "dark": 16, - "dark olive": 15, - "bronze": 14, - "olive": 13, - "tan": 12, - "light olive": 11, - "light": 10, - "fair": 9, - "very fair": 8, - "extremely fair": 7, - "pale": 6, - "very pale": 5, - "extremely pale": 4, - "white": 3, - "ivory": 2, - "pure white": 1 - }; - let newSkin = (skinToMelanin[skin] + value); - if (newSkin > 25) { - newSkin = 25; - } else if (newSkin < 1) { - newSkin = 1; - } - let prop = ""; - for (prop in skinToMelanin) { - if (!skinToMelanin.hasOwnProperty(prop)) continue; - if (newSkin >= skinToMelanin[prop]) return prop; - } - return prop; } -}; \ No newline at end of file + const skinToMelanin = { + "pure black": 25, + "ebony": 24, + "black": 23, + "dark brown": 22, + "brown": 21, + "light brown": 20, + "dark beige": 19, + "beige": 18, + "light beige": 17, + "dark": 16, + "dark olive": 15, + "bronze": 14, + "olive": 13, + "tan": 12, + "light olive": 11, + "light": 10, + "fair": 9, + "very fair": 8, + "extremely fair": 7, + "pale": 6, + "very pale": 5, + "extremely pale": 4, + "white": 3, + "ivory": 2, + "pure white": 1 + }; + let newSkin = (skinToMelanin[skin] + value); + if (newSkin > 25) { + newSkin = 25; + } else if (newSkin < 1) { + newSkin = 1; + } + for (prop in skinToMelanin) { + if (!skinToMelanin.hasOwnProperty(prop)) continue; + if (newSkin >= skinToMelanin[prop]) return prop; + } + return prop; +}; diff --git a/src/js/wombJS.js b/src/js/wombJS.js index 4c4969e7602ff829f16536a2abedf8359a67be51..b8a7933835c6c94043fbd699f95693d00d085779 100644 --- a/src/js/wombJS.js +++ b/src/js/wombJS.js @@ -196,7 +196,7 @@ window.WombProgress = function (actor, ageToAdd, realAgeToAdd = ageToAdd) { try { actor.womb.forEach(ft => { ft.age += ageToAdd; - ft.realAge += realAgeToAdd + ft.realAge += realAgeToAdd; }); } catch (err) { WombInit(actor); @@ -750,7 +750,7 @@ data.countLitter[x] = count of fetuses in "x" litter. data.litterData[x] = contain array with actual fetuses that belong to a litter "x". Can be used to check anyithing related to fetus. (This is not copy, but reference to actual fetuses, so be careful with changes of this array). -Sample of usage in SugarScript: +Sample of usage in SugarScript: --- <<set _wd = WombGetLittersData($activeSlave)>> She is _wd.litters[0] weeks pregnant with her first set of _wd.countLitter[0] children<<if _wd.litters > 1>>, _wd.litters[1] weeks along with her second set<</if>><<if _wd.litters > 2>>, _wd.litters[2] and _wd.litters[2] weeks along with her third<</if>>. @@ -783,7 +783,7 @@ window.WombGetLittersData = function (actor) { data.litterData = litterData; return data; -} +}; window.BCReserveInit = function () { var SV = State.variables;