diff --git a/src/js/generateGenetics.js b/src/js/generateGenetics.js index 501224535776154641c447b5c471a68b4168bc9c..8ba5454dbea76cc8f5ae994a90260dd49c2f0b16 100644 --- a/src/js/generateGenetics.js +++ b/src/js/generateGenetics.js @@ -65,7 +65,7 @@ window.generateGenetics = (function() { genes.fatherName = setFatherName(father, activeFather, actor2); genes.nationality = setNationality(father, mother); genes.geneticQuirks = setGeneticQuirks(father, mother, genes.gender); - genes.skin = setSkin(father, mother); + genes.skin = setSkin(father, mother, actor2); genes.race = setRace(father, mother, actor2); genes.intelligence = setIntelligence(father, mother, activeMother, actor2); genes.face = setFace(father, mother, activeMother, actor2, genes.geneticQuirks); @@ -185,7 +185,7 @@ window.generateGenetics = (function() { // race function setRace(father, mother, actor2) { let race; - let fatherRace; + let fatherRace = 0; if (father !== 0) { race = (mother.origRace === father.origRace) ? mother.origRace : (jsRandom(1,4)) === 4 ? jsEither([father.origRace, mother.origRace]) @@ -209,41 +209,47 @@ window.generateGenetics = (function() { } //skin - function setSkin(father, mother) { - let fatherSkin; + function setSkin(father, mother, actor2) { + let fatherSkin = 0; + let dadSkinIndex; let skinToMelanin = { - 'pure black': 21, - ebony: 20, - black: 19, - 'dark brown': 18, - brown: 17, - 'light brown': 16, - dark: 15, - 'dark olive': 14, - bronze: 13, - tan: 11, - olive: 10, - 'light olive': 9, - light: 8, - white: 7, - fair: 6, - 'very fair': 5, - 'extremely fair': 4, - pale: 3, - 'extremely pale': 2, + 'pure black': 25, + 'ebony': 24, + 'black': 23, + 'dark brown': 22, + 'brown': 21, + 'light brown': 20, + 'dark beige': 19, + 'beige': 18, + 'light beige': 17, + 'dark': 16, + 'dark olive': 15, + 'bronze': 14, + 'olive': 13, + 'tan': 12, + 'light olive': 11, + 'light': 10, + 'fair': 9, + 'very fair': 8, + 'extremely fair': 7, + 'pale': 6, + 'very pale': 5, + 'extremely pale': 4, + 'white': 3, + 'ivory': 2, 'pure white': 1 }; - let momSkinIndex = mother ? (skinToMelanin[mother.origSkin] || 11) : 8; + let momSkinIndex = mother ? (skinToMelanin[mother.origSkin] || 13) : 8; if (((actor2 === -2 || actor2 === -5) && V.arcologies[0].FSSupremacistLawME === 1) || (actor2 === -6 && V.arcologies[0].FSSupremacist !== "unset")) { fatherSkin = randomRaceSkin(V.arcologies[0].FSSupremacistRace); } else if (((actor2 === -2 || actor2 === -5) && V.arcologies[0].FSSubjugationistLawME === 1) || (actor2 === -6 && V.arcologies[0].FSSubjugationist !== "unset")) { let racesList = setup.filterRacesLowercase.filter(race => race !== V.arcologies[0].FSSubjugationistRace); fatherSkin = randomRaceSkin(racesList.random()); } - if (fatherRace !== 0) { - let dadSkinIndex = father !== 0 ? (skinToMelanin[father.origSkin] || 11) : 8; + if (fatherSkin !== 0) { + dadSkinIndex = father !== 0 ? (skinToMelanin[fatherSkin] || 13) : 8; } else { - let dadSkinIndex = father !== 0 ? (skinToMelanin[father.origSkin] || 11) : 8; + dadSkinIndex = father !== 0 ? (skinToMelanin[father.origSkin] || 13) : 8; } let skinIndex = Math.round(Math.random() * (dadSkinIndex - momSkinIndex) + momSkinIndex); @@ -258,6 +264,7 @@ window.generateGenetics = (function() { // eyeColor function setEyeColor(father, mother, actor2) { let eyeColor; + let fatherEye = 0; if (father !== 0) { if (mother.origEye === father.origEye) { eyeColor = mother.origEye; @@ -280,10 +287,36 @@ window.generateGenetics = (function() { } else { eyeColor = jsEither([father.origEye, mother.origEye]); } - } else if (actor2 === -2 || actor2 === 0 || actor2 === -5) { - eyeColor = jsEither(["blue", "brown", "brown", "green", "green", "hazel", mother.origEye]); } else { - eyeColor = mother.origEye; + if (((actor2 === -2 || actor2 === -5) && V.arcologies[0].FSSupremacistLawME === 1) || (actor2 === -6 && V.arcologies[0].FSSupremacist !== "unset")) { + fatherEye = randomRaceEye(V.arcologies[0].FSSupremacistRace); + } else if (((actor2 === -2 || actor2 === -5) && V.arcologies[0].FSSubjugationistLawME === 1) || (actor2 === -6 && V.arcologies[0].FSSubjugationist !== "unset")) { + let racesList = setup.filterRacesLowercase.filter(race => race !== V.arcologies[0].FSSubjugationistRace); + fatherEye = randomRaceEye(racesList.random()); + } + if (fatherEye !== 0) { + if (mother.origEye === fatherEye) { + eyeColor = mother.origEye; + } else if (mother.origEye === "red" || mother.origEye === "pale red" || mother.origEye === "light red" || mother.origEye === "pale gray" || mother.origEye === "milky white") { + eyeColor = fatherEye; + } else if (fatherEye === "blue") { + if (jsRandom(1,4) === 2) { + eyeColor = mother.origEye; + } else { + eyeColor = fatherEye; + } + } else if (fatherEye === "blue") { + if (jsRandom(1,4) === 2) { + eyeColor = fatherEye; + } else { + eyeColor = mother.origEye; + } + } else { + eyeColor = jsEither([fatherEye, mother.origEye]); + } + } else { + eyeColor = mother.origEye; + } } //just in case something wrong gets through switch (eyeColor) { @@ -300,6 +333,7 @@ window.generateGenetics = (function() { function setHeterochromaticEyeColor(father, mother, actor2) { let hEyeColor; + let fatherHEye = 0; let eyeColorArray = []; if (father !== 0) { eyeColorArray.push(mother.origEye); @@ -307,16 +341,19 @@ window.generateGenetics = (function() { if (father.geneticQuirks.heterochromia !== 0 && father.geneticQuirks.heterochromia !== 1) { eyeColorArray.push(father.geneticQuirks.heterochromia); } - } else if (actor2 === -2 || actor2 === 0 || actor2 === -5) { - eyeColorArray.push(mother.origEye); - eyeColorArray.push("brown"); - eyeColorArray.push("brown"); - eyeColorArray.push("blue"); - eyeColorArray.push("green"); - eyeColorArray.push("green"); - eyeColorArray.push("hazel"); } else { - eyeColorArray.push(mother.origEye); + if (((actor2 === -2 || actor2 === -5) && V.arcologies[0].FSSupremacistLawME === 1) || (actor2 === -6 && V.arcologies[0].FSSupremacist !== "unset")) { + fatherHEye = randomRaceEye(V.arcologies[0].FSSupremacistRace); + } else if (((actor2 === -2 || actor2 === -5) && V.arcologies[0].FSSubjugationistLawME === 1) || (actor2 === -6 && V.arcologies[0].FSSubjugationist !== "unset")) { + let racesList = setup.filterRacesLowercase.filter(race => race !== V.arcologies[0].FSSubjugationistRace); + fatherHEye = randomRaceEye(racesList.random()); + } + if (fatherHEye !== 0) { + eyeColorArray.push(fatherHEye); + eyeColorArray.push(mother.origEye); + } else { + eyeColorArray.push(mother.origEye); + } } if (mother.geneticQuirks.heterochromia !== 0 && mother.geneticQuirks.heterochromia !== 1) { eyeColorArray.push(mother.geneticQuirks.heterochromia); @@ -337,6 +374,7 @@ window.generateGenetics = (function() { // hColor function setHColor(father, mother, actor2) { let hairColor; + let fatherHair = 0; if (father !== 0) { if (mother.origHColor === father.origHColor) { hairColor = mother.origHColor; @@ -355,10 +393,32 @@ window.generateGenetics = (function() { } else { hairColor = jsEither([father.origHColor, mother.origHColor]); } - } else if (actor2 === -2 || actor2 === 0 || actor2 === -5) { - hairColor = jsEither(["black", "black", "black", "blonde", "brown", "brown", "brown", mother.origHColor]); } else { - hairColor = mother.origHColor; + if (((actor2 === -2 || actor2 === -5) && V.arcologies[0].FSSupremacistLawME === 1) || (actor2 === -6 && V.arcologies[0].FSSupremacist !== "unset")) { + fatherHair = randomRaceHair(V.arcologies[0].FSSupremacistRace); + } else if (((actor2 === -2 || actor2 === -5) && V.arcologies[0].FSSubjugationistLawME === 1) || (actor2 === -6 && V.arcologies[0].FSSubjugationist !== "unset")) { + let racesList = setup.filterRacesLowercase.filter(race => race !== V.arcologies[0].FSSubjugationistRace); + fatherHair = randomRaceHair(racesList.random()); + } + if (fatherHair !== 0) { + if (mother.origHColor === fatherHair) { + hairColor = mother.origHColor; + } else if (mother.origHColor === "white") { + hairColor = jsRandom(1,100) === 69 ? mother.origHColor : fatherHair; + } else if (mother.origHColor === "black") { + hairColor = jsEither([fatherHair, mother.origHColor, mother.origHColor, mother.origHColor, mother.origHColor, mother.origHColor, mother.origHColor, mother.origHColor]); + } else if (fatherHair === "black") { + hairColor = jsEither([fatherHair, fatherHair, fatherHair, fatherHair, fatherHair, fatherHair, fatherHair, mother.origHColor]); + } else if (mother.origHColor === "brown") { + hairColor = jsEither([fatherHair, mother.origHColor, mother.origHColor, mother.origHColor]); + } else if (fatherHair === "brown") { + hairColor = jsEither([fatherHair, fatherHair, fatherHair, mother.origHColor]); + } else { + hairColor = jsEither([fatherHair, mother.origHColor]); + } + } else { + hairColor = mother.origHColor; + } } return hairColor; } diff --git a/src/js/utilJS.js b/src/js/utilJS.js index 0e4e61a472e921aab621dd69367d90fb928a3720..3a85d1fe2e522241149213489d5e30bc2326f452 100644 --- a/src/js/utilJS.js +++ b/src/js/utilJS.js @@ -1527,4 +1527,136 @@ window.IncreasePCSkills = function(input, increase) { return ` <span class='green'> <br>You have mastered ${input}.</span>`; } } +}; + +window.randomRaceSkin = function(raceName) +{ + let skin; + switch (raceName) { + case "asian": + skin = jsEither(["dark olive", "light olive", "light"]); + break; + case "amerindian": + skin = jsEither(["dark", "light"]); + break; + case "black": + skin = jsEither(["black", "brown", "dark brown"]); + break; + case "indo-aryan": + skin = jsEither(["dark", "light"]); + break; + case "latina": + skin = jsEither(["brown", "dark brown", "dark olive", "light olive", "tanned"]); + break; + case "malay": + skin = jsEither(["dark", "light"]); + break; + case "middle eastern": + skin = jsEither(["fair", "light olive", "light", "tanned"]); + break; + case "pacific islander": + skin = jsEither(["dark", "light"]); + break; + case "semitic": + skin = jsEither(["fair", "light olive", "light", "tanned"]); + break; + case "southern european": + skin = jsEither(["fair", "light olive", "light", "tanned"]); + break; + case "white": + skin = jsEither(["fair", "light", "pale"]); + break; + default: + skin = jsEither(["dark", "light", "pale"]); + break; + } + return skin; +}; + +window.randomRaceEye = function(raceName) +{ + let eye; + switch (raceName) { + case "asian": + eye = jsEither(["brown"]); + break; + case "amerindian": + eye = jsEither(["brown", "green"]); + break; + case "black": + eye = jsEither(["brown",]); + break; + case "indo-aryan": + eye = jsEither(["brown"]); + break; + case "latina": + eye = jsEither(["brown", "green"]); + break; + case "malay": + eye = jsEither(["blue", "brown", "green"]); + break; + case "middle eastern": + eye = jsEither(["brown"]); + break; + case "pacific islander": + eye = jsEither(["brown"]); + break; + case "semitic": + eye = jsEither(["brown", "green"]); + break; + case "southern european": + eye = jsEither(["brown", "green"]); + break; + case "white": + eye = jsEither(["blue", "brown", "green"]); + break; + default: + eye = jsEither(["brown", "green"]); + break; + } + return eye; +}; + +window.randomRaceHair = function(raceName) +{ + let hair; + switch (raceName) { + case "asian": + hair = jsEither(["black"]); + break; + case "amerindian": + hair = jsEither(["black"]); + break; + case "black": + hair = jsEither(["black", "black", "black", "brown"]); + break; + case "indo-aryan": + hair = jsEither(["black"]); + break; + case "latina": + hair = jsEither(["black", "black", "brown", "brown"]); + break; + case "malay": + hair = jsEither(["black"]); + break; + case "middle eastern": + hair = jsEither(["black"]); + break; + case "pacific islander": + hair = jsEither(["black"]); + break; + case "semitic": + hair = jsEither(["black"]); + break; + case "southern european": + hair = jsEither(["black"]); + break; + case "white": + hair = jsEither(["black", "blonde", "brown", "red"]); + break; + default: + hair = jsEither(["black", "black", "black", "black", "blonde", "brown", "brown", "red"]); + break; + } + return hair; }; \ No newline at end of file diff --git a/src/js/wombJS.js b/src/js/wombJS.js index 92552b1c4a2b5e96d06ee3820293bca1a3ac96e2..46663f1bbcd3f43b9fcb2747add54457a7d1a8bd 100644 --- a/src/js/wombJS.js +++ b/src/js/wombJS.js @@ -595,138 +595,6 @@ window.WombFatherRace = function(actor, raceName) WombChangeGene(actor, "hColor", hairColor); }; -window.randomRaceSkin = function(raceName) -{ - let skin; - switch (raceName) { - case "asian": - skin = jsEither(["dark olive", "light olive", "light"]); - break; - case "amerindian": - skin = jsEither(["dark", "light"]); - break; - case "black": - skin = jsEither(["black", "brown", "dark brown"]); - break; - case "indo-aryan": - skin = jsEither(["dark", "light"]); - break; - case "latina": - skin = jsEither(["brown", "dark brown", "dark olive", "light olive", "tanned"]); - break; - case "malay": - skin = jsEither(["dark", "light"]); - break; - case "middle eastern": - skin = jsEither(["fair", "light olive", "light", "tanned"]); - break; - case "pacific islander": - skin = jsEither(["dark", "light"]); - break; - case "semitic": - skin = jsEither(["fair", "light olive", "light", "tanned"]); - break; - case "southern european": - skin = jsEither(["fair", "light olive", "light", "tanned"]); - break; - case "white": - skin = jsEither(["fair", "light", "pale"]); - break; - default: - skin = jsEither(["dark", "light", "pale"]); - break; - } - return skin; -}; - -window.randomRaceEye = function(raceName) -{ - let eye; - switch (raceName) { - case "asian": - eye = jsEither(["brown"]); - break; - case "amerindian": - eye = jsEither(["brown", "green"]); - break; - case "black": - eye = jsEither(["brown",]); - break; - case "indo-aryan": - eye = jsEither(["brown"]); - break; - case "latina": - eye = jsEither(["brown", "green"]); - break; - case "malay": - eye = jsEither(["blue", "brown", "green"]); - break; - case "middle eastern": - eye = jsEither(["brown"]); - break; - case "pacific islander": - eye = jsEither(["brown"]); - break; - case "semitic": - eye = jsEither(["brown", "green"]); - break; - case "southern european": - eye = jsEither(["brown", "green"]); - break; - case "white": - eye = jsEither(["blue", "brown", "green"]); - break; - default: - eye = jsEither(["brown", "green"]); - break; - } - return eye; -}; - -window.randomRaceHair = function(raceName) -{ - let hair; - switch (raceName) { - case "asian": - hair = jsEither(["black"]); - break; - case "amerindian": - hair = jsEither(["black"]); - break; - case "black": - hair = jsEither(["black", "black", "black", "brown"]); - break; - case "indo-aryan": - hair = jsEither(["black"]); - break; - case "latina": - hair = jsEither(["black", "black", "brown", "brown"]); - break; - case "malay": - hair = jsEither(["black"]); - break; - case "middle eastern": - hair = jsEither(["black"]); - break; - case "pacific islander": - hair = jsEither(["black"]); - break; - case "semitic": - hair = jsEither(["black"]); - break; - case "southern european": - hair = jsEither(["black"]); - break; - case "white": - hair = jsEither(["black", "blonde", "brown", "red"]); - break; - default: - hair = jsEither(["black", "black", "black", "black", "blonde", "brown", "brown", "red"]); - break; - } - return hair; -}; - // replaces untraceable fatherIDs with missingParentID. Required for concurrent pregnancy to differentiate between siblings. window.MissingParentIDCorrection = function(actor) { WombInit(actor); diff --git a/src/uncategorized/genericPlotEvents.tw b/src/uncategorized/genericPlotEvents.tw index 901db2ddd2f2876c87de5fef961da3b66e0a6175..1f4601ebf2824a386c4d1161719fef9c9fd6935d 100644 --- a/src/uncategorized/genericPlotEvents.tw +++ b/src/uncategorized/genericPlotEvents.tw @@ -518,11 +518,7 @@ When the aircraft lands at your penthouse pad, the would-be escapees are still u <<set _missLeader.pregKnown = 1>> <<set _missLeader.pregWeek = _missLeader.preg>> <<run SetBellySize(_missLeader)>> - <<run WombChangeGene(_missLeader, "race", "black")>> - <<set _skinTone = either("brown", "dark brown", "light brown")>> - <<run WombChangeGene(_missLeader, "skin", _skinTone)>> - <<run WombChangeGene(_missLeader, "hColor", "black")>> - <<run WombChangeGene(_missLeader, "eyeColor", "brown")>> + <<run WombFatherRace(_missLeader, "black")>> <<set _missLeader.birthsTotal = 3>> <<set _missLeader.bellySag = 5>> <<set _missLeader.bellySagPreg = 5>> @@ -567,11 +563,7 @@ When the aircraft lands at your penthouse pad, the would-be escapees are still u <<set $activeSlave.pregKnown = 1>> <<set $activeSlave.pregWeek = $activeSlave.preg>> <<run SetBellySize($activeSlave)>> - <<run WombChangeGene($activeSlave, "race", "black")>> - <<set _skinTone = either("brown", "dark brown", "light brown")>> - <<run WombChangeGene($activeSlave, "skin", "black")>> - <<run WombChangeGene($activeSlave, "hColor", "black")>> - <<run WombChangeGene($activeSlave, "eyeColor", "brown")>> + <<run WombFatherRace($activeSlave, "black")>> <<set $activeSlave.birthsTotal = 3>> <<set $activeSlave.bellySag = 5>> <<set $activeSlave.bellySagPreg = 5>> @@ -668,11 +660,7 @@ When the aircraft lands at your penthouse pad, the would-be escapees are still u <<set _missLoli.pregKnown = 1>> <<set _missLoli.pregWeek = _missLoli.preg>> <<run SetBellySize(_missLoli)>> - <<run WombChangeGene(_missLoli, "race", "black")>> - <<set _skinTone = either("black", "ebony", "pure black")>> - <<run WombChangeGene(_missLoli, "skin", "black")>> - <<run WombChangeGene(_missLoli, "hColor", "black")>> - <<run WombChangeGene(_missLoli, "eyeColor", "brown")>> + <<run WombChangeGene(_missLoli, "black")>> <<set _missLoli.birthsTotal = 0>> <<set _missLoli.bellySag = 5>> <<set _missLoli.bellySagPreg = 5>>