From a6bc733ad58eb0a06cc11b969a130457cc9e1de9 Mon Sep 17 00:00:00 2001
From: Elohiem <20236-Elohiem@users.noreply.gitgud.io>
Date: Thu, 19 May 2022 15:22:01 +0200
Subject: [PATCH] Latest art changes

---
 src/art/webgl/art.js | 308 ++++++++++++++++++++++++++++++++++++-------
 1 file changed, 258 insertions(+), 50 deletions(-)

diff --git a/src/art/webgl/art.js b/src/art/webgl/art.js
index ed8a93fd55a..5e5ae1a41f1 100644
--- a/src/art/webgl/art.js
+++ b/src/art/webgl/art.js
@@ -241,7 +241,7 @@ App.Art.applyFigures = function(slave, scene, p) {
 			break;
 		case "a slutty maid outfit":
 			figures.push("Slutty Maid Dress", "Slutty Maid Bands", "Slutty Maid Neck Bow", "Slutty Maid Shoes", "Slutty Maid Headband");
-			p.hideDick = true;
+			p.hideDick = false;
 			p.applyNipples = false;
 			p.hideHair = false;
 			p.applyPumps = true;
@@ -262,7 +262,7 @@ App.Art.applyFigures = function(slave, scene, p) {
 			break;
 		case "a biyelgee costume":
 			figures.push("Biyelgee Dress", "Biyelgee Hat");
-			p.hideDick = true;
+			p.hideDick = false;
 			p.applyNipples = false;
 			p.hideHair = false;
 			break;
@@ -370,7 +370,7 @@ App.Art.applyFigures = function(slave, scene, p) {
 			break;
 		case "an oversized t-shirt":
 			figures.push("Oversized Shirt");
-			p.hideDick = false;
+			p.hideDick = true;
 			p.applyNipples = false;
 			p.hideHair = false;
 			break;
@@ -546,7 +546,7 @@ App.Art.applyFigures = function(slave, scene, p) {
 			break;
 		case "slutty jewelry":
 			figures.push("Bangles");
-			p.hideDick = true;
+			p.hideDick = false;
 			p.applyNipples = true;
 			p.hideHair = false;
 			break;
@@ -586,8 +586,8 @@ App.Art.applyFigures = function(slave, scene, p) {
 			p.hideHair = false;
 			p.applyPanty = true;
 			break;
-		case "kitty lingerie": // placeholder since bunny is duplicate
-			figures.push("Bunny Outfit");
+		case "kitty lingerie":
+			figures.push("Kitty Choker", "Kitty Top", "Kitty Panty");
 			p.applyPanty = false;
 			p.hideDick = true;
 			p.applyNipples = false;
@@ -599,6 +599,34 @@ App.Art.applyFigures = function(slave, scene, p) {
 			p.applyNipples = true;
 			p.hideHair = false;
 			break;
+		case "a schoolgirl outfit":
+			figures.push("School Girl Belly Piercing", "School Girl Choker", "School Girl Panty", "School Girl Skirt", "School Girl Stockings", "School Girl Shirt");
+			p.applyPanty = false;
+			p.hideDick = true;
+			p.applyNipples = false;
+			p.hideHair = false;
+			break;
+		case "slutty business attire":
+			figures.push("Secretary Glasses", "Secretary Skirt", "Secretary Vest", "Secretary Stockings");
+			p.applyPanty = true;
+			p.hideDick = true;
+			p.applyNipples = false;
+			p.hideHair = false;
+			break;
+		case "a monokini":
+			figures.push("Monokini");
+			p.applyPanty = false;
+			p.hideDick = true;
+			p.applyNipples = false;
+			p.hideHair = false;
+			break;
+		case "a string bikini":
+			figures.push("String Bikini Bottom", "String Bikini Top");
+			p.applyPanty = false;
+			p.hideDick = true;
+			p.applyNipples = false;
+			p.hideHair = false;
+			break;
 	}
 
 	if (p.underage) {
@@ -608,17 +636,48 @@ App.Art.applyFigures = function(slave, scene, p) {
 		p.hideDick = true;
 	}
 
-	if (slave.chastityAnus && slave.chastityVagina) {
-		figures.push("Chastity Belt Base", "Chastity Belt Vaginal Cap with Holes", "Chastity Belt Anal Cap with Hole");
-		p.hideDick = true;
+	/*
+	switch (slave.vaginalAccessory) {
+		case "dildo":
+			figures.push("Dildo 1");
+			break;
 	}
-	if (!slave.chastityAnus && slave.chastityVagina) {
-		figures.push("Chastity Belt Base", "Chastity Belt Vaginal Cap with Holes");
-		p.hideDick = true;
+
+	switch (slave.buttplug) {
+		case "plug":
+			figures.push("Anal Plug 1");
+			break;
+		case "large plug":
+			figures.push("Anal Plug 2");
+			break;
+		case "huge plug":
+			figures.push("Anal Plug 3");
+			break;
+		case "long plug":
+			figures.push("Anal Plug 1");
+			break;
+		case "long, large plug":
+			figures.push("Anal Plug 2");
+			break;
+		case "long, huge plug":
+			figures.push("Anal Plug 3");
+			break;
 	}
-	if (slave.chastityAnus && !slave.chastityVagina) {
-		figures.push("Chastity Belt Base", "Chastity Belt Anal Cap with Hole");
-		p.hideDick = true;
+	*/
+
+	if (slave.chastityAnus || slave.chastityVagina || slave.chastityPenis) {
+		figures.push("Chastity Belt Base");
+		if (slave.chastityAnus) {
+			figures.push("Chastity Belt Anal Cap with Hole");
+		}
+		if (slave.chastityVagina) {
+			figures.push("Chastity Belt Vaginal Cap with Holes");
+			p.hideDick = true;
+		}
+		if (slave.chastityPenis) {
+			figures.push("Chastity Belt Vaginal Cap with Holes");
+			p.hideDick = true;
+		}
 	}
 
 	switch (slave.bellyAccessory) {
@@ -656,10 +715,10 @@ App.Art.applyFigures = function(slave, scene, p) {
 			break;
 	}
 
-	if (!hasLeftArm(slave) && slave.PLimb > 0) {
+	if (!slave.arm.left && slave.PLimb > 0) {
 		figures.push("Amputee Cap Arm Left");
 	}
-	if (!hasRightArm(slave) && slave.PLimb > 0) {
+	if (!slave.arm.right && slave.PLimb > 0) {
 		figures.push("Amputee Cap Arm Right");
 	}
 
@@ -1491,15 +1550,15 @@ App.Art.applyMaterials = function(slave, scene, p) {
 		materials.push(["Eyelashes", "map_D", "base2/eyelash/EyeLash_4.jpg"]);
 	}
 
-	let irisColorLeft = App.Art.hexToRgb(extractColor(hasLeftEye(slave) ? extractColor(slave.eye.left.iris) : extractColor("black")));
-	let irisColorRight = App.Art.hexToRgb(extractColor(hasRightEye(slave) ? extractColor(slave.eye.right.iris) : extractColor("black")));
-	let scleraColorLeft = App.Art.hexToRgb(extractColor(hasLeftEye(slave) ? extractColor(slave.eye.left.sclera) : extractColor("black")));
-	let scleraColorRight = App.Art.hexToRgb(extractColor(hasRightEye(slave) ? extractColor(slave.eye.right.sclera) : extractColor("black")));
+	let irisColorLeft = App.Art.hexToRgb(extractColor(slave.eye.left ? extractColor(slave.eye.left.iris) : extractColor("black")));
+	let irisColorRight = App.Art.hexToRgb(extractColor(slave.eye.right ? extractColor(slave.eye.right.iris) : extractColor("black")));
+	let scleraColorLeft = App.Art.hexToRgb(extractColor(slave.eye.left ? extractColor(slave.eye.left.sclera) : extractColor("black")));
+	let scleraColorRight = App.Art.hexToRgb(extractColor(slave.eye.right ? extractColor(slave.eye.right.sclera) : extractColor("black")));
 
-	materials.push(["Iris_Left", "Ka", [irisColorLeft[0]*1.4, irisColorLeft[1]*1.4, irisColorLeft[2]*1.4]]);
-	materials.push(["Iris_Right", "Ka", [irisColorRight[0]*1.4, irisColorRight[1]*1.4, irisColorRight[2]*1.4]]);
-	materials.push(["Sclera_Left", "Ka", [scleraColorLeft[0]*0.75, scleraColorLeft[1]*0.75, scleraColorLeft[2]*0.75]]);
-	materials.push(["Sclera_Right", "Ka", [scleraColorRight[0]*0.75, scleraColorRight[1]*0.75, scleraColorRight[2]*0.75]]);
+	materials.push(["Iris_Left", "Ka", [irisColorLeft[0]*1.4*2.5, irisColorLeft[1]*1.4*2.5, irisColorLeft[2]*1.4*2.5]]);
+	materials.push(["Iris_Right", "Ka", [irisColorRight[0]*1.4*2.5, irisColorRight[1]*1.4*2.5, irisColorRight[2]*1.4*2.5]]);
+	materials.push(["Sclera_Left", "Ka", [scleraColorLeft[0]*0.8*1.8, scleraColorLeft[1]*0.8*2, scleraColorLeft[2]*0.8*2]]);
+	materials.push(["Sclera_Right", "Ka", [scleraColorRight[0]*0.8*1.8, scleraColorRight[1]*0.8*2, scleraColorRight[2]*0.8*2]]);
 
 	// expected skin color
 	let O = App.Art.hexToRgb(skinColorCatcher(slave).skinColor);
@@ -1531,20 +1590,23 @@ App.Art.applyMaterials = function(slave, scene, p) {
 	let Ka;
 	let lKa;
 	let r;
+	let rN;
 	let Ni;
 	let skin;
 	let cockSkin;
 
 	if (slave.clothes === "body oil") {
 		r = 0.4;
+		rN = 0.4;
 		Ni = 1.5;
 	} else {
 		r = 0.7;
+		rN = 0.55;
 		Ni = 1.35;
 	}
 
 	if (sqAO < sqBO && sqAO < sqCO && sqAO < sqDO) {
-		Ks = [2, 2, 2];
+		Ks = [2.5, 2.5, 2.5];
 		Ka = mA;
 		lKa = lA;
 		skin = "WhiteTone";
@@ -1557,7 +1619,7 @@ App.Art.applyMaterials = function(slave, scene, p) {
 		materials.push(["nipple_mask", "map_Ka", "base/skin/torso white.jpg"]);
 		materials.push(["nipple_mask", "Ks", [3, 3, 3]]);
 	} else if (sqBO < sqAO && sqBO < sqCO && sqBO < sqDO) {
-		Ks = [1.75, 1.75, 1.75];
+		Ks = [2.5, 2.5, 2.5];
 		Ka = mB;
 		lKa = lB;
 		skin = "LightTone";
@@ -1570,7 +1632,7 @@ App.Art.applyMaterials = function(slave, scene, p) {
 		materials.push(["nipple_mask", "map_Ka", "base/skin/torso light.jpg"]);
 		materials.push(["nipple_mask", "Ks", [2.5, 2.5, 2.5]]);
 	} else if (sqCO < sqBO && sqCO < sqAO && sqCO < sqDO) {
-		Ks = [1.5, 1.5, 1.5];
+		Ks = [2, 2, 2];
 		Ka = mC;
 		lKa = lC;
 		skin = "MidTone";
@@ -1583,7 +1645,7 @@ App.Art.applyMaterials = function(slave, scene, p) {
 		materials.push(["nipple_mask", "map_Ka", "base/skin/torso mid.jpg"]);
 		materials.push(["nipple_mask", "Ks", [2, 2, 2]]);
 	} else if (sqDO < sqBO && sqDO < sqCO && sqDO < sqAO) {
-		Ks = [0.75, 0.75, 0.75];
+		Ks = [1, 1, 1];
 		Ka = mD;
 		lKa = lD;
 		skin = "DarkTone";
@@ -1631,7 +1693,7 @@ App.Art.applyMaterials = function(slave, scene, p) {
 	materials.push([skin + "Genitalia", "Ks", Ks]);
 	materials.push([skin + "Genitalia", "r", r]);
 	materials.push([skin + "Genitalia", "Ni", Ni]);
-	materials.push(["nipple_mask", "r", r]);
+	materials.push(["nipple_mask", "r", rN]);
 	materials.push(["nipple_mask", "Ni", Ni]);
 
 	let pubicColor = App.Art.hexToRgb(extractColor(slave.pubicHColor));
@@ -1692,7 +1754,7 @@ App.Art.applyMaterials = function(slave, scene, p) {
 	materials.push(["skindetail_fine_arms", "d", fineDetail]);
 	materials.push(["skindetail_fine_legs", "d", fineDetail]);
 
-	let veins = 1;
+	let veins = 0;
 	materials.push(["skindetail_veins_torso", "d", veins]);
 	materials.push(["skindetail_veins_face", "d", veins]);
 	materials.push(["skindetail_veins_arms", "d", veins]);
@@ -1780,10 +1842,10 @@ App.Art.applyMorphs = function(slave, scene, p) {
 		morphs.push(["posesExtremeHeels2", 1]);
 	}
 
-	if (hasBothArms(slave) && hasBothLegs(slave)) {
+	if (slave.arm.right && slave.arm.left && slave.leg.right && slave.leg.left) {
 		if (scene.inspect) {
-			morphs.push(["posesInspect", 1]);
-			morphs.push(["posesInspectGen", 1]);
+			morphs.push(["posesInspect2", 1]);
+			morphs.push(["posesInspectGen2", 1]);
 		} else if (slave.devotion > 50) {
 			morphs.push(["posesHigh", 1]);
 		} else if (slave.devotion > -20) {
@@ -1791,6 +1853,11 @@ App.Art.applyMorphs = function(slave, scene, p) {
 		} else {
 			morphs.push(["posesLow", 1]);
 		}
+
+		if (slave.devotion <= 50) {
+			morphs.push(["posesArmsDown", -slave.weight/300/3.5]);
+			morphs.push(["posesLegsClosed", -slave.weight/300/3.5]);
+		}
 	}
 
 	if (slave.trust < 0) {
@@ -2132,7 +2199,7 @@ App.Art.applyMorphs = function(slave, scene, p) {
 	let foreheadShape = ["foreheadShapeNormal", "foreheadShapeRound", "foreheadShapeSmall"];
 	let forehead = Math.floor(App.Art.random() * foreheadShape.length);
 	if (forehead > 0) {
-		morphs.push(foreheadShape[forehead], 1);
+		morphs.push([foreheadShape[forehead], 1]);
 	}
 
 	switch (slave.faceShape) {
@@ -2150,6 +2217,144 @@ App.Art.applyMorphs = function(slave, scene, p) {
 			morphs.push(["faceShapeExotic", 1]); break;
 	}
 
+
+	/*
+	const morphs_eyes = [
+		["", 1],
+		["mEyeShape1",1],
+		["mEyeShape2",1],
+		["mEyeShape3",0.5],
+		["mEyeShape4",1],
+		["mEyeShape5",1],
+		["mEyeShape6",1],
+		["mEyeShape7",1],
+		["mEyeShape8",1],
+	];
+	const morphs_nose = [
+		["", 1],
+		["mNoseShape1",0.5],
+		["mNoseShape2",1],
+		["mNoseShape3",0.5],
+		["mNoseShape4",0.5],
+		["mNoseShape5",0.5],
+		["mNoseShape6",1],
+		["mNoseShape7",1],
+		["mNoseShape8",1],
+		["mNoseShape9",1],
+		["mNoseShape10",1],
+	];
+	const morphs_jaw = [
+		["", 1],
+		["mJawShape1", 0.5],
+		["mJawShape2", 0.5],
+		["mJawShape3", 0.75],
+		["mJawShape4", 0.5],
+		["mJawShape5", 1],
+		["mJawShape6", 0.5],
+	];
+	const morphs_lips = [
+		["", 1],
+		["mLipsShape1",1],
+		["mLipsShape2",1],
+		["mLipsShape3",1],
+		["mLipsShape4",1],
+		["mLipsShape5",1],
+		["mLipsShape6",1],
+		["mLipsShape7",1],
+		["mLipsShape8", 0.5],
+		["mLipsShape9",1],
+		["mLipsShape10", 0.75],
+		["mLipsShape11",1],
+		["mLipsShape12", 0.5],
+	];
+	const morphs_cheeks = [
+		["", 1],
+		["mCheeksShape1",0.5],
+		["mCheeksShape2",0.5],
+		["mCheeksShape3",0.5],
+		["mCheeksShape4",1],
+		["mCheeksShape5",1],
+		["mCheeksShape6",0.5],
+		["mCheeksShape7",1],
+		["mCheeksShape8",1],
+	];
+
+	const morphs_cheeks2 = [
+		["", 1],
+		["mCheeks2Shape1",0.5],
+		["mCheeks2Shape2",0.5],
+		["mCheeks2Shape3",1],
+		["mCheeks2Shape4",0.5],
+	];
+
+	const morphs_chin = [
+		["", 1],
+		["mChinShape1", 0.5],
+		["mChinShape2", 0.5],
+		["mChinShape3", 0.5],
+		["mChinShape4", 0.5],
+	];
+
+	const morphs_unique = [
+		["", 1],
+		["mUniqueShape1", 1],
+		["mUniqueShape2", 0.75],
+		["mUniqueShape3", 0.5],
+		["mUniqueShape4", 0.5],
+		["mUniqueShape5", 0.5],
+	];
+
+	const eyeSize = App.Art.random();
+	const morphs_other = [
+		["mChinTweak1", 0.3*App.Art.random()],
+		["mEyeTweak1", 0.4*eyeSize],
+		["mEyeTweak2", 0.4*eyeSize],
+		["mEyeTweak3", 0.25*eyeSize],
+		["mEyeTweak4", 0.3*(App.Art.random()*2-1)],
+		["mEyeTweak5", 0.5*(App.Art.random()*2-1)],
+	];
+
+	const morphs_forehead = [
+		["", 1],
+		["foreheadShapeRound", 1],
+		["foreheadShapeSmall", 1],
+	];
+
+	morphs.push(morphs_other[0]);
+	morphs.push(morphs_other[1]);
+	morphs.push(morphs_other[2]);
+	morphs.push(morphs_other[3]);
+	morphs.push(morphs_other[4]);
+	morphs.push(morphs_other[5]);
+
+	let forehead = Math.floor(App.Art.random() * morphs_forehead.length);
+	if (forehead > 0) {	morphs.push(morphs_forehead[forehead]); }
+
+	let unqiue = Math.floor(App.Art.random() * morphs_unique.length);
+	if (unqiue > 0) {	morphs.push(morphs_unique[unqiue]); }
+
+	let chin = Math.floor(App.Art.random() * morphs_chin.length);
+	if (chin > 0) {	morphs.push(morphs_chin[chin]); }
+
+	let cheeks2 = Math.floor(App.Art.random() * morphs_cheeks2.length);
+	if (cheeks2 > 0) {	morphs.push(morphs_cheeks2[cheeks2]); }
+
+	let cheeks = Math.floor(App.Art.random() * morphs_cheeks.length);
+	if (cheeks > 0) {	morphs.push(morphs_cheeks[cheeks]); }
+
+	let lips = Math.floor(App.Art.random() * morphs_lips.length);
+	if (lips > 0) {	morphs.push(morphs_lips[lips]); }
+
+	let jaw = Math.floor(App.Art.random() * morphs_jaw.length);
+	if (jaw > 0) {	morphs.push(morphs_jaw[jaw]); }
+
+	let nose = Math.floor(App.Art.random() * morphs_nose.length);
+	if (nose > 0) {	morphs.push(morphs_nose[nose]); }
+
+	let eyes = Math.floor(App.Art.random() * morphs_eyes.length);
+	if (eyes > 0) {	morphs.push(morphs_eyes[eyes]); }
+	*/
+
 	if (slave.boobs < 600) {
 		morphs.push(["boobShapeSmall", -(slave.boobs-600)/600]);
 	} else {
@@ -2165,7 +2370,7 @@ App.Art.applyMorphs = function(slave, scene, p) {
 			case "downward-facing":
 				morphs.push(["boobShapeDownward", ((slave.boobs-600)**(1/3)/16) * (175/p.height)]); break;
 			case "wide-set":
-				morphs.push(["boobShapeWide", ((slave.boobs-600)**(1/3)/9) * (175/p.height)]); break;
+				morphs.push(["boobShapeWide", ((slave.boobs-600)**(1/3)/4) * (175/p.height)]); break;
 			case "spherical":
 				// special case to make nipple work
 				if (slave.nipples === "flat" || slave.nipples === "inverted" || !p.applyNipples) {
@@ -2197,9 +2402,12 @@ App.Art.applyMorphs = function(slave, scene, p) {
 		}
 	}
 
-	if (slave.foreskin !== 0 && !scene.inspect) {
-		morphs.push(["foreskin", 1]);
+	let shaftShape = ["shaftShape0", "shaftShape1", "shaftShape2", "shaftShape3", "shaftShape4", "shaftShape5", "shaftShape6"];
+	let shaft = Math.floor(App.Art.random() * shaftShape.length);
+	if (shaft > 0) {
+		morphs.push([shaftShape[shaft], 1]);
 	}
+
 	if (slave.dick === 0 && !(slave.scrotum <= 0 || slave.balls <= 0)) {
 		morphs.push(["dickRemove", 1]);
 	} else if (slave.dick !== 0) {
@@ -2216,7 +2424,7 @@ App.Art.applyMorphs = function(slave, scene, p) {
 		morphs.push(["ballsRemove", 1]);
 	} else {
 		if (slave.balls > 1) {
-			morphs.push(["balls", convertRange(2, 10, 0, 0.75, slave.balls * (175/p.height))]);
+			morphs.push(["balls", convertRange(2, 10, 0, 0.75, slave.balls * 0.6 *(175/p.height))]);
 		}
 
 		if (slave.scrotum > 0) {
@@ -2233,11 +2441,7 @@ App.Art.applyMorphs = function(slave, scene, p) {
 		morphs.push(["muscles", slave.muscles/33]);
 	}
 
-	if (scene.inspect) {
-		morphs.push(["belly", Math.max(0.7, slave.belly**(1/3)/24.6)]); // fix
-	} else {
-		morphs.push(["belly", slave.belly**(1/3)/24.6]);
-	}
+	morphs.push(["belly2", slave.belly**(1/3)/24.6]);
 
 	morphs.push(["hips", slave.hips/2]);
 
@@ -2254,7 +2458,7 @@ App.Art.applyMorphs = function(slave, scene, p) {
 	}
 
 	if (slave.weight >= 0) {
-		morphs.push(["weight", slave.weight/75]);
+		morphs.push(["weight2", slave.weight/300]);
 	} else {
 		morphs.push(["weightThin", -slave.weight/80]);
 	}
@@ -2265,20 +2469,24 @@ App.Art.applyMorphs = function(slave, scene, p) {
 		morphs.push(["physicalAgeOld", (slave.visualAge-20)/52]);
 	}
 
-	if (!hasLeftArm(slave)) {
+	if (!slave.arm.left) {
 		morphs.push(["amputeeLeftArm", 1]);
 	}
-	if (!hasRightArm(slave)) {
+	if (!slave.arm.right) {
 		morphs.push(["amputeeRightArm", 1]);
 	}
-	if (!hasLeftLeg(slave)) {
+	if (!slave.leg.left) {
 		morphs.push(["amputeeLeftLeg", 1]);
 	}
-	if (!hasRightLeg(slave)) {
+	if (!slave.leg.right) {
 		morphs.push(["amputeeRightLeg", 1]);
 	}
 
-	morphs.push(["offset", 3]); // only applies to clothes
+	if (slave.dick > 0 || slave.scrotum > 0 || slave.balls > 0) {
+		morphs.push(["bulge", Math.max(slave.dick/4, 0)]);
+	}
+
+	morphs.push(["offset", 2]); // only applies to clothes
 
 	App.Art.resetMorphs(scene);
 
-- 
GitLab