From 57c6920b41551de99e9463c1bd2666fc04aeaa0a Mon Sep 17 00:00:00 2001
From: lowercase-donkey <lowercasedonkey@gmail.com>
Date: Mon, 19 Aug 2019 18:28:12 -0400
Subject: [PATCH] fix dupes and fix walkpastlist

---
 src/interaction/main/walkPast.js  | 85 +++++++++++++++++++++++--------
 src/uncategorized/walkPastList.tw | 17 +++++--
 2 files changed, 77 insertions(+), 25 deletions(-)

diff --git a/src/interaction/main/walkPast.js b/src/interaction/main/walkPast.js
index 031739fdb9c..2eb2e2a4e79 100644
--- a/src/interaction/main/walkPast.js
+++ b/src/interaction/main/walkPast.js
@@ -33,14 +33,14 @@ window.walkPast = (function() {
 	let activeSlaveRel;
 	let partnerSlaveRel;
 
-	function walkPast(activeSlave) {
+	function walkPast(activeSlave, fixed) {
 		output = "";
 		V = State.variables;
 		seed = jsRandom(1, 100);
 		watchArray = [];
 		name = activeSlave.slaveName;
 
-		if (V.familyTesting === 1 && totalRelatives(activeSlave) > 0 && jsRandom(1, 100) > 80) {
+		if (V.familyTesting === 1 && totalRelatives(activeSlave) > 0 && (jsRandom(1, 100) > 80 || (fixed && V.target === "FRelation"))) {
 			V.relation = randomRelatedSlave(activeSlave);
 			if (V.relation.mother === activeSlave.ID || V.relation.father === activeSlave.ID) {
 				V.relationType = "daughter";
@@ -63,13 +63,13 @@ window.walkPast = (function() {
 			}
 			flag = 110;
 			V.partner = "relation";
-		} else if (V.familyTesting === 0 && activeSlave.relation !== 0 && jsRandom(1, 100) > 80) {
+		} else if (V.familyTesting === 0 && activeSlave.relation !== 0 && ((fixed && V.target === "FRelation") || jsRandom(1, 100) > 80)) {
 			flag = 110;
 			V.partner = "relation";
-		} else if (activeSlave.relationship > 0 && jsRandom(1, 100) > 70) {
+		} else if (activeSlave.relationship > 0 && ((fixed && V.target === "FRelation") || jsRandom(1, 100) > 70)) {
 			flag = 120;
 			V.partner = "relationship";
-		} else if (activeSlave.rivalry !== 0 && activeSlave.amp !== 1 && jsRandom(1, 100) > 70) {
+		} else if (activeSlave.rivalry !== 0 && activeSlave.amp !== 1 && ((fixed && V.target === "FRelation") || jsRandom(1, 100) > 70)) {
 			flag = 130;
 			V.partner = "rivalry";
 		} else {
@@ -77,6 +77,15 @@ window.walkPast = (function() {
 			V.partner = "";
 		}
 
+		if ((fixed) // return if we insist on a rival or relation but we didn't find one above
+		&& (
+			["relation", "relationship"].includes(V.partner) && V.target !== "FRelation"
+			|| ["rivalry"].includes(V.partner) && V.target !== "FRival"
+			|| ["FRelation", "FRival"].includes(V.target) && !(V.partner))
+		) {
+			return;
+		}
+
 		output += primeSlave(activeSlave, seed);
 
 		if (V.partner === "rivalry") {
@@ -104,22 +113,58 @@ window.walkPast = (function() {
 			watchArray.push("buttWatch");
 			watchArray.push("lipWatch");
 
-			watch = jsEither(watchArray);
+			if (fixed) {
+				switch (V.target) {
+					case "FLips":
+						output += lipWatch(activeSlave);
+						break;
+					case "FBoobs":
+						output += boobWatch(activeSlave);
+						break;
+					case "FButt":
+						output += buttWatch(activeSlave);
+						break;
+					case "FAnus":
+						output += anusWatch(activeSlave);
+						break;
+					case "FVagina":
+						if (activeSlave.belly < 150000) {
+							if (activeSlave.dick > 0 && (V.sexualOpeness === 1 || activeSlave.toyHole === "dick")) {
+								output += `<br>//Dick scene available:// ${dickWatch(activeSlave)}`;
+							}
+							if (activeSlave.vagina >= 0) {
+								output += `<br>//Vagina scene available:// ${vaginaWatch(activeSlave)}`;
+							}
+						}
+						if (activeSlave.belly >= 1500) {
+							output += `<br>//Belly scene available:// ${bellyWatch(activeSlave)}`;
+						}
+						break;
+					case "FRival":
+						output += boobWatch(activeSlave);
+						break;
+					case "FRelation":
+						output += lipWatch(activeSlave);
+						break;
+				}
+			} else {
+				watch = jsEither(watchArray);
 
-			if (watch === "boobWatch") {
-				output += boobWatch(activeSlave);
-			} else if (watch === "dickWatch") {
-				output += dickWatch(activeSlave);
-			} else if (watch === "vaginaWatch") {
-				output += vaginaWatch(activeSlave);
-			} else if (watch === "bellyWatch") {
-				output += bellyWatch(activeSlave);
-			} else if (watch === "anusWatch") {
-				output += anusWatch(activeSlave);
-			} else if (watch === "buttWatch") {
-				output += buttWatch(activeSlave);
-			} else if (watch === "lipWatch") {
-				output += lipWatch(activeSlave);
+				if (watch === "boobWatch") {
+					output += boobWatch(activeSlave);
+				} else if (watch === "dickWatch") {
+					output += dickWatch(activeSlave);
+				} else if (watch === "vaginaWatch") {
+					output += vaginaWatch(activeSlave);
+				} else if (watch === "bellyWatch") {
+					output += bellyWatch(activeSlave);
+				} else if (watch === "anusWatch") {
+					output += anusWatch(activeSlave);
+				} else if (watch === "buttWatch") {
+					output += buttWatch(activeSlave);
+				} else if (watch === "lipWatch") {
+					output += lipWatch(activeSlave);
+				}
 			}
 		}
 
diff --git a/src/uncategorized/walkPastList.tw b/src/uncategorized/walkPastList.tw
index c795d17dbd1..e342a8a091a 100644
--- a/src/uncategorized/walkPastList.tw
+++ b/src/uncategorized/walkPastList.tw
@@ -39,10 +39,17 @@ Target: <span id="target">$target</span><br>
 <</link>><br>
 
 <h2>Walk Past List</h2>
+
 <<for _i = 0; _i < $slaves.length; _i++>>
-	<<= walkPast($slaves[_i], "fixed")>>
-	<<if $target != _target>>
-		<<set $target = _target>>
-	<</if>>
-	<br><br>
+	<<set $activeSlave = $slaves[_i]>>
+	<<capture $activeSlave>>
+		<<set _print = "">>
+		<<set _print = walkPast($slaves[_i], "fixed")>>
+		<<if _print>>
+			<<print _print + "<br><br>">>
+		<</if>>
+		<<if $target != _target>>
+			<<set $target = _target>>
+		<</if>>
+	<</capture>>
 <</for>>
-- 
GitLab