diff --git a/src/js/sexActsJS.js b/src/js/sexActsJS.js index 93a56e0423f4189ddbc378fff730a198009007b4..0b0291db3d5b18d9c4ce9bac0b06b593160b4fa9 100644 --- a/src/js/sexActsJS.js +++ b/src/js/sexActsJS.js @@ -5,14 +5,14 @@ window.AnalVCheck = function AnalVCheck(times) { const V = State.variables; const slave = V.activeSlave; - let pronouns = getPronouns(slave); - let he = pronouns.pronoun, + const pronouns = getPronouns(slave); + const he = pronouns.pronoun, //him = pronouns.object, his = pronouns.possessive; // hers = pronouns.possessivePronoun, // himself = pronouns.objectReflexive, // boy = pronouns.noun; - let He = capFirstChar(he), + const He = capFirstChar(he), His = capFirstChar(his); let r = ``; if (canDoAnal(slave) && slave.anus === 0) { @@ -64,15 +64,15 @@ window.AnalVCheck = function AnalVCheck(times) { window.VaginalVCheck = function VaginalVCheck(times) { const V = State.variables; const slave = V.activeSlave; - let pronouns = getPronouns(slave); - let he = pronouns.pronoun, + const pronouns = getPronouns(slave); + const he = pronouns.pronoun, him = pronouns.object, his = pronouns.possessive, hers = pronouns.possessivePronoun, himself = pronouns.objectReflexive, boy = pronouns.noun; - let He = capFirstChar(he); - let His = capFirstChar(his); + const He = capFirstChar(he); + const His = capFirstChar(his); let r = ``; if (canDoVaginal(slave) && slave.vagina === 0) { r += `@@.lime;This breaks in ${slave.slaveName}'s virgin pussy.@@ `; @@ -126,15 +126,15 @@ window.VaginalVCheck = function VaginalVCheck(times) { window.BothVCheck = function BothVCheck(analTimes, bothTimes) { const V = State.variables; const slave = V.activeSlave; - let pronouns = getPronouns(slave); - let he = pronouns.pronoun, + const pronouns = getPronouns(slave); + const he = pronouns.pronoun, him = pronouns.object, his = pronouns.possessive, hers = pronouns.possessivePronoun, himself = pronouns.objectReflexive, boy = pronouns.noun; - let He = capFirstChar(he); - let His = capFirstChar(his); + const He = capFirstChar(he); + const His = capFirstChar(his); let r = ``; if (canDoVaginal(slave)) { if (slave.vagina === 0) { @@ -286,15 +286,15 @@ window.SimpleVCheck = function SimpleVCheck(times) { window.PartnerVCheck = function PartnerVCheck(analTimes, bothTimes) { const V = State.variables; const partner = V.slaves[V.partner]; - let pronouns = getPronouns(partner); - let he = pronouns.pronoun, + const pronouns = getPronouns(partner); + const he = pronouns.pronoun, him = pronouns.object, his = pronouns.possessive, hers = pronouns.possessivePronoun, himself = pronouns.objectReflexive, boy = pronouns.noun; - let He = capFirstChar(he); - let His = capFirstChar(his); + const He = capFirstChar(he); + const His = capFirstChar(his); let r = ``; if (V.partner < 0 || V.partner >= V.slaves.length) { diff --git a/src/js/slaveGenerationJS.js b/src/js/slaveGenerationJS.js index b2d66d403b277cad1b9a58095d014d058be5a1d8..df933301d9d3e5f381660f4e43cc1b3e96aff008 100644 --- a/src/js/slaveGenerationJS.js +++ b/src/js/slaveGenerationJS.js @@ -7,7 +7,7 @@ window.raceToNationality = /** @param {App.Entity.SlaveState} slave */ function const V = State.variables; slave.nationality = hashChoice(V.nationalities); /* Maximum of 100 attempts */ - for (var i = 0; setup.raceSelector[slave.nationality] && !(slave.race in setup.raceSelector[slave.nationality]) && i < 100; i++) { + for (let i = 0; setup.raceSelector[slave.nationality] && !(slave.race in setup.raceSelector[slave.nationality]) && i < 100; i++) { slave.nationality = hashChoice(V.nationalities); } /* No success after 100 attempts, so just randomize according to race */ diff --git a/src/js/storyJS.js b/src/js/storyJS.js index 14f437dfa6f544079e98735c26dbf5f903e401dc..ee10995deebd21051cfeaeb666886a75c955ac3b 100644 --- a/src/js/storyJS.js +++ b/src/js/storyJS.js @@ -25,10 +25,10 @@ window.isSexuallyPure = /** @param {App.Entity.SlaveState} slave */ function (sl } }; if (typeof interpolate === "undefined") { - var interpolate = function(x0,y0,x1,y1,x) { - if(x <= x0) { + const interpolate = function(x0,y0,x1,y1,x) { + if (x <= x0) { return y0; - } else if(x >= x1) { + } else if (x >= x1) { return y1; } else { return (x - x0) * ((y1 - y0) / (x1 - x0)) + y0; @@ -38,7 +38,7 @@ if (typeof interpolate === "undefined") { } window.removeFromArray = function(arr, val) { - for (var i = 0; i < arr.length; i++) { + for (let i = 0; i < arr.length; i++) { if (val === arr[i]) return arr.splice(i,1); } @@ -46,7 +46,7 @@ window.removeFromArray = function(arr, val) { }; window.filterInPlace = function(arr, callback, thisArg) { - var j = 0; + let j = 0; arr.forEach(function(e, i) { if (callback.call(thisArg, e, i, arr)) @@ -141,8 +141,8 @@ window.relationTargetWord = /** @param {App.Entity.SlaveState} slave */ function }; window.milkAmount = /** @param {App.Entity.SlaveState} slave */ function (slave) { - var milk; - var calcs; + let milk; + let calcs; if (!slave) { return null; } else { @@ -188,8 +188,8 @@ window.milkAmount = /** @param {App.Entity.SlaveState} slave */ function (slave) }; window.cumAmount = /** @param {App.Entity.SlaveState} slave */ function (slave) { - var cum = 0; - var calcs = 0; + let cum = 0; + let calcs = 0; if (!slave) { return null; } else { @@ -320,7 +320,7 @@ window.lispReplace = function (text) { window.repGainSacrifice = /** @param {App.Entity.SlaveState} slave */ function (slave, arcology) { slave = slave || State.variables.activeSlave; arcology = arcology || State.variables.arcologies[0]; - if(!slave || !arcology || arcology.FSAztecRevivalist === "unset" || arcology.FSAztecRevivalist <= 0) { + if (!slave || !arcology || arcology.FSAztecRevivalist === "unset" || arcology.FSAztecRevivalist <= 0) { return 0; } return Math.ceil( @@ -329,25 +329,25 @@ window.repGainSacrifice = /** @param {App.Entity.SlaveState} slave */ function ( }; window.bodyguardSuccessorEligible = /** @param {App.Entity.SlaveState} slave */ function (slave) { - if(!slave) { return false; } + if (!slave) { return false; } return (slave.devotion > 50 && slave.muscles >= 0 && slave.weight < 100 && slave.boobs < 8000 && slave.butt < 10 && slave.belly < 5000 && slave.balls < 10 && slave.dick < 10 && slave.preg < 20 && slave.fuckdoll === 0 && slave.fetish !== "mindbroken" && canWalk(slave)); }; window.ngUpdateGenePool = function(genePool) { - var transferredSlaveIds = (State.variables.slaves || []) + const transferredSlaveIds = (State.variables.slaves || []) .filter(function(s) { return s.ID >= 1200000; }) .map(function(s) { return s.ID - 1200000; }); return (genePool || []) .filter(function(s) { return transferredSlaveIds.indexOf(s.ID) >= 0; }) .map(function(s) { - var result = jQuery.extend(true, {}, s); + const result = jQuery.extend(true, {}, s); result.ID += 1200000; return result; }); }; window.ngUpdateMissingTable = function(missingTable) { - var newTable = {}; + const newTable = {}; (State.variables.slaves || []) .forEach(s => ([s.pregSource+1200000,s.mother+1200000,s.father+1200000] @@ -361,7 +361,7 @@ window.ngUpdateMissingTable = function(missingTable) { }; window.toJson = function(obj) { - var jsontext = JSON.stringify(obj); + let jsontext = JSON.stringify(obj); jsontext = jsontext.replace(/^{/,""); jsontext = jsontext.replace(/}$/,""); return jsontext; @@ -369,26 +369,26 @@ window.toJson = function(obj) { window.nippleColor = /** @param {App.Entity.SlaveState} slave */ function (slave) { slave = slave || State.variables.activeSlave; - if(slave.skin === 'tanned' || slave.skin === 'fair') { - if(slave.preg > slave.pregData.normalBirth/4 || (slave.birthsTotal > 0 && slave.lactation > 0)) { + if (slave.skin === 'tanned' || slave.skin === 'fair') { + 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 > slave.pregData.normalBirth/4 || (slave.birthsTotal > 0 && slave.lactation > 0)) { + } else if ((slave.skin === 'pale' || slave.race === 'white')) { + 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 > slave.pregData.normalBirth/4 || (slave.birthsTotal > 0 && slave.lactation > 0)) { + } else if ((slave.skin === 'brown' || slave.race === 'black')) { + if (slave.preg > slave.pregData.normalBirth/4 || (slave.birthsTotal > 0 && slave.lactation > 0)) { return 'black'; } else { return 'dark brown'; } } else { - if(slave.preg > slave.pregData.normalBirth/4 || (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'; @@ -397,15 +397,15 @@ window.nippleColor = /** @param {App.Entity.SlaveState} slave */ function (slave }; window.overpowerCheck = /** @param {App.Entity.SlaveState} slave */ function (slave, PC) { - var strength; + let strength; - if(State.variables.arcologies[0].FSPhysicalIdealist !== "unset") { - if(PC.title === 1) { + if (State.variables.arcologies[0].FSPhysicalIdealist !== "unset") { + if (PC.title === 1) { strength = 130; } else { strength = 100; } - } else if(PC.title === 1) { + } else if (PC.title === 1) { strength = 50; } else { strength = 30; @@ -422,11 +422,11 @@ window.overpowerCheck = /** @param {App.Entity.SlaveState} slave */ function (sl * @returns {number[]} */ window.impregnatedBy = function(slave) { - var IDArray = []; + const IDArray = []; if (!Array.isArray(slave.womb)) { WombInit(slave); } - for (var i = 0; i < slave.womb.length; i++) { + for (let i = 0; i < slave.womb.length; i++) { IDArray.push(slave.womb[i].fatherID); } return IDArray; @@ -640,7 +640,7 @@ window.printTrinkets = function printTrinkets() { let trinketString = []; let plurals = false; - for (let trinketDesc in trinkets) { + for (const trinketDesc in trinkets) { if (trinkets[trinketDesc] === 1) { trinketString.push(trinketDesc); } else if (trinkets[trinketDesc] > 1) {