diff --git a/src/js/assayJS.js b/src/js/assayJS.js index 1f10b570c62e3e6a45aa6d455d063fe7335cf495..76cde94601cb3d3085e7ea958dd9e59f3bcce471 100644 --- a/src/js/assayJS.js +++ b/src/js/assayJS.js @@ -566,48 +566,48 @@ window.PCTitle = function PCTitle() { V.PCTitle = PlayerName(); if (V.cheater === 1) { - V.PCTitle = (V.PCTitle + " the Cheater"); + V.PCTitle = (`${V.PCTitle } the Cheater`); } else if (V.arcologies[0].FSRestart > 10) { - V.PCTitle = (V.PCTitle + " of the Societal Elite"); + V.PCTitle = (`${V.PCTitle } of the Societal Elite`); } else if (V.rep > 18000) { - V.PCTitle = (V.PCTitle + " the Great"); + V.PCTitle = (`${V.PCTitle } the Great`); } else if (V.rep > 17000) { - V.PCTitle = ("the exalted " + V.PCTitle); + V.PCTitle = (`the exalted ${ V.PCTitle}`); } else if (V.rep > 16000) { - V.PCTitle = ("the illustrious " + V.PCTitle); + V.PCTitle = (`the illustrious ${ V.PCTitle}`); } else if (V.rep > 15000) { - V.PCTitle = ("the prestigious " + V.PCTitle); + V.PCTitle = (`the prestigious ${ V.PCTitle}`); } else if (V.rep > 14000) { - V.PCTitle = ("the renowned " + V.PCTitle); + V.PCTitle = (`the renowned ${ V.PCTitle}`); } else if (V.rep > 13000) { - V.PCTitle = ("the famed " + V.PCTitle); + V.PCTitle = (`the famed ${ V.PCTitle}`); } else if (V.rep > 12000) { - V.PCTitle = ("the celebrated " + V.PCTitle); + V.PCTitle = (`the celebrated ${ V.PCTitle}`); } else if (V.rep > 11000) { - V.PCTitle = ("the honored " + V.PCTitle); + V.PCTitle = (`the honored ${ V.PCTitle}`); } else if (V.rep > 10000) { - V.PCTitle = ("the acclaimed " + V.PCTitle); + V.PCTitle = (`the acclaimed ${ V.PCTitle}`); } else if (V.rep > 9000) { - V.PCTitle = ("the eminent " + V.PCTitle); + V.PCTitle = (`the eminent ${ V.PCTitle}`); } else if (V.rep > 8250) { - V.PCTitle = ("the prominent " + V.PCTitle); + V.PCTitle = (`the prominent ${ V.PCTitle}`); } else if (V.rep > 7500) { - V.PCTitle = ("the distinguished " + V.PCTitle); + V.PCTitle = (`the distinguished ${ V.PCTitle}`); } else if (V.rep > 6750) { - V.PCTitle = ("the admired " + V.PCTitle); + V.PCTitle = (`the admired ${ V.PCTitle}`); } else if (V.rep > 6000) { - V.PCTitle = ("the esteemed " + V.PCTitle); + V.PCTitle = (`the esteemed ${ V.PCTitle}`); } else if (V.rep > 5250) { - V.PCTitle = ("the respected " + V.PCTitle); + V.PCTitle = (`the respected ${ V.PCTitle}`); } else if (V.rep > 4500) { - V.PCTitle = ("the known " + V.PCTitle); + V.PCTitle = (`the known ${ V.PCTitle}`); } else if (V.rep > 3750) { - V.PCTitle = ("the recognized " + V.PCTitle); + V.PCTitle = (`the recognized ${ V.PCTitle}`); } else if (V.rep > 3000) { - V.PCTitle = ("the rumored " + V.PCTitle); + V.PCTitle = (`the rumored ${ V.PCTitle}`); } - V.PCTitle = (V.PCTitle + ", "); + V.PCTitle = (`${V.PCTitle }, `); if (V.PC.name === "FC Dev") { titles.push("the Creator"); @@ -635,7 +635,7 @@ window.PCTitle = function PCTitle() { } if (V.SF.Active < -1) { - switch(V.SF.BadOutcome) { + switch (V.SF.BadOutcome) { case "lockdown": titles.push("The War Host"); break; @@ -652,17 +652,17 @@ window.PCTitle = function PCTitle() { if (V.mercenaries >= 5) { if (V.mercenariesTitle === "Evocati") { - titles.push("Princeps of the " + V.mercenariesTitle); + titles.push(`Princeps of the ${ V.mercenariesTitle}`); } else if (V.mercenariesTitle === "Knights") { if (V.PC.title === 1) { - titles.push("Lord Commander of the " + V.mercenariesTitle); + titles.push(`Lord Commander of the ${ V.mercenariesTitle}`); } else { - titles.push("Lady Commander of the " + V.mercenariesTitle); + titles.push(`Lady Commander of the ${ V.mercenariesTitle}`); } } else if (V.mercenariesTitle === "Immortals") { - titles.push("Tyrant of the " + V.mercenariesTitle); + titles.push(`Tyrant of the ${ V.mercenariesTitle}`); } else { - titles.push("Commander of the " + V.mercenariesTitle); + titles.push(`Commander of the ${ V.mercenariesTitle}`); } } else if (V.mercenaries >= 1) { titles.push("Commander of the Mercenaries"); @@ -1004,9 +1004,9 @@ window.PCTitle = function PCTitle() { if (schoolsPerfected.length === 1) { schoolTitle += schoolsPerfected[0]; } else if (schoolsPerfected.length === 2) { - schoolTitle += schoolsPerfected[0] + " and " + schoolsPerfected[1]; + schoolTitle += `${schoolsPerfected[0] } and ${ schoolsPerfected[1]}`; } else { - schoolsPerfected[schoolsPerfected.length - 1] = "and " + schoolsPerfected[schoolsPerfected.length - 1]; + schoolsPerfected[schoolsPerfected.length - 1] = `and ${ schoolsPerfected[schoolsPerfected.length - 1]}`; schoolTitle += schoolsPerfected.join(", "); } titles.push(schoolTitle); @@ -1017,9 +1017,9 @@ window.PCTitle = function PCTitle() { if (schoolsPresent.length === 1) { schoolTitle += schoolsPresent[0]; } else if (schoolsPresent.length === 2) { - schoolTitle += schoolsPresent[0] + " and " + schoolsPresent[1]; + schoolTitle += `${schoolsPresent[0] } and ${ schoolsPresent[1]}`; } else { - schoolsPresent[schoolsPresent.length - 1] = "and " + schoolsPresent[schoolsPresent.length - 1]; + schoolsPresent[schoolsPresent.length - 1] = `and ${ schoolsPresent[schoolsPresent.length - 1]}`; schoolTitle += schoolsPresent.join(", "); } titles.push(schoolTitle); @@ -1088,9 +1088,9 @@ window.PCTitle = function PCTitle() { if (titles.length === 1) { V.PCTitle += titles[0]; } else if (titles.length === 2) { - V.PCTitle += titles[0] + " and " + titles[1]; + V.PCTitle += `${titles[0] } and ${ titles[1]}`; } else { - titles[titles.length - 1] = "and " + titles[titles.length - 1]; + titles[titles.length - 1] = `and ${ titles[titles.length - 1]}`; V.PCTitle += titles.join(", "); } }; @@ -1186,104 +1186,104 @@ window.SlaveTitle = /** @param {App.Entity.SlaveState} slave */ function SlaveTi if (slave.visualAge < 13) { if (slave.genes === "XY" && slave.vagina === -1) { - r = "shota " + r; + r = `shota ${ r}`; } else { - r = "loli " + r; + r = `loli ${ r}`; } } if (slave.geneticQuirks.albinism === 2) { - r = "albino " + r; + r = `albino ${ r}`; } if (slave.dick > 9 && slave.balls > 9 && slave.boobs > 12000) { - r = "hyper " + r; + r = `hyper ${ r}`; } 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; + r = `milky ${ r}`; } if (slave.boobs > 20000) { - r = "supermassive titted " + r; + r = `supermassive titted ${ r}`; } else if (slave.boobs > 10000) { - r = "giant titted " + r; + r = `giant titted ${ r}`; } else if (slave.boobs > 4000) { - r = "huge titted " + r; + r = `huge titted ${ r}`; } else if (slave.boobs > 1000) { - r = "busty " + r; + r = `busty ${ r}`; } if (slave.dick > 5 && slave.balls > 5) { - r = "womb filling " + r; + r = `womb filling ${ r}`; } else if (slave.dick > 5) { - r = "well hung " + r; + r = `well hung ${ r}`; } if (slave.butt >= 12) { - r = "colossal assed " + r; + r = `colossal assed ${ r}`; } else if (slave.butt >= 12) { - r = "massive assed " + r; + r = `massive assed ${ r}`; } else if (slave.butt >= 8) { - r = "fat assed " + r; + r = `fat assed ${ r}`; } else if (slave.butt >= 6) { - r = "bottom heavy " + r; + r = `bottom heavy ${ r}`; } else if (slave.butt >= 4) { - r = "big bottomed " + r; + r = `big bottomed ${ r}`; } if (slave.weight > 10 && slave.weight < 100 && slave.boobs > 5000 && slave.butt > 5 && slave.hips >= 2 && slave.bellyPreg >= 30000 && slave.births >= 10) { - r = r + " fertility goddess"; + r = `${r } fertility goddess`; } else if (slave.births >= 6) { - r = r + " broodmother"; + r = `${r } broodmother`; } else if (slave.births >= 3) { - r = r + " breeder"; + r = `${r } breeder`; } if (slave.indenture > -1) { - r = "indentured " + r; + r = `indentured ${ r}`; } if (slave.preg > slave.pregData.normalBirth/4 && slave.pregKnown === 1) { - r = "pregnant " + r; + r = `pregnant ${ r}`; } else if (slave.bellyFluid >= 5000) { - r = "bloated " + r; + r = `bloated ${ r}`; } else if (slave.belly >= 5000) { - r = "gravid " + r; + r = `gravid ${ r}`; } if (slave.fuckdoll > 0) { - r = r + " fuckdoll"; + r = `${r } fuckdoll`; } } else { r = "slave"; /* I don't tihnk there is an 'else'? */ if ((slave.dick === 0) && (slave.vagina === -1)) { /* NULLS */ r = "null"; if ((slave.lactation > 0) && (slave.boobs > 2000)) { - r = r + " cow"; + r = `${r } cow`; } else if ((slave.boobsImplant > 0) && (slave.buttImplant > 0)) { - r = r + " bimbo "; + r = `${r } bimbo `; } else if (slave.boobs > 6000) { - r = r + " boob"; + r = `${r } boob`; } else if (slave.butt > 6) { - r = r + " ass"; + r = `${r } ass`; } else if ((slave.muscles > 30) && (slave.height < 185)) { - r = r + " muscle"; + r = `${r } muscle`; } if (slave.visualAge > 55) { - r = r + "GILF"; + r = `${r }GILF`; } else if (slave.visualAge > 35) { - r = r + "MILF"; + r = `${r }MILF`; } else if (slave.visualAge >= 25) { - r = r + "slave"; + r = `${r }slave`; } else { - r = r + "girl"; + r = `${r }girl`; } } @@ -1298,15 +1298,15 @@ window.SlaveTitle = /** @param {App.Entity.SlaveState} slave */ function SlaveTi r = "slavegirl"; } if ((slave.muscles > 30) && (slave.height < 185)) { - r = "muscle " + r; + r = `muscle ${ r}`; } else if ((slave.lactation > 0) && (slave.boobs > 2000)) { - r = r + " cow"; + r = `${r } cow`; } else if ((slave.boobsImplant > 0) && (slave.buttImplant > 0)) { - r = r + " bimbo"; + r = `${r } bimbo`; } else if (slave.boobs > 6000) { - r = "boob" + r; + r = `boob${ r}`; } else if (slave.butt > 6) { - r = "ass" + r; + r = `ass${ r}`; } } @@ -1317,27 +1317,27 @@ window.SlaveTitle = /** @param {App.Entity.SlaveState} slave */ function SlaveTi r = "futa "; } if ((slave.lactation > 0) && (slave.boobs > 2000)) { - r = r + "cow"; + r = `${r }cow`; } else if ((slave.boobsImplant > 0) && (slave.buttImplant > 0)) { - r = r + "bimbo "; + r = `${r }bimbo `; } else if (slave.boobs > 6000) { - r = r + "boob"; + r = `${r }boob`; } else if (slave.butt > 6) { - r = r + "ass"; + r = `${r }ass`; } else if ((slave.muscles > 30) && (slave.height < 185)) { - r = r + "muscle"; + r = `${r }muscle`; } if (slave.visualAge > 55) { - r = r + "GILF"; + r = `${r }GILF`; } else if (slave.visualAge > 35) { - r = r + "MILF"; + r = `${r }MILF`; } else if (slave.visualAge >= 25) { - r = r + "slave"; + r = `${r }slave`; } else { - r = r + "girl"; + r = `${r }girl`; } if (slave.dick > 5 && slave.balls > 5 && slave.boobs > 5000) { - r = "hyper " + r; + r = `hyper ${ r}`; } } @@ -1352,15 +1352,15 @@ window.SlaveTitle = /** @param {App.Entity.SlaveState} slave */ function SlaveTi r = "tgirl"; } if ((slave.muscles > 30) && (slave.height < 185)) { - r = "muscle" + r; + r = `muscle${ r}`; } else if ((slave.lactation > 0) && (slave.boobs > 2000)) { - r = r + " cow"; + r = `${r } cow`; } else if ((slave.boobsImplant > 0) && (slave.buttImplant > 0)) { - r = r + " bimbo"; + r = `${r } bimbo`; } else if (slave.boobs > 6000) { - r = "topheavy " + r; + r = `topheavy ${ r}`; } else if (slave.butt > 6) { - r = "bottomheavy " + r; + r = `bottomheavy ${ r}`; } } @@ -1387,9 +1387,9 @@ window.SlaveTitle = /** @param {App.Entity.SlaveState} slave */ function SlaveTi } } if (slave.lactation > 0) { - r = r + " cow"; + r = `${r } cow`; } else if ((slave.boobsImplant > 0) && (slave.buttImplant > 0)) { - r = r + " bimbo"; + r = `${r } bimbo`; } } } @@ -1400,18 +1400,18 @@ window.SlaveTitle = /** @param {App.Entity.SlaveState} slave */ function SlaveTi if ((slave.shoulders > 1) || (slave.muscles >= 30)) { /* BITCHES: masculine shoulders or muscles */ r = "bitch"; if ((slave.muscles > 30) && (slave.height < 185)) { - r = "muscle" + r; + r = `muscle${ r}`; } else if (slave.lactation > 0) { - r = r + "cow"; + r = `${r }cow`; } else if ((slave.boobsImplant > 0) && (slave.buttImplant > 0)) { - r = "bimbo " + r; + r = `bimbo ${ r}`; } if (slave.visualAge > 55) { - r = "aged " + r; + r = `aged ${ r}`; } else if (slave.visualAge > 35) { - r = "mature " + r; + r = `mature ${ r}`; } else if (slave.visualAge < 25) { - r = "young " + r; + r = `young ${ r}`; } } } @@ -1420,61 +1420,61 @@ window.SlaveTitle = /** @param {App.Entity.SlaveState} slave */ function SlaveTi if ((slave.dick !== 0) && (slave.vagina === -1) && (slave.balls === 0)) { r = "dick"; if (slave.visualAge > 55) { - r = r + "GILF"; + r = `${r }GILF`; } else if (slave.visualAge > 35) { - r = r + "MILF"; + r = `${r }MILF`; } else if (slave.visualAge >= 25) { - r = r + "slave"; + r = `${r }slave`; } else { - r = r + "girl"; + r = `${r }girl`; } if ((slave.muscles > 30) && (slave.height < 185)) { - r = "muscle" + r; + r = `muscle${ r}`; } else if ((slave.lactation > 0) && (slave.boobs > 2000)) { - r = r + " cow"; + r = `${r } cow`; } else if ((slave.boobsImplant > 0) && (slave.buttImplant > 0)) { - r = r + " bimbo"; + r = `${r } bimbo`; } else if (slave.boobs > 6000) { - r = "boob " + r; + r = `boob ${ r}`; } else if (slave.butt > 6) { - r = "ass " + r; + r = `ass ${ r}`; } } if ((slave.muscles > 30) && (slave.height > 185)) { - r = "amazon " + r; + r = `amazon ${ r}`; } else if ((slave.muscles < 30) && (slave.height > 185)) { - r = "statuesque " + r; + r = `statuesque ${ r}`; } else if ((slave.boobs < 800) && (slave.height < 150)) { - r = "petite " + r; + r = `petite ${ r}`; } else if ((slave.boobs > 800) && (slave.height < 150)) { - r = "shortstack " + r; + r = `shortstack ${ r}`; } if (slave.births >= 5) { - r = r + " broodmother"; + r = `${r } broodmother`; } else if (slave.births >= 2) { - r = r + " breeder"; + r = `${r } breeder`; } if (slave.geneticQuirks.albinism === 2) { - r = "albino " + r; + r = `albino ${ r}`; } if (slave.indenture > -1) { - r = "indentured " + r; + r = `indentured ${ r}`; } if (slave.preg > slave.pregData.normalBirth/4 && slave.pregKnown === 1) { - r = "pregnant " + r; + r = `pregnant ${ r}`; } else if (slave.bellyFluid >= 5000) { - r = "bloated " + r; + r = `bloated ${ r}`; } else if (slave.belly >= 5000) { - r = "gravid " + r; + r = `gravid ${ r}`; } if (slave.fuckdoll > 0) { - r = r + " fuckdoll"; + r = `${r } fuckdoll`; } } return r; @@ -1501,10 +1501,10 @@ window.DegradingName = /** @param {App.Entity.SlaveState} slave */ function Degr const suffixes = []; if (slave.fuckdoll > 0) { - slave.slaveName = "Fuckdoll No. " + slave.ID; + slave.slaveName = `Fuckdoll No. ${ slave.ID}`; slave.slaveSurname = 0; } else if (slave.assignment === "work in the dairy" && V.dairyRestraintsSetting >= 2) { - slave.slaveName = "Bioreactor No. " + slave.ID; + slave.slaveName = `Bioreactor No. ${ slave.ID}`; slave.slaveSurname = 0; } else { if (V.seeRace === 1) { diff --git a/src/js/economyJS.js b/src/js/economyJS.js index 937eebc2ea4c02e41b5144287b852b4bf5eee762..63955e40086db7e49e725eeb9837fc6ff06c57c7 100644 --- a/src/js/economyJS.js +++ b/src/js/economyJS.js @@ -881,7 +881,7 @@ window.getSlaveCost = function(s) { } if (isNaN(cost)) { - throw new Error('Cost calculation for slave ' + s.slaveName + ' (' + s.ID + ') failed.'); + throw new Error(`Cost calculation for slave ${ s.slaveName } (${ s.ID }) failed.`); } return cost; }; diff --git a/src/js/familyTreeJS.js b/src/js/familyTreeJS.js index 9b9f993adb2c7622a993a46cbe42810d1d4bb96d..4819a4019cad81bb1a854391173009beb8d321c6 100644 --- a/src/js/familyTreeJS.js +++ b/src/js/familyTreeJS.js @@ -75,7 +75,7 @@ window.renderFamilyTree = function(slaves, filterID) { chartLayer .attr('width', chartWidth) .attr('height', chartHeight) - .attr('transform', 'translate('+[margin.left, margin.top]+')'); + .attr('transform', `translate(${[margin.left, margin.top]})`); } function runFtreeSim(data) { @@ -147,7 +147,7 @@ window.renderFamilyTree = function(slaves, filterID) { } else { ssym = '?'; } - return d.name + '('+ssym+')'; + return `${d.name }(${ssym})`; }) .attr('dy', 4) .attr('dx', function(d) { return -(8*d.name.length)/2; }) @@ -177,7 +177,7 @@ window.renderFamilyTree = function(slaves, filterID) { .attr('y2', function (d) { return d.target.y; }); node - .attr("transform", function (d) { return "translate(" + d.x + ", " + d.y + ")"; }); + .attr("transform", function (d) { return `translate(${ d.x }, ${ d.y })`; }); }; simulation.nodes(data.nodes) @@ -225,7 +225,7 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { var kids = {}; var fake_pc = { - slaveName: State.variables.PC.name + '(You)', + slaveName: `${State.variables.PC.name }(You)`, mother: State.variables.PC.mother, father: State.variables.PC.father, dick: State.variables.PC.dick, @@ -311,12 +311,12 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { } else if(names.length === 2) { name = names.join(' and '); } else { - names[-1] = 'and '+names[-1]; + names[-1] = `and ${names[-1]}`; name = names.join(', '); } node_lookup[key] = family_graph.nodes.length; //Outside extant slaves set - charList.push({ID: key, mother: 0, father: 0, is_mother: true, dick: 0, vagina: 1, slaveName: name+"'s mother"}); + charList.push({ID: key, mother: 0, father: 0, is_mother: true, dick: 0, vagina: 1, slaveName: `${name}'s mother`}); } var dkeys = Object.keys(outdads); @@ -329,12 +329,12 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { } else if(names.length === 2) { name = names.join(' and '); } else { - names[-1] = 'and '+names[-1]; + names[-1] = `and ${names[-1]}`; name = names.join(', '); } node_lookup[key] = family_graph.nodes.length; //Outside extant slaves set - charList.push({ID: key, mother: 0, father: 0, is_father: true, dick: 1, vagina: -1, slaveName: name+"'s father"}); + charList.push({ID: key, mother: 0, father: 0, is_father: true, dick: 1, vagina: -1, slaveName: `${name}'s father`}); } var charHash = {}; @@ -546,7 +546,7 @@ window.updateFamilyTree = function(activeSlave = lastActiveSlave, slaves = lastS slavesAdded[slave.ID] = true; } var data = { - "name": slave.slaveName + (slave.physicalAge?(" (" + slave.physicalAge + ")"):""), + "name": slave.slaveName + (slave.physicalAge?(` (${ slave.physicalAge })`):""), "class": slave.genes, "textClass": (activeSlaveId === slave.ID)?"emphasis":"", "marriages": [], @@ -586,7 +586,7 @@ window.updateFamilyTree = function(activeSlave = lastActiveSlave, slaves = lastS var spouse = getSlave(key, (slaves.genes === "XX")?"unknownXY":(slaves.genes === "XY")?"unknownXX":"unknown"); var spouseName; if (spouse.ID !== slave.ID){ - spouseName = spouse.slaveName + (spouse.physicalAge?(" (" + spouse.physicalAge + ")"):""); + spouseName = spouse.slaveName + (spouse.physicalAge?(` (${ spouse.physicalAge })`):""); } else { spouseName = (spouse.ID === -1)?"(yourself)":"(themselves)"; } diff --git a/src/js/foreachMacroJS.js b/src/js/foreachMacroJS.js index ea5e0afcd3ffed39d03bb4a9ef4e833376ad54fb..5aa54d90562c88b890c9458d1a7da4a2567a1c1f 100644 --- a/src/js/foreachMacroJS.js +++ b/src/js/foreachMacroJS.js @@ -31,15 +31,15 @@ Macro.add('foreach', { // We don't check for "instanceof Array" to also be able to pass arguments or other strange objects if(typeof resultLength !== 'number' || (resultLength % 1) !== 0) { - return this.error("bad evaluation: '" + result + "' is not an array or array-like object"); + return this.error(`bad evaluation: '${ result }' is not an array or array-like object`); } if(resultLength > Config.macros.maxLoopIterations) { - return this.error('Array too large for maxLoopIterations (' + resultLength + ' > ' + Config.macros.maxLoopIterations + ')'); + return this.error(`Array too large for maxLoopIterations (${ resultLength } > ${ Config.macros.maxLoopIterations })`); } if(!new RegExp(`^(${Patterns.variable})$`).test(variable)) { - return this.error('not a variable identifier: ' + variable); + return this.error(`not a variable identifier: ${ variable}`); } if(resultLength <= 0) { diff --git a/src/js/futureSocietyJS.js b/src/js/futureSocietyJS.js index 6978059a94ef3010a2c41179f75d09b8c285ac8c..bd005f0b772658df2c50e77f44088b56670d0c65 100644 --- a/src/js/futureSocietyJS.js +++ b/src/js/futureSocietyJS.js @@ -11,9 +11,9 @@ window.FutureSocieties = (function() { function removeFS(FS) { const V = State.variables; const arcology = V.arcologies[0]; - const FSDecoration = FS + "Decoration"; - const FSSMR = FS + "SMR"; - let FSLaw = FS + "Law"; + const FSDecoration = `${FS }Decoration`; + const FSSMR = `${FS }SMR`; + let FSLaw = `${FS }Law`; if (arcology[FS] === undefined) { console.log(`ERROR: bad FS reference, $arcologies[0].${FS} not defined`); return; diff --git a/src/js/hTagMacroJS.js b/src/js/hTagMacroJS.js index 64681ad4b2d674888901a44ca00d456f210377db..a0908716ab2f36f3a701760f96851d23201c3b35 100644 --- a/src/js/hTagMacroJS.js +++ b/src/js/hTagMacroJS.js @@ -20,7 +20,7 @@ Macro.add('htag', { let htag = 'div'; let attributes; function munge (val, key) { - return key + '="' + val + '"'; + return `${key }="${ val }"`; } if (1 > this.args.length) @@ -30,11 +30,11 @@ Macro.add('htag', { if ("object" === typeof this.args[0]) attributes = $.map(this.args[0], munge).join(" "); else - attributes = 'id="' + String(this.args[0]).trim() + '"'; + attributes = `id="${ String(this.args[0]).trim() }"`; if (Config.debug) this.debugView.modes({block: true}); - jQuery('<' + htag + ' ' + attributes + ' />') + jQuery(`<${ htag } ${ attributes } />`) .wiki(payload) .appendTo(this.output); } diff --git a/src/js/itemAvailability.js b/src/js/itemAvailability.js index 2bbfa0e66945ce80ac3b0987975c0af345cc3505..049b0668248e291324b7ab99ab17d4f7e996222c 100644 --- a/src/js/itemAvailability.js +++ b/src/js/itemAvailability.js @@ -5,155 +5,154 @@ window.isItemAccessible = function(string) { if (V.cheatMode === 1) { return true; - } else { - switch (string) { /* no breaks needed because we always return */ - case "attractive lingerie for a pregnant woman": - return (V.arcologies[0].FSRepopulationFocus > 0 || V.clothesBoughtMaternityLingerie === 1); - case "a bunny outfit": - return (V.arcologies[0].FSGenderFundamentalist > 0 || V.clothesBoughtBunny === 1); - case "body oil": - return (V.arcologies[0].FSPhysicalIdealist > 0 || V.clothesBoughtOil === 1); - case "chains": - return (V.arcologies[0].FSDegradationist > 0 || V.clothesBoughtChains === 1); - case "a chattel habit": - return (V.arcologies[0].FSChattelReligionist > 0 || V.clothesBoughtHabit === 1); - case "conservative clothing": - return (V.arcologies[0].FSPaternalist > 0 || V.clothesBoughtConservative === 1); - case "harem gauze": - return (V.arcologies[0].FSArabianRevivalist > 0 || V.clothesBoughtHarem === 1); - case "a huipil": - return (V.arcologies[0].FSAztecRevivalist > 0 || V.clothesBoughtHuipil === 1); - case "a kimono": - return (V.arcologies[0].FSEdoRevivalist > 0 || V.clothesBoughtKimono === 1 || V.continent === "Japan"); - case "a maternity dress": - return (V.arcologies[0].FSRepopulationFocus > 0 || V.clothesBoughtMaternityDress === 1); - case "a slutty qipao": - return (V.arcologies[0].FSChineseRevivalist > 0 || V.clothesBoughtQipao === 1); - case "a long qipao": - return (V.arcologies[0].FSChineseRevivalist > 0 || V.clothesBoughtCultural === 1); - case "stretch pants and a crop-top": - return (V.arcologies[0].FSHedonisticDecadence > 0 || V.clothesBoughtLazyClothes === 1); - case "a toga": - return (V.arcologies[0].FSRomanRevivalist > 0 || V.clothesBoughtToga === 1); - case "Western clothing": - return (V.arcologies[0].FSPastoralist > 0 || V.clothesBoughtWestern === 1); - case "battlearmor": - case "a military uniform": - case "a red army uniform": - case "battledress": - return (V.clothesBoughtMilitary === 1); - case "a biyelgee costume": - case "a dirndl": - case "lederhosen": - case "a mounty outfit": - case "a hanbok": - return (V.clothesBoughtCultural === 1); - case "a burqa": - case "a niqab and abaya": - return (V.clothesBoughtMiddleEastern === 1 || V.continent === "the Middle East"); - case "a hijab and blouse": - return (V.clothesBoughtMiddleEastern === 1 || V.clothesBoughtConservative === 1 || V.continent === "the Middle East"); - case "a burkini": - return (V.clothesBoughtMiddleEastern === 1 && V.clothesBoughtSwimwear === 1 || V.continent === "the Middle East"); - case "a Santa dress": - return (V.clothesBoughtCostume === 1); - case "a klan robe": - case "a slutty klan robe": - case "a schutzstaffel uniform": - case "a slutty schutzstaffel uniform": - return (V.clothesBoughtPol === 1); - case "nice business attire": - case "a nice nurse outfit": - case "a police uniform": - return (V.clothesBoughtCareer === 1); - case "a nice maid outfit": - 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': - return (V.clothesBoughtDresses === 1); - case "a cybersuit": - case "a latex catsuit": - return (V.clothesBoughtBodysuits === 1); - case "a button-up shirt and panties": - case "a button-up shirt": - case "cutoffs": - case "jeans": - case "leather pants and a tube top": - case "leather pants": - case "an oversized t-shirt": - case "a sweater and cutoffs": - case "a sweater and panties": - case "a sweater": - case "a t-shirt and jeans": - case "a t-shirt and panties": - case "a t-shirt": - case "a tank-top and panties": - case "a tank-top": - case "a tube top": - return (V.clothesBoughtCasual === 1); - case "boyshorts": - case "a bra": - case "kitty lingerie": - case "panties and pasties": - case "a skimpy loincloth": - case "a thong": - 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": - return (V.clothesBoughtUnderwear === 1 && V.clothesBoughtCasual === 1); - case "sport shorts and a sports bra": - case "sport shorts": - case "a sports bra": - return (V.clothesBoughtSports === 1); - case "sport shorts and a t-shirt": - return (V.clothesBoughtSports === 1 && V.clothesBoughtCasual === 1); - case "a nice pony outfit": - case "a slutty pony outfit": - return (V.clothesBoughtPony === 1); - case "a monokini": - case "a one-piece swimsuit": - return (V.clothesBoughtSwimwear === 1); - case "shimapan panties": - case "a striped bra": - case "striped panties": - case "striped underwear": - return (V.clothesBoughtPantsu === 1 || V.continent === "Japan"); - case "bowtie": - return (V.arcologies[0].FSGenderFundamentalist > 0 || V.clothesBoughtBunny === 1); - case "ancient Egyptian": - return (V.arcologies[0].FSEgyptianRevivalist > 0 || V.clothesBoughtEgypt === 1); - case "pasties": /* an option in saChoosesOwnClothes.tw, but everything else (e.g. descriptions, artwork, option in wardrobeUse.tw) is missing or not hooked up correctly */ - return false; - case "massive dildo gag": - 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 "bullet vibrator": - case "smart bullet vibrator": - case "long dildo": - case "long, large dildo": - case "long, huge dildo": - return (V.toysBoughtDildos === 1); - case "vibrator": - return (V.toysBoughtVaginalAttachments === 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; - } + } + switch (string) { /* no breaks needed because we always return */ + case "attractive lingerie for a pregnant woman": + return (V.arcologies[0].FSRepopulationFocus > 0 || V.clothesBoughtMaternityLingerie === 1); + case "a bunny outfit": + return (V.arcologies[0].FSGenderFundamentalist > 0 || V.clothesBoughtBunny === 1); + case "body oil": + return (V.arcologies[0].FSPhysicalIdealist > 0 || V.clothesBoughtOil === 1); + case "chains": + return (V.arcologies[0].FSDegradationist > 0 || V.clothesBoughtChains === 1); + case "a chattel habit": + return (V.arcologies[0].FSChattelReligionist > 0 || V.clothesBoughtHabit === 1); + case "conservative clothing": + return (V.arcologies[0].FSPaternalist > 0 || V.clothesBoughtConservative === 1); + case "harem gauze": + return (V.arcologies[0].FSArabianRevivalist > 0 || V.clothesBoughtHarem === 1); + case "a huipil": + return (V.arcologies[0].FSAztecRevivalist > 0 || V.clothesBoughtHuipil === 1); + case "a kimono": + return (V.arcologies[0].FSEdoRevivalist > 0 || V.clothesBoughtKimono === 1 || V.continent === "Japan"); + case "a maternity dress": + return (V.arcologies[0].FSRepopulationFocus > 0 || V.clothesBoughtMaternityDress === 1); + case "a slutty qipao": + return (V.arcologies[0].FSChineseRevivalist > 0 || V.clothesBoughtQipao === 1); + case "a long qipao": + return (V.arcologies[0].FSChineseRevivalist > 0 || V.clothesBoughtCultural === 1); + case "stretch pants and a crop-top": + return (V.arcologies[0].FSHedonisticDecadence > 0 || V.clothesBoughtLazyClothes === 1); + case "a toga": + return (V.arcologies[0].FSRomanRevivalist > 0 || V.clothesBoughtToga === 1); + case "Western clothing": + return (V.arcologies[0].FSPastoralist > 0 || V.clothesBoughtWestern === 1); + case "battlearmor": + case "a military uniform": + case "a red army uniform": + case "battledress": + return (V.clothesBoughtMilitary === 1); + case "a biyelgee costume": + case "a dirndl": + case "lederhosen": + case "a mounty outfit": + case "a hanbok": + return (V.clothesBoughtCultural === 1); + case "a burqa": + case "a niqab and abaya": + return (V.clothesBoughtMiddleEastern === 1 || V.continent === "the Middle East"); + case "a hijab and blouse": + return (V.clothesBoughtMiddleEastern === 1 || V.clothesBoughtConservative === 1 || V.continent === "the Middle East"); + case "a burkini": + return (V.clothesBoughtMiddleEastern === 1 && V.clothesBoughtSwimwear === 1 || V.continent === "the Middle East"); + case "a Santa dress": + return (V.clothesBoughtCostume === 1); + case "a klan robe": + case "a slutty klan robe": + case "a schutzstaffel uniform": + case "a slutty schutzstaffel uniform": + return (V.clothesBoughtPol === 1); + case "nice business attire": + case "a nice nurse outfit": + case "a police uniform": + return (V.clothesBoughtCareer === 1); + case "a nice maid outfit": + 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': + return (V.clothesBoughtDresses === 1); + case "a cybersuit": + case "a latex catsuit": + return (V.clothesBoughtBodysuits === 1); + case "a button-up shirt and panties": + case "a button-up shirt": + case "cutoffs": + case "jeans": + case "leather pants and a tube top": + case "leather pants": + case "an oversized t-shirt": + case "a sweater and cutoffs": + case "a sweater and panties": + case "a sweater": + case "a t-shirt and jeans": + case "a t-shirt and panties": + case "a t-shirt": + case "a tank-top and panties": + case "a tank-top": + case "a tube top": + return (V.clothesBoughtCasual === 1); + case "boyshorts": + case "a bra": + case "kitty lingerie": + case "panties and pasties": + case "a skimpy loincloth": + case "a thong": + 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": + return (V.clothesBoughtUnderwear === 1 && V.clothesBoughtCasual === 1); + case "sport shorts and a sports bra": + case "sport shorts": + case "a sports bra": + return (V.clothesBoughtSports === 1); + case "sport shorts and a t-shirt": + return (V.clothesBoughtSports === 1 && V.clothesBoughtCasual === 1); + case "a nice pony outfit": + case "a slutty pony outfit": + return (V.clothesBoughtPony === 1); + case "a monokini": + case "a one-piece swimsuit": + return (V.clothesBoughtSwimwear === 1); + case "shimapan panties": + case "a striped bra": + case "striped panties": + case "striped underwear": + return (V.clothesBoughtPantsu === 1 || V.continent === "Japan"); + case "bowtie": + return (V.arcologies[0].FSGenderFundamentalist > 0 || V.clothesBoughtBunny === 1); + case "ancient Egyptian": + return (V.arcologies[0].FSEgyptianRevivalist > 0 || V.clothesBoughtEgypt === 1); + case "pasties": /* an option in saChoosesOwnClothes.tw, but everything else (e.g. descriptions, artwork, option in wardrobeUse.tw) is missing or not hooked up correctly */ + return false; + case "massive dildo gag": + 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 "bullet vibrator": + case "smart bullet vibrator": + case "long dildo": + case "long, large dildo": + case "long, huge dildo": + return (V.toysBoughtDildos === 1); + case "vibrator": + return (V.toysBoughtVaginalAttachments === 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; } }; diff --git a/src/js/pregJS.js b/src/js/pregJS.js index c3024a85201ec1b1d85af3d525ae407d35affe4e..3477b35aef8d599f20e7bdafaf1a136a8dd0f252 100644 --- a/src/js/pregJS.js +++ b/src/js/pregJS.js @@ -402,7 +402,7 @@ window.knockMeUp = function(target, chance, hole, fatherID, displayOverride) { let He; let r = ""; if (target.ID !== -1) { - pronouns = getPronouns(slave); + pronouns = getPronouns(target); He = capFirstChar(pronouns.pronoun); } if (V.seePreg !== 0) { diff --git a/src/js/rulesAssistantOptions.js b/src/js/rulesAssistantOptions.js index af2198d9ac8b5ebe7fd6e195ceab8b81186d1f94..02b265d38d9a2793376e50b17820773411773984 100644 --- a/src/js/rulesAssistantOptions.js +++ b/src/js/rulesAssistantOptions.js @@ -167,7 +167,7 @@ window.rulesAssistantOptions = (function() { // it can be "bound" to a variable by setting its "onchange" method class EditorWithShortcuts extends Element { constructor(prefix, data=[], editor=false, ...args) { - super(prefix + ": ", editor, ...args); + super(`${prefix }: `, editor, ...args); this.selectedItem = null; data.forEach(item => this.appendChild(new ListItem(...item))); } @@ -199,9 +199,9 @@ window.rulesAssistantOptions = (function() { setValue(what) { if (this.value.tagName === "INPUT") - this.value.value = ""+what; + this.value.value = `${what}`; else - this.value.innerHTML = ""+what; + this.value.innerHTML = `${what}`; } getData(what) { @@ -305,7 +305,7 @@ window.rulesAssistantOptions = (function() { render(label) { const elem = document.createElement("div"); const lelem = document.createElement("em"); - lelem.innerText = label + ": "; + lelem.innerText = `${label }: `; elem.appendChild(lelem); return elem; } @@ -432,7 +432,7 @@ window.rulesAssistantOptions = (function() { V.defaultRules.push(rule); reload(this.root); } catch (e) { - alert("Couldn't import that rule:\n" + e.message); + alert(`Couldn't import that rule:\n${ e.message}`); } } } @@ -706,7 +706,7 @@ window.rulesAssistantOptions = (function() { const min = document.createElement("input"); min.setAttribute("type", "text"); - min.value = "" + data.value[0]; + min.value = `${ data.value[0]}`; min.onkeypress = e => { if (returnP(e)) this.setmin(min.value); }; min.onblur = e => this.setmin(min.value); this.min = min; @@ -720,7 +720,7 @@ window.rulesAssistantOptions = (function() { const max = document.createElement("input"); max.setAttribute("type", "text"); - max.value = "" + data.value[1]; + max.value = `${ data.value[1]}`; max.onkeypress = e => { if (returnP(e)) this.setmax(max.value); }; max.onblur = e => this.setmax(max.value); this.max = max; @@ -745,12 +745,12 @@ window.rulesAssistantOptions = (function() { setmin(value) { current_rule.condition.data.value[0] = this.parse(value); - this.min.value = ""+current_rule.condition.data.value[0]; + this.min.value = `${current_rule.condition.data.value[0]}`; } setmax(value) { current_rule.condition.data.value[1] = this.parse(value); - this.max.value = ""+current_rule.condition.data.value[1]; + this.max.value = `${current_rule.condition.data.value[1]}`; } info(attribute) { @@ -793,11 +793,11 @@ window.rulesAssistantOptions = (function() { } info(attribute) { - return "Insert a valid JSON array. Known values: " + { + return `Insert a valid JSON array. Known values: ${ { "fetish": "buttslut, cumslut, masochist, sadist, dom, submissive, boobs, pregnancy, none (AKA vanilla)", "amp": "Amputated: 1, Not amputated: 0", "genes": "XX, XY", - }[attribute]; + }[attribute]}`; } setValue(input) { @@ -1315,9 +1315,9 @@ window.rulesAssistantOptions = (function() { if (acc.fs === undefined && acc.rs === undefined) bellies.push([acc.name, acc.value]); else if (acc.fs === "repopulation" && V.arcologies[0].FSRepopulationFocus !== "unset") - bellies.push([acc.name + " (FS)", acc.value]); + bellies.push([`${acc.name } (FS)`, acc.value]); else if (acc.rs === "boughtBelly" && V.clothesBoughtBelly === 1) - bellies.push([acc.name + " (Purchased)", acc.value]); + bellies.push([`${acc.name } (Purchased)`, acc.value]); }); super("Corsetage", bellies); this.setValue(current_rule.set.bellyAccessory); @@ -1359,7 +1359,7 @@ window.rulesAssistantOptions = (function() { if (acc.fs === undefined && acc.rs === undefined) accs.push([acc.name, acc.value]); else if (acc.rs === "buyBigDildos" && V.toysBoughtDildos === 1) - accs.push([acc.name + " (Purchased)", acc.value]); + accs.push([`${acc.name } (Purchased)`, acc.value]); }); super("Vaginal accessories for virgins", accs); this.setValue(current_rule.set.virginAccessory); @@ -1374,7 +1374,7 @@ window.rulesAssistantOptions = (function() { if (acc.fs === undefined && acc.rs === undefined) accs.push([acc.name, acc.value]); else if (acc.rs === "buyBigDildos" && V.toysBoughtDildos === 1) - accs.push([acc.name + " (Purchased)", acc.value]); + accs.push([`${acc.name } (Purchased)`, acc.value]); }); super("Vaginal accessories for anal virgins", accs); this.setValue(current_rule.set.aVirginAccessory); @@ -1389,7 +1389,7 @@ window.rulesAssistantOptions = (function() { if (acc.fs === undefined && acc.rs === undefined) accs.push([acc.name, acc.value]); else if (acc.rs === "buyBigDildos" && V.toysBoughtDildos === 1) - accs.push([acc.name + " (Purchased)", acc.value]); + accs.push([`${acc.name } (Purchased)`, acc.value]); }); super("Vaginal accessories for other slaves", accs); this.setValue(current_rule.set.vaginalAccessory); @@ -1404,7 +1404,7 @@ window.rulesAssistantOptions = (function() { if (acc.fs === undefined && acc.rs === undefined) accs.push([acc.name, acc.value]); else if (acc.rs === "buyVaginalAttachments" && V.toysBoughtVaginalAttachments === 1) - accs.push([acc.name + " (Purchased)", acc.value]); + accs.push([`${acc.name } (Purchased)`, acc.value]); }); super("Vaginal attachments for slaves with vaginal accessories", accs); this.setValue(current_rule.set.vaginalAttachment); @@ -1461,7 +1461,7 @@ window.rulesAssistantOptions = (function() { if (acc.fs === undefined && acc.rs === undefined) accs.push([acc.name, acc.value]); else if (acc.rs === "buyBigPlugs" && V.toysBoughtButtPlugs === 1) - accs.push([acc.name + " (Purchased)", acc.value]); + accs.push([`${acc.name } (Purchased)`, acc.value]); }); super("Buttplugs for anal virgins", accs); this.setValue(current_rule.set.aVirginButtplug); @@ -1476,7 +1476,7 @@ window.rulesAssistantOptions = (function() { if (acc.fs === undefined && acc.rs === undefined) accs.push([acc.name, acc.value]); else if (acc.rs === "buyBigPlugs" && V.toysBoughtButtPlugs === 1) - accs.push([acc.name + " (Purchased)", acc.value]); + accs.push([`${acc.name } (Purchased)`, acc.value]); }); super("Buttplugs for other slaves", accs); this.setValue(current_rule.set.buttplug); @@ -1491,7 +1491,7 @@ window.rulesAssistantOptions = (function() { if (acc.fs === undefined && acc.rs === undefined) accs.push([acc.name, acc.value]); else if (acc.rs === "buyTails" && V.toysBoughtButtPlugTails === 1) - accs.push([acc.name + " (Purchased)", acc.value]); + accs.push([`${acc.name } (Purchased)`, acc.value]); }); super("Buttplug attachments for slaves with buttplugs", accs); this.setValue(current_rule.set.buttplugAttachment); diff --git a/src/js/slaveGenerationJS.js b/src/js/slaveGenerationJS.js index d87b6c35d4829b6e35ac15e55329fcbc94354599..f9359ebaf05f3f8120460158166ca28249fe4271 100644 --- a/src/js/slaveGenerationJS.js +++ b/src/js/slaveGenerationJS.js @@ -1,4 +1,3 @@ -/* eslint-disable no-undef */ window.nationalityToRace = /** @param {App.Entity.SlaveState} slave */ function nationalityToRace(slave) { slave.race = hashChoice(setup.raceSelector[slave.nationality] || setup.raceSelector[""]); }; @@ -14,7 +13,7 @@ window.raceToNationality = /** @param {App.Entity.SlaveState} slave */ function } /* No success after 100 attempts, so just randomize according to race */ if (setup.raceSelector[slave.nationality] && !(slave.race in setup.raceSelector[slave.nationality]) && i === 100) { - slave.nationality = hashChoice(setup[slave.race.toLowerCase().replace(/[ -]/g, '')+'Nationalities']); + slave.nationality = hashChoice(setup[`${slave.race.toLowerCase().replace(/[ -]/g, "")}Nationalities`]); } }; @@ -22,10 +21,10 @@ window.generateName = function generateName(nationality, race, male, filter) { filter = filter || _.stubTrue; /* default: allow all */ const lookup = (male ? setup.malenamePoolSelector : setup.namePoolSelector); const result = jsEither( - (lookup[nationality + "." + race] || lookup[nationality] || + (lookup[`${nationality }.${ race}`] || lookup[nationality] || (male ? setup.whiteAmericanMaleNames : setup.whiteAmericanSlaveNames)).filter(filter)); /* fallback for males without specific male name sets: return female name */ - if(male && !result) { + if (male && !result) { return generateName(nationality, race, false); } return result; @@ -34,13 +33,13 @@ window.generateName = function generateName(nationality, race, male, filter) { window.generateSurname = function generateSurname(nationality, race, male, filter) { filter = filter || _.stubTrue; /* default: allow all */ const result = jsEither( - (setup.surnamePoolSelector[nationality + "." + race] || + (setup.surnamePoolSelector[`${nationality }.${ race}`] || setup.surnamePoolSelector[nationality] || setup.whiteAmericanSlaveSurnames).filter(filter)); - if(male) { + if (male) { /* see if we have male equivalent of that surname, and return that if so */ - const maleLookup = setup.maleSurnamePoolSelector[nationality + "." + race] || setup.maleSurnamePoolSelector[nationality]; - if(maleLookup && maleLookup[result]) { + const maleLookup = setup.maleSurnamePoolSelector[`${nationality }.${ race}`] || setup.maleSurnamePoolSelector[nationality]; + if (maleLookup && maleLookup[result]) { return maleLookup[result]; } } @@ -48,7 +47,7 @@ window.generateSurname = function generateSurname(nationality, race, male, filte }; window.isMaleName = function isMaleName(name, nationality, race) { - const names = setup.malenamePoolSelector[nationality + "." + race] || + const names = setup.malenamePoolSelector[`${nationality }.${ race}`] || setup.malenamePoolSelector[nationality] || setup.whiteAmericanMaleNames; return names && names.includes(name); @@ -60,7 +59,7 @@ window.nationalityToName = /** @param {App.Entity.SlaveState} slave */ function slave.birthName = generateName(slave.nationality, slave.race, male); slave.birthSurname = generateSurname(slave.nationality, slave.race, male); - if(male && isMaleName(slave.birthName, slave.nationality, slave.race) && !V.allowMaleSlaveNames) { + if (male && isMaleName(slave.birthName, slave.nationality, slave.race) && !V.allowMaleSlaveNames) { slave.slaveName = generateName(slave.nationality, slave.race, false); } else { slave.slaveName = slave.birthName; diff --git a/src/js/spanMacroJS.js b/src/js/spanMacroJS.js index 005e6d1c7b6f0380b886b610df78d519f66902d8..19eb0a5bef19ee032a69f1dae269961c8c182db6 100644 --- a/src/js/spanMacroJS.js +++ b/src/js/spanMacroJS.js @@ -26,7 +26,7 @@ Macro.add('span', { Config.debug && this.debugView.modes({block: true}); - jQuery("<span id='" + String(result) + "' />") + jQuery(`<span id='${ String(result) }' />`) .wiki(payload) .appendTo(this.output); }