diff --git a/src/js/generateGenetics.js b/src/js/generateGenetics.js index 031457b76df371df817c7557b1cee6fef6617905..4e960670bfa82ba86a019d04002062cec24a7ca6 100644 --- a/src/js/generateGenetics.js +++ b/src/js/generateGenetics.js @@ -187,13 +187,13 @@ window.generateGenetics = (function() { let race; if (father !== 0) { race = (mother.origRace === father.origRace) ? mother.origRace - : (jsRandom(1,4)) === 4 ? jsEither([father.origRace, mother.origRace]) + : (jsRandom(1, 4)) === 4 ? jsEither([father.origRace, mother.origRace]) : "mixed race"; } else if (actor2 === -2 || actor2 === -5) { if (V.arcologies[0].FSSupremacist !== "unset") { race = jsEither([mother.origRace, V.arcologies[0].FSSupremacistRace, V.arcologies[0].FSSupremacistRace]); if (mother.origRace !== V.arcologies[0].FSSupremacistRace) { - if (jsRandom(1,100) > 50) { + if (jsRandom(1, 100) > 50) { race = "mixed race"; } } @@ -253,13 +253,13 @@ window.generateGenetics = (function() { } else if (father.origEye === "red" || father.origEye === "pale red" || father.origEye === "light red" || father.origEye === "pale gray" || father.origEye === "milky white") { eyeColor = mother.origEye; } else if (mother.origEye === "blue") { - if (jsRandom(1,4) === 2) { + if (jsRandom(1, 4) === 2) { eyeColor = mother.origEye; } else { eyeColor = father.origEye; } } else if (father.origEye === "blue") { - if (jsRandom(1,4) === 2) { + if (jsRandom(1, 4) === 2) { eyeColor = father.origEye; } else { eyeColor = mother.origEye; @@ -328,9 +328,9 @@ window.generateGenetics = (function() { if (mother.origHColor === father.origHColor) { hairColor = mother.origHColor; } else if (mother.origHColor === "white") { - hairColor = jsRandom(1,100) === 69 ? mother.origHColor : father.origHColor; + hairColor = jsRandom(1, 100) === 69 ? mother.origHColor : father.origHColor; } else if (father.origHColor === "white") { - hairColor = jsRandom(1,100) === 69 ? father.origHColor : mother.origHColor; + hairColor = jsRandom(1, 100) === 69 ? father.origHColor : mother.origHColor; } else if (mother.origHColor === "black") { hairColor = jsEither([father.origHColor, mother.origHColor, mother.origHColor, mother.origHColor, mother.origHColor, mother.origHColor, mother.origHColor, mother.origHColor]); } else if (father.origHColor === "black") { @@ -357,12 +357,12 @@ window.generateGenetics = (function() { if (mother.underArmHStyle === "hairless" && father.underArmHStyle === "hairless") { hair = "hairless"; } else if (mother.underArmHStyle === "hairless" || father.underArmHStyle === "hairless") { - hair = (jsRandom(1,5) === 3) ? "hairless" : jsEither(["bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "hairless"]); + hair = (jsRandom(1, 5) === 3) ? "hairless" : jsEither(["bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "hairless"]); } else { hair = jsEither(["bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "hairless"]); } } else if (mother.underArmHStyle === "hairless") { - hair = (jsRandom(1,5) === 3) ? "hairless" : jsEither(["bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "hairless"]); + hair = (jsRandom(1, 5) === 3) ? "hairless" : jsEither(["bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "hairless"]); } else { hair = jsEither(["bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "hairless"]); } @@ -376,12 +376,12 @@ window.generateGenetics = (function() { if (mother.pubicHStyle === "hairless" && father.pubicHStyle === "hairless") { hair = "hairless"; } else if (mother.pubicHStyle === "hairless" || father.pubicHStyle === "hairless") { - hair = (jsRandom(1,5) === 3) ? "hairless" : jsEither(["bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "hairless"]); + hair = (jsRandom(1, 5) === 3) ? "hairless" : jsEither(["bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "hairless"]); } else { hair = jsEither(["bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "hairless"]); } } else if (mother.pubicHStyle === "hairless") { - hair = (jsRandom(1,5) === 3) ? "hairless" : jsEither(["bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "hairless"]); + hair = (jsRandom(1, 5) === 3) ? "hairless" : jsEither(["bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "hairless"]); } else { hair = jsEither(["bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "hairless"]); } @@ -391,7 +391,7 @@ window.generateGenetics = (function() { // markings function setMarkings(father, mother) { let markings; - if (jsRandom(1,8) === 1) { + if (jsRandom(1, 8) === 1) { markings = jsEither(["beauty mark", "birthmark"]); } else { markings = "none"; @@ -445,7 +445,7 @@ window.generateGenetics = (function() { let smarts; if (mother.ID === -1) { if (actor2 === -6) { - smarts = jsRandom(90,100); + smarts = jsRandom(90, 100); } else if (father !== 0) { if (father.intelligence < mother.intelligence) { smarts = jsRandom(father.intelligence, mother.intelligence); @@ -456,7 +456,7 @@ window.generateGenetics = (function() { smarts += 30; } } else { - smarts = jsRandom(50,100); + smarts = jsRandom(50, 100); } } else if (father !== 0) { if (father.intelligence < mother.intelligence) { @@ -465,7 +465,7 @@ window.generateGenetics = (function() { smarts = jsRandom(mother.intelligence, father.intelligence); } if (activeMother.breedingMark === 1 && smarts <= 50) { - smarts = jsRandom(60,100); + smarts = jsRandom(60, 100); } } else { smarts = mother.intelligence; @@ -473,17 +473,17 @@ window.generateGenetics = (function() { if (V.inbreeding === 1) { if (mother.ID !== -1) { if (father !== 0 && father.ID === -1 && activeMother.breedingMark !== 1) { - if (smarts >= -95 && jsRandom(1,100) < 40) { - smarts -= jsRandom(1,10); - if (smarts >= -95 && jsRandom(1,100) < 20) { - smarts -= jsRandom(1,5); + if (smarts >= -95 && jsRandom(1, 100) < 40) { + smarts -= jsRandom(1, 10); + if (smarts >= -95 && jsRandom(1, 100) < 20) { + smarts -= jsRandom(1, 5); } } } else { - if (smarts >= -95 && jsRandom(1,100) < 50) { - smarts -= jsRandom(1,15); - if (smarts >= -95 && jsRandom(1,100) < 30) { - smarts -= jsRandom(1,15); + if (smarts >= -95 && jsRandom(1, 100) < 50) { + smarts -= jsRandom(1, 15); + if (smarts >= -95 && jsRandom(1, 100) < 30) { + smarts -= jsRandom(1, 15); } } } @@ -503,7 +503,7 @@ window.generateGenetics = (function() { face = -100; } else if (mother.ID === -1) { if (actor2 === -6) { - face = jsRandom(90,100); + face = jsRandom(90, 100); } else if (father !== 0) { if (father.face < mother.face) { face = jsRandom(father.face, mother.face); @@ -511,10 +511,10 @@ window.generateGenetics = (function() { face = jsRandom(mother.face, father.face); } if (face <= 40) { - face += jsRandom(5,20); + face += jsRandom(5, 20); } } else { - face = jsRandom(20,100); + face = jsRandom(20, 100); } } else if (father !== 0) { if (father.face < mother.face) { @@ -523,7 +523,7 @@ window.generateGenetics = (function() { face = jsRandom(mother.face, father.face); } if (activeMother.breedingMark === 1 && face < 60) { - face = jsRandom(60,100); + face = jsRandom(60, 100); } } else { face = mother.face; @@ -531,14 +531,14 @@ window.generateGenetics = (function() { if (V.inbreeding === 1 && genes.pFace === 0 && genes.uFace === 0) { if (mother.ID !== -1) { if (father !== 0 && father.ID === -1 && activeMother.breedingMark !== 1) { - if (face > -100 && jsRandom(1,100) > 60) { - face -= jsRandom(2,20); + if (face > -100 && jsRandom(1, 100) > 60) { + face -= jsRandom(2, 20); } } else { - if (face > -100 && jsRandom(1,100) < 50) { - face -= jsRandom(1,15); - if (face >= -95 && jsRandom(1,100) < 30) { - face -= jsRandom(5,20); + if (face > -100 && jsRandom(1, 100) < 50) { + face -= jsRandom(1, 15); + if (face >= -95 && jsRandom(1, 100) < 30) { + face -= jsRandom(5, 20); } } }