From ad95b80da5bb56117202fc69110e4ac88bf80987 Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Tue, 29 Jun 2021 21:23:51 -0400
Subject: [PATCH] svorn casting suggestion

---
 .../RE/incest/REresistantmotherdaughter.js    | 41 +++++++------------
 .../RE/incest/reDevotedMotherDaughter.js      | 41 +++++++------------
 src/events/RE/incest/reSiblingRevenge.js      | 38 ++++++-----------
 3 files changed, 43 insertions(+), 77 deletions(-)

diff --git a/src/events/RE/incest/REresistantmotherdaughter.js b/src/events/RE/incest/REresistantmotherdaughter.js
index ad1cd725313..de039f6ce1f 100644
--- a/src/events/RE/incest/REresistantmotherdaughter.js
+++ b/src/events/RE/incest/REresistantmotherdaughter.js
@@ -6,21 +6,20 @@ App.Events.REResistantMotherDaughter = class REResistantMotherDaughter extends A
 	}
 
 	actorPrerequisites() {
-		return [[
-			(s) => s.daughters > 0,
-			(s) => s.devotion > 50,
-			(s) => s.anus !== 0,
-			canWalk,
-			(s) => {
-				for (const daughter of V.slaves) {
-					if (isParentP(daughter, s)) {
-						if ((daughter.devotion < 10) && (daughter.anus !== 0) && canWalk(daughter)) {
-							return true;
-						}
-					}
-				}
-			}
-		]];
+		return [
+			[
+				(s) => s.daughters > 0,
+				(s) => s.devotion > 50,
+				(s) => s.anus !== 0,
+				canWalk,
+			],
+			[
+				s => s.mother === this.actors[0],
+				(s) => s.devotion < 10,
+				(s) => s.anus !== 0,
+				canWalk
+			]
+		];
 	}
 
 	execute(node) {
@@ -28,17 +27,7 @@ App.Events.REResistantMotherDaughter = class REResistantMotherDaughter extends A
 		V.nextLink = "RIE Eligibility Check";
 		let r = [];
 		const mommy = getSlave(this.actors[0]);
-		const candidates = [];
-
-		for (const daughter of V.slaves) {
-			if (isParentP(daughter, mommy)) {
-				if ((daughter.devotion < 10) && (daughter.anus !== 0) && canWalk(daughter)) {
-					candidates.push(daughter);
-				}
-			}
-		}
-
-		const daughter = candidates.pluck();
+		const daughter = getSlave(this.actors[1]);
 		const {
 			he, him, his, mother
 		} = getPronouns(mommy);
diff --git a/src/events/RE/incest/reDevotedMotherDaughter.js b/src/events/RE/incest/reDevotedMotherDaughter.js
index e7f017f9216..19e0087e25d 100644
--- a/src/events/RE/incest/reDevotedMotherDaughter.js
+++ b/src/events/RE/incest/reDevotedMotherDaughter.js
@@ -6,21 +6,20 @@ App.Events.REDevotedMotherDaughter = class REDevotedMotherDaughter extends App.E
 	}
 
 	actorPrerequisites() {
-		return [[
-			(s) => s.daughters > 0,
-			(s) => s.devotion > 50,
-			(s) => s.anus !== 0,
-			canWalk,
-			(s) => {
-				for (const daughter of V.slaves) {
-					if (isParentP(daughter, s)) {
-						if ((daughter.devotion > 50) && (daughter.anus !== 0) && canWalk(daughter)) {
-							return true;
-						}
-					}
-				}
-			}
-		]];
+		return [
+			[
+				(s) => s.daughters > 0,
+				(s) => s.devotion > 50,
+				(s) => s.anus !== 0,
+				canWalk,
+			],
+			[
+				s => s.mother === this.actors[0],
+				(s) => s.devotion > 50,
+				(s) => s.anus !== 0,
+				canWalk
+			]
+		];
 	}
 
 	execute(node) {
@@ -28,17 +27,7 @@ App.Events.REDevotedMotherDaughter = class REDevotedMotherDaughter extends App.E
 		V.nextLink = "RIE Eligibility Check";
 		let r = [];
 		const mommy = getSlave(this.actors[0]);
-		const candidates = [];
-
-		for (const daughter of V.slaves) {
-			if (isParentP(daughter, mommy)) {
-				if ((daughter.devotion > 50) && (daughter.anus !== 0) && canWalk(daughter)) {
-					candidates.push(daughter);
-				}
-			}
-		}
-
-		const daughter = candidates.pluck();
+		const daughter = getSlave(this.actors[1]);
 		const {
 			he, his, mother
 		} = getPronouns(mommy);
diff --git a/src/events/RE/incest/reSiblingRevenge.js b/src/events/RE/incest/reSiblingRevenge.js
index 36cec10e48b..913bf2a3364 100644
--- a/src/events/RE/incest/reSiblingRevenge.js
+++ b/src/events/RE/incest/reSiblingRevenge.js
@@ -6,20 +6,18 @@ App.Events.RESiblingRevenge = class RESiblingRevenge extends App.Events.BaseEven
 	}
 
 	actorPrerequisites() {
-		return [[
-			(s) => s.sisters > 0,
-			(s) => s.origin === "$He was sold into slavery by $his older sister.",
-			canPenetrate,
-			(s) => {
-				for (const olderSis of V.slaves) {
-					if (areSisters(olderSis, s)) {
-						if (olderSis.anus === 0 && s.devotion > (olderSis.devotion + 20)) {
-							return true;
-						}
-					}
-				}
-			}
-		]];
+		return [
+			[
+				(s) => s.sisters > 0,
+				(s) => s.origin === "$He was sold into slavery by $his older sister.",
+				canPenetrate,
+			],
+			[
+				(s) => s.anus === 0,
+				(s) => getSlave(this.actors[0]).devotion > (s.devotion + 20),
+				(s) => areSisters(getSlave(this.actors[0]), s) > 0,
+			]
+		];
 	}
 
 	execute(node) {
@@ -27,17 +25,7 @@ App.Events.RESiblingRevenge = class RESiblingRevenge extends App.Events.BaseEven
 		V.nextLink = "RIE Eligibility Check";
 		let r = [];
 		const youngerSis = getSlave(this.actors[0]);
-		const candidates = [];
-
-		for (const olderSis of V.slaves) {
-			if (areSisters(olderSis, youngerSis)) {
-				if (olderSis.anus === 0 && youngerSis.devotion > (olderSis.devotion + 20)) {
-					candidates.push(olderSis);
-				}
-			}
-		}
-
-		const olderSis = candidates.pluck();
+		const olderSis = getSlave(this.actors[1]);
 		const {
 			He, His,
 			he, him, his, himself,
-- 
GitLab