From 3c5180568ccca88def46ef9ac6b9e4965276bd0e Mon Sep 17 00:00:00 2001 From: Skriv <skrivelese@gmail.com> Date: Sun, 24 Mar 2019 16:24:21 +0100 Subject: [PATCH] literal templates, empty blocks --- src/js/generateGenetics.js | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/js/generateGenetics.js b/src/js/generateGenetics.js index 4e960670bfa..cc979783579 100644 --- a/src/js/generateGenetics.js +++ b/src/js/generateGenetics.js @@ -110,7 +110,7 @@ window.generateGenetics = (function() { // name function setName(x) { - return "ovum" + x; + return `ovum${x}`; } // motherID @@ -123,10 +123,10 @@ window.generateGenetics = (function() { let motherName; if (activeMother.ID === -1) { motherName = activeMother.name; - if (activeMother.surname !== 0 && activeMother.surname !== "") { motherName += " " + activeMother.surname; } + if (activeMother.surname !== 0 && activeMother.surname !== "") { motherName += ` ${activeMother.surname}`; } } else { motherName = activeMother.slaveName; - if (activeMother.slaveSurname !== 0 && activeMother.slaveSurname !== "") { motherName += " " + activeMother.slaveSurname; } + if (activeMother.slaveSurname !== 0 && activeMother.slaveSurname !== "") { motherName += ` ${activeMother.slaveSurname}`; } } return motherName; } @@ -142,13 +142,13 @@ window.generateGenetics = (function() { if (father !== 0) { if (father.ID === -1) { fatherName = activeFather.name; - if (activeFather.surname !== 0 && activeFather.surname !== "") { fatherName += " " + activeFather.surname; } + if (activeFather.surname !== 0 && activeFather.surname !== "") { fatherName += ` ${activeFather.surname}`; } } else { fatherName = activeFather.slaveName; - if (activeFather.slaveSurname !== 0 && activeFather.slaveSurname !== "") { fatherName += " " + activeFather.slaveSurname; } + if (activeFather.slaveSurname !== 0 && activeFather.slaveSurname !== "") { fatherName += ` ${activeFather.slaveSurname}`; } } } else { - switch(actor2) { + switch (actor2) { case -2: case -5: fatherName = "Citizen"; @@ -234,7 +234,7 @@ window.generateGenetics = (function() { let dadSkinIndex = father !== 0 ? (skinToMelanin[father.origSkin] || 11) : 8; let skinIndex = Math.round(Math.random() * (dadSkinIndex - momSkinIndex) + momSkinIndex); - var prop = ""; + let prop = ""; for (prop in skinToMelanin) { if (!skinToMelanin.hasOwnProperty(prop)) continue; if (skinIndex >= skinToMelanin[prop]) return prop; @@ -761,11 +761,9 @@ window.generateGenetics = (function() { } return generateGenetics; - })(); window.generateChild = function (mother, ova, destination) { - let V = State.variables; let genes = ova.genetics; //maybe just argument this? We'll see. let pregUpgrade = V.pregnancyMonitoringUpgrade; @@ -1032,9 +1030,7 @@ window.generateChild = function (mother, ova, destination) { child.nationality = "Ancient Chinese Revivalist"; } } - } else { - V.activeSlaveOneTimeMinAge = V.targetAge; V.activeSlaveOneTimeMaxAge = V.targetAge; V.one_time_age_overrides_pedo_mode = 1; -- GitLab