From f69b35188b9104aadff6c644456a35df6bc6f171 Mon Sep 17 00:00:00 2001
From: DCoded <dcoded@live.com>
Date: Sun, 4 Oct 2020 23:56:26 -0400
Subject: [PATCH] Bugfix, added new variable anAnimal, changed variable
 declarations

---
 .../backwardsCompatibility.js                 |   2 +
 src/npc/interaction/fAnimal.js                | 107 +++++++++---------
 2 files changed, 54 insertions(+), 55 deletions(-)

diff --git a/src/data/backwardsCompatibility/backwardsCompatibility.js b/src/data/backwardsCompatibility/backwardsCompatibility.js
index 57ee89fac23..bf22323b35e 100644
--- a/src/data/backwardsCompatibility/backwardsCompatibility.js
+++ b/src/data/backwardsCompatibility/backwardsCompatibility.js
@@ -361,6 +361,8 @@ App.Update.globalVariables = function(node) {
 
 	if (V.felines.some(e => typeof e !== "string")) {
 		V.felines = V.felines.filter(e => typeof e === "string");
+	}
+
 	// Pit
 	if (typeof V.pit === "number") {
 		V.pit = V.pit ? {} : null;
diff --git a/src/npc/interaction/fAnimal.js b/src/npc/interaction/fAnimal.js
index 0df0539565d..11e4b3f50ed 100644
--- a/src/npc/interaction/fAnimal.js
+++ b/src/npc/interaction/fAnimal.js
@@ -3,29 +3,27 @@
  * @param {App.Entity.SlaveState} slave
  */
 App.Interact.fAnimal = function(slave, type) {
-	const
-		frag = new DocumentFragment(),
+	const frag = new DocumentFragment();
 
-		{He, he, him, His, his, girl} = getPronouns(slave),
+	const {He, he, him, His, his, girl} = getPronouns(slave);
 
-		Acts = {
-			VAGINAL: "vaginal",
-			ANAL: "anal",
-			ORAL: "oral",
-		},
+	const Acts = {
+		VAGINAL: "vaginal",
+		ANAL: "anal",
+		ORAL: "oral",
+	};
 
-		vaginal = Acts.VAGINAL,
-		anal = Acts.ANAL,
-		oral = Acts.ORAL,
+	const vaginal = Acts.VAGINAL;
+	const anal = Acts.ANAL;
+	const oral = Acts.ORAL;
 
-		approvingFetishes = ["masochist", "humiliation", "perverted", "sinful"];	// not strictly fetishes, but approvingFetishesAndBehavioralQuirksAndSexualQuirks doesn't have the same ring to it
+	const approvingFetishes = ["masochist", "humiliation", "perverted", "sinful"];	// not strictly fetishes, but approvingFetishesAndBehavioralQuirksAndSexualQuirks doesn't have the same ring to it
 
-	let
-		animal,
-		fetishDesc,
-		act,
-		hole,
-		orifice = [];
+	let animal;
+	let fetishDesc;
+	let act;
+	let hole;
+	let orifice = [];
 
 	switch (type) {
 		case "canine":
@@ -39,6 +37,8 @@ App.Interact.fAnimal = function(slave, type) {
 			break;
 	}
 
+	const anAnimal = animal.articleAn ? `an ${animal.name}` : `a ${animal.name}`;
+
 	if (slave.assignment === Job.FUCKTOY || slave.assignment === Job.MASTERSUITE) {
 		if (slave.toyHole === "pussy") {
 			act = vaginal;
@@ -63,16 +63,13 @@ App.Interact.fAnimal = function(slave, type) {
 		act = oral;
 	}
 
-	const
-		isVowel = e => /[aeiou]/.test(e),
-		a = isVowel(animal.name.charAt(0).toLowerCase()) ? `an` : `a`,
-		slaveApproves = () =>
-			approvingFetishes.includes(slave.fetish) ||
-			approvingFetishes.includes(slave.sexualQuirk) ||
-			approvingFetishes.includes(slave.behavioralQuirk) ||
-			slave.fetish === "buttslut" && act === anal ||
-			slave.fetish === "cumslut" && act === oral ||
-			slave.sexualQuirk === "gagfuck queen" && act === oral;
+	const slaveApproves = () =>
+		approvingFetishes.includes(slave.fetish) ||
+		approvingFetishes.includes(slave.sexualQuirk) ||
+		approvingFetishes.includes(slave.behavioralQuirk) ||
+		slave.fetish === "buttslut" && act === anal ||
+		slave.fetish === "cumslut" && act === oral ||
+		slave.sexualQuirk === "gagfuck queen" && act === oral;
 
 	switch (act) {
 		case oral:
@@ -121,9 +118,9 @@ App.Interact.fAnimal = function(slave, type) {
 	// MARK: Intro Functions
 
 	function intro() {
-		const
-			mainSpan = document.createElement("span"),
-			r = [];
+		const mainSpan = document.createElement("span");
+
+		const r = [];
 
 		if (canWalk(slave)) {
 			r.push(`You call ${him} over and`);
@@ -135,7 +132,7 @@ App.Interact.fAnimal = function(slave, type) {
 			`suck off` :
 			act === vaginal ?
 				`get fucked by` :
-				`get fucked in the ass by`} ${a} ${animal.name}. `);
+				`get fucked in the ass by`} ${anAnimal}. `);
 
 		if (slave.fetish === "mindbroken") {
 			r.push(`${slave.slaveName} nods ${his} head dumbly, ${his} eyes vacant${!canSee(slave) ? ` as always` : ``}. `);
@@ -205,7 +202,7 @@ App.Interact.fAnimal = function(slave, type) {
 					}
 				} else {
 					if (slaveApproves()) {
-						mainSpan.append(`${slave.slaveName} clearly has some reservations about having ${his} ${act === anal ? `anal ` : ``}virginity taken by ${a} ${fetishDesc}, but the thought of ${fetishDesc} is enough to make agree to comply. `);
+						mainSpan.append(`${slave.slaveName} clearly has some reservations about having ${his} ${act === anal ? `anal ` : ``}virginity taken by ${anAnimal}, but the thought of ${fetishDesc} is enough to make agree to comply. `);
 					} else {
 						mainSpan.append(`${slave.slaveName} tries in vain to conceal ${his} horror at the thought of having ${his} precious ${act === anal ? `rosebud` : `pearl`} taken by a beast, but quickly regains ${his} composure. `);
 					}
@@ -233,7 +230,7 @@ App.Interact.fAnimal = function(slave, type) {
 					}
 				} else {
 					if (slaveApproves()) {
-						mainSpan.append(`${slave.slaveName} clearly has some reservations about having ${his} ${act === anal ? `anal ` : ``}virginity taken by ${a} ${fetishDesc}, but the thought of ${fetishDesc} is enough to make agree to comply. `);
+						mainSpan.append(`${slave.slaveName} clearly has some reservations about having ${his} ${act === anal ? `anal ` : ``}virginity taken by ${anAnimal}, but the thought of ${fetishDesc} is enough to make agree to comply. `);
 					} else {
 						mainSpan.append(`${slave.slaveName} tries in vain to conceal ${his} horror at the thought of having ${his} precious ${act === anal ? `rosebud` : `pearl`} taken by a beast${canWalk(slave) ? `, and only the threat of worse punishment keeps ${him} from running away as fast as ${he} can` : ``}. `);
 					}
@@ -303,7 +300,7 @@ App.Interact.fAnimal = function(slave, type) {
 					if (slaveApproves()) {
 						r.push(`The slave seems to quickly get over the fact that the dick currently in ${his} mouth belongs to a canine as ${his} more carnal desires kick in. `);
 					} else {
-						r.push(`The slave visibly gags as the unfamiliar texture of ${a} ${animal.name}'s cock fills it, then gives a groan as the beast thrusts, filling ${his} throat. `);
+						r.push(`The slave visibly gags as the unfamiliar texture of ${anAnimal}'s cock fills it, then gives a groan as the beast thrusts, filling ${his} throat. `);
 					}
 				} else {
 					if (canWalk(slave)) {
@@ -321,7 +318,7 @@ App.Interact.fAnimal = function(slave, type) {
 					if (slaveApproves()) {
 						r.push(`The slave seems to quickly get over the fact that dick currently in ${his} mouth is not a human one as ${his} more carnal desires kick in. `);
 					} else {
-						r.push(`The slave visibly gags as the unfamiliar texture of ${a} ${animal.name}'s cock fills it, then gives a groan as the beast thrusts, stretching ${his} poor throat to the limit. `);
+						r.push(`The slave visibly gags as the unfamiliar texture of ${anAnimal}'s cock fills it, then gives a groan as the beast thrusts, stretching ${his} poor throat to the limit. `);
 					}
 				} else {
 					r.push(`${slave.slaveName} gives a long, drawn-out moan as the huge phallus fills ${his} ${act === vaginal ? `pussy` : `asshole`} nearly to its breaking point. `);
@@ -331,9 +328,9 @@ App.Interact.fAnimal = function(slave, type) {
 			function consummationDevotedFeline(type) {
 				if (type === oral) {
 					if (slaveApproves()) {
-						r.push(`The slave seems to quickly get over the fact that dick currently in ${his} mouth belongs to ${a} ${animal.name} as ${his} more carnal desires kick in. `);
+						r.push(`The slave seems to quickly get over the fact that dick currently in ${his} mouth belongs to ${anAnimal} as ${his} more carnal desires kick in. `);
 					} else {
-						r.push(`The slave visibly gags as the unfamiliar texture of ${a} ${animal.name}'s cock fills it, then gives a groan as the beast thrusts, the barbs on its cock rubbing the inside of ${his} mouth raw. `);
+						r.push(`The slave visibly gags as the unfamiliar texture of ${anAnimal}'s cock fills it, then gives a groan as the beast thrusts, the barbs on its cock rubbing the inside of ${his} mouth raw. `);
 					}
 				} else {
 					r.push(`${slave.slaveName} gives a squeal of pain as the barbed cock makes its way into ${his} ${act === vaginal ? `pussy` : `asshole`}. `);
@@ -377,9 +374,9 @@ App.Interact.fAnimal = function(slave, type) {
 			function consummationNondevotedCanine(type) {
 				if (type === oral) {
 					if (slaveApproves()) {
-						r.push(`Though the slave still seems to have some reservations about sucking off an animal, ${he} seems to forget that the cock in ${his} mouth belongs to ${a} ${animal.name} soon enough, once ${his} carnal desires kick in. `);
+						r.push(`Though the slave still seems to have some reservations about sucking off an animal, ${he} seems to forget that the cock in ${his} mouth belongs to ${anAnimal} soon enough, once ${his} carnal desires kick in. `);
 					} else {
-						r.push(`The slave visibly gags as the unfamiliar texture of ${a} ${animal.name}'s cock fills it, and you get the feeling ${he} is beginning to reevaluate just how much ${he} wants to avoid punishment. `);
+						r.push(`The slave visibly gags as the unfamiliar texture of ${anAnimal}'s cock fills it, and you get the feeling ${he} is beginning to reevaluate just how much ${he} wants to avoid punishment. `);
 					}
 				} else {
 					if (canWalk(slave)) {
@@ -395,9 +392,9 @@ App.Interact.fAnimal = function(slave, type) {
 			function consummationNondevotedHooved(type) {
 				if (type === oral) {
 					if (slaveApproves()) {
-						r.push(`Though the slave still seems to have some reservations about sucking off ${a} ${animal.name}, ${he} seems to forget that the cock in ${his} mouth isn't human soon enough, once ${his} carnal desires kick in. `);
+						r.push(`Though the slave still seems to have some reservations about sucking off ${anAnimal}, ${he} seems to forget that the cock in ${his} mouth isn't human soon enough, once ${his} carnal desires kick in. `);
 					} else {
-						r.push(`The slave visibly gags as the unfamiliar texture of ${a} ${animal.name}'s cock fills it, and you get the feeling ${he} is beginning to reevaluate just how much ${he} wants to avoid punishment. `);
+						r.push(`The slave visibly gags as the unfamiliar texture of ${anAnimal}'s cock fills it, and you get the feeling ${he} is beginning to reevaluate just how much ${he} wants to avoid punishment. `);
 					}
 				} else {
 					r.push(`${slave.slaveName} gives a long, drawn-out groan as the huge phallus fills ${his} ${act === vaginal ? `pussy` : `asshole`} nearly to its breaking point. `);
@@ -409,7 +406,7 @@ App.Interact.fAnimal = function(slave, type) {
 					if (slaveApproves()) {
 						r.push(`Though the slave still seems to have some reservations about sucking off an animal, ${he} seems to forget that the cock in ${his} mouth belongs to a feline soon enough, once ${his} carnal desires kick in. `);
 					} else {
-						r.push(`The slave visibly gags as the unfamiliar texture of ${a} ${animal.name}'s barbed dick fills it, and you get the feeling ${he} is beginning to reevaluate just how much ${he} wants to avoid punishment. `);
+						r.push(`The slave visibly gags as the unfamiliar texture of ${anAnimal}'s barbed dick fills it, and you get the feeling ${he} is beginning to reevaluate just how much ${he} wants to avoid punishment. `);
 					}
 				} else {
 					r.push(`${slave.slaveName} gives a squeal of pain as the barbed cock makes its way into ${his} ${act === vaginal ? `pussy` : `asshole`}. `);
@@ -453,9 +450,9 @@ App.Interact.fAnimal = function(slave, type) {
 			function consummationNonresistantCanine(type) {
 				if (type === oral) {
 					if (slaveApproves()) {
-						r.push(`Though the slave still seems to have some reservations about sucking off an animal, ${he} seems to forget that the cock in ${his} mouth belongs to ${a} ${animal.name} soon enough, once ${his} carnal desires kick in. `);
+						r.push(`Though the slave still seems to have some reservations about sucking off an animal, ${he} seems to forget that the cock in ${his} mouth belongs to ${anAnimal} soon enough, once ${his} carnal desires kick in. `);
 					} else {
-						r.push(`The slave visibly gags as the unfamiliar texture of ${a} ${animal.name}'s cock fills it, and you get the feeling ${he} is beginning to reevaluate just how much ${he} wants to avoid punishment. `);
+						r.push(`The slave visibly gags as the unfamiliar texture of ${anAnimal}'s cock fills it, and you get the feeling ${he} is beginning to reevaluate just how much ${he} wants to avoid punishment. `);
 					}
 				} else {
 					if (canWalk(slave)) {
@@ -471,9 +468,9 @@ App.Interact.fAnimal = function(slave, type) {
 			function consummationNonresistantHooved(type) {
 				if (type === oral) {
 					if (slaveApproves()) {
-						r.push(`Though the slave still seems to have some reservations about sucking off ${a} ${animal.name}, ${he} seems to forget that the cock in ${his} mouth isn't human soon enough, once ${his} carnal desires kick in. `);
+						r.push(`Though the slave still seems to have some reservations about sucking off ${anAnimal}, ${he} seems to forget that the cock in ${his} mouth isn't human soon enough, once ${his} carnal desires kick in. `);
 					} else {
-						r.push(`The slave visibly gags as the unfamiliar texture of ${a} ${animal.name}'s cock fills it, and you get the feeling ${he} is beginning to reevaluate just how much ${he} wants to avoid punishment. `);
+						r.push(`The slave visibly gags as the unfamiliar texture of ${anAnimal}'s cock fills it, and you get the feeling ${he} is beginning to reevaluate just how much ${he} wants to avoid punishment. `);
 					}
 				} else {
 					r.push(`${slave.slaveName} gives a long, drawn-out groan as the huge phallus fills ${his} ${act === vaginal ? `pussy` : `asshole`} nearly to its breaking point. `);
@@ -485,7 +482,7 @@ App.Interact.fAnimal = function(slave, type) {
 					if (slaveApproves()) {
 						r.push(`Though the slave still seems to have some reservations about sucking off an animal, ${he} seems to forget that the cock in ${his} mouth belongs to a feline soon enough, once ${his} carnal desires kick in. `);
 					} else {
-						r.push(`The slave visibly gags as the unfamiliar texture of ${a} ${animal.name}'s barbed dick fills it, and you get the feeling ${he} is beginning to reevaluate just how much ${he} wants to avoid punishment. `);
+						r.push(`The slave visibly gags as the unfamiliar texture of ${anAnimal}'s barbed dick fills it, and you get the feeling ${he} is beginning to reevaluate just how much ${he} wants to avoid punishment. `);
 					}
 				} else {
 					r.push(`${slave.slaveName} gives a squeal of pain as the barbed cock makes its way into ${his} ${act === vaginal ? `pussy` : `asshole`}. `);
@@ -538,7 +535,7 @@ App.Interact.fAnimal = function(slave, type) {
 								`a slight blush to ${his} cheeks`}
 							tells you that ${he}'s enjoying this, at least a little. `);
 					} else {
-						r.push(`The slave visibly gags as the unfamiliar texture of ${a} ${animal.name}'s cock fills it, and you get the feeling ${he} would have run away a long time ago if ${he} wasn't a little tied up at the moment. `);
+						r.push(`The slave visibly gags as the unfamiliar texture of ${anAnimal}'s cock fills it, and you get the feeling ${he} would have run away a long time ago if ${he} wasn't a little tied up at the moment. `);
 					}
 				} else {
 					if (canWalk(slave)) {
@@ -563,7 +560,7 @@ App.Interact.fAnimal = function(slave, type) {
 								`a slight blush to ${his} cheeks`}
 							tells you that ${he}'s enjoying this, at least a little. `);
 					} else {
-						r.push(`The slave visibly gags as the unfamiliar texture of ${a} ${animal.name}'s cock fills it, and you get the feeling ${he} would have run away a long time ago if ${he} wasn't a little tied up at the moment. `);
+						r.push(`The slave visibly gags as the unfamiliar texture of ${anAnimal}'s cock fills it, and you get the feeling ${he} would have run away a long time ago if ${he} wasn't a little tied up at the moment. `);
 					}
 				} else {
 					r.push(`${slave.slaveName} lets out a blood-curdling scream as the huge phallus fills ${his} ${act === vaginal ? `pussy` : `asshole`} nearly to its breaking point. `);
@@ -582,7 +579,7 @@ App.Interact.fAnimal = function(slave, type) {
 								`a slight blush to ${his} cheeks`}
 							tells you that ${he}'s enjoying this, at least a little. `);
 					} else {
-						r.push(`The slave visibly gags as the unfamiliar texture of ${a} ${animal.name}'s barbed dick fills it, and you get the feeling ${he} would have run away a long time ago if ${he} wasn't a little tied up at the moment .`);
+						r.push(`The slave visibly gags as the unfamiliar texture of ${anAnimal}'s barbed dick fills it, and you get the feeling ${he} would have run away a long time ago if ${he} wasn't a little tied up at the moment .`);
 					}
 				} else {
 					r.push(`${slave.slaveName} lets out a blood-curdling scream as the barbed cock makes its way into ${his} ${act === vaginal ? `pussy` : `asshole`}. `);
@@ -714,21 +711,21 @@ App.Interact.fAnimal = function(slave, type) {
 			switch (act) {
 				case oral:
 					if (slave.energy < 95 && slave.sexualFlaw !== "hates oral") {
-						mainSpan.append(`Having ${a} ${animal.name} fuck ${his} throat by force has given ${him} a hatred of oral sex. `);
+						mainSpan.append(`Having ${anAnimal} fuck ${his} throat by force has given ${him} a hatred of oral sex. `);
 					}
 					slave.sexualFlaw = "hates oral";
 
 					break;
 				case vaginal:
 					if (slave.energy < 95 && slave.sexualFlaw !== "hates penetration") {
-						mainSpan.append(`Having ${a} ${animal.name} fuck ${him} by force has given ${him} a hatred of penetration. `);
+						mainSpan.append(`Having ${anAnimal} fuck ${him} by force has given ${him} a hatred of penetration. `);
 					}
 					slave.sexualFlaw = "hates penetration";
 
 					break;
 				case anal:
 					if (slave.energy < 95 && slave.sexualFlaw !== "hates anal") {
-						mainSpan.append(`Having ${a} ${animal.name} fuck ${his} asshole by force has given ${him} a hatred of anal penetration. `);
+						mainSpan.append(`Having ${anAnimal} fuck ${his} asshole by force has given ${him} a hatred of anal penetration. `);
 					}
 					slave.sexualFlaw = "hates anal";
 
@@ -812,7 +809,7 @@ App.Interact.fAnimal = function(slave, type) {
 						r.push(`though it's only a matter of time before another slave decides to play with ${his} fuckhole. `);
 						break;
 					case Job.HEADGIRL:
-						r.push(`worried that ${his} charges got up to trouble while ${he} enjoyed ${his} ${WrittenMaster(slave)}'s use. `);
+						r.push(`worried that ${his} charges got up to trouble while ${he} enjoyed ${his} ${properMaster()}'s use. `);
 						break;
 					case Job.BODYGUARD:
 						r.push(`so ${he} can be fresh and ready for more sexual use even as ${he} guards your person. `);
-- 
GitLab