diff --git a/devNotes/twine JS.txt b/devNotes/twine JS.txt index db8e6256de2674a853cc7cddefd49acf3b1ca445..b39e62f9b44358b8cb0713ed811f67a705d18413 100644 --- a/devNotes/twine JS.txt +++ b/devNotes/twine JS.txt @@ -234,11 +234,11 @@ window.filterInPlace = function(arr, callback, thisArg) { if (typeof FertilityAge == "undefined") { var FertilityAge = { setAge: function (age) { - age = Number(age) - if (age != age) { - return 13; - } else { - return age + age = Number(age); + if (age != age) { + return 13; + } else { + return age; } } }; @@ -851,25 +851,25 @@ window.toJson = function(obj) { window.nippleColor = function(slave) { slave = slave || State.variables.activeSlave; if(slave.skin === 'tanned' || slave.skin === 'fair') { - if(slave.preg > 10 || (slave.birthsTotal > 0 && slave.lactation > 0)) { + if(slave.preg > slave.pregData.normalBirth/4 || (slave.birthsTotal > 0 && slave.lactation > 0)) { return 'dark brown'; } else { return 'pink'; } } else if((slave.skin === 'pale' || slave.race === 'white')) { - if(slave.preg > 10 || (slave.birthsTotal > 0 && slave.lactation > 0)) { + if(slave.preg > slave.pregData.normalBirth/4 || (slave.birthsTotal > 0 && slave.lactation > 0)) { return 'brown'; } else { return 'pink'; } } else if((slave.skin === 'brown' || slave.race === 'black')) { - if(slave.preg > 10 || (slave.birthsTotal > 0 && slave.lactation > 0)) { + if(slave.preg > slave.pregData.normalBirth/4 || (slave.birthsTotal > 0 && slave.lactation > 0)) { return 'black'; } else { return 'dark brown'; } } else { - if(slave.preg > 10 || (slave.birthsTotal > 0 && slave.lactation > 0)) { + if(slave.preg > slave.pregData.normalBirth/4 || (slave.birthsTotal > 0 && slave.lactation > 0)) { return 'dark brown'; } else { return 'brown'; @@ -988,19 +988,6 @@ window.SoftenSexualFlaw = function SoftenSexualFlaw(slave) { slave.sexualFlaw = "none"; }; -window.genUUID = function() { - var d = new Date().getTime(); - if(Date.now){ - d = Date.now(); //high-precision timer - } - var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { - var r = (d + Math.random()*16)%16 | 0; - d = Math.floor(d/16); - return (c=='x' ? r : (r&0x3|0x8)).toString(16); - }); - return uuid; -}; - window.removeFS = function(FS) { const V = State.variables; const arcology = V.arcologies[0]; @@ -1088,203 +1075,78 @@ window.resetFSCredits = function() { /* intended to condense the clothing/toy/etc availability checks into something less asinine */ window.isItemAccessible = function(string) { - const V = State.variables; - if (State.variables.cheatMode === 1){ + if (V.cheatMode === 1){ return true; } else { - switch(string) { + switch (string) { /* no breaks needed because we always return */ case 'attractive lingerie for a pregnant woman': - if ((V.arcologies[0].FSRepopulationFocus > 0) || (V.clothesBoughtMaternityLingerie === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSRepopulationFocus > 0 || V.clothesBoughtMaternityLingerie === 1); case 'a bunny outfit': - if ((V.arcologies[0].FSGenderFundamentalist > 0) || (V.clothesBoughtBunny === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSGenderFundamentalist > 0 || V.clothesBoughtBunny === 1); case 'body oil': - if ((V.arcologies[0].FSPhysicalIdealist > 0) || (V.clothesBoughtOil === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSPhysicalIdealist > 0 || V.clothesBoughtOil === 1); case 'chains': - if ((V.arcologies[0].FSDegradationist > 0) || (V.clothesBoughtChains === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSDegradationist > 0 || V.clothesBoughtChains === 1); case 'a chattel habit': - if ((V.arcologies[0].FSChattelReligionist > 0) || (V.clothesBoughtHabit === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSChattelReligionist > 0 || V.clothesBoughtHabit === 1); case 'conservative clothing': - if ((V.arcologies[0].FSPaternalist > 0) || (V.clothesBoughtConservative === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSPaternalist > 0 || V.clothesBoughtConservative === 1); case 'harem gauze': - if ((V.arcologies[0].FSArabianRevivalist > 0) || (V.clothesBoughtHarem === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSArabianRevivalist > 0 || V.clothesBoughtHarem === 1); case 'a huipil': - if ((V.arcologies[0].FSAztecRevivalist > 0) || (V.clothesBoughtHuipil === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSAztecRevivalist > 0 || V.clothesBoughtHuipil === 1); case 'a kimono': - if ((V.arcologies[0].FSEdoRevivalist > 0) || (V.clothesBoughtKimono === 1) || (V.continent === 'Japan')) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSEdoRevivalist > 0 || V.clothesBoughtKimono === 1 || V.continent === 'Japan'); case 'a maternity dress': - if ((V.arcologies[0].FSRepopulationFocus > 0) || (V.clothesBoughtMaternityDress === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSRepopulationFocus > 0 || V.clothesBoughtMaternityDress === 1); case 'a slutty qipao': - if ((V.arcologies[0].FSChineseRevivalist > 0) || (V.clothesBoughtQipao === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSChineseRevivalist > 0 || V.clothesBoughtQipao === 1); case 'a long qipao': - if ((V.arcologies[0].FSChineseRevivalist > 0) || (V.clothesBoughtCultural === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSChineseRevivalist > 0 || V.clothesBoughtCultural === 1); case 'stretch pants and a crop-top': - if ((V.arcologies[0].FSHedonisticDecadence > 0) || (V.clothesBoughtLazyClothes === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSHedonisticDecadence > 0 || V.clothesBoughtLazyClothes === 1); case 'a toga': - if ((V.arcologies[0].FSRomanRevivalist > 0) || (V.clothesBoughtToga === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSRomanRevivalist > 0 || V.clothesBoughtToga === 1); case 'Western clothing': - if ((V.arcologies[0].FSPastoralist > 0) || (V.clothesBoughtWestern === 1)) { - return true; - } else { - return false; - } - break; - + return (V.arcologies[0].FSPastoralist > 0 || V.clothesBoughtWestern === 1); case 'battlearmor': case 'a military uniform': case 'a red army uniform': case 'battledress': - if (V.clothesBoughtMilitary === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtMilitary === 1); case 'a biyelgee costume': case 'a dirndl': case 'lederhosen': case 'a mounty outfit': case 'a hanbok': - if (V.clothesBoughtCultural === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtCultural === 1); case 'a burqa': case 'a burkini': case 'a blouse and hijab': case 'a niqab and abaya': - if (V.clothesBoughtMiddleEastern === 1 || V.continent === 'the Middle East') { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtMiddleEastern === 1 || V.continent === 'the Middle East'); case 'a klan robe': case 'a slutty klan robe': case 'a schutzstaffel uniform': case 'a slutty schutzstaffel uniform': - if (V.clothesBoughtPol === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtPol === 1); case 'a nice nurse outfit': case 'a police uniform': case 'nice business attire': - if (V.clothesBoughtCareer === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtCareer === 1); case 'a nice maid outfit': - if (V.clothesBoughtCareer === 1 || V.PC.career === 'servant') { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtCareer === 1 || V.PC.career === 'servant'); case 'a ball gown': case 'a gothic lolita dress': //case 'a halter top dress': //case 'a mini dress': //case 'a slave gown': - if (V.clothesBoughtDresses === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtDresses === 1); case 'a cybersuit': case 'a latex catsuit': - if (V.clothesBoughtBodysuits === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtBodysuits === 1); case 'a button-up shirt and panties': case 'a button-up shirt': case 'cutoffs': @@ -1301,136 +1163,61 @@ window.isItemAccessible = function(string) { case 'a tank-top and panties': case 'a tank-top': case 'a tube top': - if (V.clothesBoughtCasual === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtCasual === 1); case 'boyshorts': case 'a bra': case 'kitty lingerie': case 'panties and pasties': case 'a skimpy loincloth': case 'a thong': - if (V.clothesBoughtUnderwear === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtUnderwear === 1); case 'leather pants and pasties': case 'a t-shirt and thong': case 'a tube top and thong': case 'an oversized t-shirt and boyshorts': - if (V.clothesBoughtUnderwear === 1 && V.clothesBoughtCasual === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtUnderwear === 1 && V.clothesBoughtCasual === 1); case 'sport shorts and a sports bra': case 'sport shorts': case 'a sports bra': - if (V.clothesBoughtSports === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtSports === 1); case 'sport shorts and a t-shirt': - if (V.clothesBoughtSports === 1 && V.clothesBoughtCasual === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtSports === 1 && V.clothesBoughtCasual === 1); case 'a nice pony outfit': case 'a slutty pony outfit': - if (V.clothesBoughtPony === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtPony === 1); case 'a monokini': case 'a one-piece swimsuit': - if (V.clothesBoughtSwimwear === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtSwimwear === 1); case 'shimapan panties': case 'a striped bra': case 'striped panties': case 'striped underwear': - if (V.clothesBoughtPantsu === 1 || V.continent === 'Japan') { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtPantsu === 1 || V.continent === 'Japan'); case 'bowtie': - if ((V.arcologies[0].FSGenderFundamentalist > 0) || (V.clothesBoughtBunny === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSGenderFundamentalist > 0 || V.clothesBoughtBunny === 1); case 'ancient Egyptian': - if ((V.arcologies[0].FSEgyptianRevivalist > 0) || (V.clothesBoughtEgypt === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSEgyptianRevivalist > 0 || V.clothesBoughtEgypt === 1); case 'massive dildo gag': - if (V.toysBoughtGags === 1) { - return true; - } else { - return false; - } - break; - case 'a small empathy belly': case 'a medium empathy belly': case 'a large empathy belly': case 'a huge empathy belly': - if ((V.arcologies[0].FSRepopulationFocus > 0) || (V.clothesBoughtBelly === 1)) { - return true; - } else { - return false; - } - break; - case 'long dildo': case 'long, large dildo': case 'long, huge dildo': - if (V.toysBoughtDildos === 1) { - return true; - } else { - return false; - } - break; - case 'long plug': case 'long, large plug': case 'long, huge plug': - if (V.toysBoughtButtPlugs === 1) { - return true; - } else { - return false; - } - break; - case 'tail': case 'cat tail': case 'fox tail': - if (V.toysBoughtButtPlugTails === 1) { - return true; - } else { - return false; - } - break; + return (V.toysBoughtGags === 1); + case 'a small empathy belly': + case 'a medium empathy belly': + case 'a large empathy belly': + case 'a huge empathy belly': + return (V.arcologies[0].FSRepopulationFocus > 0 || V.clothesBoughtBelly === 1); + case 'long dildo': + case 'long, large dildo': + case 'long, huge dildo': + return (V.toysBoughtDildos === 1); + case 'long plug': + case 'long, large plug': + case 'long, huge plug': + return (V.toysBoughtButtPlugs === 1); + case 'tail': + case 'cat tail': + case 'fox tail': + return (V.toysBoughtButtPlugTails === 1); default: return true; - break; } } }; @@ -1701,7 +1488,7 @@ window.relativeTerm = function(slave1, slave2) { /*:: pregJS [script]*/ -//* Major props to the anons who worked together to forge the Super Pregnancy Project. Let your legacy go unforgotten.*/ +/* Major props to the anons who worked together to forge the Super Pregnancy Project. Let your legacy go unforgotten.*/ window.getPregBellySize = function(s) { var gestastionWeek = s.preg; var fetuses = s.pregType; @@ -1723,25 +1510,25 @@ window.bellyAdjective = function(slave) { slave = slave || State.variables.activeSlave; if(slave.belly >= 1500) { if(slave.belly >= 1000000) { - if(slave.preg > 10) { + if(slave.preg > slave.pregData.normalBirth/4) { return 'unfathomably distended, brimming with life'; } else { return 'unfathomable'; } } else if(slave.belly >= 750000) { - if(slave.preg > 10) { + if(slave.preg > slave.pregData.normalBirth/4) { return 'monolithic bulging'; } else { return 'monolithic'; } } else if(slave.belly >= 600000) { - if(slave.preg > 10) { + if(slave.preg > slave.pregData.normalBirth/4) { return 'titanic bulging'; } else { return 'titanic'; } } else if(slave.belly >= 450000) { - if(slave.preg > 10) { + if(slave.preg > slave.pregData.normalBirth/4) { return 'gigantic bulgy'; } else { return 'gigantic'; @@ -1760,15 +1547,26 @@ window.bellyAdjective = function(slave) { } else { return ''; } -} +}; /* calculates and returns expected ovum count during conception*/ window.setPregType = function(actor) { /* IMHO rework is posssible. Can be more interesting to play, if this code will take in account more body conditions - age, fat, food, hormone levels, etc. */ - var ovum = 1; + var ovum = jsRandom(actor.pregData.normalOvaMin, actor.pregData.normalOvaMax); //for default human profile it's always 1. var fertilityStack = 0; // adds an increasing bonus roll for stacked fertility drugs + /* Suggestion for better animal pregnancy support - usage of another variable then ovum for fertility drugs bonus, and then adding actor.pregData.drugsEffect multiplier to it before adding to ovum. Example: + + var bonus = 0; + + ... (code below where ovum changed to bonus) + + bonus *= actor.pregData.drugsEffect; + ovum += bonus; + + */ + if(actor.broodmother < 1) { // Broodmothers should be not processed here. Necessary now. if(typeof actor.readyOva == "number" && actor.readyOva != 0) { ovum = actor.readyOva; //just single override; for delayed impregnation cases @@ -1859,7 +1657,7 @@ window.setPregType = function(actor) { } } return ovum; -} +}; /* Penetrative ability, ability to become pregnant, and canBreed() must be checked outside of this. Designed to assume .eggType == "human". @@ -1929,17 +1727,17 @@ window.knockMeUp = function(target, chance, hole, fatherID, displayOverride) { } } return r; -} +}; window.getIncubatorReserved = function(slaves) { return FetusGlobalReserveCount("incubator"); -} +}; window.getNurseryReserved = function (slaves) { return FetusGlobalReserveCount("nursery"); -} +}; window.findFather = function(fatherID) { let father; @@ -1958,13 +1756,13 @@ window.findFather = function(fatherID) { } return father; -} +}; window.adjustFatherProperty = function(actor, property, newValue) { let father = findFather(actor.ID); if (father) father[property] = newValue; -} +}; /* OLD window.adjustFatherProperty = function(actor, property, newValue) { @@ -1994,7 +1792,7 @@ window.adjustFatherProperty = function(actor, property, newValue) { /* not to be used until that last part is defined. It may become slave.boobWomb.volume or some shit */ window.getBaseBoobs = function(slave) { return slave.boobs-slave.boobsImplant-slave.boobsWombVolume; -} +}; /*:: SetBellySize [script]*/ @@ -2660,7 +2458,7 @@ window.getSlaveCost = function(s) { if(s.lactation > 0) { cost += foodCost * s.lactation * (1 + Math.trunc(s.boobs/10000)); } - if(s.preg > 5) { + if(s.preg > s.pregData.normalBirth/8) { if(s.assignment === Job.DAIRY && State.variables.dairyFeedersSetting > 0) { // Extra feeding costs to support pregnancy are covered by dairy feeders. // TODO: Include them here anyway? @@ -2741,7 +2539,7 @@ window.getSlaveCost = function(s) { cost += 50; } if((s.assignment !== Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment !== Job.ARCADE)) { - if(s.preg > 35 && State.variables.universalRulesBirthing === 1) { + if(s.preg > s.pregData.minLiveBirth && State.variables.universalRulesBirthing === 1) { cost += 50; } } @@ -2803,7 +2601,7 @@ window.getSlaveCost = function(s) { cost += drugsCost * 5; break; case 'sag-B-gone': - cost += Math.trunc(drugsCost * .1); + cost += Math.trunc(drugsCost * .1); break; case 'no drugs': case 'none': break; @@ -2890,11 +2688,11 @@ window.initFacilityStatistics = function(facility) { facility.profit = 0; facility.income = new Map(); return facility; -} +}; Number.prototype.toFixedHTML = function() { return commaNum(Number.prototype.toFixed.apply(this, arguments)).replace(/\.0+$/, '<span style="opacity: 0.3">$&</span>'); -} +}; /*:: rulesAssistant [script]*/ @@ -3451,7 +3249,7 @@ window.Height = (function(){ "Finnish": 165.90, "French Guianan": 157, "French Polynesian": 164.52, "French": 164.88, "Gabonese": 158.84, "Gambian": 160.93, "Georgian": 162.98, "German": 165.86, "Ghanan": 157.91, "Greek": 164.87, "Greenlandic": 161.55, "Grenadian": 164.51, "Guamanian": 153.7, "Guatemalan": 149.39, "Guinean": 157.80, "Guyanese": 157.92, "Haitian": 158.72, "Honduran": 153.84, "Hungarian": 163.66, "I-Kiribati": 157.00, "Icelandic": 165.95, "Indian": 152.59, "Indonesian": 152.80, "Iranian": 159.67, "Iraqi": 158.67, "Irish": 165.11, "Israeli": 161.80, "Italian": 164.61, "Ivorian": 158.07, - "Jamaican": 163.12, "Japanese": 158.31, "Jordanian": 158.83, "Kazakh": 158.58, "Kenyan": 158.16, "Kittitian": 159.20, "Korean": 160.65, "Kosovan": 165.72, "Kurdish": 165, "Kuwaiti": 159.43, + "Jamaican": 163.12, "Japanese": 158.31, "Jordanian": 158.83, "Kazakh": 158.58, "Kenyan": 158.16, "Kittitian": 159.20, "Korean": 160.65, "Kosovan": 165.7, "Kurdish": 165, "Kuwaiti": 159.43, "Kyrgyz": 159.35, "Laotian": 151.28, "Latvian": 169.80, "Lebanese": 162.43, "Liberian": 157.3, "Libyan": 162.08, "a Liechtensteiner": 164.3, "Lithuanian": 166.61, "Luxembourgian": 164.43, "Macedonian": 159.75, "Malagasy": 151.18, "Malawian": 154.40, "Malaysian": 156.30, "Maldivian": 155.02, "Malian": 160.47, "Maltese": 160.85, "Marshallese": 151.31, "Mauritanian": 157.72, "Mauritian": 157.24, "Mexican": 156.85, "Micronesian": 156.09, "Moldovan": 163.24, "Monégasque": 164.61, "Mongolian": 158.22, "Montenegrin": 164.86, "Moroccan": 157.82, "Mosotho": 155.71, @@ -3478,7 +3276,7 @@ window.Height = (function(){ "French Guianan": 168, "French Polynesian": 177.41, "French": 179.74, "Gabonese": 167.94, "Gambian": 165.40, "Georgian": 174.34, "German": 179.88, "Ghanan": 168.85, "Greek": 177.32, "Greenlandic": 174.87, "Grenadian": 176.97, "Guamanian": 169.8, "Guatemalan": 163.41, "Guinean": 167.54, "Guyanese": 170.21, "Haitian": 172.64, "Honduran": 166.39, "Hungarian": 177.26, "I-Kiribati": 169.20, "Icelandic": 180.49, "Indian": 164.95, "Indonesian": 163.55, "Iranian": 170.3, "Iraqi": 170.43, "Irish": 178.93, "Israeli": 176.86, "Italian": 177.77, "Ivorian": 166.53, "Jamaican": 174.53, "Japanese": 170.82, "Jordanian": 171.03, - "Kazakh": 171.14, "Kenyan": 169.64, "Kittitian": 169.62, "Korean": 173.46, "Kosovan": 179.52, "Kurdish": 175, "Kuwaiti": 172.07, "Kyrgyz": 171.24, "Laotian": 160.52, "Latvian": 181.42, "Lebanese": 174.39, + "Kazakh": 171.14, "Kenyan": 169.64, "Kittitian": 169.62, "Korean": 173.46, "Kosovan": 179.5, "Kurdish": 175, "Kuwaiti": 172.07, "Kyrgyz": 171.24, "Laotian": 160.52, "Latvian": 181.42, "Lebanese": 174.39, "Liberian": 163.66, "Libyan": 173.53, "a Liechtensteiner": 175.4, "Lithuanian": 179.03, "Luxembourgian": 177.86, "Macedonian": 178.33, "Malagasy": 161.55, "Malawian": 166, "Malaysian": 167.89, "Maldivian": 167.68, "Malian": 171.3, "Maltese": 173.32, "Marshallese": 162.81, "Mauritanian": 163.28, "Mauritian": 170.50, "Mexican": 169.01, "Micronesian": 168.51, "Moldovan": 175.49, "Monégasque": 177.77, "Mongolian": 169.07, "Montenegrin": 178.28, "Moroccan": 170.40, "Mosotho": 165.59, "Motswana": 171.63, "Mozambican": 164.80, "Namibian": 166.96, "Nauruan": 167.83, @@ -3877,17 +3675,6 @@ window.jsEither = function(choices) { return choices[index]; }; -//This function is alternative to clone - usage needed if nested objects present. Slower but result is separate object tree, not with reference to source object. -window.deepCopy = function (o) { - var output, v, key; - output = Array.isArray(o) ? [] : {}; - for (key in o) { - v = o[key]; - output[key] = (typeof v === "object") ? deepCopy(v) : v; - } - return output; -}; - /* Make everything waiting for this execute. Usage: @@ -3952,16 +3739,15 @@ window.between = function between(a, low, high) { return (a > low && a < high); }; -// generate a random, almost unique ID -// if two are generated the same second every second, -// duplicates appear approximately once every 100 trillion years -// this is ~7000 times the age of the universe +// generate a random, almost unique ID that is compliant (possibly) with RFC 4122 window.generateNewID = function generateNewID() { - let randint = ""; - for(let i = 0; i < 12; i++) - randint += jsEither("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); - const timestamp = Date.now(); - return (randint + timestamp.toString(36)); + let date = Date.now(); //high-precision timer + let uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { + let r = (date + Math.random()*16)%16 | 0; + date = Math.floor(date/16); + return (c=='x' ? r : (r & 0x3 | 0x8)).toString(16); + }); + return uuid; }; window.arraySwap = function arraySwap(array, a, b) { @@ -4401,11 +4187,11 @@ window.ordinalSuffix = function ordinalSuffix(i) { return i + "rd"; } return i + "th"; -} +}; window.removeDuplicates = function removeDuplicates(array) { return [...new Set(array)]; -} +}; /*:: Span Macro JS [script]*/ @@ -7437,21 +7223,25 @@ window.populateEventArray = function(RESS = State.variables.RESSevent.length, RE /*:: AssayJS [script]*/ window.isSlim = function(slave) { - var slim = false; - var ArcologyZero = State.variables.arcologies[0]; - - if ((slave.boobs < 500) && (slave.butt < 3)) { - if ((slave.muscles <= 30) && (ArcologyZero.FSPhysicalIdealist === "unset") && (slave.weight <= 10) && (ArcologyZero.FSHedonisticDecadence === "unset")) { - slim = true; - } else if (ArcologyZero.FSPhysicalIdealist !== "unset") { - if ((ArcologyZero.FSPhysicalIdealistStrongFat === 1) && (slave.weight <= 30)) { - slim = true; - } - } else if ((ArcologyZero.FSHedonisticDecadence !== "unset") && (slave.weight <= 30)) { - if (ArcologyZero.FSHedonisticDecadenceStrongFat === 1) { - slim = true; - } else if (slave.muscles <= 30) { + let slim = false; + const ArcologyZero = State.variables.arcologies[0]; + + if (ArcologyZero.FSSlimnessEnthusiastLaw === 1) { + return (slimPass(slave) === 1); + } else { + if ((slave.boobs < 500) && (slave.butt < 3)) { + if ((slave.muscles <= 30) && (ArcologyZero.FSPhysicalIdealist === "unset") && (slave.weight <= 10) && (ArcologyZero.FSHedonisticDecadence === "unset")) { slim = true; + } else if (ArcologyZero.FSPhysicalIdealist !== "unset") { + if ((ArcologyZero.FSPhysicalIdealistStrongFat === 1) && (slave.weight <= 30)) { + slim = true; + } + } else if ((ArcologyZero.FSHedonisticDecadence !== "unset") && (slave.weight <= 30)) { + if (ArcologyZero.FSHedonisticDecadenceStrongFat === 1) { + slim = true; + } else if (slave.muscles <= 30) { + slim = true; + } } } } @@ -7464,18 +7254,15 @@ window.isStacked = function(slave) { }; window.isModded = function(slave) { - var tatScore = TatScore(slave); - var piercingScore = PiercingScore(slave); - var modScore = piercingScore+tatScore; + let tatScore = TatScore(slave); + let piercingScore = PiercingScore(slave); + let modScore = piercingScore+tatScore; - return ((modScore > 15) || (piercingScore > 8) && (tatScore > 5)); + return ((modScore > 15) || (piercingScore > 8 && tatScore > 5)); }; window.isUnmodded = function(slave) { - var tatScore = TatScore(slave); - var piercingScore = PiercingScore(slave); - - return !isModded(slave) && (slave.corsetPiercing === 0) && (piercingScore < 3) && (tatScore < 2); + return (!isModded(slave) && (slave.corsetPiercing === 0) && (PiercingScore(slave) < 3) && (TatScore(slave) < 2)); }; window.isXY = function(slave) { @@ -7491,7 +7278,7 @@ window.isPreg = function(slave) { }; window.isNotPreg = function(slave) { - return !isPreg(slave) && (slave.belly < 100) && (slave.weight < 30) && !setup.fakeBellies.includes(slave.bellyAccessory); + return (!isPreg(slave) && (slave.belly < 100) && (slave.weight < 30) && !setup.fakeBellies.includes(slave.bellyAccessory)); }; window.isPure = function(slave) { @@ -7506,7 +7293,7 @@ window.modScore = function modScore(slave) { }; window.PiercingScore = function(slave) { - var piercingScore = 0; + let piercingScore = 0; if (slave.earPiercing > 0) { piercingScore += slave.earPiercing*0.75-0.5; @@ -7553,7 +7340,7 @@ window.PiercingScore = function(slave) { }; window.TatScore = function(slave) { - var tatScore = 0; + let tatScore = 0; if (slave.boobsTat !== 0) { tatScore += 1.25; @@ -7586,13 +7373,13 @@ window.TatScore = function(slave) { tatScore += 1; } if (slave.bellyTat !== 0) { - if (((slave.preg > 30) && (slave.pregType >= 20)) || (slave.belly >= 300000)) { + if (((slave.preg > slave.pregData.normalBirth/1.33) && (slave.pregType >= 20)) || (slave.belly >= 300000)) { tatScore += 0.75; - } else if (((slave.preg > 20) && (slave.pregType >= 20)) || ((slave.preg > 30) && (slave.pregType >= 10)) || (slave.belly >= 150000)) { + } else if (((slave.preg > slave.pregData.normalBirth/2) && (slave.pregType >= 20)) || ((slave.preg > slave.pregData.normalBirth/1.33) && (slave.pregType >= 10)) || (slave.belly >= 150000)) { tatScore += 1; } else if ((slave.belly >= 10000) || (slave.bellyImplant >= 8000)) { tatScore += 1; - } else if (((slave.preg >= 10) && (slave.pregType >= 20)) || ((slave.preg > 10) && (slave.pregType >= 10)) || (slave.belly >= 5000)) { + } else if (((slave.preg >= slave.pregData.normalBirth/4) && (slave.pregType >= 20)) || ((slave.preg > slave.pregData.normalBirth/4) && (slave.pregType >= 10)) || (slave.belly >= 5000)) { tatScore += 0.5; } else if (slave.belly >= 1500) { tatScore += 0.25; @@ -7658,7 +7445,7 @@ window.inferiorRaceP = function inferiorRaceP(slave) { window.isLeaderP = function isLeaderP(slave) { const V = State.variables; - const leaders = [V.HeadGirl, V.Bodyguard, V.Recruiter, V.Concubine, V.Nurse, V.Attendant, V.Matron, V.Madam, V.DJ, V.Milkmaid, V.Farmer, V.Stewardess, V.Schoolteacher, V.Wardeness]; + const leaders = [V.HeadGirl, V.Bodyguard, V.Recruiter, V.Concubine, V.Nurse, V.Attendant, V.Matron, V.Madam, V.DJ, V.Milkmaid, V. Farmer, V.Stewardess, V.Schoolteacher, V.Wardeness]; return leaders.some(leader => leader.ID && leader.ID === slave.ID); }; @@ -7910,7 +7697,7 @@ window.getPronouns = function getPronouns(slave) { window.SlavePronouns = function SlavePronouns(slave) { const V = State.variables; - var pronouns = getPronouns(slave); + const pronouns = getPronouns(slave); V.pronoun = pronouns.pronoun; V.pronounCap = capFirstChar(pronouns.pronoun); V.possessive = pronouns.possessive; @@ -8716,9 +8503,9 @@ window.SlaveTitle = function SlaveTitle(slave) { if (slave.boobs > 4000 && slave.lactation > 0) { if (slave.physicalAge < 13) { - r = r + " calf "; + r = r + " calf"; } else { - r = r + " cow "; + r = r + " cow"; } } else if (slave.lactation > 0) { r = "milky " + r; @@ -8764,7 +8551,7 @@ window.SlaveTitle = function SlaveTitle(slave) { r = "indentured " + r; } - if (slave.preg > 10 && slave.pregKnown === 1) { + if (slave.preg > slave.pregData.normalBirth/4 && slave.pregKnown === 1) { r = "pregnant " + r; } else if (slave.bellyFluid >= 5000) { r = "bloated " + r; @@ -8975,7 +8762,7 @@ window.SlaveTitle = function SlaveTitle(slave) { r = "indentured " + r; } - if (slave.preg > 10 && slave.pregKnown === 1) { + if (slave.preg > slave.pregData.normalBirth/4 && slave.pregKnown === 1) { r = "pregnant " + r; } else if (slave.bellyFluid >= 5000) { r = "bloated " + r; @@ -9133,7 +8920,7 @@ window.DegradingName = function DegradingName(slave) { names.push("Potent"); suffixes.push("Cannon", "Daddy"); } - if (slave.preg > 30) { + if (slave.preg > slave.pregData.normalBirth/1.33) { if (slave.broodmother === 2) { names.push("Bursting", "Seeded"); suffixes.push("Factory", "Nursery"); @@ -9334,7 +9121,7 @@ window.DegradingName = function DegradingName(slave) { slave.slaveName = jsEither(["Bath", "Spa"]); break; case "be the Matron": - slave.slaveName = jsEither(["Nanny", "Matron"]); + slave.slaveName = jsEither(["Nursery", "Matron"]); break; case "be the Stewardess": slave.slaveName = jsEither(["Servant", "Maid"]); @@ -9617,7 +9404,7 @@ window.Deadliness = function Deadliness(slave) { if (slave.labor === 1) { deadliness -= 15; - } else if (slave.preg >= 40 && slave.pregControl !== "labor supressors") { + } else if (slave.preg >= slave.pregData.normalBirth && slave.pregControl !== "labor supressors") { deadliness -= 5; } @@ -11196,6 +10983,13 @@ window.WombInit = function(actor) { actor.readyOva = 0; } + if ( actor.pregData == undefined) + { + actor.pregData = clone( setup.pregData.human ); + //Setup should be through deep copy, so in future, if we like, these values can be changed individually. Gameplay expansion posibilities. But for dev time to simplify debugging: + //actor.pregData = setup.pregData.human; // any changes in setup pregData template will be applied immideatly to all. But can't be made seperate changes. + } + //backward compatibility setup. Fully accurate for normal pregnancy only. if (actor.womb.length > 0 && actor.womb[0].genetics == undefined) { var i=0 @@ -11208,7 +11002,7 @@ window.WombInit = function(actor) { } else if (actor.womb.length == 0 && actor.pregType > 0 && actor.broodmother > 0 && actor.broodmotherOnHold < 1) { //sorry but for already present broodmothers it's impossible to calculate fully, approximation used. var i, pw = actor.preg, bCount, bLeft; - if (pw > 40) pw = 40; //to avoid disaster. + if (pw > actor.pregData.normalBirth) pw = actor.pregData.normalBirth; //to avoid disaster. bCount = Math.floor(actor.pregType/pw); bLeft = actor.pregType - (bCount*pw); if (pw > actor.pregType) { @@ -11238,7 +11032,7 @@ window.WombImpregnate = function(actor, fCount, fatherID, age) { tf.identical = 0; //Initial, to create property. Updated with actual data during fetalSplit call. tf.splitted = 0; //marker for already splitted fetus. tf.genetics = generateGenetics(actor, fatherID, i+1); //Stored genetic information. - tf.ID = genUUID(); + tf.ID = generateNewID(); try { if (actor.womb.length == 0) { @@ -11334,41 +11128,150 @@ window.WombBirthReady = function(actor, readyAge) { return readyCnt; }; -window.WombGetVolume = function(actor) { //most code from pregJS.tw with minor adaptation. - var gestastionWeek; - var phi = 1.618; - var targetLen; - var wombSize = 0; - try { - actor.womb.forEach(ft => { - gestastionWeek = ft.age; - if (gestastionWeek <= 32) { - targetLen = (0.00006396 * Math.pow(gestastionWeek, 4)) - - (0.005501 * Math.pow(gestastionWeek, 3)) + - (0.161 * Math.pow(gestastionWeek, 2)) - - (0.76 * gestastionWeek) + - 0.208; - } else if (gestastionWeek <= 106) { - targetLen = (-0.0000004675 * Math.pow(gestastionWeek, 4)) + - (0.0001905 * Math.pow(gestastionWeek, 3)) - - (0.029 * Math.pow(gestastionWeek, 2)) + - (2.132 * gestastionWeek) - - 16.575; - } else { - targetLen = (-0.00003266 * Math.pow(gestastionWeek,2)) + - (0.076 * gestastionWeek) + - 43.843; - } - ft.volume = ((4 / 3) * (Math.PI) * (phi / 2) * (Math.pow((targetLen / 2), 3))); - wombSize += ft.volume; - }); - } catch(err){ - WombInit(actor); - alert("WombGetVolume warning - " + actor.slaveName + " " + err); - } - if (wombSize < 0) //catch for strange cases, to avoid messing with outside code. - wombSize = 0; - return wombSize; +window.WombGetVolume = function(actor) { //most legacy code from pregJS.tw with minor adaptation. + + + if (actor.pregData.sizeType == 0) + return getVolByLen(actor); + else if (actor.pregData.sizeType == 1) + return getVolByWeight(actor); + else if (actor.pregData.sizeType == 2) + return getVolByRaw(actor); + else + return 0; + + function getCurData(actor, age) + { + let i = 0; + let min, max, ageMin, ageMax, rateMin, rateMax, one, rateOne, rate, cage, csize; + let data = {}; + + while (actor.pregData.fetusWeek[i+1] < age && i < actor.pregData.fetusWeek.length-1) + i++; + + min = actor.pregData.fetusSize[i]; + max = actor.pregData.fetusSize[i+1]; + ageMin = actor.pregData.fetusWeek[i]; + ageMax = actor.pregData.fetusWeek[i+1]; + rateMin = actor.pregData.fetusRate[i]; + rateMax = actor.pregData.fetusRate[i+1]; + + cage = age - ageMin; + + one = (max - min) / (ageMax - ageMin); + rateOne = (rateMax - rateMin) / (ageMax - ageMin); + + rate = rateMin + (rateOne * cage); + + csize = (min + (one * cage)); + //console.log("min:"+min+" max:"+max+" ageMin:"+ageMin+" ageMax:"+ageMax+" one:"+one+" rateOne:"+rateOne+" cage:"+cage+" rate:"+rate+" csize:"+csize+" final size:"+csize*rate); + + data.size = csize; + data.rate = rate; + + return data; //csize * rate; + //maybe not very effective code, but simple and easy to debug. May be optimized more in future. + } + + + function getVolByLen(actor){ + + try { + + var phi = 1.618; + var targetData, targetLen; + var wombSize = 0; + + actor.womb.forEach(ft => { + + /* legacy block for debug only + let gestastionWeek = ft.age; + let oldLen; + let oldVol; + if (gestastionWeek <= 32) { + oldLen = (0.00006396 * Math.pow(gestastionWeek, 4)) - + (0.005501 * Math.pow(gestastionWeek, 3)) + + (0.161 * Math.pow(gestastionWeek, 2)) - + (0.76 * gestastionWeek) + + 0.208; + } else if (gestastionWeek <= 106) { + oldLen = (-0.0000004675 * Math.pow(gestastionWeek, 4)) + + (0.0001905 * Math.pow(gestastionWeek, 3)) - + (0.029 * Math.pow(gestastionWeek, 2)) + + (2.132 * gestastionWeek) - + 16.575; + } else { + oldLen = (-0.00003266 * Math.pow(gestastionWeek,2)) + + (0.076 * gestastionWeek) + + 43.843; + } + */ + + targetData = getCurData(actor, ft.age); + targetLen = targetData.size * targetData.rate; + + ft.volume = ((4 / 3) * (Math.PI) * (phi / 2) * (Math.pow((targetLen / 2), 3))); + wombSize += ft.volume; + + //oldVol = ((4 / 3) * (Math.PI) * (phi / 2) * (Math.pow((oldLen / 2), 3))); //for debug + + //console.log("fetus.age:" + ft.age + " oldLen:"+oldLen+" targetLen:"+targetLen+" ft.volume:"+ft.volume+ " old volume:"+oldVol ); + /* + I found, that previous targetLen calculation not exactly accurate if compared to the actual medical data chart for fetal length. It's been rough aproximation based only on pregnancy week (giving smaller fetus size then it should in most cases). So I need all this debug code to compare data and verify calculations. After final tweaking I will remove or comment out legacy code. Please not touch this before it. + Pregmodfan. + */ + }); + } catch(err){ + WombInit(actor); + alert("WombGetVolume warning - " + actor.slaveName + " " + err); + } + if (wombSize < 0) //catch for strange cases, to avoid messing with outside code. + wombSize = 0; + + return wombSize; + + } + + + function getVolByWeight(actor) + { + var targetData; + var wombSize = 0; + + actor.womb.forEach(ft => { + + targetData = getCurData(actor, ft.age); + + wombSize += targetData.size * targetData.rate; + + }); + + if (wombSize < 0) //catch for strange cases, to avoid messing with outside code. + wombSize = 0; + + return wombSize; + } + + + function getVolByRaw(actor) + { + var targetData; + var wombSize = 0; + + actor.womb.forEach(ft => { + + targetData = getCurData(actor, ft.age); + + wombSize += targetData.size; + + }); + + if (wombSize < 0) //catch for strange cases, to avoid messing with outside code. + wombSize = 0; + + return wombSize; + } + }; window.WombUpdatePregVars = function(actor) { @@ -11507,13 +11410,13 @@ window.fetalSplit = function(actor, chance) { nft.motherID = s.motherID; nft.volume = s.volume; nft.reserve = ""; //splitted fetus is new separate, reserve - it's not genetic to split. - nft.genetics = deepCopy(s.genetics); + nft.genetics = clone(s.genetics); s.splitted = 1; //this is marker that this is already splitted fetus (to not split second time in loop), only source fetus needed it. nft.identical = 1; //this is marker that this fetus has at least one twin. s.identical = 1; //this is marker that this fetus has at least one twin. if (s.twinID == "" || s.twinID == undefined) - s.twinID = genUUID(); + s.twinID = generateNewID(); nft.twinID = s.twinID; @@ -11555,7 +11458,7 @@ window.WombRemoveFetus = function(actor, fetusNum) return null; } -/*to add fetus object in the womb. Be warned - you can add one single fetus to many wombs, or even add it many times to one womb. It's will not show error, but behavior become strange, as fetus object will be the same - it's reference, not full copies. If this not desired - use deepCopy on fetus before adding.*/ +/*to add fetus object in the womb. Be warned - you can add one single fetus to many wombs, or even add it many times to one womb. It's will not show error, but behavior become strange, as fetus object will be the same - it's reference, not full copies. If this not desired - use clone() on fetus before adding.*/ window.WombAddFetus = function(actor, fetus) { WombInit(actor); @@ -11763,7 +11666,7 @@ window.BCReserveInit = function() ft.motherID = slave.ID; if (ft.ID == undefined) - ft.ID = genUUID(); + ft.ID = generateNewID(); try { if (slave.reservedChildren > 0) @@ -11795,7 +11698,7 @@ window.fetalSplit = function(actor, chance) actor.womb.forEach(function(s){ if ((jsRandom(1,chance) >= chance) && s.identical !== 1) { - nft = deepCopy(s); + nft = clone(s); actor.womb.push(nft); s.identical = 1; } @@ -15154,14 +15057,14 @@ window.DefaultRules = (function() { } function ProcessAnalAccessories(slave, rule) { - // apply buttplugs to slave + // apply buttplugs and buttplug accessories to slave if ((slave.vaginalAccessory !== "anal chastity") && (slave.vaginalAccessory !== "combined chastity") && (slave.dickAccessory !== "anal chastity") && (slave.dickAccessory !== "combined chastity")) { if (slave.anus === 0) ProcessAnalVirginButtplugs(slave, rule); else ProcessNonVirginButtplugs(slave, rule); } - ProcessButtplugAttachments(slave, rule); // contains a clear condition for no buttplug + ProcessButtplugAttachments(slave, rule); } function ProcessAnalVirginButtplugs(slave, rule) { @@ -16046,16 +15949,16 @@ window.DefaultRules = (function() { function ProcessPregnancyDrugs(slave, rule) { if (slave.pregKnown == 1 && rule.pregSpeed != "no default setting" && (slave.breedingMark != 1 || V.propOutcome == 0) && slave.indentureRestrictions < 1 && slave.broodmother === 0) { - if (rule.pregSpeed == "slow" && slave.preg < 35) { + if (rule.pregSpeed == "slow" && slave.preg < slave.pregData.minLiveBirth) { slave.pregControl = "slow gestation"; r += `<br>${slave.slaveName} is pregnant, so she has been put on the gestation slowing agents.`; - } else if (rule.pregSpeed == "fast" && slave.preg < 35 && slave.health > -50) { + } else if (rule.pregSpeed == "fast" && slave.preg < slave.pregData.minLiveBirth && slave.health > -50) { slave.pregControl = "speed up"; r += `<br>${slave.slaveName} is pregnant, so she has been put on rapid gestation agents. CAUTION! Can be dangerous. Clinic supervision is recommended.`; - } else if (rule.pregSpeed == "suppress" && slave.preg > 34 && slave.health > -50) { + } else if (rule.pregSpeed == "suppress" && slave.preg >= slave.pregData.minLiveBirth && slave.health > -50) { slave.pregControl = "labor supressors"; r += `<br>${slave.slaveName} is ready to birth, so she has been put on labor suppressing agents.`; - } else if (rule.pregSpeed == "stimulate" && slave.preg >= 37 && slave.health > -50) { + } else if (rule.pregSpeed == "stimulate" && slave.preg > slave.pregData.minLiveBirth && slave.health > -50) { slave.labor = 1; slave.induce = 1; V.birthee = 1; @@ -22388,7 +22291,7 @@ window.SlaveSummaryUncached = (function(){ r += `<strong>CC</strong>`; } else if (slave.preg === 0 && (slave.ovaries === 1 || slave.mpreg === 1)) { r += `<strong>Fert+</strong>`; - } else if (((slave.preg < 4) && (slave.preg > 0) && slave.pregKnown === 0) || slave.pregWeek === 1) { + } else if (((slave.preg < slave.pregData.normalBirth/10) && (slave.preg > 0) && slave.pregKnown === 0) || slave.pregWeek === 1) { r += `<strong>Preg?</strong>`; } else if ((slave.preg >= 36) && (slave.broodmother > 0)) { r += `<strong>Perm preg</strong>`; @@ -22465,7 +22368,7 @@ window.SlaveSummaryUncached = (function(){ r += `On contraceptives.`; } else if (slave.preg === 0 && (slave.ovaries === 1 || slave.mpreg === 1)) { r += `Fertile.`; - } else if (((slave.preg < 4) && (slave.preg > 0) && slave.pregKnown === 0) || slave.pregWeek === 1) { + } else if (((slave.preg < slave.pregData.normalBirth/10) && (slave.preg > 0) && slave.pregKnown === 0) || slave.pregWeek === 1) { r += `May be pregnant.`; } else if ((slave.preg >= 36) && (slave.broodmother > 0)) { r += `Permanently pregnant.`; @@ -22498,6 +22401,9 @@ window.SlaveSummaryUncached = (function(){ r += `twins.`; } } + if (slave.preg > slave.pregData.normalBirth && slave.broodmother == 0) { + r += ` (Overdue.)`; + } } r += `</span> `; if (slave.induce === 1) { @@ -26132,7 +26038,7 @@ window.SlaveSummaryUncached = (function(){ } return SlaveSummaryUncached; -})(); +}; // :: Remove activeSlave JS [script] @@ -29394,19 +29300,19 @@ window.GetVignette = function GetVignette(slave) { } if (V.arcologies[0].FSSupremacistRace === "asian") { vignettes.push({ - text: `${he} was hired to be the special guest at a rather unconvential seijin-shiki celebration party,`, + text: `${he} was hired to be the special guest at a rather unconventional seijin-shiki celebration party,`, type: "cash", effect: 1, }); } else if (V.arcologies[0].FSSupremacistRace === "semitic") { vignettes.push({ - text: `${he} was hired to be the special guest at a rather unconvential bar mitzvah celebration party,`, + text: `${he} was hired to be the special guest at a rather unconventional bar mitzvah celebration party,`, type: "cash", effect: 1, }); } else if (V.arcologies[0].FSSupremacistRace === "white") { vignettes.push({ - text: `${he} was hired to be the special guest at a rather unconvential Jugendweihe celebration party,`, + text: `${he} was hired to be the special guest at a rather unconventional Jugendweihe celebration party,`, type: "cash", effect: 1, }); @@ -29455,7 +29361,7 @@ window.GetVignette = function GetVignette(slave) { }); } } - if (V.arcologies[0].FSRepopulationFocus !== "unset" || V.arcologies[0].FSRepopulationFocusPregPolicy === 1) { + if (V.arcologies[0].FSRepopulationFocus !== "unset" || V.arcologies[0].FSRepopulationFocusSMR == 1) { if (slave.pregType > 1 && slave.pregKnown > 1 && slave.belly >= 10000) { vignettes.push({ text: `${he} got repeat business from a customer who loves fucking ${boy}s with wombs filled by more than a single child,`, @@ -29463,7 +29369,7 @@ window.GetVignette = function GetVignette(slave) { effect: 1, }); } - if (slave.preg > 10 && slave.pregKnown > 1 && slave.bellyPreg >= 5000) { + if (slave.preg > slave.pregData.normalBirth/4 && slave.pregKnown > 1 && slave.bellyPreg >= 5000) { vignettes.push({ text: `a customer loved ${his} pregnant belly so much that he came back for repeat business,`, type: "cash", @@ -29634,7 +29540,7 @@ window.GetVignette = function GetVignette(slave) { }); } vignettes.push({ - text: `${he} was hired to be the special guest at a rather unconvential genpuku celebration party,`, + text: `${he} was hired to be the special guest at a rather unconventional genpuku celebration party,`, type: "cash", effect: 1, }); @@ -29657,7 +29563,7 @@ window.GetVignette = function GetVignette(slave) { }); } vignettes.push({ - text: `${he} was hired to be the special guest at a rather unconvential Guan Li celebration party,`, + text: `${he} was hired to be the special guest at a rather unconventional Guan Li celebration party,`, type: "cash", effect: 1, }); @@ -30971,19 +30877,19 @@ window.GetVignette = function GetVignette(slave) { } if (V.arcologies[0].FSSupremacistRace === "asian") { vignettes.push({ - text: `${he} was invited to and livened up a rather unconvential seijin-shiki celebration party,`, + text: `${he} was invited to and livened up a rather unconventional seijin-shiki celebration party,`, type: "rep", effect: 1, }); } else if (V.arcologies[0].FSSupremacistRace === "semitic") { vignettes.push({ - text: `${he} was invited to and livened up a rather unconvential bar mitzvah celebration party,`, + text: `${he} was invited to and livened up a rather unconventional bar mitzvah celebration party,`, type: "rep", effect: 1, }); } else if (V.arcologies[0].FSSupremacistRace === "white") { vignettes.push({ - text: `${he} was invited to and livened up a rather unconvential Jugendweihe celebration party,`, + text: `${he} was invited to and livened up a rather unconventional Jugendweihe celebration party,`, type: "rep", effect: 1, }); @@ -31032,7 +30938,7 @@ window.GetVignette = function GetVignette(slave) { }); } } - if (V.arcologies[0].FSRepopulationFocus !== "unset" || V.arcologies[0].FSRepopulationFocusPregPolicy === 1) { + if (V.arcologies[0].FSRepopulationFocus !== "unset" || V.arcologies[0].FSRepopulationFocusSMR == 1) { if (slave.pregType > 1 && slave.pregKnown > 1 && slave.belly >= 10000) { vignettes.push({ text: `${he} gratified a citizen who enjoys the feeling of a womb filled with more than a single child,`, @@ -31040,7 +30946,7 @@ window.GetVignette = function GetVignette(slave) { effect: 1, }); } - if (slave.preg > 10 && slave.pregKnown > 1 && slave.bellyPreg >= 5000) { + if (slave.preg > slave.pregData.normalBirth/4 && slave.pregKnown > 1 && slave.bellyPreg >= 5000) { vignettes.push({ text: `a citizen loved ${his} pregnant belly so much that he came back for repeat service,`, type: "rep", @@ -31211,7 +31117,7 @@ window.GetVignette = function GetVignette(slave) { }); } vignettes.push({ - text: `${he} was invited to and livened up a rather unconvential genpuku celebration party,`, + text: `${he} was invited to and livened up a rather unconventional genpuku celebration party,`, type: "rep", effect: 1, }); @@ -31234,7 +31140,7 @@ window.GetVignette = function GetVignette(slave) { }); } vignettes.push({ - text: `${he} was invited to and livened up a rather unconvential Guan Li celebration party,`, + text: `${he} was invited to and livened up a rather unconventional Guan Li celebration party,`, type: "rep", effect: 1, }); @@ -35324,648 +35230,640 @@ window.findNaN = function findNan() { window.primeSlave = function(activeSlave, seed) { /* will be moved up once this becomes a single, contained function. */ - var _target = "" - var t = "" - var V = State.variables - var race - if (V.seeRace == 1) { race = activeSlave.race } else { race = "" } - - var pronouns = getPronouns(activeSlave) - var he = pronouns.pronoun, him = pronouns.object, his = pronouns.possessive, hers = pronouns.possessivePronoun, himself = pronouns.objectReflexive, boy = pronouns.noun - var He = capFirstChar(he), His = capFirstChar(his) + const V = State.variables; + const pronouns = getPronouns(activeSlave); + const he = pronouns.pronoun, him = pronouns.object, his = pronouns.possessive, hers = pronouns.possessivePronoun, himself = pronouns.objectReflexive, boy = pronouns.noun; + const He = capFirstChar(he), His = capFirstChar(his); + let _target = ""; + let t = ""; + let race = (V.seeRace ? activeSlave.race : ""); if (V.partner !== "relationship" || activeSlave.relationship == 1 || activeSlave.relationship == 2 || activeSlave.releaseRules == "restrictive") { - t += `${activeSlave.slaveName} ` - t += walkPasts(activeSlave, seed) + t += `${activeSlave.slaveName} `; + t += walkPasts(activeSlave, seed); /* WALKPASTS END */ } /* TIME TOGETHER EXCEPTION ENDS */ return t; -} +}; window.rivalSlave = function(activeSlave, seed) { - var _partnerSlave = getSlave(activeSlave.rivalryTarget) - - var _target = "" - var t = "" - var V = State.variables - - var pronouns = getPronouns(activeSlave) - var he = pronouns.pronoun, him = pronouns.object, his = pronouns.possessive, hers = pronouns.possessivePronoun, himself = pronouns.objectReflexive, boy = pronouns.noun - var He = capFirstChar(he), His = capFirstChar(his) + const V = State.variables; + const pronouns = getPronouns(activeSlave); + const he = pronouns.pronoun, him = pronouns.object, his = pronouns.possessive, hers = pronouns.possessivePronoun, himself = pronouns.objectReflexive, boy = pronouns.noun; + const He = capFirstChar(he), His = capFirstChar(his); + let _partnerSlave = getSlave(activeSlave.rivalryTarget); + let _target = ""; + let t = ""; if (_partnerSlave != undefined) { /* potential problem point */ + let race2 = (V.seeRace ? _partnerSlave.race : ""); - var race2 - if (V.seeRace == 1) { race2 = _partnerSlave.race } else { race2 = "" } - - t += " Meanwhile, " + t += " Meanwhile, "; if (activeSlave.rivalry >= 3) { - t += `${_partnerSlave.slaveName}, whom ${he} hates, ` + t += `${_partnerSlave.slaveName}, whom ${he} hates, `; } else if (activeSlave.rivalry >= 2) { - t += `${his} rival ${_partnerSlave.slaveName} ` + t += `${his} rival ${_partnerSlave.slaveName} `; } else { - t += `${_partnerSlave.slaveName}, whom ${he} dislikes, ` + t += `${_partnerSlave.slaveName}, whom ${he} dislikes, `; } - t += walkPasts(_partnerSlave, 100-seed) + t += walkPasts(_partnerSlave, 100-seed); - _target = "FRival", _partnerSlave = null - V.target = "FRival" /*potentially removed later*/ + _target = "FRival"; + _partnerSlave = null; + V.target = "FRival"; /*potentially removed later*/ } return t; -} +}; window.walkPasts = function(slave, _seed) { /* will be moved up once this becomes a single, contained function. */ - var _target = "" - var t = "" - var V = State.variables - var race - if (V.seeRace == 1) { race = slave.race } else { race = "" } - - var pronouns = getPronouns(slave) - var he = pronouns.pronoun, him = pronouns.object, his = pronouns.possessive, hers = pronouns.possessivePronoun, himself = pronouns.objectReflexive, boy = pronouns.noun - var He = capFirstChar(he), His = capFirstChar(his) + const V = State.variables; + const pronouns = getPronouns(slave); + const he = pronouns.pronoun, him = pronouns.object, his = pronouns.possessive, hers = pronouns.possessivePronoun, himself = pronouns.objectReflexive, boy = pronouns.noun; + const He = capFirstChar(he), His = capFirstChar(his); + let _target = ""; + let t = ""; + let race = (V.seeRace ? slave.race : ""); switch (slave.assignment) { case "be your agent": - t += `is shaping society in ${his} assigned arcology.` - break + t += `is shaping society in ${his} assigned arcology.`; + break; case "live with your agent": - t += `is helping ${his} lover shape society in ${his} assigned arcology.` - break + t += `is helping ${his} lover shape society in ${his} assigned arcology.`; + break; case "work in the dairy": if (V.dairyRestraintsSetting > 1) { - t += `is strapped to a milking machine in ${V.dairyName}, ` + t += `is strapped to a milking machine in ${V.dairyName}, `; if (slave.ovaries == 1 && V.dairyPregSetting > 0 && jsRandom(1,2) == 2) { if (isFertile(slave)) { - t += `and is wincing in pain as the machine forces another load of cum into ${his} womb. As you watch, ${his} ${race} stomach steadily swells with baby batter.` + t += `and is wincing in pain as the machine forces another load of cum into ${his} womb. As you watch, ${his} ${race} stomach steadily swells with baby batter.`; } else { - t += `giving you a good view of ${his} ${race} body and heavy belly on the feeds.` + t += `giving you a good view of ${his} ${race} body and heavy belly on the feeds.`; } } else if (slave.lactation > 0) { if (slave.balls > 0 && jsRandom(1,2) == 1) { if (slave.dick > 0) { if (_seed > 50) { - t += `and is having ${his} cock sucked dry. As you watch, ` + t += `and is having ${his} cock sucked dry. As you watch, `; if (slave.scrotum) { - t += `${his} balls tighten ` + t += `${his} balls tighten `; } else { - t += `${he} begins to thrust harder ` + t += `${he} begins to thrust harder `; } if (V.dairyStimulatorsSetting > 0) { - t += `as the phallus up ${his} butt ` + t += `as the phallus up ${his} butt `; } else { - t += `as the suction to ${his} dick ` + t += `as the suction to ${his} dick `; } - t += `forces ${him} closer to yet another ejaculation.` + t += `forces ${him} closer to yet another ejaculation.`; } else { - t += `and is wincing in pain as the machine sucks ${his} sore cock, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is wincing in pain as the machine sucks ${his} sore cock, but you have a good view of ${his} ${race} body on the feeds.`; } } else { if (_seed > 50) { - t += `and is having ${his} balls sucked dry. As you watch, ` + t += `and is having ${his} balls sucked dry. As you watch, `; if (slave.scrotum) { - t += `${his} scrotum tightens ` + t += `${his} scrotum tightens `; } else { - t += `${he} begins to thrust harder ` + t += `${he} begins to thrust harder `; } if (V.dairyStimulatorsSetting) { - t += `as the phallus up ${his} butt ` + t += `as the phallus up ${his} butt `; } else { - t += `as the suction against ${his} crotch ` + t += `as the suction against ${his} crotch `; } - t += `forces ${him} closer to yet another leaking ejaculation.` + t += `forces ${him} closer to yet another leaking ejaculation.`; } else { - t += `and is wincing in pain as the machine sucks ${his} empty balls, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is wincing in pain as the machine sucks ${his} empty balls, but you have a good view of ${his} ${race} body on the feeds.`; } } } else { if (_seed > 50) { - t += `and is having ${his} tits drained, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is having ${his} tits drained, but you have a good view of ${his} ${race} body on the feeds.`; } else { - t += `and is recovering after having ${his} tits sucked dry, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is recovering after having ${his} tits sucked dry, but you have a good view of ${his} ${race} body on the feeds.`; } } } else if (slave.balls > 0) { if (slave.dick > 0) { if (_seed > 50) { - t += `and is having ${his} cock sucked dry. As you watch, ` + t += `and is having ${his} cock sucked dry. As you watch, `; if (slave.scrotum) { - t += `${his} balls tighten ` + t += `${his} balls tighten `; } else { - t += `${he} begins to thrust harder ` + t += `${he} begins to thrust harder `; } if (V.dairyStimulatorsSetting > 0) { - t += `as the phallus up ${his} butt ` + t += `as the phallus up ${his} butt `; } else { - t += `as the suction to ${his} dick ` + t += `as the suction to ${his} dick `; } - t += `forces ${him} closer to yet another ejaculation.` + t += `forces ${him} closer to yet another ejaculation.`; } else { - t += `and is wincing in pain as the machine sucks ${his} sore cock, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is wincing in pain as the machine sucks ${his} sore cock, but you have a good view of ${his} ${race} body on the feeds.`; } } else { if (_seed > 50) { - t += `and is having ${his} balls sucked dry. As you watch, ` + t += `and is having ${his} balls sucked dry. As you watch, `; if (slave.scrotum) { - t += `${his} scrotum tightens ` + t += `${his} scrotum tightens `; } else { - t += `${he} begins to thrust harder ` + t += `${he} begins to thrust harder `; } if (V.dairyStimulatorsSetting) { - t += `as the phallus up ${his} butt ` + t += `as the phallus up ${his} butt `; } else { - t += `as the suction against ${his} crotch ` + t += `as the suction against ${his} crotch `; } - t += `forces ${him} closer to yet another leaking ejaculation.` + t += `forces ${him} closer to yet another leaking ejaculation.`; } else { - t += `and is wincing in pain as the machine sucks ${his} empty balls, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is wincing in pain as the machine sucks ${his} empty balls, but you have a good view of ${his} ${race} body on the feeds.`; } } } else { - t += `and is massaging ${his} sore, milkless tits, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is massaging ${his} sore, milkless tits, but you have a good view of ${his} ${race} body on the feeds.`; } } else { - t += `is working in ${V.dairyName}, ` + t += `is working in ${V.dairyName}, `; if (slave.lactation > 0) { if (slave.balls > 0 && jsRandom(1,2) == 1) { if (slave.dick > 0) { if (_seed > 50) { - t += `and is having ${his} cock milked. As you watch, ` + t += `and is having ${his} cock milked. As you watch, `; if (slave.scrotum) { - t += `${his} balls tighten ` + t += `${his} balls tighten `; } else { - t += `${he} begins to thrust harder ` + t += `${he} begins to thrust harder `; } if (V.dairyStimulatorsSetting > 0) { - t += `as the phallus up ${his} butt ` + t += `as the phallus up ${his} butt `; } else { - t += `as the suction to ${his} dick ` + t += `as the suction to ${his} dick `; } - t += `brings ${him} closer to a copious ejaculation.` + t += `brings ${him} closer to a copious ejaculation.`; } else { - t += `and is massaging ${his} sore swollen cock, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is massaging ${his} sore swollen cock, but you have a good view of ${his} ${race} body on the feeds.`; } } else { if (_seed > 50) { - t += `and is having ${his} balls drained. As you watch, ` + t += `and is having ${his} balls drained. As you watch, `; if (slave.scrotum) { - t += `${his} scrotum tightens ` + t += `${his} scrotum tightens `; } else { - t += `${he} begins to thrust harder ` + t += `${he} begins to thrust harder `; } if (V.dairyStimulatorsSetting) { - t += `as the phallus up ${his} butt ` + t += `as the phallus up ${his} butt `; } else { - t += `as the suction against ${his} crotch ` + t += `as the suction against ${his} crotch `; } - t += `brings ${him} closer to a copious squirting.` + t += `brings ${him} closer to a copious squirting.`; } else { - t += `and is massaging ${his} aching balls, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is massaging ${his} aching balls, but you have a good view of ${his} ${race} body on the feeds.`; } } } else { if (_seed > 50) { - t += `and is having ${his} tits milked, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is having ${his} tits milked, but you have a good view of ${his} ${race} body on the feeds.`; } else { - t += `and is massaging ${his} sore tits, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is massaging ${his} sore tits, but you have a good view of ${his} ${race} body on the feeds.`; } } } else if (slave.balls > 0) { if (slave.dick > 0) { if (_seed > 50) { - t += `and is having ${his} cock milked. As you watch, ` + t += `and is having ${his} cock milked. As you watch, `; if (slave.scrotum) { - t += `${his} balls tighten ` + t += `${his} balls tighten `; } else { - t += `${he} begins to thrust harder ` + t += `${he} begins to thrust harder `; } if (V.dairyStimulatorsSetting) { - t += `as the phallus up ${his} butt ` + t += `as the phallus up ${his} butt `; } else { - t += `as the suction to ${his} dick ` + t += `as the suction to ${his} dick `; } - t += `brings ${him} closer to a copious ejaculation.` + t += `brings ${him} closer to a copious ejaculation.`; } else { - t += `and is massaging ${his} sore swollen cock, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is massaging ${his} sore swollen cock, but you have a good view of ${his} ${race} body on the feeds.`; } } else { if (_seed > 50) { - t += `and is having ${his} balls drained. As you watch, ` + t += `and is having ${his} balls drained. As you watch, `; if (slave.scrotum) { - t += `${his} scrotum tightens ` + t += `${his} scrotum tightens `; } else { - t += `${he} begins to thrust harder ` + t += `${he} begins to thrust harder `; } if (V.dairyStimulatorsSetting) { - t += `as the phallus up ${his} butt ` + t += `as the phallus up ${his} butt `; } else { - t += `as the suction against ${his} crotch ` + t += `as the suction against ${his} crotch `; } - t += `brings ${him} closer to a copious squirting.` + t += `brings ${him} closer to a copious squirting.`; } else { - t += `and is massaging ${his} aching balls, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is massaging ${his} aching balls, but you have a good view of ${his} ${race} body on the feeds.`; } } } else { - t += `and is massaging ${his} sore, milkless tits, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is massaging ${his} sore, milkless tits, but you have a good view of ${his} ${race} body on the feeds.`; } } - break + break; case "work in the brothel": - /* Beauty is being supplanted here until it is JS'd, after which it should be retured! */ - t += `is working in ${V.brothelName}, and is ` - if (slave.whoreSkill >= 100 && jsRandom(1,2) == 1) { + t += `is working in ${V.brothelName}, and is `; + if (Beauty(slave) > 100 && jsRandom(1,2) == 1) { if (_seed > 80) { if (canDoAnal(slave) || canDoVaginal(slave)) { - t += `riding one customer's dick while ${he} gives another a blowjob.` + t += `riding one customer's dick while ${he} gives another a blowjob.`; } else { - t += "deep throating a pair of customer's dicks." + t += "deep throating a pair of customer's dicks."; } } else if (_seed > 60 && slave.amp != 1) { - t += "sucking one customer's cock while giving another a handjob." + t += "sucking one customer's cock while giving another a handjob."; } else if (_seed > 40) { - t += "eating out one customer's cunt while another " + t += "eating out one customer's cunt while another "; if (canDoAnal(slave) || canDoVaginal(slave)) { - t += `uses a strap-on on ${him}.` + t += `uses a strap-on on ${him}.`; } else { - t += `teases ${his} butt.` + t += `teases ${his} butt.`; } } else if (_seed > 20) { if (canDoAnal(slave) || canDoVaginal(slave)) { - t += "getting pounded by " + t += "getting pounded by "; } else { - t += "amusing " + t += "amusing "; } - t += "two women wearing strap-ons." + t += "two women wearing strap-ons."; } else { if (canDoAnal(slave) || canDoVaginal(slave)) { - t += "being double penetrated by " + t += "being double penetrated by "; } else { - t += `using ${her} body to please ` + t += `using ${her} body to please `; } - t += "a pair of customers." + t += "a pair of customers."; } } else if (_seed > 80) { if (canDoAnal(slave) || canDoVaginal(slave)) { - t += "pleasing " + t += "pleasing "; } else { - t += "riding " + t += "riding "; } - t += "a customer's dick." + t += "a customer's dick."; } else if (_seed > 60) { - t += "sucking a customer's cock." + t += "sucking a customer's cock."; } else if (_seed > 40) { - t += "pleasuring a customer's cunt." + t += "pleasuring a customer's cunt."; } else if (_seed > 20) { - t += "getting pounded by a woman wearing a strap-on." + t += "getting pounded by a woman wearing a strap-on."; } else { - t += "being held down and " + t += "being held down and "; if (canDoAnal(slave)) { - t += "buttfucked " + t += "buttfucked "; } else { - t += "raped " + t += "raped "; } - t += "by a customer." + t += "by a customer."; } - t += ` You have a voyeuristic view of ${his} ${race} body on the feeds.` - break + t += ` You have a voyeuristic view of ${his} ${race} body on the feeds.`; + break; case "serve in the club": - t += `is working in ${V.clubName}, ` + t += `is working in ${V.clubName}, `; if (_seed > 50) { - t += `displaying ${his} ${race} body, keeping citizens company, and flirting with anyone who shows interest.` + t += `displaying ${his} ${race} body, keeping citizens company, and flirting with anyone who shows interest.`; } else { - t += `or rather just off it, having taken a prominent citizen back to a discreet room so he can use ${his} ${race} body.` + t += `or rather just off it, having taken a prominent citizen back to a discreet room so he can use ${his} ${race} body.`; } - break + break; case "work as a servant": if (_seed > 50) { - t += "was scrubbing the penthouse floor, until another slave requested oral service." + t += "was scrubbing the penthouse floor, until another slave requested oral service."; } else { - t += "is scrubbing the penthouse floor." + t += "is scrubbing the penthouse floor."; } - break + break; case "serve in the master suite": if (slave.fuckdoll > 0) { - t += `waiting for use in ${V.masterSuiteName}, next to a display case full of other sex toys.` + t += `waiting for use in ${V.masterSuiteName}, next to a display case full of other sex toys.`; } else if (V.masterSuiteUpgradeLuxury == 1) { if (_seed > 50) { - t += `is sitting on the big bed in ${V.masterSuiteName}, awaiting your return.` + t += `is sitting on the big bed in ${V.masterSuiteName}, awaiting your return.`; } else { - t += `is beautifying ${himself} in ${V.masterSuiteName} so ${he}'ll be pretty when you return.` + t += `is beautifying ${himself} in ${V.masterSuiteName} so ${he}'ll be pretty when you return.`; } } else if (V.masterSuiteUpgradeLuxury == 2) { - t += `is in ${V.masterSuiteName}'s fuckpit, ` + t += `is in ${V.masterSuiteName}'s fuckpit, `; if (_seed > 80) { - t += `with a pair of ${his} fellow fucktoys industriously sucking on ${his} nipples.` + t += `with a pair of ${his} fellow fucktoys industriously sucking on ${his} nipples.`; } else if (_seed > 60) { if ((slave.anus > 0 && canDoAnal(slave)) || (slave.vagina > 0 && canDoVaginal(slave))) { - t += "taking double penetration from " + t += "taking double penetration from "; } else { - t += "being spitroasted by " + t += "being spitroasted by "; } - t += `a pair of ${his} fellow fucktoys.` + t += `a pair of ${his} fellow fucktoys.`; } else if (_seed > 40) { if (canPenetrate(slave)) { - t += `with ${his} dick inside ` + t += `with ${his} dick inside `; } else if (slave.dick > 0 && slave.dickAccessory != "chastity" && slave.dick != "combined chastity") { - t += `getting ${his} soft dick sucked by ` + t += `getting ${his} soft dick sucked by `; } else if (canDoVaginal(slave) || canDoAnal(slave)) { - t += "getting eaten out by " + t += "getting eaten out by "; } else { - t += "making out with " + t += "making out with "; } - t += "a fellow fucktoy." + t += "a fellow fucktoy."; } else if (_seed > 20) { if (slave.vagina > 0 && canDoVaginal(slave)) { - t += "getting pounded " + t += "getting pounded "; } else if (slave.anus > 0 && canDoAnal(slave)) { - t += `getting ${his} ass pounded ` + t += `getting ${his} ass pounded `; } else if (canDoVaginal(slave) || canDoAnal(slave)) { - t += "getting eaten out " + t += "getting eaten out "; } else { - t += "getting deepthroated " + t += "getting deepthroated "; } - t += "by a fellow fucktoy." + t += "by a fellow fucktoy."; } else { - t += "performing oral sex on a fellow fucktoy." + t += "performing oral sex on a fellow fucktoy."; } } else { if (slave.energy > 95) { - t += `is having enthusiastic sex with your other pets while waiting for you to ravish ${him}.` + t += `is having enthusiastic sex with your other pets while waiting for you to ravish ${him}.`; } else { - t += "is having idle sex with several of your other toys while they await your pleasure." + t += "is having idle sex with several of your other toys while they await your pleasure."; if (slave.fetishKnown == 1) { switch (slave.fetish) { case "buttslut": if (canDoAnal(slave) && slave.anus > 0) { - t += `${He}'s happily taking a strap-on up ${his} asspussy.` + t += `${He}'s happily taking a strap-on up ${his} asspussy.`; } else { - t += `${He}'s happily got another slave between ${his} buttcheeks.` + t += `${He}'s happily got another slave between ${his} buttcheeks.`; } - break + break; case "cumslut": - t += `${He}'s happily performing oral on another slave.` - break + t += `${He}'s happily performing oral on another slave.`; + break; case "dom": - t += `${He}'s pinning another slave down while ${he} fucks her.` - break + t += `${He}'s pinning another slave down while ${he} fucks her.`; + break; case "submissive": - t += `${He}'s letting another slave have her way with ${him}.` - break + t += `${He}'s letting another slave have her way with ${him}.`; + break; case "sadist": if (slave.amp != 1) { - t += `${He}'s spanking another slave with one hand and fingering her with the other.` + t += `${He}'s spanking another slave with one hand and fingering her with the other.`; } else { - t += `${He}'s painfully teasing another slave's nipple with ${his} teeth.` + t += `${He}'s painfully teasing another slave's nipple with ${his} teeth.`; } - break + break; case "masochist": - t += `Another slave is spanking ${him} while molesting everything she can.` - break + t += `Another slave is spanking ${him} while molesting everything she can.`; + break; case "boobs": - t += `${He} has a slave sucking on each of ${his} nipples` + t += `${He} has a slave sucking on each of ${his} nipples`; if (slave.amp != 1) { - t += ` while ${he} gives each a handjob.` + t += ` while ${he} gives each a handjob.`; } else { - t += "." + t += "."; } - break + break; case "pregnancy": if (slave.belly >= 5000) { - t += `${He}'s sighing contentedly as ${his} rounded belly is sensually rubbed.` + t += `${He}'s sighing contentedly as ${his} rounded belly is sensually rubbed.`; } else if (canPenetrate(slave)) { - t += `${He}'s happily roleplaying impregnating the slave ${he}'s fucking.` + t += `${He}'s happily roleplaying impregnating the slave ${he}'s fucking.`; } else if ((slave.anus > 0 && canDoAnal(slave)) || (slave.vagina > 0 && canDoVaginal(slave))) { - t += `${He}'s happily roleplaying conceiving a child as ${he} gets fucked.` + t += `${He}'s happily roleplaying conceiving a child as ${he} gets fucked.`; } else { - t += `${He}'s happily roleplaying being hugely pregnant.` + t += `${He}'s happily roleplaying being hugely pregnant.`; } } } } } - break + break; /* case "guard you": t += "is standing discreetly behind your left shoulder, watching for threats." break */ case "stay confined": - t += `is confined, but you have a fine view of ${his} ${race} body on the feed from ${his} cell.` - break + t += `is confined, but you have a fine view of ${his} ${race} body on the feed from ${his} cell.`; + break; case "be confined in the cellblock": - t += `is confined in ${V.cellblockName}, but you have a fine view of ${his} ${race} body on the feed from ${his} cell.` - break + t += `is confined in ${V.cellblockName}, but you have a fine view of ${his} ${race} body on the feed from ${his} cell.`; + break; case "be confined in the arcade": case "work a glory hole": - t += "is confined in " + t += "is confined in "; if (slave.assignment == "be confined in the arcade") { - t += `${V.arcadeName}; ` + t += `${V.arcadeName}; `; } else { - t += "a glory hole; " + t += "a glory hole; "; } if (_seed > 80 && (canDoAnal(slave) || canDoVaginal(slave))) { - t += `${his} ass is held out at cock height, and a customer is using ${his} fuckhole.` + t += `${his} ass is held out at cock height, and a customer is using ${his} fuckhole.`; } else if (_seed > 60) { - t += `${his} mouth is held open at cock height, and a customer is fucking ${his} throat.` + t += `${his} mouth is held open at cock height, and a customer is fucking ${his} throat.`; } else if (_seed > 40) { - t += `a woman is abusing ${him} with a couple of dildos.` + t += `a woman is abusing ${him} with a couple of dildos.`; } else if (_seed > 20 && canDoAnal(slave)) { - t += `a customer is harshly using ${his} defenseless anus.` + t += `a customer is harshly using ${his} defenseless anus.`; } else { - t += `a customer is cruelly spanking ${his} helpless butt.` + t += `a customer is cruelly spanking ${his} helpless butt.`; } - break + break; case "be the Madam": - t += `is managing ${V.brothelName}: ${he} is making sure all the customers are satisfied and all the whores are working hard.` - break + t += `is managing ${V.brothelName}: ${he} is making sure all the customers are satisfied and all the whores are working hard.`; + break; case "be your Concubine": if (jsRandom(1,2) == 1) { - t += `is looking after ${himself}; ${he} spends many hours every day on ${his} beauty regimen.` + t += `is looking after ${himself}; ${he} spends many hours every day on ${his} beauty regimen.`; } else { - t += "is checking over the appearance of your harem, making sure everyone looks perfect." + t += "is checking over the appearance of your harem, making sure everyone looks perfect."; } - break + break; case "be the Wardeness": - t += `is looking after the cells: ${he} is ` + t += `is looking after the cells: ${he} is `; if (_seed > 50) { - t += `forcing a resistant slave to orally service ${him}.` + t += `forcing a resistant slave to orally service ${him}.`; } else { - t += "beating a rebellious slave across the buttocks." + t += "beating a rebellious slave across the buttocks."; } - break + break; case "live with your Head Girl": if (V.HeadGirl != 0) { - t += `is getting the Head Girl's suite cleaned up while ${V.HeadGirl.slaveName} is out working.` + t += `is getting the Head Girl's suite cleaned up while ${V.HeadGirl.slaveName} is out working.`; } else { - t += "is making sure the Head Girl's suite is in order for your next Head Girl." + t += "is making sure the Head Girl's suite is in order for your next Head Girl."; } - break + break; case "be the Stewardess": - t += `is managing the house servants in ${V.servantsQuartersName}: ${he} overseeing the laboring house slaves and punishing any that step out of line.` - break + t += `is managing the house servants in ${V.servantsQuartersName}: ${he} overseeing the laboring house slaves and punishing any that step out of line.`; + break; case "be the Schoolteacher": - t += `is teaching classes in ${V.schoolroomName}: ${he} is leading the slave students in rote recitation.` - break + t += `is teaching classes in ${V.schoolroomName}: ${he} is leading the slave students in rote recitation.`; + break; case "be the Attendant": - t += `is seeing to girls in ${V.spaName}: ${he} is gently soaping an exhausted slave.` - break + t += `is seeing to girls in ${V.spaName}: ${he} is gently soaping an exhausted slave.`; + break; case "be the DJ": if (_seed > 50) { - t += `is right where ${he} belongs, in the DJ booth in ${V.clubName} ${he} leads. ${He}'s bouncing in time with the beat to show off ${his} ` + t += `is right where ${he} belongs, in the DJ booth in ${V.clubName} ${he} leads. ${He}'s bouncing in time with the beat to show off ${his} `; if (slave.boobs > 300) { - t += "tits." + t += "tits."; } else { - t += "goods." + t += "goods."; } } else { - t += `is taking the lead on ${V.clubName}'s floor: ${he} greets new arrivals, flirts with them prettily, and subtly guides them towards choice sluts.` + t += `is taking the lead on ${V.clubName}'s floor: ${he} greets new arrivals, flirts with them prettily, and subtly guides them towards choice sluts.`; } - break + break; case "be the Milkmaid": - t += `is working in ${V.dairyName}, looking after your stock.` - break + t += `is working in ${V.dairyName}, looking after your stock.`; + break; default: /* WALKPASTS START HERE */ if (slave.heels == 1 && !["flats", "none"].includes(slave.shoes)) { - t += `walks past your desk with the tiny swaying steps ${he} must take in order to walk on ${his} surgically altered legs. ${He} is on ${his} way to ` + t += `walks past your desk with the tiny swaying steps ${he} must take in order to walk on ${his} surgically altered legs. ${He} is on ${his} way to `; } else if (["heels", "pumps"].includes(slave.shoes)) { - t += `walks past your desk with the swaying steps ${he} must take in ${his} high heels. ${He} is on ${his} way to ` + t += `walks past your desk with the swaying steps ${he} must take in ${his} high heels. ${He} is on ${his} way to `; } else if (slave.shoes == "boots") { - t += `walks past your desk with the confident gait encouraged by ${his} high heeled boots. ${He} is on ${his} way to ` + t += `walks past your desk with the confident gait encouraged by ${his} high heeled boots. ${He} is on ${his} way to `; } else if (slave.shoes == "extreme heels") { - t += `walks past your desk with the tiny swaying steps ${he} must take in ${his} ridiculous heels. ${He} is on ${his} way to ` + t += `walks past your desk with the tiny swaying steps ${he} must take in ${his} ridiculous heels. ${He} is on ${his} way to `; } else if (slave.heels == 1) { - t += `crawls past your desk on all fours, since ${he} has not been allowed the heels ${he} needs to walk upright. ${He} is on ${his} way to ` + t += `crawls past your desk on all fours, since ${he} has not been allowed the heels ${he} needs to walk upright. ${He} is on ${his} way to `; } else if (slave.amp == 1) { - t += `is carried past your desk by one of your other slaves. ${He} is on ${his} way to ` + t += `is carried past your desk by one of your other slaves. ${He} is on ${his} way to `; } else if (!canWalk(slave)) { - t += `is helped past your desk by one of your other slaves. ${He} is on ${his} way to ` + t += `is helped past your desk by one of your other slaves. ${He} is on ${his} way to `; } else { - t += `walks past your desk on ${his} way to ` + t += `walks past your desk on ${his} way to `; } if (slave.inflation > 0 && jsRandom(1,100) > 70) { if (slave.inflationMethod == 1) { - t += `gorge ${himself} with ${slave.inflationType}; ` + t += `gorge ${himself} with ${slave.inflationType}; `; } else if (slave.inflationMethod == 2) { - t += `fill ${his} rear with ` + t += `fill ${his} rear with `; switch (slave.inflationType) { case "water": case "milk": case "cum": case "food": - t += `${slave.inflationType}; ` - break + t += `${slave.inflationType}; `; + break; default: - t += `${slave.inflationType}s; ` - break + t += `${slave.inflationType}s; `; + break; } } else if (slave.inflationMethod == 3) { if (slave.inflationType == "milk") { - t += `suckle from ${his} assigned nipple until ${he} is sufficiently filled with milk; ` + t += `suckle from ${his} assigned nipple until ${he} is sufficiently filled with milk; `; } else { - t += `suck ${his} assigned dick until ${he} is sufficiently filled with cum; ` + t += `suck ${his} assigned dick until ${he} is sufficiently filled with cum; `; } } } else { switch (slave.assignment) { case "rest": if (_seed > 50) { - t += "bed; " + t += "bed; "; } else { - t += "eat; " + t += "eat; "; } - break + break; case "get milked": if (_seed > 50) { if (slave.lactation) { - t += `milk ${his} overfull ${race} tits; ` + t += `milk ${his} overfull ${race} tits; `; } else { - t += `empty ${his} aching balls; ` + t += `empty ${his} aching balls; `; } } else { if (slave.lactation) { - t += `drain ${his} milky ${race} udders; ` + t += `drain ${his} milky ${race} udders; `; } else { - t += `relieve ${his} heavy balls; ` + t += `relieve ${his} heavy balls; `; } } - break + break; case "whore": if (_seed > 50) { - t += `sell ${his} ${race} body; ` + t += `sell ${his} ${race} body; `; } else { - t += `ply ${his} trade as a whore; ` + t += `ply ${his} trade as a whore; `; } - break + break; case "serve the public": if (_seed > 50) { - t += "serve the public; " + t += "serve the public; "; } else { - t += "be a public slut; " + t += "be a public slut; "; } - break + break; case "rest in the spa": - t += `relax in ${V.spaName}; ` - break + t += `relax in ${V.spaName}; `; + break; case "please you": - t += `wait next to you and wait for you to fuck ${him}; ` - break + t += `wait next to you and wait for you to fuck ${him}; `; + break; case "be a subordinate slave": - t += "service your other slaves; " - break + t += "service your other slaves; "; + break; case "be a servant": - t += "clean up after your other slaves; " - break + t += "clean up after your other slaves; "; + break; case "learn in the schoolroom": - t += "attend classes " + t += "attend classes "; if (V.Schoolteacher == 0) { - t += `in ${V.schoolroomName}; ` + t += `in ${V.schoolroomName}; `; } else { - t += `under ${V.Schoolteacher.slaveName}, perhaps literally; ` + t += `under ${V.Schoolteacher.slaveName}, perhaps literally; `; } - break + break; case "be a subordinate slave": - t += "service your other slaves; " - break + t += "service your other slaves; "; + break; case "be the Attendant": - t += `look after the girls in ${V.spaName}; ` - break + t += `look after the girls in ${V.spaName}; `; + break; case "take classes": - t += `attend classes with ${V.assistantName}; ` - break + t += `attend classes with ${V.assistantName}; `; + break; case "be your Head Girl": - t += "oversee your other slaves; " - break + t += "oversee your other slaves; "; + break; case "recruit girls": - t += `use ${his} connections to recruit slaves; ` - break + t += `use ${his} connections to recruit slaves; `; + break; default: - t += `${slave.assignment}; ` - break + t += `${slave.assignment}; `; + break; } } /* end inflation blurb */ if (slave.fetish == "mindbroken") { - t += `${he} does not even glance at you as ${he} goes mindlessly to ${his} next task.` + t += `${he} does not even glance at you as ${he} goes mindlessly to ${his} next task.`; } else if (slave.devotion < -50) { - t += `${he} directs a look of pure hatred at where you sit as ${he} passes.` + t += `${he} directs a look of pure hatred at where you sit as ${he} passes.`; } else if (slave.devotion < -20) { - t += `${he} cannot keep the loathing from ${his} face as ${he} passes.` + t += `${he} cannot keep the loathing from ${his} face as ${he} passes.`; } else if (slave.devotion <= 20) { - t += `${he} passes quickly, obviously hoping to avoid you.` + t += `${he} passes quickly, obviously hoping to avoid you.`; } else if (slave.devotion <= 50) { - t += `${he} rushes by, hurrying to ${his} next task.` + t += `${he} rushes by, hurrying to ${his} next task.`; } else { - t += `as ${he} passes ${he} gives you a look of adoration.` + t += `as ${he} passes ${he} gives you a look of adoration.`; } - break + break; } - return t -} + return t; +}; /*:: Datatype Cleanup JS [script]*/ @@ -38013,7 +37911,7 @@ window.Beauty = (function() { }; function calcRepopulationPregBeauty(slave) { - if (slave.preg > 30) { /*limited huge boost for full term */ + if (slave.preg > slave.pregData.normalBirth/1.33) { /*limited huge boost for full term */ if (slave.broodmother > 0) { beauty += 0.4*(slave.broodmother*arcology.FSRepopulationFocus); /*40-80 limited due to constant presence. Also good breeders, but subpar mothers*/ } else if (slave.bellyPreg >= 600000) { @@ -38025,7 +37923,7 @@ window.Beauty = (function() { } else { beauty += 0.8*arcology.FSRepopulationFocus; /*80*/ } - } else if (slave.preg > 20) { + } else if (slave.preg > slave.pregData.normalBirth/2) { if (slave.pregType >= 20) { beauty += 10*(arcology.FSRepopulationFocus/40); /*25*/ } else if (slave.pregType >= 10) { @@ -38033,7 +37931,7 @@ window.Beauty = (function() { } else { beauty += 8*(arcology.FSRepopulationFocus/40); /*20*/ } - } else if (slave.preg > 10) { + } else if (slave.preg > slave.pregData.normalBirth/4) { if (slave.pregType >= 20) { beauty += arcology.FSRepopulationFocus/5; /*20*/ } else if (slave.pregType >= 10) { @@ -38056,7 +37954,7 @@ window.Beauty = (function() { }; function calcTrendyPregBeauty(slave) { - if (slave.preg > 30) { /*limited huge boost for full term */ + if (slave.preg > slave.pregData.normalBirth/1.33) { /*limited huge boost for full term */ beauty += 20; } else if (slave.bellyPreg >= 1500) { beauty += 10; @@ -38065,11 +37963,11 @@ window.Beauty = (function() { function calcRestartPregBeauty(slave) { if (slave.breedingMark === 1 && V.propOutcome === 1) { - if (slave.preg > 5 && slave.pregSource === -1) { + if (slave.preg > slave.pregData.normalBirth/8 && slave.pregSource === -1) { beauty += arcology.FSRestart; /*100*/ } } else { - if (slave.preg > 30) { + if (slave.preg > slave.pregData.normalBirth/1.33) { if (slave.bellyPreg >= 600000) { beauty -= 2.5*arcology.FSRestart; /*-250*/ } else if (slave.bellyPreg >= 300000) { @@ -38079,7 +37977,7 @@ window.Beauty = (function() { } else { beauty -= 0.75*arcology.FSRestart; /*-75*/ } - } else if (slave.preg > 20) { + } else if (slave.preg > slave.pregData.normalBirth/2) { if (slave.pregType >= 20) { beauty -= arcology.FSRestart/1.5; /*-66.6*/ } else if (slave.pregType >= 10) { @@ -38087,7 +37985,7 @@ window.Beauty = (function() { } else { beauty -= arcology.FSRestart/3; /*-33.3*/ } - } else if (slave.preg > 10) { + } else if (slave.preg > slave.pregData.normalBirth/4) { if (slave.pregType >= 20) { beauty -= 3*(arcology.FSRestart/8); /*-37.5*/ } else if (slave.pregType >= 10) { @@ -38654,7 +38552,7 @@ window.FResult = (function() { result += 0; } if (V.arcologies[0].FSRepopulationFocusMilfPolicy === 1 || V.arcologies[0].FSRepopulationFocus > 20) { - result += 1; + result += 1; } } @@ -38922,7 +38820,7 @@ window.slaveCost = (function() { multiplier += 1; } else if (slave.bellyPreg >= 120000) { multiplier += 0.5; - } else if (slave.preg > 10) { + } else if (slave.preg > slave.pregData.normalBirth/4) { multiplier += 0.1; } } else if (arcology.FSRestartSMR === 1) { @@ -38932,7 +38830,7 @@ window.slaveCost = (function() { multiplier -= 2.5; } else if (slave.bellyPreg >= 30000) { multiplier -= 1.5; - } else if (slave.preg > 10) { + } else if (slave.preg > slave.pregData.normalBirth/4) { multiplier -= 1.0; } } else { @@ -38942,7 +38840,7 @@ window.slaveCost = (function() { multiplier -= 1.5; } else if (V.activeSlave.bellyPreg >= 120000) { multiplier -= 0.5; - } else if (slave.preg > 10) { + } else if (slave.preg > slave.pregData.normalBirth/4) { multiplier -= 0.1; } } @@ -39238,4 +39136,4 @@ window.slaveCost = (function() { window.startingSlaveCost = function startingSlaveCost(slave) { return slaveCost(slave, true); -}; \ No newline at end of file +}; diff --git a/src/js/DefaultRules.tw b/src/js/DefaultRules.tw index 823cef231fc0865d828d99f5c0849e8a21f06e3e..7019772719e4eca718f3a29efbb1e37d1e0a02b7 100644 --- a/src/js/DefaultRules.tw +++ b/src/js/DefaultRules.tw @@ -8,7 +8,7 @@ window.DefaultRules = (function() { function DefaultRules(slave) { if (slave.useRulesAssistant === 0) return r; //exempted - + V = State.variables; r = ""; let rule = MergeRules(slave); @@ -71,24 +71,24 @@ window.DefaultRules = (function() { } function ProcessAssignments(slave, rule) { - // Before merging rules, we process assignments for each rule separately so we can remove slaves from facilities when they no longer qualify, even if the final "winning" rule assigns them elsewhere - // We also ignore inapplicable assignments for the current slave, so we only merge assignments that are valid + // Before merging rules, we process assignments for each rule separately so we can remove slaves from facilities when they no longer qualify, even if the final "winning" rule assigns them elsewhere + // We also ignore inapplicable assignments for the current slave, so we only merge assignments that are valid switch (rule.setAssignment) { case "no default setting": delete rule.setAssignment; break; - + case "rest": case "please you": case "choose her own job": - // slaves always qualify for this assignment + // slaves always qualify for this assignment break; case "live with your Head Girl": if ((V.HGSuiteSlaves < 1 && slave.indentureRestrictions <= 0)) break; else { - RAFacilityRemove(slave, rule); // before deleting rule.setAssignment + RAFacilityRemove(slave, rule); // before deleting rule.setAssignment delete rule.setAssignment; } break; @@ -97,7 +97,7 @@ window.DefaultRules = (function() { if ((V.arcadeSlaves < V.arcade && slave.indentureRestrictions <= 0 && (slave.breedingMark != 1 || V.propOutcome === 0))) break; else { - RAFacilityRemove(slave, rule); // before deleting rule.setAssignment + RAFacilityRemove(slave, rule); // before deleting rule.setAssignment delete rule.setAssignment; } break; @@ -106,7 +106,7 @@ window.DefaultRules = (function() { if ((V.masterSuiteSlaves < V.masterSuite && (slave.devotion > 20 || slave.trust < -50 || (slave.devotion >= -50 && slave.trust < -20)))) break; else { - RAFacilityRemove(slave, rule); // before deleting rule.setAssignment + RAFacilityRemove(slave, rule); // before deleting rule.setAssignment delete rule.setAssignment; } break; @@ -115,7 +115,7 @@ window.DefaultRules = (function() { if ((V.clinicSlaves < V.clinic && (slave.health < 20 || (slave.chem > 15 && V.Nurse !== 0 && V.clinicUpgradeFilters == 1)) || ((slave.bellyImplant > -1) && (V.bellyImplants == 1)) || slave.preg > 1)) break; else { - RAFacilityRemove(slave, rule); // before deleting rule.setAssignment + RAFacilityRemove(slave, rule); // before deleting rule.setAssignment delete rule.setAssignment; } break; @@ -124,7 +124,7 @@ window.DefaultRules = (function() { if ((V.spaSlaves < V.spa) && (slave.health < 20) || (slave.trust < 60) || (slave.devotion <= 60) || (slave.fetish == "mindbroken") && (slave.devotion >= -20)) break; else { - RAFacilityRemove(slave,rule); // before deleting rule.setAssignment + RAFacilityRemove(slave,rule); // before deleting rule.setAssignment delete rule.setAssignment; } break; @@ -133,7 +133,7 @@ window.DefaultRules = (function() { if ((V.nurserySlaves < V.nursery) && !slave.fuckdoll && (slave.devotion > 20 || slave.trust > 20)) break; else { - RAFacilityRemove(slave, rule); // before deleting rule.setAssignment + RAFacilityRemove(slave, rule); // before deleting rule.setAssignment delete rule.setAssignment; } break; @@ -142,7 +142,7 @@ window.DefaultRules = (function() { if ((V.brothelSlaves < V.brothel && (slave.devotion > 50 || slave.trust > 50 || slave.trust < -50 || (slave.devotion >= -50 && slave.trust < -20)) && (slave.breedingMark != 1 || V.propOutcome === 0))) break; else { - RAFacilityRemove(slave, rule); // before deleting rule.setAssignment + RAFacilityRemove(slave, rule); // before deleting rule.setAssignment delete rule.setAssignment; } break; @@ -151,7 +151,7 @@ window.DefaultRules = (function() { if ((V.clubSlaves < V.club && (slave.devotion > 50 || slave.trust > 50 || slave.trust < -50 || (slave.devotion >= -50 && slave.trust < -20)) && (slave.breedingMark != 1 || V.propOutcome === 0))) break; else { - RAFacilityRemove(slave, rule); // before deleting rule.setAssignment + RAFacilityRemove(slave, rule); // before deleting rule.setAssignment delete rule.setAssignment; } break; @@ -169,19 +169,19 @@ window.DefaultRules = (function() { if ((V.dairyPregSetting < 2) || (slave.vagina > 2) || (slave.ovaries === 0) || (V.dairyPrepUpgrade == 1)) break; else { - RAFacilityRemove(slave,rule); // before deleting rule.setAssignment + RAFacilityRemove(slave,rule); // before deleting rule.setAssignment delete rule.setAssignment; } } else { - RAFacilityRemove(slave,rule); // before deleting rule.setAssignment + RAFacilityRemove(slave,rule); // before deleting rule.setAssignment delete rule.setAssignment; } } else { - RAFacilityRemove(slave,rule); // before deleting rule.setAssignment + RAFacilityRemove(slave,rule); // before deleting rule.setAssignment delete rule.setAssignment; } } else { - RAFacilityRemove(slave,rule); // before deleting rule.setAssignment + RAFacilityRemove(slave,rule); // before deleting rule.setAssignment delete rule.setAssignment; } } @@ -201,7 +201,7 @@ window.DefaultRules = (function() { if ((V.servantsQuartersSlaves < V.servantsQuarters && canSee(slave) && canWalk(slave) && (slave.devotion >= -20 || slave.trust < -20 || (slave.devotion >= -50 && slave.trust <= 20)))) break; else { - RAFacilityRemove(slave,rule); // before deleting rule.setAssignment + RAFacilityRemove(slave,rule); // before deleting rule.setAssignment delete rule.setAssignment; } break; @@ -211,11 +211,11 @@ window.DefaultRules = (function() { if ((slave.intelligenceImplant < 30) || (slave.voice !== 0 && slave.accent+V.schoolroomUpgradeLanguage > 2) || (slave.oralSkill <= 10+V.schoolroomUpgradeSkills*20) || (slave.whoreSkill <= 10+V.schoolroomUpgradeSkills*20) || (slave.entertainSkill <= 10+V.schoolroomUpgradeSkills*20) || (slave.analSkill < 10+V.schoolroomUpgradeSkills*20) || ((slave.vagina >= 0) && (slave.vaginalSkill < 10+V.schoolroomUpgradeSkills*20))) break; else { - RAFacilityRemove(slave,rule); // before deleting rule.setAssignment + RAFacilityRemove(slave,rule); // before deleting rule.setAssignment delete rule.setAssignment; } else { - RAFacilityRemove(slave,rule); // before deleting rule.setAssignment + RAFacilityRemove(slave,rule); // before deleting rule.setAssignment delete rule.setAssignment; } break; @@ -224,7 +224,7 @@ window.DefaultRules = (function() { if ((V.cellblockSlaves < V.cellblock && ((slave.devotion < -20 && slave.trust >= -20) || (slave.devotion < -50 && slave.trust >= -50)))) break; else { - RAFacilityRemove(slave,rule); // before deleting rule.setAssignment + RAFacilityRemove(slave,rule); // before deleting rule.setAssignment delete rule.setAssignment; } break; @@ -857,7 +857,7 @@ window.DefaultRules = (function() { slave.buttplug = "plug"; } break; - + case "long, large plug": if (slave.breedingMark == 1 && V.propOutcome == 1) { r += `<br>Breeding regulations forbid the use of anal plugs that can damage a growing fetus on marked slaves, so ${slave.slaveName} has been given a standard length large plug for her anus.`; @@ -999,7 +999,7 @@ window.DefaultRules = (function() { } function ProcessAssetGrowthDrugs(slave, rule) { - // Asset Growth + // Asset Growth const growth_drugs = new Set(["breast injections", "intensive breast injections", "breast redistributors", "butt injections", "intensive butt injections", "butt redistributors", "lip injections", "lip atrophiers", "penis enhancement", "intensive penis enhancement", "penis atrophiers", "testicle enhancement", "intensive testicle enhancement", "testicle atrophiers", "hyper breast injections", "hyper butt injections", "hyper penis enhancement", "hyper testicle enhancement"]); if ((slave.drugs == "super fertility drugs" || slave.drugs == "fertility drugs") && isFertile(slave)) { r += `<br>${slave.slaveName} is on ${slave.drugs} and will not be considered for drug enhancement until that regime is complete.`; @@ -1205,7 +1205,7 @@ window.DefaultRules = (function() { } function ProcessOtherDrugs(slave, rule) { - // Other Drugs + // Other Drugs if (slave.indentureRestrictions < 2 && rule.drug !== "no default setting" && slave.drugs !== rule.drug) { let flag = true; switch (rule.drug) { @@ -1233,117 +1233,117 @@ window.DefaultRules = (function() { if (!((slave.breedingMark != 1 || V.propOutcome == 0) && slave.balls > 0 && slave.pubertyXY === 0)) flag = false; break; - + case "psychosuppressants": if (!(slave.intelligence > -100 && slave.indentureRestrictions < 1)) flag = false; break; - + case "breast injections": if (!(slave.boobs < 48000)) flag = false; break; - + case "hyper breast injections": if (!(slave.boobs < 25000)) flag = false; break; - + case "breast redistributors": if (!(slave.boobs - slave.boobsImplant > 100)) flag = false; break; - + case "butt injections": if (!(slave.butt < 9)) flag = false; break; - + case "hyper butt injections": if (!(slave.butt < 20)) flag = false; break; - + case "nipple atrophiers": if (!(["huge", "puffy", "cute"].includes(slave.nipples))) flag = false; break; - + case "butt redistributors": if (!(slave.buttImplant > 0)) flag = false; break; - + case "lip injections": if (!(slave.lips <= 95 || (slave.lips <= 85 && V.seeExtreme !== 1))) flag = false; break; - + case "lip atrophiers": if (!(slave.lips - slave.lipsImplant > 0)) flag = false; break; - + case "super fertility drugs": if (!(slave.indentureRestrictions < 1 && (slave.breedingMark !== 1 || V.propOutcome == 0))) flag = false; break; - + case "penis enhancement": if (!((slave.dick > 0 && slave.dick < 10) || slave.clit < 5)) flag = false; break; - + case "hyper penis enhancement": if (!((slave.dick > 0 && slave.dick < 31) || slave.clit < 5)) flag = false; break; - + case "penis atrophiers": if (!(slave.dick > 1)) flag = false; break; - + case "testicle enhancement": if (!(slave.balls > 0)) flag = false; break; - + case "hyper testicle enhancement": if (!(slave.balls > 0)) flag = false; break; - + case "testicle atrophiers": if (!(slave.balls > 1)) flag = false; break; - + case "clitoris atrophiers": if (!(slave.clit > 0)) flag = false; break; - + case "labia atrophiers": if (!(slave.labia > 0)) flag = false; break; - + case "appetite suppressors": if (!(slave.weight <= -95)) flag = false; break; - + case "female hormone injections": if (!((slave.breedingMark !== 1 || V.propOutcome == 0) && (slave.ovaries === 1 || slave.mpreg === 1) && slave.pubertyXX === 0)) flag = false; break; - + case "male hormone injections": if (!(slave.balls > 0 && slave.pubertyXY === 0)) flag = false; break; - + default: break; } @@ -1398,7 +1398,7 @@ window.DefaultRules = (function() { } function ProcessDiet(slave, rule) { - // Diet Setting + // Diet Setting if (rule.diet !== undefined && rule.diet !== "no default setting") { /* if ((slave.boobs >= 1600) && (slave.muscles <= 5) && (slave.amp != 1) && ((rule.muscles == "no default setting") || (rule.muscles === 0))) { @@ -1426,7 +1426,7 @@ window.DefaultRules = (function() { slave.diet = "restricted"; r += `<br>${slave.slaveName} is too fat so her diet has been set to restricted.`; } - + } else if ((slave.weight - rule.diet) < -5) { if ((slave.diet !== "fattening")) { slave.diet = "fattening"; @@ -1547,7 +1547,7 @@ window.DefaultRules = (function() { } } } - } else if ((rule.muscles !== undefined) && (rule.muscles !== "no default setting") && (slave.amp != 1)) { // no diet rule, muscles only + } else if ((rule.muscles !== undefined) && (rule.muscles !== "no default setting") && (slave.amp != 1)) { // no diet rule, muscles only if ((slave.muscles >= rule.muscles+8)) { if ((slave.diet !== "slimming")) { slave.diet = "slimming"; @@ -1844,7 +1844,7 @@ window.DefaultRules = (function() { } } } - + function ProcessSolidFood(slave, rule) { if ((rule.onDiet !== undefined) && (rule.onDiet !== "no default setting")) { if ((slave.onDiet !== rule.onDiet)) { @@ -2457,12 +2457,12 @@ window.DefaultRules = (function() { } } } - + function ProcessLabel(slave, rule) { if (rule.label !== "no default setting" && !slave.customLabel.includes("["+rule.label+"]")) { slave.customLabel = slave.customLabel + "[" + rule.label + "]"; r += `<br>${slave.slaveName} has been tagged as ${rule.label}`; - } + } if (rule.removeLabel !== "no default setting" && slave.customLabel.includes("["+rule.removeLabel+"]")) { slave.customLabel = slave.customLabel.replace("["+rule.removeLabel+"]", ""); diff --git a/src/js/assayJS.tw b/src/js/assayJS.tw index a7f48ff960dea669936d5f26534027584c5755b0..a83041606a17ba784a95b5e79a0ec2e9af2d470d 100644 --- a/src/js/assayJS.tw +++ b/src/js/assayJS.tw @@ -1,21 +1,25 @@ :: AssayJS [script] window.isSlim = function(slave) { - var slim = false; - var ArcologyZero = State.variables.arcologies[0]; - - if ((slave.boobs < 500) && (slave.butt < 3)) { - if ((slave.muscles <= 30) && (ArcologyZero.FSPhysicalIdealist === "unset") && (slave.weight <= 10) && (ArcologyZero.FSHedonisticDecadence === "unset")) { - slim = true; - } else if (ArcologyZero.FSPhysicalIdealist !== "unset") { - if ((ArcologyZero.FSPhysicalIdealistStrongFat === 1) && (slave.weight <= 30)) { - slim = true; - } - } else if ((ArcologyZero.FSHedonisticDecadence !== "unset") && (slave.weight <= 30)) { - if (ArcologyZero.FSHedonisticDecadenceStrongFat === 1) { - slim = true; - } else if (slave.muscles <= 30) { + let slim = false; + const ArcologyZero = State.variables.arcologies[0]; + + if (ArcologyZero.FSSlimnessEnthusiastLaw === 1) { + return (slimPass(slave) === 1); + } else { + if ((slave.boobs < 500) && (slave.butt < 3)) { + if ((slave.muscles <= 30) && (ArcologyZero.FSPhysicalIdealist === "unset") && (slave.weight <= 10) && (ArcologyZero.FSHedonisticDecadence === "unset")) { slim = true; + } else if (ArcologyZero.FSPhysicalIdealist !== "unset") { + if ((ArcologyZero.FSPhysicalIdealistStrongFat === 1) && (slave.weight <= 30)) { + slim = true; + } + } else if ((ArcologyZero.FSHedonisticDecadence !== "unset") && (slave.weight <= 30)) { + if (ArcologyZero.FSHedonisticDecadenceStrongFat === 1) { + slim = true; + } else if (slave.muscles <= 30) { + slim = true; + } } } } @@ -28,18 +32,15 @@ window.isStacked = function(slave) { }; window.isModded = function(slave) { - var tatScore = TatScore(slave); - var piercingScore = PiercingScore(slave); - var modScore = piercingScore+tatScore; + let tatScore = TatScore(slave); + let piercingScore = PiercingScore(slave); + let modScore = piercingScore+tatScore; - return ((modScore > 15) || (piercingScore > 8) && (tatScore > 5)); + return ((modScore > 15) || (piercingScore > 8 && tatScore > 5)); }; window.isUnmodded = function(slave) { - var tatScore = TatScore(slave); - var piercingScore = PiercingScore(slave); - - return !isModded(slave) && (slave.corsetPiercing === 0) && (piercingScore < 3) && (tatScore < 2); + return (!isModded(slave) && (slave.corsetPiercing === 0) && (PiercingScore(slave) < 3) && (TatScore(slave) < 2)); }; window.isXY = function(slave) { @@ -55,7 +56,7 @@ window.isPreg = function(slave) { }; window.isNotPreg = function(slave) { - return !isPreg(slave) && (slave.belly < 100) && (slave.weight < 30) && !setup.fakeBellies.includes(slave.bellyAccessory); + return (!isPreg(slave) && (slave.belly < 100) && (slave.weight < 30) && !setup.fakeBellies.includes(slave.bellyAccessory)); }; window.isPure = function(slave) { @@ -70,7 +71,7 @@ window.modScore = function modScore(slave) { }; window.PiercingScore = function(slave) { - var piercingScore = 0; + let piercingScore = 0; if (slave.earPiercing > 0) { piercingScore += slave.earPiercing*0.75-0.5; @@ -117,7 +118,7 @@ window.PiercingScore = function(slave) { }; window.TatScore = function(slave) { - var tatScore = 0; + let tatScore = 0; if (slave.boobsTat !== 0) { tatScore += 1.25; @@ -474,7 +475,7 @@ window.getPronouns = function getPronouns(slave) { window.SlavePronouns = function SlavePronouns(slave) { const V = State.variables; - var pronouns = getPronouns(slave); + const pronouns = getPronouns(slave); V.pronoun = pronouns.pronoun; V.pronounCap = capFirstChar(pronouns.pronoun); V.possessive = pronouns.possessive; @@ -1653,7 +1654,7 @@ window.DegradingName = function DegradingName(slave) { if (slave.fetishKnown === 1) { if (slave.fetish === "buttslut") { names.push("Anal", "Sodomy"); - } + } if (slave.fetish === "cumslut") { names.push("Cum", "Dicksuck", "Sucker"); } @@ -2178,7 +2179,7 @@ window.Deadliness = function Deadliness(slave) { deadliness -= 1; } } - + if (slave.labor === 1) { deadliness -= 15; } else if (slave.preg >= slave.pregData.normalBirth && slave.pregControl !== "labor supressors") { diff --git a/src/js/economyJS.tw b/src/js/economyJS.tw index 2c0a51ce590072503956974eccb3377e7fcfb955..9b375c4d5e4f8ba1c0b25494cbef5a20998f9864 100644 --- a/src/js/economyJS.tw +++ b/src/js/economyJS.tw @@ -690,8 +690,8 @@ window.initFacilityStatistics = function(facility) { facility.profit = 0; facility.income = new Map(); return facility; -} +}; Number.prototype.toFixedHTML = function() { return commaNum(Number.prototype.toFixed.apply(this, arguments)).replace(/\.0+$/, '<span style="opacity: 0.3">$&</span>'); -} \ No newline at end of file +}; diff --git a/src/js/itemAvailability.tw b/src/js/itemAvailability.tw index 8cf51a08b04bb3569e6df1b4f8d5dd04485ed6d7..228bb91fd8efb5ccb57adacf6bba08c538fb8275 100644 --- a/src/js/itemAvailability.tw +++ b/src/js/itemAvailability.tw @@ -2,203 +2,78 @@ /* intended to condense the clothing/toy/etc availability checks into something less asinine */ window.isItemAccessible = function(string) { - const V = State.variables; - if (State.variables.cheatMode === 1){ + if (V.cheatMode === 1){ return true; } else { - switch(string) { + switch (string) { /* no breaks needed because we always return */ case 'attractive lingerie for a pregnant woman': - if ((V.arcologies[0].FSRepopulationFocus > 0) || (V.clothesBoughtMaternityLingerie === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSRepopulationFocus > 0 || V.clothesBoughtMaternityLingerie === 1); case 'a bunny outfit': - if ((V.arcologies[0].FSGenderFundamentalist > 0) || (V.clothesBoughtBunny === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSGenderFundamentalist > 0 || V.clothesBoughtBunny === 1); case 'body oil': - if ((V.arcologies[0].FSPhysicalIdealist > 0) || (V.clothesBoughtOil === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSPhysicalIdealist > 0 || V.clothesBoughtOil === 1); case 'chains': - if ((V.arcologies[0].FSDegradationist > 0) || (V.clothesBoughtChains === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSDegradationist > 0 || V.clothesBoughtChains === 1); case 'a chattel habit': - if ((V.arcologies[0].FSChattelReligionist > 0) || (V.clothesBoughtHabit === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSChattelReligionist > 0 || V.clothesBoughtHabit === 1); case 'conservative clothing': - if ((V.arcologies[0].FSPaternalist > 0) || (V.clothesBoughtConservative === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSPaternalist > 0 || V.clothesBoughtConservative === 1); case 'harem gauze': - if ((V.arcologies[0].FSArabianRevivalist > 0) || (V.clothesBoughtHarem === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSArabianRevivalist > 0 || V.clothesBoughtHarem === 1); case 'a huipil': - if ((V.arcologies[0].FSAztecRevivalist > 0) || (V.clothesBoughtHuipil === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSAztecRevivalist > 0 || V.clothesBoughtHuipil === 1); case 'a kimono': - if ((V.arcologies[0].FSEdoRevivalist > 0) || (V.clothesBoughtKimono === 1) || (V.continent === 'Japan')) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSEdoRevivalist > 0 || V.clothesBoughtKimono === 1 || V.continent === 'Japan'); case 'a maternity dress': - if ((V.arcologies[0].FSRepopulationFocus > 0) || (V.clothesBoughtMaternityDress === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSRepopulationFocus > 0 || V.clothesBoughtMaternityDress === 1); case 'a slutty qipao': - if ((V.arcologies[0].FSChineseRevivalist > 0) || (V.clothesBoughtQipao === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSChineseRevivalist > 0 || V.clothesBoughtQipao === 1); case 'a long qipao': - if ((V.arcologies[0].FSChineseRevivalist > 0) || (V.clothesBoughtCultural === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSChineseRevivalist > 0 || V.clothesBoughtCultural === 1); case 'stretch pants and a crop-top': - if ((V.arcologies[0].FSHedonisticDecadence > 0) || (V.clothesBoughtLazyClothes === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSHedonisticDecadence > 0 || V.clothesBoughtLazyClothes === 1); case 'a toga': - if ((V.arcologies[0].FSRomanRevivalist > 0) || (V.clothesBoughtToga === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSRomanRevivalist > 0 || V.clothesBoughtToga === 1); case 'Western clothing': - if ((V.arcologies[0].FSPastoralist > 0) || (V.clothesBoughtWestern === 1)) { - return true; - } else { - return false; - } - break; - + return (V.arcologies[0].FSPastoralist > 0 || V.clothesBoughtWestern === 1); case 'battlearmor': case 'a military uniform': case 'a red army uniform': case 'battledress': - if (V.clothesBoughtMilitary === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtMilitary === 1); case 'a biyelgee costume': case 'a dirndl': case 'lederhosen': case 'a mounty outfit': case 'a hanbok': - if (V.clothesBoughtCultural === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtCultural === 1); case 'a burqa': case 'a burkini': case 'a blouse and hijab': case 'a niqab and abaya': - if (V.clothesBoughtMiddleEastern === 1 || V.continent === 'the Middle East') { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtMiddleEastern === 1 || V.continent === 'the Middle East'); case 'a klan robe': case 'a slutty klan robe': case 'a schutzstaffel uniform': case 'a slutty schutzstaffel uniform': - if (V.clothesBoughtPol === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtPol === 1); case 'a nice nurse outfit': case 'a police uniform': case 'nice business attire': - if (V.clothesBoughtCareer === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtCareer === 1); case 'a nice maid outfit': - if (V.clothesBoughtCareer === 1 || V.PC.career === 'servant') { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtCareer === 1 || V.PC.career === 'servant'); case 'a ball gown': case 'a gothic lolita dress': //case 'a halter top dress': //case 'a mini dress': //case 'a slave gown': - if (V.clothesBoughtDresses === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtDresses === 1); case 'a cybersuit': case 'a latex catsuit': - if (V.clothesBoughtBodysuits === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtBodysuits === 1); case 'a button-up shirt and panties': case 'a button-up shirt': case 'cutoffs': @@ -215,136 +90,61 @@ window.isItemAccessible = function(string) { case 'a tank-top and panties': case 'a tank-top': case 'a tube top': - if (V.clothesBoughtCasual === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtCasual === 1); case 'boyshorts': case 'a bra': case 'kitty lingerie': case 'panties and pasties': case 'a skimpy loincloth': case 'a thong': - if (V.clothesBoughtUnderwear === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtUnderwear === 1); case 'leather pants and pasties': case 'a t-shirt and thong': case 'a tube top and thong': case 'an oversized t-shirt and boyshorts': - if (V.clothesBoughtUnderwear === 1 && V.clothesBoughtCasual === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtUnderwear === 1 && V.clothesBoughtCasual === 1); case 'sport shorts and a sports bra': case 'sport shorts': case 'a sports bra': - if (V.clothesBoughtSports === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtSports === 1); case 'sport shorts and a t-shirt': - if (V.clothesBoughtSports === 1 && V.clothesBoughtCasual === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtSports === 1 && V.clothesBoughtCasual === 1); case 'a nice pony outfit': case 'a slutty pony outfit': - if (V.clothesBoughtPony === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtPony === 1); case 'a monokini': case 'a one-piece swimsuit': - if (V.clothesBoughtSwimwear === 1) { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtSwimwear === 1); case 'shimapan panties': case 'a striped bra': case 'striped panties': case 'striped underwear': - if (V.clothesBoughtPantsu === 1 || V.continent === 'Japan') { - return true; - } else { - return false; - } - break; - + return (V.clothesBoughtPantsu === 1 || V.continent === 'Japan'); case 'bowtie': - if ((V.arcologies[0].FSGenderFundamentalist > 0) || (V.clothesBoughtBunny === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSGenderFundamentalist > 0 || V.clothesBoughtBunny === 1); case 'ancient Egyptian': - if ((V.arcologies[0].FSEgyptianRevivalist > 0) || (V.clothesBoughtEgypt === 1)) { - return true; - } else { - return false; - } - break; + return (V.arcologies[0].FSEgyptianRevivalist > 0 || V.clothesBoughtEgypt === 1); case 'massive dildo gag': - if (V.toysBoughtGags === 1) { - return true; - } else { - return false; - } - break; - case 'a small empathy belly': case 'a medium empathy belly': case 'a large empathy belly': case 'a huge empathy belly': - if ((V.arcologies[0].FSRepopulationFocus > 0) || (V.clothesBoughtBelly === 1)) { - return true; - } else { - return false; - } - break; - case 'long dildo': case 'long, large dildo': case 'long, huge dildo': - if (V.toysBoughtDildos === 1) { - return true; - } else { - return false; - } - break; - case 'long plug': case 'long, large plug': case 'long, huge plug': - if (V.toysBoughtButtPlugs === 1) { - return true; - } else { - return false; - } - break; - case 'tail': case 'cat tail': case 'fox tail': - if (V.toysBoughtButtPlugTails === 1) { - return true; - } else { - return false; - } - break; + return (V.toysBoughtGags === 1); + case 'a small empathy belly': + case 'a medium empathy belly': + case 'a large empathy belly': + case 'a huge empathy belly': + return (V.arcologies[0].FSRepopulationFocus > 0 || V.clothesBoughtBelly === 1); + case 'long dildo': + case 'long, large dildo': + case 'long, huge dildo': + return (V.toysBoughtDildos === 1); + case 'long plug': + case 'long, large plug': + case 'long, huge plug': + return (V.toysBoughtButtPlugs === 1); + case 'tail': + case 'cat tail': + case 'fox tail': + return (V.toysBoughtButtPlugTails === 1); default: return true; - break; } } -}; \ No newline at end of file +}; diff --git a/src/js/pregJS.tw b/src/js/pregJS.tw index 9ef54e189296dd59563b7a722e47e3ea484fd862..b0694c39c07bab0fb8e9213da00f713d4f0177aa 100644 --- a/src/js/pregJS.tw +++ b/src/js/pregJS.tw @@ -59,7 +59,7 @@ window.bellyAdjective = function(slave) { } else { return ''; } -} +}; /* calculates and returns expected ovum count during conception*/ window.setPregType = function(actor) { @@ -71,7 +71,7 @@ window.setPregType = function(actor) { /* Suggestion for better animal pregnancy support - usage of another variable then ovum for fertility drugs bonus, and then adding actor.pregData.drugsEffect multiplier to it before adding to ovum. Example: var bonus = 0; - + ... (code below where ovum changed to bonus) bonus *= actor.pregData.drugsEffect; @@ -81,7 +81,7 @@ window.setPregType = function(actor) { if(actor.broodmother < 1) { // Broodmothers should be not processed here. Necessary now. if(typeof actor.readyOva == "number" && actor.readyOva != 0) { - ovum = actor.readyOva; //just single override; for delayed impregnation cases + ovum = actor.readyOva; //just single override; for delayed impregnation cases } else if(actor.ID == -1) { if(actor.geneticQuirks.fertility == 2 && actor.geneticQuirks.hyperFertility == 2) { // Do not mix with sperm if(actor.fertDrugs == 1) { @@ -169,7 +169,7 @@ window.setPregType = function(actor) { } } return ovum; -} +}; /* Penetrative ability, ability to become pregnant, and canBreed() must be checked outside of this. Designed to assume .eggType == "human". @@ -239,22 +239,22 @@ window.knockMeUp = function(target, chance, hole, fatherID, displayOverride) { } } return r; -} +}; window.getIncubatorReserved = function(slaves) { - + return FetusGlobalReserveCount("incubator"); -} +}; window.getNurseryReserved = function (slaves) { return FetusGlobalReserveCount("nursery"); -} +}; window.findFather = function(fatherID) { let father; let V = State.variables; - + father = V.slaves[V.slaveIndices[fatherID]]; if (father === undefined) { if (V.incubator > 0) { @@ -266,21 +266,21 @@ window.findFather = function(fatherID) { father = V.cribs.find(function(s) { return s.ID == fatherID; }); } } - + return father; -} +}; window.adjustFatherProperty = function(actor, property, newValue) { let father = findFather(actor.ID); if (father) father[property] = newValue; -} +}; /* OLD window.adjustFatherProperty = function(actor, property, newValue) { let V = State.variables; let fatherIndex; - + fatherIndex = V.slaves.findIndex(function(s) { return s.ID == actor.ID; }); if (fatherIndex > 0) { V.slaves[fatherIndex][property] = newValue; @@ -304,4 +304,4 @@ window.adjustFatherProperty = function(actor, property, newValue) { /* not to be used until that last part is defined. It may become slave.boobWomb.volume or some shit */ window.getBaseBoobs = function(slave) { return slave.boobs-slave.boobsImplant-slave.boobsWombVolume; -} +}; diff --git a/src/js/slaveCostJS.tw b/src/js/slaveCostJS.tw index 1391670508782f6fa01b12c4d8d794d347441831..e5452f821fe8ea2ec488b75c86f4acb2c76b30b5 100644 --- a/src/js/slaveCostJS.tw +++ b/src/js/slaveCostJS.tw @@ -1398,7 +1398,7 @@ window.FResult = (function() { result += 0; } if (V.arcologies[0].FSRepopulationFocusMilfPolicy === 1 || V.arcologies[0].FSRepopulationFocus > 20) { - result += 1; + result += 1; } } @@ -1563,7 +1563,7 @@ window.slaveCost = (function() { calcCareersCost(slave); calcMiscCost(slave); calcIndentureCost(slave); /* multipliers */ - + calcCost(slave); if (isStartingSlave) { calcStartingSlaveCost(slave); diff --git a/src/js/slaveSummaryWidgets.tw b/src/js/slaveSummaryWidgets.tw index cb5e37e686863baf25c68d81dbae7b0bc15d2b3f..44788270923ae3d3b72362e85fedd4f69b296427 100644 --- a/src/js/slaveSummaryWidgets.tw +++ b/src/js/slaveSummaryWidgets.tw @@ -2276,7 +2276,7 @@ window.SlaveSummaryUncached = (function(){ } r += " "; /* - ** No NCS, then do the standard, However because of the wrinkes of Incubators, as long as visual age is greater + ** No NCS, then do the standard, However because of the wrinkes of Incubators, as long as visual age is greater ** than or equal to physical age, we do the old physical body/Looks for fresh out of the can NCS slaves. */ if (((slave.geneMods.NCS === 0) || (slave.visualAge >= slave.physicalAge))) { @@ -2290,9 +2290,9 @@ window.SlaveSummaryUncached = (function(){ /* ** Now the rub. The use of physical Age for the year old body above, basically conflicts with the changes ** that NCS introduces, so here to *distinguish* the changes, we use visual age with the 'year old body' - ** and appears, for example: Slave release from incubator at age 10, Her summary would show, 'Age 0. 10 - ** year old body.' But if she's given NCS a few weeks after release, while she's still before her first - ** birthday, it'll appear the same. But once her birthday fires, if we ran with the above code it would + ** and appears, for example: Slave release from incubator at age 10, Her summary would show, 'Age 0. 10 + ** year old body.' But if she's given NCS a few weeks after release, while she's still before her first + ** birthday, it'll appear the same. But once her birthday fires, if we ran with the above code it would ** say: 'Age 1. 11 year old body.' -- this conflicts with the way NCS works though, because she hasn't ** visually aged, so our change here makes it say 'Age 1. Appears to have a 10 year old body.' */ diff --git a/src/js/storyJS.tw b/src/js/storyJS.tw index e42d3627a269030f92590ae273657d5c46dbff1e..fd6f29a35150fda5e87f6bcbdc8dbddbc95783e1 100644 --- a/src/js/storyJS.tw +++ b/src/js/storyJS.tw @@ -232,11 +232,11 @@ window.filterInPlace = function(arr, callback, thisArg) { if (typeof FertilityAge == "undefined") { var FertilityAge = { setAge: function (age) { - age = Number(age) - if (age != age) { - return 13; - } else { - return age + age = Number(age); + if (age != age) { + return 13; + } else { + return age; } } }; @@ -986,19 +986,6 @@ window.SoftenSexualFlaw = function SoftenSexualFlaw(slave) { slave.sexualFlaw = "none"; }; -window.genUUID = function() { - var d = new Date().getTime(); - if(Date.now){ - d = Date.now(); //high-precision timer - } - var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { - var r = (d + Math.random()*16)%16 | 0; - d = Math.floor(d/16); - return (c=='x' ? r : (r&0x3|0x8)).toString(16); - }); - return uuid; -}; - window.removeFS = function(FS) { const V = State.variables; const arcology = V.arcologies[0]; diff --git a/src/js/utilJS.tw b/src/js/utilJS.tw index bfbaae8ae70690ce63e278088008d951ade4190f..737eb147b0e87889d35e3cec63958b339643bda4 100644 --- a/src/js/utilJS.tw +++ b/src/js/utilJS.tw @@ -523,17 +523,6 @@ window.jsEither = function(choices) { return choices[index]; }; -//This function is alternative to clone - usage needed if nested objects present. Slower but result is separate object tree, not with reference to source object. -window.deepCopy = function (o) { - var output, v, key; - output = Array.isArray(o) ? [] : {}; - for (key in o) { - v = o[key]; - output[key] = (typeof v === "object") ? deepCopy(v) : v; - } - return output; -}; - /* Make everything waiting for this execute. Usage: @@ -598,16 +587,15 @@ window.between = function between(a, low, high) { return (a > low && a < high); }; -// generate a random, almost unique ID -// if two are generated the same second every second, -// duplicates appear approximately once every 100 trillion years -// this is ~7000 times the age of the universe +// generate a random, almost unique ID that is compliant (possibly) with RFC 4122 window.generateNewID = function generateNewID() { - let randint = ""; - for(let i = 0; i < 12; i++) - randint += jsEither("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); - const timestamp = Date.now(); - return (randint + timestamp.toString(36)); + let date = Date.now(); //high-precision timer + let uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { + let r = (date + Math.random()*16)%16 | 0; + date = Math.floor(date/16); + return (c=='x' ? r : (r & 0x3 | 0x8)).toString(16); + }); + return uuid; }; window.arraySwap = function arraySwap(array, a, b) { @@ -1047,8 +1035,8 @@ window.ordinalSuffix = function ordinalSuffix(i) { return i + "rd"; } return i + "th"; -} +}; window.removeDuplicates = function removeDuplicates(array) { return [...new Set(array)]; -} \ No newline at end of file +}; diff --git a/src/js/vignettes.tw b/src/js/vignettes.tw index 6264a1b94b31971f4d12efbd48b7a1e5a59809e0..eb14308c63c725591cfef9c6b93ee3837f14d8ed 100644 --- a/src/js/vignettes.tw +++ b/src/js/vignettes.tw @@ -3535,4 +3535,4 @@ window.GetVignette = function GetVignette(slave) { }); } return jsEither(vignettes); -}; \ No newline at end of file +}; diff --git a/src/js/walkPastJS.tw b/src/js/walkPastJS.tw index a55bbecccd4274124401ae93c58c8d1368c55ad5..295f05ec0486cc1464b37cde773e48bf4cd3780f 100644 --- a/src/js/walkPastJS.tw +++ b/src/js/walkPastJS.tw @@ -5,645 +5,637 @@ window.primeSlave = function(activeSlave, seed) { /* will be moved up once this becomes a single, contained function. */ - var _target = "" - var t = "" - var V = State.variables - var race - if (V.seeRace == 1) { race = activeSlave.race } else { race = "" } - - var pronouns = getPronouns(activeSlave) - var he = pronouns.pronoun, him = pronouns.object, his = pronouns.possessive, hers = pronouns.possessivePronoun, himself = pronouns.objectReflexive, boy = pronouns.noun - var He = capFirstChar(he), His = capFirstChar(his) + const V = State.variables; + const pronouns = getPronouns(activeSlave); + const he = pronouns.pronoun, him = pronouns.object, his = pronouns.possessive, hers = pronouns.possessivePronoun, himself = pronouns.objectReflexive, boy = pronouns.noun; + const He = capFirstChar(he), His = capFirstChar(his); + let _target = ""; + let t = ""; + let race = (V.seeRace ? activeSlave.race : ""); if (V.partner !== "relationship" || activeSlave.relationship == 1 || activeSlave.relationship == 2 || activeSlave.releaseRules == "restrictive") { - t += `${activeSlave.slaveName} ` - t += walkPasts(activeSlave, seed) + t += `${activeSlave.slaveName} `; + t += walkPasts(activeSlave, seed); /* WALKPASTS END */ } /* TIME TOGETHER EXCEPTION ENDS */ return t; -} +}; window.rivalSlave = function(activeSlave, seed) { - var _partnerSlave = getSlave(activeSlave.rivalryTarget) - - var _target = "" - var t = "" - var V = State.variables - - var pronouns = getPronouns(activeSlave) - var he = pronouns.pronoun, him = pronouns.object, his = pronouns.possessive, hers = pronouns.possessivePronoun, himself = pronouns.objectReflexive, boy = pronouns.noun - var He = capFirstChar(he), His = capFirstChar(his) + const V = State.variables; + const pronouns = getPronouns(activeSlave); + const he = pronouns.pronoun, him = pronouns.object, his = pronouns.possessive, hers = pronouns.possessivePronoun, himself = pronouns.objectReflexive, boy = pronouns.noun; + const He = capFirstChar(he), His = capFirstChar(his); + let _partnerSlave = getSlave(activeSlave.rivalryTarget); + let _target = ""; + let t = ""; if (_partnerSlave != undefined) { /* potential problem point */ - - var race2 - if (V.seeRace == 1) { race2 = _partnerSlave.race } else { race2 = "" } - - t += " Meanwhile, " + let race2 = (V.seeRace ? _partnerSlave.race : ""); + + t += " Meanwhile, "; if (activeSlave.rivalry >= 3) { - t += `${_partnerSlave.slaveName}, whom ${he} hates, ` + t += `${_partnerSlave.slaveName}, whom ${he} hates, `; } else if (activeSlave.rivalry >= 2) { - t += `${his} rival ${_partnerSlave.slaveName} ` + t += `${his} rival ${_partnerSlave.slaveName} `; } else { - t += `${_partnerSlave.slaveName}, whom ${he} dislikes, ` + t += `${_partnerSlave.slaveName}, whom ${he} dislikes, `; } - t += walkPasts(_partnerSlave, 100-seed) + t += walkPasts(_partnerSlave, 100-seed); - _target = "FRival", _partnerSlave = null - V.target = "FRival" /*potentially removed later*/ + _target = "FRival"; + _partnerSlave = null; + V.target = "FRival"; /*potentially removed later*/ } return t; -} +}; window.walkPasts = function(slave, _seed) { /* will be moved up once this becomes a single, contained function. */ - var _target = "" - var t = "" - var V = State.variables - var race - if (V.seeRace == 1) { race = slave.race } else { race = "" } - - var pronouns = getPronouns(slave) - var he = pronouns.pronoun, him = pronouns.object, his = pronouns.possessive, hers = pronouns.possessivePronoun, himself = pronouns.objectReflexive, boy = pronouns.noun - var He = capFirstChar(he), His = capFirstChar(his) + const V = State.variables; + const pronouns = getPronouns(slave); + const he = pronouns.pronoun, him = pronouns.object, his = pronouns.possessive, hers = pronouns.possessivePronoun, himself = pronouns.objectReflexive, boy = pronouns.noun; + const He = capFirstChar(he), His = capFirstChar(his); + let _target = ""; + let t = ""; + let race = (V.seeRace ? slave.race : ""); switch (slave.assignment) { case "be your agent": - t += `is shaping society in ${his} assigned arcology.` - break + t += `is shaping society in ${his} assigned arcology.`; + break; case "live with your agent": - t += `is helping ${his} lover shape society in ${his} assigned arcology.` - break + t += `is helping ${his} lover shape society in ${his} assigned arcology.`; + break; case "work in the dairy": if (V.dairyRestraintsSetting > 1) { - t += `is strapped to a milking machine in ${V.dairyName}, ` + t += `is strapped to a milking machine in ${V.dairyName}, `; if (slave.ovaries == 1 && V.dairyPregSetting > 0 && jsRandom(1,2) == 2) { if (isFertile(slave)) { - t += `and is wincing in pain as the machine forces another load of cum into ${his} womb. As you watch, ${his} ${race} stomach steadily swells with baby batter.` + t += `and is wincing in pain as the machine forces another load of cum into ${his} womb. As you watch, ${his} ${race} stomach steadily swells with baby batter.`; } else { - t += `giving you a good view of ${his} ${race} body and heavy belly on the feeds.` + t += `giving you a good view of ${his} ${race} body and heavy belly on the feeds.`; } } else if (slave.lactation > 0) { if (slave.balls > 0 && jsRandom(1,2) == 1) { if (slave.dick > 0) { if (_seed > 50) { - t += `and is having ${his} cock sucked dry. As you watch, ` + t += `and is having ${his} cock sucked dry. As you watch, `; if (slave.scrotum) { - t += `${his} balls tighten ` + t += `${his} balls tighten `; } else { - t += `${he} begins to thrust harder ` + t += `${he} begins to thrust harder `; } if (V.dairyStimulatorsSetting > 0) { - t += `as the phallus up ${his} butt ` + t += `as the phallus up ${his} butt `; } else { - t += `as the suction to ${his} dick ` + t += `as the suction to ${his} dick `; } - t += `forces ${him} closer to yet another ejaculation.` + t += `forces ${him} closer to yet another ejaculation.`; } else { - t += `and is wincing in pain as the machine sucks ${his} sore cock, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is wincing in pain as the machine sucks ${his} sore cock, but you have a good view of ${his} ${race} body on the feeds.`; } } else { if (_seed > 50) { - t += `and is having ${his} balls sucked dry. As you watch, ` + t += `and is having ${his} balls sucked dry. As you watch, `; if (slave.scrotum) { - t += `${his} scrotum tightens ` + t += `${his} scrotum tightens `; } else { - t += `${he} begins to thrust harder ` + t += `${he} begins to thrust harder `; } if (V.dairyStimulatorsSetting) { - t += `as the phallus up ${his} butt ` + t += `as the phallus up ${his} butt `; } else { - t += `as the suction against ${his} crotch ` + t += `as the suction against ${his} crotch `; } - t += `forces ${him} closer to yet another leaking ejaculation.` + t += `forces ${him} closer to yet another leaking ejaculation.`; } else { - t += `and is wincing in pain as the machine sucks ${his} empty balls, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is wincing in pain as the machine sucks ${his} empty balls, but you have a good view of ${his} ${race} body on the feeds.`; } } } else { if (_seed > 50) { - t += `and is having ${his} tits drained, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is having ${his} tits drained, but you have a good view of ${his} ${race} body on the feeds.`; } else { - t += `and is recovering after having ${his} tits sucked dry, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is recovering after having ${his} tits sucked dry, but you have a good view of ${his} ${race} body on the feeds.`; } } } else if (slave.balls > 0) { if (slave.dick > 0) { if (_seed > 50) { - t += `and is having ${his} cock sucked dry. As you watch, ` + t += `and is having ${his} cock sucked dry. As you watch, `; if (slave.scrotum) { - t += `${his} balls tighten ` + t += `${his} balls tighten `; } else { - t += `${he} begins to thrust harder ` + t += `${he} begins to thrust harder `; } if (V.dairyStimulatorsSetting > 0) { - t += `as the phallus up ${his} butt ` + t += `as the phallus up ${his} butt `; } else { - t += `as the suction to ${his} dick ` + t += `as the suction to ${his} dick `; } - t += `forces ${him} closer to yet another ejaculation.` + t += `forces ${him} closer to yet another ejaculation.`; } else { - t += `and is wincing in pain as the machine sucks ${his} sore cock, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is wincing in pain as the machine sucks ${his} sore cock, but you have a good view of ${his} ${race} body on the feeds.`; } } else { if (_seed > 50) { - t += `and is having ${his} balls sucked dry. As you watch, ` + t += `and is having ${his} balls sucked dry. As you watch, `; if (slave.scrotum) { - t += `${his} scrotum tightens ` + t += `${his} scrotum tightens `; } else { - t += `${he} begins to thrust harder ` + t += `${he} begins to thrust harder `; } if (V.dairyStimulatorsSetting) { - t += `as the phallus up ${his} butt ` + t += `as the phallus up ${his} butt `; } else { - t += `as the suction against ${his} crotch ` + t += `as the suction against ${his} crotch `; } - t += `forces ${him} closer to yet another leaking ejaculation.` + t += `forces ${him} closer to yet another leaking ejaculation.`; } else { - t += `and is wincing in pain as the machine sucks ${his} empty balls, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is wincing in pain as the machine sucks ${his} empty balls, but you have a good view of ${his} ${race} body on the feeds.`; } } } else { - t += `and is massaging ${his} sore, milkless tits, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is massaging ${his} sore, milkless tits, but you have a good view of ${his} ${race} body on the feeds.`; } } else { - t += `is working in ${V.dairyName}, ` + t += `is working in ${V.dairyName}, `; if (slave.lactation > 0) { if (slave.balls > 0 && jsRandom(1,2) == 1) { if (slave.dick > 0) { if (_seed > 50) { - t += `and is having ${his} cock milked. As you watch, ` + t += `and is having ${his} cock milked. As you watch, `; if (slave.scrotum) { - t += `${his} balls tighten ` + t += `${his} balls tighten `; } else { - t += `${he} begins to thrust harder ` + t += `${he} begins to thrust harder `; } if (V.dairyStimulatorsSetting > 0) { - t += `as the phallus up ${his} butt ` + t += `as the phallus up ${his} butt `; } else { - t += `as the suction to ${his} dick ` + t += `as the suction to ${his} dick `; } - t += `brings ${him} closer to a copious ejaculation.` + t += `brings ${him} closer to a copious ejaculation.`; } else { - t += `and is massaging ${his} sore swollen cock, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is massaging ${his} sore swollen cock, but you have a good view of ${his} ${race} body on the feeds.`; } } else { if (_seed > 50) { - t += `and is having ${his} balls drained. As you watch, ` + t += `and is having ${his} balls drained. As you watch, `; if (slave.scrotum) { - t += `${his} scrotum tightens ` + t += `${his} scrotum tightens `; } else { - t += `${he} begins to thrust harder ` + t += `${he} begins to thrust harder `; } if (V.dairyStimulatorsSetting) { - t += `as the phallus up ${his} butt ` + t += `as the phallus up ${his} butt `; } else { - t += `as the suction against ${his} crotch ` + t += `as the suction against ${his} crotch `; } - t += `brings ${him} closer to a copious squirting.` + t += `brings ${him} closer to a copious squirting.`; } else { - t += `and is massaging ${his} aching balls, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is massaging ${his} aching balls, but you have a good view of ${his} ${race} body on the feeds.`; } } } else { if (_seed > 50) { - t += `and is having ${his} tits milked, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is having ${his} tits milked, but you have a good view of ${his} ${race} body on the feeds.`; } else { - t += `and is massaging ${his} sore tits, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is massaging ${his} sore tits, but you have a good view of ${his} ${race} body on the feeds.`; } } } else if (slave.balls > 0) { if (slave.dick > 0) { if (_seed > 50) { - t += `and is having ${his} cock milked. As you watch, ` + t += `and is having ${his} cock milked. As you watch, `; if (slave.scrotum) { - t += `${his} balls tighten ` + t += `${his} balls tighten `; } else { - t += `${he} begins to thrust harder ` + t += `${he} begins to thrust harder `; } if (V.dairyStimulatorsSetting) { - t += `as the phallus up ${his} butt ` + t += `as the phallus up ${his} butt `; } else { - t += `as the suction to ${his} dick ` + t += `as the suction to ${his} dick `; } - t += `brings ${him} closer to a copious ejaculation.` + t += `brings ${him} closer to a copious ejaculation.`; } else { - t += `and is massaging ${his} sore swollen cock, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is massaging ${his} sore swollen cock, but you have a good view of ${his} ${race} body on the feeds.`; } } else { if (_seed > 50) { - t += `and is having ${his} balls drained. As you watch, ` + t += `and is having ${his} balls drained. As you watch, `; if (slave.scrotum) { - t += `${his} scrotum tightens ` + t += `${his} scrotum tightens `; } else { - t += `${he} begins to thrust harder ` + t += `${he} begins to thrust harder `; } if (V.dairyStimulatorsSetting) { - t += `as the phallus up ${his} butt ` + t += `as the phallus up ${his} butt `; } else { - t += `as the suction against ${his} crotch ` + t += `as the suction against ${his} crotch `; } - t += `brings ${him} closer to a copious squirting.` + t += `brings ${him} closer to a copious squirting.`; } else { - t += `and is massaging ${his} aching balls, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is massaging ${his} aching balls, but you have a good view of ${his} ${race} body on the feeds.`; } } } else { - t += `and is massaging ${his} sore, milkless tits, but you have a good view of ${his} ${race} body on the feeds.` + t += `and is massaging ${his} sore, milkless tits, but you have a good view of ${his} ${race} body on the feeds.`; } } - break + break; case "work in the brothel": - /* Beauty is being supplanted here until it is JS'd, after which it should be retured! */ - t += `is working in ${V.brothelName}, and is ` - if (slave.whoreSkill >= 100 && jsRandom(1,2) == 1) { + t += `is working in ${V.brothelName}, and is `; + if (Beauty(slave) > 100 && jsRandom(1,2) == 1) { if (_seed > 80) { if (canDoAnal(slave) || canDoVaginal(slave)) { - t += `riding one customer's dick while ${he} gives another a blowjob.` + t += `riding one customer's dick while ${he} gives another a blowjob.`; } else { - t += "deep throating a pair of customer's dicks." + t += "deep throating a pair of customer's dicks."; } } else if (_seed > 60 && slave.amp != 1) { - t += "sucking one customer's cock while giving another a handjob." + t += "sucking one customer's cock while giving another a handjob."; } else if (_seed > 40) { - t += "eating out one customer's cunt while another " + t += "eating out one customer's cunt while another "; if (canDoAnal(slave) || canDoVaginal(slave)) { - t += `uses a strap-on on ${him}.` + t += `uses a strap-on on ${him}.`; } else { - t += `teases ${his} butt.` + t += `teases ${his} butt.`; } } else if (_seed > 20) { if (canDoAnal(slave) || canDoVaginal(slave)) { - t += "getting pounded by " + t += "getting pounded by "; } else { - t += "amusing " + t += "amusing "; } - t += "two women wearing strap-ons." + t += "two women wearing strap-ons."; } else { if (canDoAnal(slave) || canDoVaginal(slave)) { - t += "being double penetrated by " + t += "being double penetrated by "; } else { - t += `using ${her} body to please ` + t += `using ${her} body to please `; } - t += "a pair of customers." + t += "a pair of customers."; } } else if (_seed > 80) { if (canDoAnal(slave) || canDoVaginal(slave)) { - t += "pleasing " + t += "pleasing "; } else { - t += "riding " + t += "riding "; } - t += "a customer's dick." + t += "a customer's dick."; } else if (_seed > 60) { - t += "sucking a customer's cock." + t += "sucking a customer's cock."; } else if (_seed > 40) { - t += "pleasuring a customer's cunt." + t += "pleasuring a customer's cunt."; } else if (_seed > 20) { - t += "getting pounded by a woman wearing a strap-on." + t += "getting pounded by a woman wearing a strap-on."; } else { - t += "being held down and " + t += "being held down and "; if (canDoAnal(slave)) { - t += "buttfucked " + t += "buttfucked "; } else { - t += "raped " + t += "raped "; } - t += "by a customer." + t += "by a customer."; } - t += ` You have a voyeuristic view of ${his} ${race} body on the feeds.` - break + t += ` You have a voyeuristic view of ${his} ${race} body on the feeds.`; + break; case "serve in the club": - t += `is working in ${V.clubName}, ` + t += `is working in ${V.clubName}, `; if (_seed > 50) { - t += `displaying ${his} ${race} body, keeping citizens company, and flirting with anyone who shows interest.` + t += `displaying ${his} ${race} body, keeping citizens company, and flirting with anyone who shows interest.`; } else { - t += `or rather just off it, having taken a prominent citizen back to a discreet room so he can use ${his} ${race} body.` + t += `or rather just off it, having taken a prominent citizen back to a discreet room so he can use ${his} ${race} body.`; } - break + break; case "work as a servant": if (_seed > 50) { - t += "was scrubbing the penthouse floor, until another slave requested oral service." + t += "was scrubbing the penthouse floor, until another slave requested oral service."; } else { - t += "is scrubbing the penthouse floor." + t += "is scrubbing the penthouse floor."; } - break + break; case "serve in the master suite": if (slave.fuckdoll > 0) { - t += `waiting for use in ${V.masterSuiteName}, next to a display case full of other sex toys.` + t += `waiting for use in ${V.masterSuiteName}, next to a display case full of other sex toys.`; } else if (V.masterSuiteUpgradeLuxury == 1) { if (_seed > 50) { - t += `is sitting on the big bed in ${V.masterSuiteName}, awaiting your return.` + t += `is sitting on the big bed in ${V.masterSuiteName}, awaiting your return.`; } else { - t += `is beautifying ${himself} in ${V.masterSuiteName} so ${he}'ll be pretty when you return.` + t += `is beautifying ${himself} in ${V.masterSuiteName} so ${he}'ll be pretty when you return.`; } } else if (V.masterSuiteUpgradeLuxury == 2) { - t += `is in ${V.masterSuiteName}'s fuckpit, ` + t += `is in ${V.masterSuiteName}'s fuckpit, `; if (_seed > 80) { - t += `with a pair of ${his} fellow fucktoys industriously sucking on ${his} nipples.` + t += `with a pair of ${his} fellow fucktoys industriously sucking on ${his} nipples.`; } else if (_seed > 60) { if ((slave.anus > 0 && canDoAnal(slave)) || (slave.vagina > 0 && canDoVaginal(slave))) { - t += "taking double penetration from " + t += "taking double penetration from "; } else { - t += "being spitroasted by " + t += "being spitroasted by "; } - t += `a pair of ${his} fellow fucktoys.` + t += `a pair of ${his} fellow fucktoys.`; } else if (_seed > 40) { if (canPenetrate(slave)) { - t += `with ${his} dick inside ` + t += `with ${his} dick inside `; } else if (slave.dick > 0 && slave.dickAccessory != "chastity" && slave.dick != "combined chastity") { - t += `getting ${his} soft dick sucked by ` + t += `getting ${his} soft dick sucked by `; } else if (canDoVaginal(slave) || canDoAnal(slave)) { - t += "getting eaten out by " + t += "getting eaten out by "; } else { - t += "making out with " + t += "making out with "; } - t += "a fellow fucktoy." + t += "a fellow fucktoy."; } else if (_seed > 20) { if (slave.vagina > 0 && canDoVaginal(slave)) { - t += "getting pounded " + t += "getting pounded "; } else if (slave.anus > 0 && canDoAnal(slave)) { - t += `getting ${his} ass pounded ` + t += `getting ${his} ass pounded `; } else if (canDoVaginal(slave) || canDoAnal(slave)) { - t += "getting eaten out " + t += "getting eaten out "; } else { - t += "getting deepthroated " + t += "getting deepthroated "; } - t += "by a fellow fucktoy." + t += "by a fellow fucktoy."; } else { - t += "performing oral sex on a fellow fucktoy." + t += "performing oral sex on a fellow fucktoy."; } } else { if (slave.energy > 95) { - t += `is having enthusiastic sex with your other pets while waiting for you to ravish ${him}.` + t += `is having enthusiastic sex with your other pets while waiting for you to ravish ${him}.`; } else { - t += "is having idle sex with several of your other toys while they await your pleasure." + t += "is having idle sex with several of your other toys while they await your pleasure."; if (slave.fetishKnown == 1) { switch (slave.fetish) { case "buttslut": if (canDoAnal(slave) && slave.anus > 0) { - t += `${He}'s happily taking a strap-on up ${his} asspussy.` + t += `${He}'s happily taking a strap-on up ${his} asspussy.`; } else { - t += `${He}'s happily got another slave between ${his} buttcheeks.` + t += `${He}'s happily got another slave between ${his} buttcheeks.`; } - break + break; case "cumslut": - t += `${He}'s happily performing oral on another slave.` - break + t += `${He}'s happily performing oral on another slave.`; + break; case "dom": - t += `${He}'s pinning another slave down while ${he} fucks her.` - break + t += `${He}'s pinning another slave down while ${he} fucks her.`; + break; case "submissive": - t += `${He}'s letting another slave have her way with ${him}.` - break + t += `${He}'s letting another slave have her way with ${him}.`; + break; case "sadist": if (slave.amp != 1) { - t += `${He}'s spanking another slave with one hand and fingering her with the other.` + t += `${He}'s spanking another slave with one hand and fingering her with the other.`; } else { - t += `${He}'s painfully teasing another slave's nipple with ${his} teeth.` + t += `${He}'s painfully teasing another slave's nipple with ${his} teeth.`; } - break + break; case "masochist": - t += `Another slave is spanking ${him} while molesting everything she can.` - break + t += `Another slave is spanking ${him} while molesting everything she can.`; + break; case "boobs": - t += `${He} has a slave sucking on each of ${his} nipples` + t += `${He} has a slave sucking on each of ${his} nipples`; if (slave.amp != 1) { - t += ` while ${he} gives each a handjob.` + t += ` while ${he} gives each a handjob.`; } else { - t += "." + t += "."; } - break + break; case "pregnancy": if (slave.belly >= 5000) { - t += `${He}'s sighing contentedly as ${his} rounded belly is sensually rubbed.` + t += `${He}'s sighing contentedly as ${his} rounded belly is sensually rubbed.`; } else if (canPenetrate(slave)) { - t += `${He}'s happily roleplaying impregnating the slave ${he}'s fucking.` + t += `${He}'s happily roleplaying impregnating the slave ${he}'s fucking.`; } else if ((slave.anus > 0 && canDoAnal(slave)) || (slave.vagina > 0 && canDoVaginal(slave))) { - t += `${He}'s happily roleplaying conceiving a child as ${he} gets fucked.` + t += `${He}'s happily roleplaying conceiving a child as ${he} gets fucked.`; } else { - t += `${He}'s happily roleplaying being hugely pregnant.` + t += `${He}'s happily roleplaying being hugely pregnant.`; } } } } } - break + break; /* case "guard you": t += "is standing discreetly behind your left shoulder, watching for threats." break */ case "stay confined": - t += `is confined, but you have a fine view of ${his} ${race} body on the feed from ${his} cell.` - break + t += `is confined, but you have a fine view of ${his} ${race} body on the feed from ${his} cell.`; + break; case "be confined in the cellblock": - t += `is confined in ${V.cellblockName}, but you have a fine view of ${his} ${race} body on the feed from ${his} cell.` - break + t += `is confined in ${V.cellblockName}, but you have a fine view of ${his} ${race} body on the feed from ${his} cell.`; + break; case "be confined in the arcade": case "work a glory hole": - t += "is confined in " + t += "is confined in "; if (slave.assignment == "be confined in the arcade") { - t += `${V.arcadeName}; ` + t += `${V.arcadeName}; `; } else { - t += "a glory hole; " + t += "a glory hole; "; } if (_seed > 80 && (canDoAnal(slave) || canDoVaginal(slave))) { - t += `${his} ass is held out at cock height, and a customer is using ${his} fuckhole.` + t += `${his} ass is held out at cock height, and a customer is using ${his} fuckhole.`; } else if (_seed > 60) { - t += `${his} mouth is held open at cock height, and a customer is fucking ${his} throat.` + t += `${his} mouth is held open at cock height, and a customer is fucking ${his} throat.`; } else if (_seed > 40) { - t += `a woman is abusing ${him} with a couple of dildos.` + t += `a woman is abusing ${him} with a couple of dildos.`; } else if (_seed > 20 && canDoAnal(slave)) { - t += `a customer is harshly using ${his} defenseless anus.` + t += `a customer is harshly using ${his} defenseless anus.`; } else { - t += `a customer is cruelly spanking ${his} helpless butt.` + t += `a customer is cruelly spanking ${his} helpless butt.`; } - break + break; case "be the Madam": - t += `is managing ${V.brothelName}: ${he} is making sure all the customers are satisfied and all the whores are working hard.` - break + t += `is managing ${V.brothelName}: ${he} is making sure all the customers are satisfied and all the whores are working hard.`; + break; case "be your Concubine": if (jsRandom(1,2) == 1) { - t += `is looking after ${himself}; ${he} spends many hours every day on ${his} beauty regimen.` + t += `is looking after ${himself}; ${he} spends many hours every day on ${his} beauty regimen.`; } else { - t += "is checking over the appearance of your harem, making sure everyone looks perfect." + t += "is checking over the appearance of your harem, making sure everyone looks perfect."; } - break + break; case "be the Wardeness": - t += `is looking after the cells: ${he} is ` + t += `is looking after the cells: ${he} is `; if (_seed > 50) { - t += `forcing a resistant slave to orally service ${him}.` + t += `forcing a resistant slave to orally service ${him}.`; } else { - t += "beating a rebellious slave across the buttocks." + t += "beating a rebellious slave across the buttocks."; } - break + break; case "live with your Head Girl": if (V.HeadGirl != 0) { - t += `is getting the Head Girl's suite cleaned up while ${V.HeadGirl.slaveName} is out working.` + t += `is getting the Head Girl's suite cleaned up while ${V.HeadGirl.slaveName} is out working.`; } else { - t += "is making sure the Head Girl's suite is in order for your next Head Girl." + t += "is making sure the Head Girl's suite is in order for your next Head Girl."; } - break + break; case "be the Stewardess": - t += `is managing the house servants in ${V.servantsQuartersName}: ${he} overseeing the laboring house slaves and punishing any that step out of line.` - break + t += `is managing the house servants in ${V.servantsQuartersName}: ${he} overseeing the laboring house slaves and punishing any that step out of line.`; + break; case "be the Schoolteacher": - t += `is teaching classes in ${V.schoolroomName}: ${he} is leading the slave students in rote recitation.` - break + t += `is teaching classes in ${V.schoolroomName}: ${he} is leading the slave students in rote recitation.`; + break; case "be the Attendant": - t += `is seeing to girls in ${V.spaName}: ${he} is gently soaping an exhausted slave.` - break + t += `is seeing to girls in ${V.spaName}: ${he} is gently soaping an exhausted slave.`; + break; case "be the DJ": if (_seed > 50) { - t += `is right where ${he} belongs, in the DJ booth in ${V.clubName} ${he} leads. ${He}'s bouncing in time with the beat to show off ${his} ` + t += `is right where ${he} belongs, in the DJ booth in ${V.clubName} ${he} leads. ${He}'s bouncing in time with the beat to show off ${his} `; if (slave.boobs > 300) { - t += "tits." + t += "tits."; } else { - t += "goods." + t += "goods."; } } else { - t += `is taking the lead on ${V.clubName}'s floor: ${he} greets new arrivals, flirts with them prettily, and subtly guides them towards choice sluts.` + t += `is taking the lead on ${V.clubName}'s floor: ${he} greets new arrivals, flirts with them prettily, and subtly guides them towards choice sluts.`; } - break + break; case "be the Milkmaid": - t += `is working in ${V.dairyName}, looking after your stock.` - break + t += `is working in ${V.dairyName}, looking after your stock.`; + break; default: /* WALKPASTS START HERE */ if (slave.heels == 1 && !["flats", "none"].includes(slave.shoes)) { - t += `walks past your desk with the tiny swaying steps ${he} must take in order to walk on ${his} surgically altered legs. ${He} is on ${his} way to ` + t += `walks past your desk with the tiny swaying steps ${he} must take in order to walk on ${his} surgically altered legs. ${He} is on ${his} way to `; } else if (["heels", "pumps"].includes(slave.shoes)) { - t += `walks past your desk with the swaying steps ${he} must take in ${his} high heels. ${He} is on ${his} way to ` + t += `walks past your desk with the swaying steps ${he} must take in ${his} high heels. ${He} is on ${his} way to `; } else if (slave.shoes == "boots") { - t += `walks past your desk with the confident gait encouraged by ${his} high heeled boots. ${He} is on ${his} way to ` + t += `walks past your desk with the confident gait encouraged by ${his} high heeled boots. ${He} is on ${his} way to `; } else if (slave.shoes == "extreme heels") { - t += `walks past your desk with the tiny swaying steps ${he} must take in ${his} ridiculous heels. ${He} is on ${his} way to ` + t += `walks past your desk with the tiny swaying steps ${he} must take in ${his} ridiculous heels. ${He} is on ${his} way to `; } else if (slave.heels == 1) { - t += `crawls past your desk on all fours, since ${he} has not been allowed the heels ${he} needs to walk upright. ${He} is on ${his} way to ` + t += `crawls past your desk on all fours, since ${he} has not been allowed the heels ${he} needs to walk upright. ${He} is on ${his} way to `; } else if (slave.amp == 1) { - t += `is carried past your desk by one of your other slaves. ${He} is on ${his} way to ` + t += `is carried past your desk by one of your other slaves. ${He} is on ${his} way to `; } else if (!canWalk(slave)) { - t += `is helped past your desk by one of your other slaves. ${He} is on ${his} way to ` + t += `is helped past your desk by one of your other slaves. ${He} is on ${his} way to `; } else { - t += `walks past your desk on ${his} way to ` + t += `walks past your desk on ${his} way to `; } if (slave.inflation > 0 && jsRandom(1,100) > 70) { if (slave.inflationMethod == 1) { - t += `gorge ${himself} with ${slave.inflationType}; ` + t += `gorge ${himself} with ${slave.inflationType}; `; } else if (slave.inflationMethod == 2) { - t += `fill ${his} rear with ` + t += `fill ${his} rear with `; switch (slave.inflationType) { case "water": case "milk": case "cum": case "food": - t += `${slave.inflationType}; ` - break + t += `${slave.inflationType}; `; + break; default: - t += `${slave.inflationType}s; ` - break + t += `${slave.inflationType}s; `; + break; } } else if (slave.inflationMethod == 3) { if (slave.inflationType == "milk") { - t += `suckle from ${his} assigned nipple until ${he} is sufficiently filled with milk; ` + t += `suckle from ${his} assigned nipple until ${he} is sufficiently filled with milk; `; } else { - t += `suck ${his} assigned dick until ${he} is sufficiently filled with cum; ` + t += `suck ${his} assigned dick until ${he} is sufficiently filled with cum; `; } } } else { switch (slave.assignment) { case "rest": if (_seed > 50) { - t += "bed; " + t += "bed; "; } else { - t += "eat; " + t += "eat; "; } - break + break; case "get milked": if (_seed > 50) { if (slave.lactation) { - t += `milk ${his} overfull ${race} tits; ` + t += `milk ${his} overfull ${race} tits; `; } else { - t += `empty ${his} aching balls; ` + t += `empty ${his} aching balls; `; } } else { if (slave.lactation) { - t += `drain ${his} milky ${race} udders; ` + t += `drain ${his} milky ${race} udders; `; } else { - t += `relieve ${his} heavy balls; ` + t += `relieve ${his} heavy balls; `; } } - break + break; case "whore": if (_seed > 50) { - t += `sell ${his} ${race} body; ` + t += `sell ${his} ${race} body; `; } else { - t += `ply ${his} trade as a whore; ` + t += `ply ${his} trade as a whore; `; } - break + break; case "serve the public": if (_seed > 50) { - t += "serve the public; " + t += "serve the public; "; } else { - t += "be a public slut; " + t += "be a public slut; "; } - break + break; case "rest in the spa": - t += `relax in ${V.spaName}; ` - break + t += `relax in ${V.spaName}; `; + break; case "please you": - t += `wait next to you and wait for you to fuck ${him}; ` - break + t += `wait next to you and wait for you to fuck ${him}; `; + break; case "be a subordinate slave": - t += "service your other slaves; " - break + t += "service your other slaves; "; + break; case "be a servant": - t += "clean up after your other slaves; " - break + t += "clean up after your other slaves; "; + break; case "learn in the schoolroom": - t += "attend classes " + t += "attend classes "; if (V.Schoolteacher == 0) { - t += `in ${V.schoolroomName}; ` + t += `in ${V.schoolroomName}; `; } else { - t += `under ${V.Schoolteacher.slaveName}, perhaps literally; ` + t += `under ${V.Schoolteacher.slaveName}, perhaps literally; `; } - break + break; case "be a subordinate slave": - t += "service your other slaves; " - break + t += "service your other slaves; "; + break; case "be the Attendant": - t += `look after the girls in ${V.spaName}; ` - break + t += `look after the girls in ${V.spaName}; `; + break; case "take classes": - t += `attend classes with ${V.assistantName}; ` - break + t += `attend classes with ${V.assistantName}; `; + break; case "be your Head Girl": - t += "oversee your other slaves; " - break + t += "oversee your other slaves; "; + break; case "recruit girls": - t += `use ${his} connections to recruit slaves; ` - break + t += `use ${his} connections to recruit slaves; `; + break; default: - t += `${slave.assignment}; ` - break + t += `${slave.assignment}; `; + break; } } /* end inflation blurb */ if (slave.fetish == "mindbroken") { - t += `${he} does not even glance at you as ${he} goes mindlessly to ${his} next task.` + t += `${he} does not even glance at you as ${he} goes mindlessly to ${his} next task.`; } else if (slave.devotion < -50) { - t += `${he} directs a look of pure hatred at where you sit as ${he} passes.` + t += `${he} directs a look of pure hatred at where you sit as ${he} passes.`; } else if (slave.devotion < -20) { - t += `${he} cannot keep the loathing from ${his} face as ${he} passes.` + t += `${he} cannot keep the loathing from ${his} face as ${he} passes.`; } else if (slave.devotion <= 20) { - t += `${he} passes quickly, obviously hoping to avoid you.` + t += `${he} passes quickly, obviously hoping to avoid you.`; } else if (slave.devotion <= 50) { - t += `${he} rushes by, hurrying to ${his} next task.` + t += `${he} rushes by, hurrying to ${his} next task.`; } else { - t += `as ${he} passes ${he} gives you a look of adoration.` + t += `as ${he} passes ${he} gives you a look of adoration.`; } - break + break; } - return t -} \ No newline at end of file + return t; +}; diff --git a/src/js/wombJS.tw b/src/js/wombJS.tw index 4cd077330693ca3730390401d7e71df0237cfaf0..d5e8b04f7ed97ce3600bfb6a8e540f18b83f4ce2 100644 --- a/src/js/wombJS.tw +++ b/src/js/wombJS.tw @@ -47,7 +47,7 @@ window.WombInit = function(actor) { if ( actor.pregData == undefined) { - actor.pregData = deepCopy( setup.pregData.human ); + actor.pregData = clone( setup.pregData.human ); //Setup should be through deep copy, so in future, if we like, these values can be changed individually. Gameplay expansion posibilities. But for dev time to simplify debugging: //actor.pregData = setup.pregData.human; // any changes in setup pregData template will be applied immideatly to all. But can't be made seperate changes. } @@ -94,7 +94,7 @@ window.WombImpregnate = function(actor, fCount, fatherID, age) { tf.identical = 0; //Initial, to create property. Updated with actual data during fetalSplit call. tf.splitted = 0; //marker for already splitted fetus. tf.genetics = generateGenetics(actor, fatherID, i+1); //Stored genetic information. - tf.ID = genUUID(); + tf.ID = generateNewID(); try { if (actor.womb.length == 0) { @@ -349,7 +349,7 @@ window.WombUpdatePregVars = function(actor) { window.WombMinPreg = function(actor) { WombSort(actor); - if (actor.womb.length > 0) + if (actor.womb.length > 0) return actor.womb[actor.womb.length-1].age; else return 0; @@ -357,7 +357,7 @@ window.WombMinPreg = function(actor) { window.WombMaxPreg = function(actor) { WombSort(actor); - if (actor.womb.length > 0) + if (actor.womb.length > 0) return actor.womb[0].age; else return 0; @@ -369,20 +369,20 @@ window.WombNormalizePreg = function(actor) WombInit(actor); // this is broodmother on hold. - if (actor.womb.length == 0 && actor.broodmother >= 1) { - actor.pregType = 0; + if (actor.womb.length == 0 && actor.broodmother >= 1) { + actor.pregType = 0; actor.pregKnown = 0; // to avoid legacy code conflicts - broodmother on hold // can't be impregnated, but she not on normal contraceptives. // So we set this for special case. if (actor.preg >= 0) - actor.preg = 0.1; + actor.preg = 0.1; if (actor.pregSource > 0) actor.pregSource = 0; - if (actor.pregWeek > 0) + if (actor.pregWeek > 0) actor.pregWeek = 0; actor.broodmotherCountDown = 0; @@ -420,7 +420,7 @@ window.WombNormalizePreg = function(actor) // We can't properly set postpartum here, // but can normalize obvious error with forgotten property. - if (actor.pregWeek > 0) + if (actor.pregWeek > 0) actor.pregWeek = 0; } actor.bellyPreg = WombGetVolume(actor); @@ -472,13 +472,13 @@ window.fetalSplit = function(actor, chance) { nft.motherID = s.motherID; nft.volume = s.volume; nft.reserve = ""; //splitted fetus is new separate, reserve - it's not genetic to split. - nft.genetics = deepCopy(s.genetics); + nft.genetics = clone(s.genetics); s.splitted = 1; //this is marker that this is already splitted fetus (to not split second time in loop), only source fetus needed it. nft.identical = 1; //this is marker that this fetus has at least one twin. s.identical = 1; //this is marker that this fetus has at least one twin. if (s.twinID == "" || s.twinID == undefined) - s.twinID = genUUID(); + s.twinID = generateNewID(); nft.twinID = s.twinID; @@ -502,7 +502,7 @@ window.WombGetFetus = function(actor, fetusNum) WombInit(actor); if (actor.womb.length >= fetusNum) return actor.womb[fetusNum]; - else + else return null; } @@ -520,7 +520,7 @@ window.WombRemoveFetus = function(actor, fetusNum) return null; } -/*to add fetus object in the womb. Be warned - you can add one single fetus to many wombs, or even add it many times to one womb. It's will not show error, but behavior become strange, as fetus object will be the same - it's reference, not full copies. If this not desired - use deepCopy on fetus before adding.*/ +/*to add fetus object in the womb. Be warned - you can add one single fetus to many wombs, or even add it many times to one womb. It's will not show error, but behavior become strange, as fetus object will be the same - it's reference, not full copies. If this not desired - use clone() on fetus before adding.*/ window.WombAddFetus = function(actor, fetus) { WombInit(actor); @@ -574,7 +574,7 @@ window.WombCleanYYFetuses = function(actor) return reserved; } -window.FetusGlobalReserveCount = function(reserveType) +window.FetusGlobalReserveCount = function(reserveType) { var cnt = 0; var SV = State.variables; @@ -614,7 +614,7 @@ window.WombSetGenericReserve = function(actor, type, count) window.WombAddToGenericReserve = function(actor, type, count) { - + WombSetGenericReserve(actor, type, (WombReserveCount(actor, type)+count)); } @@ -725,15 +725,15 @@ window.BCReserveInit = function() if (typeof ft.reserve != 'string') ft.reserve = ""; if (typeof ft.motherID != 'number') //setting missing biological mother ID for fetus. - ft.motherID = slave.ID; + ft.motherID = slave.ID; if (ft.ID == undefined) - ft.ID = genUUID(); + ft.ID = generateNewID(); try { if (slave.reservedChildren > 0) WombSetGenericReserve(slave, "incubator", reservedChildren); - + if (slave.reservedChildrenNursery > 0) WombSetGenericReserve(slave, "nursery", reservedChildren); } catch (err) { @@ -747,7 +747,7 @@ window.BCReserveInit = function() SV.PC.womb.forEach(function(ft){ if (typeof ft.reserve != 'string') ft.reserve = ""; - ft.motherID = SV.PC.ID; + ft.motherID = SV.PC.ID; }); } @@ -760,7 +760,7 @@ window.fetalSplit = function(actor, chance) actor.womb.forEach(function(s){ if ((jsRandom(1,chance) >= chance) && s.identical !== 1) { - nft = deepCopy(s); + nft = clone(s); actor.womb.push(nft); s.identical = 1; } diff --git a/src/pregmod/organFarmOptions.tw b/src/pregmod/organFarmOptions.tw index ac508c4ded2f36ea342a301f78e6852615415341..89bd20bb912bf89a423285388ab7ea613c7e3afa 100644 --- a/src/pregmod/organFarmOptions.tw +++ b/src/pregmod/organFarmOptions.tw @@ -1212,7 +1212,7 @@ The fabricator is ready to grow an organ for $him. Extract tissue to begin growi <<set $activeSlave.eggType = "human">> <<set $activeSlave.preg = 0>> <<set $activeSlave.health -= 20>> - <<set $activeSlave.pregData = deepCopy($setup.pregData.human)>> + <<set $activeSlave.pregData = clone($setup.pregData.human)>> <<if $organFarmUpgrade == 2>> <<set $activeSlave.chem += 20>> <</if>> @@ -1265,7 +1265,7 @@ The fabricator is ready to grow an organ for $him. Extract tissue to begin growi <<set $activeSlave.eggType = "human">> <<set $activeSlave.preg = 0>> <<set $activeSlave.health -= 20>> - <<set $activeSlave.pregData = deepCopy($setup.pregData.human)>> + <<set $activeSlave.pregData = clone($setup.pregData.human)>> <<if $organFarmUpgrade == 2>> <<set $activeSlave.chem += 20>> <</if>> @@ -1327,7 +1327,7 @@ The fabricator is ready to grow an organ for $him. Extract tissue to begin growi <<set $activeSlave.eggType = "pig">> <<set $activeSlave.preg = 0>> <<set $activeSlave.health -= 20>> - <<set $activeSlave.pregData = deepCopy($setup.pregData.pig)>> + <<set $activeSlave.pregData = clone($setup.pregData.pig)>> <<if $organFarmUpgrade == 2>> <<set $activeSlave.chem += 20>> <</if>> @@ -1380,7 +1380,7 @@ The fabricator is ready to grow an organ for $him. Extract tissue to begin growi <<set $activeSlave.eggType = "pig">> <<set $activeSlave.preg = 0>> <<set $activeSlave.health -= 20>> - <<set $activeSlave.pregData = deepCopy($setup.pregData.pig)>> + <<set $activeSlave.pregData = clone($setup.pregData.pig)>> <<if $organFarmUpgrade == 2>> <<set $activeSlave.chem += 20>> <</if>> @@ -1442,7 +1442,7 @@ The fabricator is ready to grow an organ for $him. Extract tissue to begin growi <<set $activeSlave.eggType = "dog">> <<set $activeSlave.preg = 0>> <<set $activeSlave.health -= 20>> - <<set $activeSlave.pregData = deepCopy($setup.pregData.canineM)>> + <<set $activeSlave.pregData = clone($setup.pregData.canineM)>> <<if $organFarmUpgrade == 2>> <<set $activeSlave.chem += 20>> <</if>> @@ -1495,7 +1495,7 @@ The fabricator is ready to grow an organ for $him. Extract tissue to begin growi <<set $activeSlave.eggType = "dog">> <<set $activeSlave.preg = 0>> <<set $activeSlave.health -= 20>> - <<set $activeSlave.pregData = deepCopy($setup.pregData.canineM)>> + <<set $activeSlave.pregData = clone($setup.pregData.canineM)>> <<if $organFarmUpgrade == 2>> <<set $activeSlave.chem += 20>> <</if>> @@ -1557,7 +1557,7 @@ The fabricator is ready to grow an organ for $him. Extract tissue to begin growi <<set $activeSlave.eggType = "horse">> <<set $activeSlave.preg = 0>> <<set $activeSlave.health -= 20>> - <<set $activeSlave.pregData = deepCopy($setup.pregData.equine)>> + <<set $activeSlave.pregData = clone($setup.pregData.equine)>> <<if $organFarmUpgrade == 2>> <<set $activeSlave.chem += 20>> <</if>> @@ -1610,7 +1610,7 @@ The fabricator is ready to grow an organ for $him. Extract tissue to begin growi <<set $activeSlave.eggType = "horse">> <<set $activeSlave.preg = 0>> <<set $activeSlave.health -= 20>> - <<set $activeSlave.pregData = deepCopy($setup.pregData.equine)>> + <<set $activeSlave.pregData = clone($setup.pregData.equine)>> <<if $organFarmUpgrade == 2>> <<set $activeSlave.chem += 20>> <</if>> @@ -2019,7 +2019,7 @@ The fabricator is ready to grow an organ for $him. Extract tissue to begin growi <<set $activeSlave.eggType = "human">> <<set $activeSlave.preg = 0>> <<set $activeSlave.health -= 40>> - <<set $activeSlave.pregData = deepCopy($setup.pregData.human)>> + <<set $activeSlave.pregData = clone($setup.pregData.human)>> <<if $organFarmUpgrade == 2>> <<set $activeSlave.chem += 20>> <</if>> @@ -2072,7 +2072,7 @@ The fabricator is ready to grow an organ for $him. Extract tissue to begin growi <<set $activeSlave.eggType = "pig">> <<set $activeSlave.preg = 0>> <<set $activeSlave.health -= 40>> - <<set $activeSlave.pregData = deepCopy($setup.pregData.pig)>> + <<set $activeSlave.pregData = clone($setup.pregData.pig)>> <<if $organFarmUpgrade == 2>> <<set $activeSlave.chem += 20>> <</if>> @@ -2125,7 +2125,7 @@ The fabricator is ready to grow an organ for $him. Extract tissue to begin growi <<set $activeSlave.eggType = "dog">> <<set $activeSlave.preg = 0>> <<set $activeSlave.health -= 40>> - <<set $activeSlave.pregData = deepCopy($setup.pregData.canineM)>> + <<set $activeSlave.pregData = clone($setup.pregData.canineM)>> <<if $organFarmUpgrade == 2>> <<set $activeSlave.chem += 20>> <</if>> @@ -2178,7 +2178,7 @@ The fabricator is ready to grow an organ for $him. Extract tissue to begin growi <<set $activeSlave.eggType = "horse">> <<set $activeSlave.preg = 0>> <<set $activeSlave.health -= 40>> - <<set $activeSlave.pregData = deepCopy($setup.pregData.equine)>> + <<set $activeSlave.pregData = clone($setup.pregData.equine)>> <<if $organFarmUpgrade == 2>> <<set $activeSlave.chem += 20>> <</if>>