From 4cc92230480f45a82807c9e3dcfbeb33b0e10263 Mon Sep 17 00:00:00 2001
From: DCoded <dcoded@live.com>
Date: Mon, 7 Sep 2020 16:04:08 -0400
Subject: [PATCH] Added lethality() and virginities()

---
 js/003-data/gameVariableData.js |   2 +-
 src/facilities/pit/pit.js       | 148 +++++++++++++++++++++++++++++++-
 src/facilities/pit/pit.tw       |   3 +-
 3 files changed, 150 insertions(+), 3 deletions(-)

diff --git a/js/003-data/gameVariableData.js b/js/003-data/gameVariableData.js
index 39d517ca622..c99a864ddf7 100644
--- a/js/003-data/gameVariableData.js
+++ b/js/003-data/gameVariableData.js
@@ -800,7 +800,7 @@ App.Data.resetOnNGPlus = {
 	pitAnimalType: null,
 	pitAudience: "none",
 	pitLethal: false,
-	pitVirginities: false,
+	pitVirginities: "neither",
 	pitFought: 0,
 	pit: null,
 	pitName: "the Pit",
diff --git a/src/facilities/pit/pit.js b/src/facilities/pit/pit.js
index 6d652878f27..08da6cc6a48 100644
--- a/src/facilities/pit/pit.js
+++ b/src/facilities/pit/pit.js
@@ -6,10 +6,21 @@ App.Facilities.Pit.pit = function() {
 			FREE: "free",
 			PAID: "paid",
 		},
+		Virginities = {
+			NEITHER: "neither",
+			VAGINAL: "vaginal",
+			ANAL: "anal",
+			ALL: "all",
+		},
 
 		none = Audience.NONE,
 		free = Audience.FREE,
-		paid = Audience.PAID;
+		paid = Audience.PAID,
+
+		neither = Virginities.NEITHER,
+		vaginal = Virginities.VAGINAL,
+		anal = Virginities.ANAL,
+		all = Virginities.ALL;
 
 	V.nextButton = "Back to Main";
 	V.nextLink = "Main";
@@ -24,6 +35,7 @@ App.Facilities.Pit.pit = function() {
 	App.UI.DOM.appendNewElement("div", frag, audience());
 	if (V.killChoice !== 2) {
 		App.UI.DOM.appendNewElement("div", frag, fighters());
+		App.UI.DOM.appendNewElement("div", frag, lethality());
 	}
 
 	App.UI.SlaveList.ScrollPosition.restore();
@@ -188,4 +200,138 @@ App.Facilities.Pit.pit = function() {
 
 		return frag;
 	}
+
+	function lethality() {
+		const
+			frag = new DocumentFragment(),
+			linkSpan = document.createElement("span");
+
+		if (V.pitLethal) {
+			if (V.pitAnimal) {
+				frag.append(`The fighter will be armed with a sword and will fight to the death. `);
+
+				linkSpan.append(
+					App.UI.DOM.passageLink("Nonlethal", "Pit", () => {
+						V.pitLethal = false;
+					})
+				);
+			} else {
+				frag.append(`Fighters will be armed with swords, and fights will be to the death. `);
+
+				linkSpan.append(
+					App.UI.DOM.passageLink("Nonlethal", "Pit", () => {
+						V.pitLethal = false;
+					})
+				);
+			}
+		} else {
+			if (V.pitAnimal) {
+				frag.append(`The slave will be restrained and will try to avoid becoming the animal's plaything. `);
+
+				linkSpan.append(
+					App.UI.DOM.passageLink("Lethal", "Pit", () => {
+						V.pitLethal = true;
+					})
+				);
+			} else {
+				frag.append(`Fighters will use their fists and feet, and fights will be to submission. `);
+
+				linkSpan.append(
+					App.UI.DOM.passageLink("Lethal", "Pit", () => {
+						V.pitLethal = true;
+					})
+				);
+			}
+		}
+
+		frag.appendChild(linkSpan);
+
+		if (!V.pitLethal && !V.pitAnimal) {
+			frag.appendChild(virginities());
+		}
+
+
+
+		function virginities() {
+			const
+				mainDiv = document.createElement("div"),
+				boldSpan = App.UI.DOM.makeElement("span", '', "bold"),
+				linkSpan = document.createElement("span"),
+
+				links = [];
+
+			if (V.pitVirginities === neither) {
+				boldSpan.append(`No`);
+
+				mainDiv.append(boldSpan, ` virginities of the loser will be respected.`);
+
+				links.push(
+					App.UI.DOM.passageLink("Vaginal", "Pit", () => {
+						V.pitVirginities = vaginal;
+					}),
+					App.UI.DOM.passageLink("Anal", "Pit", () => {
+						V.pitVirginities = anal;
+					}),
+					App.UI.DOM.passageLink("All", "Pit", () => {
+						V.pitVirginities = all;
+					})
+				);
+			} else if (V.pitVirginities === vaginal) {
+				boldSpan.append(`Vaginal`);
+
+				mainDiv.append(boldSpan, ` virginity of the loser will be respected.`);
+
+				links.push(
+					App.UI.DOM.passageLink("Neither", "Pit", () => {
+						V.pitVirginities = neither;
+					}),
+					App.UI.DOM.passageLink("Anal", "Pit", () => {
+						V.pitVirginities = anal;
+					}),
+					App.UI.DOM.passageLink("All", "Pit", () => {
+						V.pitVirginities = all;
+					})
+				);
+			} else if (V.pitVirginities === anal) {
+				boldSpan.append(`Anal`);
+
+				mainDiv.append(boldSpan, ` virginity of the loser will be respected.`);
+
+				links.push(
+					App.UI.DOM.passageLink("Neither", "Pit", () => {
+						V.pitVirginities = neither;
+					}),
+					App.UI.DOM.passageLink("Vaginal", "Pit", () => {
+						V.pitVirginities = vaginal;
+					}),
+					App.UI.DOM.passageLink("All", "Pit", () => {
+						V.pitVirginities = all;
+					})
+				);
+			} else {
+				boldSpan.append(`All`);
+
+				mainDiv.append(boldSpan, ` virginities of the loser will be respected.`);
+
+				links.push(
+					App.UI.DOM.passageLink("Neither", "Pit", () => {
+						V.pitVirginities = neither;
+					}),
+					App.UI.DOM.passageLink("Vaginal", "Pit", () => {
+						V.pitVirginities = vaginal;
+					}),
+					App.UI.DOM.passageLink("Anal", "Pit", () => {
+						V.pitVirginities = anal;
+					})
+				);
+			}
+
+			linkSpan.append(App.UI.DOM.generateLinksStrip(links));
+			mainDiv.appendChild(linkSpan);
+
+			return mainDiv;
+		}
+
+		return frag;
+	}
 };
diff --git a/src/facilities/pit/pit.tw b/src/facilities/pit/pit.tw
index 9944d5358d4..65bcdccce63 100644
--- a/src/facilities/pit/pit.tw
+++ b/src/facilities/pit/pit.tw
@@ -58,6 +58,7 @@ $pitNameCaps is clean and ready,
 		<</if>>
 	<</if>>
 */
+/*
 	<br>
 	<<if $pitLethal == 1>>
 		<<if $pitAnimal == 1>>
@@ -96,7 +97,7 @@ $pitNameCaps is clean and ready,
 			The slave will be restrained and will try to avoid being used by the animal. [[Lethal|Pit][$pitLethal = 1]]
 		<</if>>
 	<</if>>
-
+*/
 	<<if $activeCanine != 0 || $activeHooved != 0 || $activeFeline != 0>>
 
 	<<switch $activeCanine.breed>>
-- 
GitLab