From f1d6cf6efd9f006c75eb9bb069dea820d9982509 Mon Sep 17 00:00:00 2001
From: DCoded <dcoded@live.com>
Date: Mon, 18 Mar 2019 08:23:46 -0400
Subject: [PATCH] generateGenetics() revert pass one

---
 src/js/generateGenetics.js | 1062 ++++++++++++++++++------------------
 1 file changed, 531 insertions(+), 531 deletions(-)

diff --git a/src/js/generateGenetics.js b/src/js/generateGenetics.js
index 1712104cddb..709e60d4a61 100644
--- a/src/js/generateGenetics.js
+++ b/src/js/generateGenetics.js
@@ -83,520 +83,508 @@ window.generateGenetics = (function() {
 		genes.fetish = setFetish(father, mother);
 
 		return genes;
+	}
 
-		// gender
-		function setGender(father, mother) {
-			let gender;
-			if (V.seeDicksAffectsPregnancy === 1) {
-				gender = Math.floor(Math.random()*100) < V.seeDicks ? "XY" : "XX";
-			} else if (V.adamPrinciple === 1) {
-				if (father !== 0) {
-					if (father.genes === "XX" && mother.genes === "XX") {
-						gender = "XX";
-					} else if (father.genes !== mother.genes) {
-						gender = jsEither(["XX", "XY"]);
-					} else {
-						gender = jsEither(["XX", "XY", "XY", "YY"]);
-					}
-				} else {
+	// gender
+	function setGender(father, mother) {
+		let gender;
+		if (V.seeDicksAffectsPregnancy === 1) {
+			gender = Math.floor(Math.random()*100) < V.seeDicks ? "XY" : "XX";
+		} else if (V.adamPrinciple === 1) {
+			if (father !== 0) {
+				if (father.genes === "XX" && mother.genes === "XX") {
+					gender = "XX";
+				} else if (father.genes !== mother.genes) {
 					gender = jsEither(["XX", "XY"]);
+				} else {
+					gender = jsEither(["XX", "XY", "XY", "YY"]);
 				}
 			} else {
 				gender = jsEither(["XX", "XY"]);
 			}
-			return gender;
+		} else {
+			gender = jsEither(["XX", "XY"]);
 		}
+		return gender;
+	}
 
-		// name
-		function setName(x) {
-			return "ovum" + x;
-		}
+	// name
+	function setName(x) {
+		return "ovum" + x;
+	}
 
-		// motherID
-		function setMotherID(actor1ID) {
-			return actor1ID;
-		}
+	// motherID
+	function setMotherID(actor1ID) {
+		return actor1ID;
+	}
 
-		// motherName
-		function setMotherName(activeMother) {
-			let motherName;
-			if (activeMother.ID === -1) {
-				motherName = activeMother.name;
-				if (activeMother.surname !== 0 && activeMother.surname !== "") { motherName += " " + activeMother.surname; }
-			} else {
-				motherName = activeMother.slaveName;
-				if (activeMother.slaveSurname !== 0 && activeMother.slaveSurname !== "") { motherName += " " + activeMother.slaveSurname; }
-			}
-			return motherName;
+	// motherName
+	function setMotherName(activeMother) {
+		let motherName;
+		if (activeMother.ID === -1) {
+			motherName = activeMother.name;
+			if (activeMother.surname !== 0 && activeMother.surname !== "") { motherName += " " + activeMother.surname; }
+		} else {
+			motherName = activeMother.slaveName;
+			if (activeMother.slaveSurname !== 0 && activeMother.slaveSurname !== "") { motherName += " " + activeMother.slaveSurname; }
 		}
+		return motherName;
+	}
 
-		// fatherID
-		function setFatherID(actor2) {
-			return actor2;
-		}
+	// fatherID
+	function setFatherID(actor2) {
+		return actor2;
+	}
 
-		// fatherName
-		function setFatherName(father, activeFather, actor2) {
-			let fatherName;
-			if (father !== 0) {
-				if (father.ID === -1) {
-					fatherName = activeFather.name;
-					if (activeFather.surname !== 0 && activeFather.surname !== "") { fatherName += " " + activeFather.surname; }
-				} else {
-					fatherName = activeFather.slaveName;
-					if (activeFather.slaveSurname !== 0 && activeFather.slaveSurname !== "") { fatherName += " " + activeFather.slaveSurname; }
-				}
+	// fatherName
+	function setFatherName(father, activeFather, actor2) {
+		let fatherName;
+		if (father !== 0) {
+			if (father.ID === -1) {
+				fatherName = activeFather.name;
+				if (activeFather.surname !== 0 && activeFather.surname !== "") { fatherName += " " + activeFather.surname; }
 			} else {
-				switch(actor2) {
-					case -2:
-					case -5:
-						fatherName = "Citizen";
-						break;
-					case -3:
-						fatherName = "Your Master";
-						break;
-					case -4:
-						fatherName = "Another arcology owner";
-						break;
-					case -6:
-						fatherName = "The Societal Elite";
-						break;
-					case -7:
-						fatherName = "Lab designed";
-						break;
-					case -8:
-						fatherName = "One of your animals";
-						break;
-					case -9:
-						fatherName = "A Futanari Sister";
-						break;
-					default:
-						fatherName = "Unknown";
-				}
-			return fatherName;
+				fatherName = activeFather.slaveName;
+				if (activeFather.slaveSurname !== 0 && activeFather.slaveSurname !== "") { fatherName += " " + activeFather.slaveSurname; }
 			}
+		} else {
+			switch(actor2) {
+				case -2:
+				case -5:
+					fatherName = "Citizen";
+					break;
+				case -3:
+					fatherName = "Your Master";
+					break;
+				case -4:
+					fatherName = "Another arcology owner";
+					break;
+				case -6:
+					fatherName = "The Societal Elite";
+					break;
+				case -7:
+					fatherName = "Lab designed";
+					break;
+				case -8:
+					fatherName = "One of your animals";
+					break;
+				case -9:
+					fatherName = "A Futanari Sister";
+					break;
+				default:
+					fatherName = "Unknown";
+			}
+		return fatherName;
 		}
+	}
 
-		// nationality
-		function setNationality(father, mother) {
-			return (father === 0) ? "Stateless"
-				: (father.nationality === mother.nationality) ? mother.nationality
-				: "Stateless";
-		}
+	// nationality
+	function setNationality(father, mother) {
+		return (father === 0) ? "Stateless"
+			: (father.nationality === mother.nationality) ? mother.nationality
+			: "Stateless";
+	}
 
-		// race
-		function setRace(father, mother, actor2) {
-			let race;
-			if (father !== 0) {
-				race = (mother.origRace === 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) {
-							race = "mixed race";
-						}
+	// race
+	function setRace(father, mother, actor2) {
+		let race;
+		if (father !== 0) {
+			race = (mother.origRace === 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) {
+						race = "mixed race";
 					}
-				} else {
-					race = mother.origRace;
 				}
 			} else {
 				race = mother.origRace;
 			}
-			return race;
+		} else {
+			race = mother.origRace;
 		}
+		return race;
+	}
 
-		//skin
-		function setSkin(father, mother) {
-			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 white': 1
-			};
-			let momSkinIndex = mother ? (skinToMelanin[mother.origSkin] || 11) : 8;
-			let dadSkinIndex = father !== 0 ? (skinToMelanin[father.origSkin] || 11) : 8;
-			let skinIndex = Math.round(Math.random() * (dadSkinIndex - momSkinIndex) + momSkinIndex);
+	//skin
+	function setSkin(father, mother) {
+		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 white': 1
+		};
+		let momSkinIndex = mother ? (skinToMelanin[mother.origSkin] || 11) : 8;
+		let dadSkinIndex = father !== 0 ? (skinToMelanin[father.origSkin] || 11) : 8;
+		let skinIndex = Math.round(Math.random() * (dadSkinIndex - momSkinIndex) + momSkinIndex);
 
-			var prop = '';
-			for (prop in skinToMelanin) {
-				if (!skinToMelanin.hasOwnProperty(prop)) continue;
-				if (skinIndex >= skinToMelanin[prop]) return prop;
-			}
-			return prop; // skinIndex can be zero
+		var prop = '';
+		for (prop in skinToMelanin) {
+			if (!skinToMelanin.hasOwnProperty(prop)) continue;
+			if (skinIndex >= skinToMelanin[prop]) return prop;
 		}
+		return prop; // skinIndex can be zero
+	}
 
-		// eyeColor
-		function setEyeColor(father, mother, actor2) {
-			let eyeColor;
-			if (father !== 0) {
-				if (mother.origEye === father.origEye) {
+	// eyeColor
+	function setEyeColor(father, mother, actor2) {
+		let eyeColor;
+		if (father !== 0) {
+			if (mother.origEye === father.origEye) {
+				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 = father.origEye;
+			} 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) {
 					eyeColor = mother.origEye;
-				} else if (mother.origEye === "red" || mother.origEye === "pale red" || mother.origEye === "light red" || mother.origEye === "pale gray" || mother.origEye === "milky white") {
+				} else {
+					eyeColor = father.origEye;
+				}
+			} else if (father.origEye === "blue") {
+				if (jsRandom(1,4) === 2) {
 					eyeColor = father.origEye;
-				} 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) {
-						eyeColor = mother.origEye;
-					} else {
-						eyeColor = father.origEye;
-					}
-				} else if (father.origEye === "blue") {
-					if (jsRandom(1,4) === 2) {
-						eyeColor = father.origEye;
-					} else {
-						eyeColor = mother.origEye;
-					}
 				} else {
-					eyeColor = jsEither([father.origEye, mother.origEye]);
+					eyeColor = mother.origEye;
 				}
-			} else if (actor2 === -2 || actor2 === 0 || actor2 === -5) {
-				eyeColor = jsEither(["blue", "brown", "brown", "green", "green", "hazel", mother.origEye]);
 			} else {
-				eyeColor = mother.origEye;
+				eyeColor = jsEither([father.origEye, mother.origEye]);
 			}
-			//just in case something wrong gets through
-			switch (eyeColor) {
-				case "blind blue":
-					eyeColor = "deep blue";
-					break;
-				case "milky white":
-				case "implant":
-					eyeColor = jsEither(["blue", "brown", "dark blue", "dark green", "green", "hazel", "light blue", "light green"]);
-					break;
-			}
-			return eyeColor;
+		} else if (actor2 === -2 || actor2 === 0 || actor2 === -5) {
+			eyeColor = jsEither(["blue", "brown", "brown", "green", "green", "hazel", mother.origEye]);
+		} else {
+			eyeColor = mother.origEye;
 		}
+		//just in case something wrong gets through
+		switch (eyeColor) {
+			case "blind blue":
+				eyeColor = "deep blue";
+				break;
+			case "milky white":
+			case "implant":
+				eyeColor = jsEither(["blue", "brown", "dark blue", "dark green", "green", "hazel", "light blue", "light green"]);
+				break;
+		}
+		return eyeColor;
+	}
 
-		function setHeterochromaticEyeColor(father, mother, actor2) {
-			let hEyeColor;
-			let eyeColorArray = [];
-			if (father !== 0) {
-				eyeColorArray.push(mother.origEye);
-				eyeColorArray.push(father.origEye);
-				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 (mother.geneticQuirks.heterochromia !== 0 && mother.geneticQuirks.heterochromia !== 1) {
-				eyeColorArray.push(mother.geneticQuirks.heterochromia);
+	function setHeterochromaticEyeColor(father, mother, actor2) {
+		let hEyeColor;
+		let eyeColorArray = [];
+		if (father !== 0) {
+			eyeColorArray.push(mother.origEye);
+			eyeColorArray.push(father.origEye);
+			if (father.geneticQuirks.heterochromia !== 0 && father.geneticQuirks.heterochromia !== 1) {
+				eyeColorArray.push(father.geneticQuirks.heterochromia);
 			}
-			//just in case something wrong gets through
-			switch (hEyeColor) {
-				case "blind blue":
-					hEyeColor = ["deep blue"];
-					break;
-				case "milky white":
-				case "implant":
-					hEyeColor = jsEither(["blue", "green", "brown", "hazel", "light blue", "light green", "dark green", "dark blue"]);
-					break;
-			}
-			return jsEither(hEyeColor);
+		} 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 (mother.geneticQuirks.heterochromia !== 0 && mother.geneticQuirks.heterochromia !== 1) {
+			eyeColorArray.push(mother.geneticQuirks.heterochromia);
+		}
+		//just in case something wrong gets through
+		switch (hEyeColor) {
+			case "blind blue":
+				hEyeColor = ["deep blue"];
+				break;
+			case "milky white":
+			case "implant":
+				hEyeColor = jsEither(["blue", "green", "brown", "hazel", "light blue", "light green", "dark green", "dark blue"]);
+				break;
 		}
+		return jsEither(hEyeColor);
+	}
 
-		// hColor
-		function setHColor(father, mother, actor2) {
-			let hairColor;
-			if (father !== 0) {
-				if (mother.origHColor === father.origHColor) {
-					hairColor = mother.origHColor;
-				} else if (mother.origHColor === "white") {
-					hairColor = jsRandom(1,100) === 69 ? mother.origHColor : father.origHColor;
-				} else if (father.origHColor === "white") {
-					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") {
-					hairColor = jsEither([father.origHColor, father.origHColor, father.origHColor, father.origHColor, father.origHColor, father.origHColor, father.origHColor, mother.origHColor]);
-				} else if (mother.origHColor === "brown") {
-					hairColor = jsEither([father.origHColor, mother.origHColor, mother.origHColor, mother.origHColor]);
-				} else if (father.origHColor === "brown") {
-					hairColor = jsEither([father.origHColor, father.origHColor, father.origHColor, mother.origHColor]);
-				} 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 {
+	// hColor
+	function setHColor(father, mother, actor2) {
+		let hairColor;
+		if (father !== 0) {
+			if (mother.origHColor === father.origHColor) {
 				hairColor = mother.origHColor;
+			} else if (mother.origHColor === "white") {
+				hairColor = jsRandom(1,100) === 69 ? mother.origHColor : father.origHColor;
+			} else if (father.origHColor === "white") {
+				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") {
+				hairColor = jsEither([father.origHColor, father.origHColor, father.origHColor, father.origHColor, father.origHColor, father.origHColor, father.origHColor, mother.origHColor]);
+			} else if (mother.origHColor === "brown") {
+				hairColor = jsEither([father.origHColor, mother.origHColor, mother.origHColor, mother.origHColor]);
+			} else if (father.origHColor === "brown") {
+				hairColor = jsEither([father.origHColor, father.origHColor, father.origHColor, mother.origHColor]);
+			} else {
+				hairColor = jsEither([father.origHColor, mother.origHColor]);
 			}
-			return hairColor;
+		} else if (actor2 === -2 || actor2 === 0 || actor2 === -5) {
+			hairColor = jsEither(["black", "black", "black", "blonde", "brown", "brown", "brown", mother.origHColor]);
+		} else {
+			hairColor = mother.origHColor;
 		}
+		return hairColor;
+	}
 
-		// underArmHairStyle
-		function setUnderArmHStyle(father, mother) {
-			let hair;
-			if (father !== 0) {
-				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"]);
-				} else {
-					hair = jsEither(["bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "hairless"]);
-				}
-			} else if (mother.underArmHStyle === "hairless") {
+	// underArmHairStyle
+	function setUnderArmHStyle(father, mother) {
+		let hair;
+		if (father !== 0) {
+			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"]);
 			} else {
 				hair = jsEither(["bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "hairless"]);
 			}
-			return hair;
+		} 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"]);
+		} else {
+			hair = jsEither(["bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "hairless"]);
 		}
+		return hair;
+	}
 
-		// pubicHairStyle
-		function setPubicHStyle(father, mother) {
-			let hair;
-			if (father !== 0) {
-				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"]);
-				} else {
-					hair = jsEither(["bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "hairless"]);
-				}
-			} else if (mother.pubicHStyle === "hairless") {
+	// pubicHairStyle
+	function setPubicHStyle(father, mother) {
+		let hair;
+		if (father !== 0) {
+			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"]);
 			} else {
 				hair = jsEither(["bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "hairless"]);
 			}
-			return hair;
+		} 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"]);
+		} else {
+			hair = jsEither(["bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "hairless"]);
 		}
+		return hair;
+	}
 
-		// markings
-		function setMarkings(father, mother) {
-			let markings;
-			if (jsRandom(1,8) === 1) {
-				markings = jsEither(["beauty mark", "birthmark"]);
-			} else {
-				markings = "none";
-			}
-			if (markings === "none") {
-				if (father !== 0) {
-					markings = jsEither(["none", "none", father.markings, mother.markings]);
-				} else {
-					markings = jsEither(["none", "none", mother.markings, mother.markings]);
-				}
-			}
-			return markings;
+	// markings
+	function setMarkings(father, mother) {
+		let markings;
+		if (jsRandom(1,8) === 1) {
+			markings = jsEither(["beauty mark", "birthmark"]);
+		} else {
+			markings = "none";
 		}
-
-		// sexualFlaw
-		function setSexualFlaw(father, mother) {
-			let flaw;
+		if (markings === "none") {
 			if (father !== 0) {
-				flaw = jsEither(["none", "none", father.sexualFlaw, mother.sexualFlaw]);
+				markings = jsEither(["none", "none", father.markings, mother.markings]);
 			} else {
-				flaw = jsEither(["none", "none", mother.sexualFlaw, mother.sexualFlaw]);
+				markings = jsEither(["none", "none", mother.markings, mother.markings]);
 			}
-			return flaw;
 		}
+		return markings;
+	}
 
-		// behavioralFlaw
-		function setBehavioralFlaw(father, mother) {
-			let flaw;
-			if (father !== 0) {
-				flaw = jsEither(["none", "none", father.behavioralFlaw, mother.behavioralFlaw]);
-			} else {
-				flaw = jsEither(["none", "none", mother.behavioralFlaw, mother.behavioralFlaw]);
-			}
-			return flaw;
+	// sexualFlaw
+	function setSexualFlaw(father, mother) {
+		let flaw;
+		if (father !== 0) {
+			flaw = jsEither(["none", "none", father.sexualFlaw, mother.sexualFlaw]);
+		} else {
+			flaw = jsEither(["none", "none", mother.sexualFlaw, mother.sexualFlaw]);
 		}
+		return flaw;
+	}
 
-		// fetish
-		function setFetish(father, mother) {
-			let fetish;
-			if (father !== 0) {
-				fetish = jsEither(["none", "none", "none", "none", "none", father.fetish, mother.fetish]);
-			} else {
-				fetish = jsEither(["none", "none", "none", "none", "none", mother.fetish, mother.fetish]);
-			}
-			if (fetish === "mindbroken") { fetish = "none"; }
-			return fetish;
+	// behavioralFlaw
+	function setBehavioralFlaw(father, mother) {
+		let flaw;
+		if (father !== 0) {
+			flaw = jsEither(["none", "none", father.behavioralFlaw, mother.behavioralFlaw]);
+		} else {
+			flaw = jsEither(["none", "none", mother.behavioralFlaw, mother.behavioralFlaw]);
 		}
+		return flaw;
+	}
 
-		//intelligence
-		function setIntelligence(father, mother, activeMother, actor2) {
-			let smarts;
-			if (mother.ID === -1) {
-				if (actor2 === -6) {
-					smarts = jsRandom(90,100);
-				} else if (father !== 0) {
-					if (father.intelligence < mother.intelligence) {
-						smarts = jsRandom(father.intelligence, mother.intelligence);
-					} else {
-						smarts = jsRandom(mother.intelligence, father.intelligence);
-					}
-					if (smarts <= 50) {
-						smarts += 30;
-					}
-				} else {
-					smarts = jsRandom(50,100);
-				}
+	// fetish
+	function setFetish(father, mother) {
+		let fetish;
+		if (father !== 0) {
+			fetish = jsEither(["none", "none", "none", "none", "none", father.fetish, mother.fetish]);
+		} else {
+			fetish = jsEither(["none", "none", "none", "none", "none", mother.fetish, mother.fetish]);
+		}
+		if (fetish === "mindbroken") { fetish = "none"; }
+		return fetish;
+	}
+
+	//intelligence
+	function setIntelligence(father, mother, activeMother, actor2) {
+		let smarts;
+		if (mother.ID === -1) {
+			if (actor2 === -6) {
+				smarts = jsRandom(90,100);
 			} else if (father !== 0) {
 				if (father.intelligence < mother.intelligence) {
 					smarts = jsRandom(father.intelligence, mother.intelligence);
 				} else {
 					smarts = jsRandom(mother.intelligence, father.intelligence);
 				}
-				if (activeMother.breedingMark === 1 && smarts <= 50) {
-					smarts = jsRandom(60,100);
+				if (smarts <= 50) {
+					smarts += 30;
 				}
 			} else {
-				smarts = mother.intelligence;
+				smarts = jsRandom(50,100);
 			}
-			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);
-							}
+		} else if (father !== 0) {
+			if (father.intelligence < mother.intelligence) {
+				smarts = jsRandom(father.intelligence, mother.intelligence);
+			} else {
+				smarts = jsRandom(mother.intelligence, father.intelligence);
+			}
+			if (activeMother.breedingMark === 1 && smarts <= 50) {
+				smarts = jsRandom(60,100);
+			}
+		} else {
+			smarts = mother.intelligence;
+		}
+		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);
 						}
-					} else {
-						if (smarts >= -95 && jsRandom(1,100) < 50) {
+					}
+				} 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) < 30) {
-								smarts -= jsRandom(1,15);
-							}
 						}
 					}
 				}
 			}
-			return Math.clamp(smarts, -100, 100);
 		}
+		return Math.clamp(smarts, -100, 100);
+	}
 
-		//face
-		function setFace(father, mother, activeMother, actor2, genes) {
-			let face;
-			if (genes.pFace > 0 && genes.uFace > 0) {
-				face = 0;
-			} else if (genes.pFace > 0) {
-				face = 100;
-			} else if (genes.uFace > 0) {
-				face = -100;
-			} else if (mother.ID === -1) {
-				if (actor2 === -6) {
-					face = jsRandom(90,100);
-				} else if (father !== 0) {
-					if (father.face < mother.face) {
-						face = jsRandom(father.face, mother.face);
-					} else {
-						face = jsRandom(mother.face, father.face);
-					}
-					if (face <= 40) {
-						face += jsRandom(5,20);
-					}
-				} else {
-					face = jsRandom(20,100);
-				}
+	//face
+	function setFace(father, mother, activeMother, actor2, genes) {
+		let face;
+		if (genes.pFace > 0 && genes.uFace > 0) {
+			face = 0;
+		} else if (genes.pFace > 0) {
+			face = 100;
+		} else if (genes.uFace > 0) {
+			face = -100;
+		} else if (mother.ID === -1) {
+			if (actor2 === -6) {
+				face = jsRandom(90,100);
 			} else if (father !== 0) {
 				if (father.face < mother.face) {
 					face = jsRandom(father.face, mother.face);
 				} else {
 					face = jsRandom(mother.face, father.face);
 				}
-				if (activeMother.breedingMark === 1 && face < 60) {
-					face = jsRandom(60,100);
+				if (face <= 40) {
+					face += jsRandom(5,20);
 				}
 			} else {
-				face = mother.face;
+				face = jsRandom(20,100);
 			}
-			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);
-						}
-					} else {
-						if (face > -100 && jsRandom(1,100) < 50) {
-							face -= jsRandom(1,15);
-							if (face >= -95 && jsRandom(1,100) < 30) {
-								face -= jsRandom(5,20);
-							}
+		} else if (father !== 0) {
+			if (father.face < mother.face) {
+				face = jsRandom(father.face, mother.face);
+			} else {
+				face = jsRandom(mother.face, father.face);
+			}
+			if (activeMother.breedingMark === 1 && face < 60) {
+				face = jsRandom(60,100);
+			}
+		} else {
+			face = mother.face;
+		}
+		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);
+					}
+				} else {
+					if (face > -100 && jsRandom(1,100) < 50) {
+						face -= jsRandom(1,15);
+						if (face >= -95 && jsRandom(1,100) < 30) {
+							face -= jsRandom(5,20);
 						}
 					}
 				}
 			}
-			return Math.clamp(face, -100, 100);
 		}
+		return Math.clamp(face, -100, 100);
+	}
 
-		// face shape
-		function setFaceShape(father, mother) {
-			let shape;
-			if (father !== 0) {
-				if (mother.faceShape === father.faceShape) {
-					shape = mother.faceShape;
-				} else {
-					shape = jsEither(["androgynous", "androgynous", "cute", "cute", "exotic", "normal", "normal", "sensual", mother.faceShape, mother.faceShape]);
-				}
+	// face shape
+	function setFaceShape(father, mother) {
+		let shape;
+		if (father !== 0) {
+			if (mother.faceShape === father.faceShape) {
+				shape = mother.faceShape;
 			} else {
 				shape = jsEither(["androgynous", "androgynous", "cute", "cute", "exotic", "normal", "normal", "sensual", mother.faceShape, mother.faceShape]);
 			}
-			return shape;
+		} else {
+			shape = jsEither(["androgynous", "androgynous", "cute", "cute", "exotic", "normal", "normal", "sensual", mother.faceShape, mother.faceShape]);
 		}
+		return shape;
+	}
 
-		// genetic quirks
-		function setGeneticQuirks(father, mother, sex) {
-			let quirks = {macromastia: 0, gigantomastia: 0, fertility: 0, hyperFertility: 0, superfetation: 0, gigantism: 0, dwarfism: 0, pFace: 0, uFace: 0, albinism: 0, heterochromia: 0, rearLipedema: 0, wellHung: 0, wGain: 0, wLoss: 0, androgyny: 0};
-			let chance = 0;
+	// genetic quirks
+	function setGeneticQuirks(father, mother, sex) {
+		let quirks = {macromastia: 0, gigantomastia: 0, fertility: 0, hyperFertility: 0, superfetation: 0, gigantism: 0, dwarfism: 0, pFace: 0, uFace: 0, albinism: 0, heterochromia: 0, rearLipedema: 0, wellHung: 0, wGain: 0, wLoss: 0, androgyny: 0};
+		let chance = 0;
 
-			// fertility
-			if (mother.geneticQuirks.fertility === 2) {
-				if (sex === "XX") {
-					quirks.fertility = 2;
-				} else {
-					quirks.fertility = 1;
-				}
-			} else if (mother.geneticQuirks.fertility === 1) {
-				chance = jsRandom(0, 1000);
-				if (father !== 0) {
-					if (father.geneticQuirks.fertility >= 1) {
-						if (sex === "XX") {
-							if (chance > 500) {
-								quirks.fertility = 2;
-							} else if (chance > 50) {
-								quirks.fertility = 1;
-							}
-						} else {
-							if (chance > 500) {
-								quirks.fertility = 1;
-							}
-						}
-					}
-				} else {
+		// fertility
+		if (mother.geneticQuirks.fertility === 2) {
+			if (sex === "XX") {
+				quirks.fertility = 2;
+			} else {
+				quirks.fertility = 1;
+			}
+		} else if (mother.geneticQuirks.fertility === 1) {
+			chance = jsRandom(0, 1000);
+			if (father !== 0) {
+				if (father.geneticQuirks.fertility >= 1) {
 					if (sex === "XX") {
-						if (chance > 950) {
+						if (chance > 500) {
 							quirks.fertility = 2;
-						} else if (chance > 200) {
+						} else if (chance > 50) {
 							quirks.fertility = 1;
 						}
 					} else {
@@ -605,162 +593,174 @@ window.generateGenetics = (function() {
 						}
 					}
 				}
-			}
-
-			// hyper fertility
-			if (mother.geneticQuirks.hyperFertility === 2) {
+			} else {
 				if (sex === "XX") {
-					quirks.hyperFertility = 2;
-				} else {
-					quirks.hyperFertility = 1;
-				}
-			} else if (mother.geneticQuirks.hyperFertility === 1) {
-				chance = jsRandom(0, 1000);
-				if (father !== 0) {
-					if (father.geneticQuirks.hyperFertility >= 1) {
-						if (sex === "XX") {
-							if (chance > 750) {
-								quirks.hyperFertility = 2;
-							} else if (chance > 500) {
-								quirks.hyperFertility = 1;
-							}
-						} else {
-							if (chance > 500) {
-								quirks.hyperFertility = 1;
-							}
-						}
+					if (chance > 950) {
+						quirks.fertility = 2;
+					} else if (chance > 200) {
+						quirks.fertility = 1;
 					}
 				} else {
+					if (chance > 500) {
+						quirks.fertility = 1;
+					}
+				}
+			}
+		}
+
+		// hyper fertility
+		if (mother.geneticQuirks.hyperFertility === 2) {
+			if (sex === "XX") {
+				quirks.hyperFertility = 2;
+			} else {
+				quirks.hyperFertility = 1;
+			}
+		} else if (mother.geneticQuirks.hyperFertility === 1) {
+			chance = jsRandom(0, 1000);
+			if (father !== 0) {
+				if (father.geneticQuirks.hyperFertility >= 1) {
 					if (sex === "XX") {
-						if (chance > 950) {
+						if (chance > 750) {
 							quirks.hyperFertility = 2;
-						} else if (chance > 700) {
+						} else if (chance > 500) {
 							quirks.hyperFertility = 1;
 						}
 					} else {
-						if (chance > 700) {
+						if (chance > 500) {
 							quirks.hyperFertility = 1;
 						}
 					}
 				}
-			}
-
-			// well hung
-			if (father !== 0) {
-				if (mother.geneticQuirks.wellHung + father.geneticQuirks.wellHung >= 3) {
-					if (sex === "XY") {
-						quirks.wellHung = 2;
-					} else {
-						quirks.wellHung = 1;
+			} else {
+				if (sex === "XX") {
+					if (chance > 950) {
+						quirks.hyperFertility = 2;
+					} else if (chance > 700) {
+						quirks.hyperFertility = 1;
 					}
-				} else if (mother.geneticQuirks.wellHung + father.geneticQuirks.wellHung >= 1) {
-					chance = jsRandom(0, 1000);
-					if (chance > 750) {
-						quirks.wellHung = 1;
+				} else {
+					if (chance > 700) {
+						quirks.hyperFertility = 1;
 					}
 				}
-			} else if (mother.geneticQuirks.wellHung === 2) {
-				chance = jsRandom(0, 1000);
+			}
+		}
+
+		// well hung
+		if (father !== 0) {
+			if (mother.geneticQuirks.wellHung + father.geneticQuirks.wellHung >= 3) {
 				if (sex === "XY") {
-					if (chance > 900) {
-						quirks.wellHung = 2;
-					} else if (chance > 200) {
-						quirks.wellHung = 1;
-					}
+					quirks.wellHung = 2;
 				} else {
-					if (chance > 500) {
-						quirks.wellHung = 1;
-					}
+					quirks.wellHung = 1;
+				}
+			} else if (mother.geneticQuirks.wellHung + father.geneticQuirks.wellHung >= 1) {
+				chance = jsRandom(0, 1000);
+				if (chance > 750) {
+					quirks.wellHung = 1;
 				}
 			}
-
-			//perfect face
-			if (father !== 0) {
-				if (mother.geneticQuirks.pFace + father.geneticQuirks.pFace >= 4) {
-					quirks.pFace = 2;
-				} else if (mother.geneticQuirks.pFace === 2 || father.geneticQuirks.pFace === 2) {
-					quirks.pFace = 1;
+		} else if (mother.geneticQuirks.wellHung === 2) {
+			chance = jsRandom(0, 1000);
+			if (sex === "XY") {
+				if (chance > 900) {
+					quirks.wellHung = 2;
+				} else if (chance > 200) {
+					quirks.wellHung = 1;
 				}
-			} else if (mother.geneticQuirks.pFace === 2) {
+			} else {
+				if (chance > 500) {
+					quirks.wellHung = 1;
+				}
+			}
+		}
+
+		//perfect face
+		if (father !== 0) {
+			if (mother.geneticQuirks.pFace + father.geneticQuirks.pFace >= 4) {
+				quirks.pFace = 2;
+			} else if (mother.geneticQuirks.pFace === 2 || father.geneticQuirks.pFace === 2) {
 				quirks.pFace = 1;
 			}
+		} else if (mother.geneticQuirks.pFace === 2) {
+			quirks.pFace = 1;
+		}
 
-			//ugly face
-			if (father !== 0) {
-				if (mother.geneticQuirks.uFace + father.geneticQuirks.uFace >= 4) {
-					quirks.uFace = 2;
-				} else if (mother.geneticQuirks.uFace === 2 || father.geneticQuirks.uFace === 2) {
-					quirks.uFace = 1;
-				}
-			} else if (mother.geneticQuirks.uFace === 2) {
+		//ugly face
+		if (father !== 0) {
+			if (mother.geneticQuirks.uFace + father.geneticQuirks.uFace >= 4) {
+				quirks.uFace = 2;
+			} else if (mother.geneticQuirks.uFace === 2 || father.geneticQuirks.uFace === 2) {
 				quirks.uFace = 1;
 			}
+		} else if (mother.geneticQuirks.uFace === 2) {
+			quirks.uFace = 1;
+		}
 
-			//albinism
-			if (father !== 0) {
-				// Add treatment to force albinism
-				if (mother.geneticQuirks.albinism === 2 && father.geneticQuirks.albinism === 2) {
-					if (jsRandom(1, 4) === 1) {
-						quirks.albinism = 2;
-					} else {
-						quirks.albinism = 1;
-					}
-				} else if (mother.geneticQuirks.albinism === 1 + father.geneticQuirks.albinism >= 3) {
-					chance = jsRandom(1, 4);
-					if (chance === 1) {
-						quirks.albinism = 2;
-					} else if (chance !== 4) {
-						quirks.albinism = 1;
-					}
-				} else if (mother.geneticQuirks.albinism === 1 && father.geneticQuirks.albinism === 1) {
-					if (jsRandom(1, 4) === 1) {
-						quirks.albinism = 2;
-					}
+		//albinism
+		if (father !== 0) {
+			// Add treatment to force albinism
+			if (mother.geneticQuirks.albinism === 2 && father.geneticQuirks.albinism === 2) {
+				if (jsRandom(1, 4) === 1) {
+					quirks.albinism = 2;
+				} else {
+					quirks.albinism = 1;
 				}
-			} else if (mother.geneticQuirks.albinism >= 1) {
-				if (jsRandom(0, 40000) >= 39500) {
-					chance = jsRandom(1, 4);
-					if (chance === 1) {
-						quirks.albinism = 2;
-					} else if (chance !== 4) {
-						quirks.albinism = 1;
-					}
+			} else if (mother.geneticQuirks.albinism === 1 + father.geneticQuirks.albinism >= 3) {
+				chance = jsRandom(1, 4);
+				if (chance === 1) {
+					quirks.albinism = 2;
+				} else if (chance !== 4) {
+					quirks.albinism = 1;
+				}
+			} else if (mother.geneticQuirks.albinism === 1 && father.geneticQuirks.albinism === 1) {
+				if (jsRandom(1, 4) === 1) {
+					quirks.albinism = 2;
 				}
 			}
+		} else if (mother.geneticQuirks.albinism >= 1) {
+			if (jsRandom(0, 40000) >= 39500) {
+				chance = jsRandom(1, 4);
+				if (chance === 1) {
+					quirks.albinism = 2;
+				} else if (chance !== 4) {
+					quirks.albinism = 1;
+				}
+			}
+		}
 
-			//heterochromia
-			if (father !== 0) {
-				if (mother.geneticQuirks.heterochromia === 2 && father.geneticQuirks.heterochromia === 2) {
-					if (jsRandom(1, 4) === 1) {
-						quirks.heterochromia = 2;
-					} else {
-						quirks.heterochromia = 1;
-					}
-				} else if (mother.geneticQuirks.heterochromia === 1 + father.geneticQuirks.heterochromia >= 3) {
-					chance = jsRandom(1, 4);
-					if (chance === 1) {
-						quirks.heterochromia = 2;
-					} else if (chance !== 4) {
-						quirks.heterochromia = 1;
-					}
-				} else if (mother.geneticQuirks.heterochromia === 1 && father.geneticQuirks.heterochromia === 1) {
-					if (jsRandom(1, 4) === 1) {
-						quirks.heterochromia = 2;
-					}
+		//heterochromia
+		if (father !== 0) {
+			if (mother.geneticQuirks.heterochromia === 2 && father.geneticQuirks.heterochromia === 2) {
+				if (jsRandom(1, 4) === 1) {
+					quirks.heterochromia = 2;
+				} else {
+					quirks.heterochromia = 1;
 				}
-			} else if (mother.geneticQuirks.heterochromia >= 1) {
-				if (jsRandom(0, 40000) >= 39500) {
-					chance = jsRandom(1, 4);
-					if (chance === 1) {
-						quirks.heterochromia = 2;
-					} else if (chance !== 4) {
-						quirks.heterochromia = 1;
-					}
+			} else if (mother.geneticQuirks.heterochromia === 1 + father.geneticQuirks.heterochromia >= 3) {
+				chance = jsRandom(1, 4);
+				if (chance === 1) {
+					quirks.heterochromia = 2;
+				} else if (chance !== 4) {
+					quirks.heterochromia = 1;
+				}
+			} else if (mother.geneticQuirks.heterochromia === 1 && father.geneticQuirks.heterochromia === 1) {
+				if (jsRandom(1, 4) === 1) {
+					quirks.heterochromia = 2;
+				}
+			}
+		} else if (mother.geneticQuirks.heterochromia >= 1) {
+			if (jsRandom(0, 40000) >= 39500) {
+				chance = jsRandom(1, 4);
+				if (chance === 1) {
+					quirks.heterochromia = 2;
+				} else if (chance !== 4) {
+					quirks.heterochromia = 1;
 				}
 			}
-
-			return clone(quirks);
 		}
+
+		return clone(quirks);
 	}
 
 	return generateGenetics;
-- 
GitLab