From 91e75d22b4e02e7b50a11048170c7051506acebe Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Mon, 6 Jan 2020 21:51:59 -0500
Subject: [PATCH] scar templates

---
 src/js/modification.js | 60 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/src/js/modification.js b/src/js/modification.js
index 28a8f6e41d4..22da5e6f257 100644
--- a/src/js/modification.js
+++ b/src/js/modification.js
@@ -103,3 +103,63 @@ App.Medicine.Modification.addScourged = function(slave, weight) {
 		App.Medicine.Modification.addScar(slave, scarArray[i], "chain", weight);
 	}
 };
+
+/**
+ * Scars a slave over a large section of their body.
+ * @param {App.Entity.SlaveState} slave
+ * @param {string} location full, upper, lower, left or right
+ * @param {string} type whip, burn, surgical, generic
+ * @param {int} weight
+ */
+App.Medicine.Modification.addBulkScars = function(slave, location, type, weight) {
+	let scarArray = [];
+
+	/* Divide slave into quarters, and add each quarter as needed. */
+
+	/* Top left */
+	if (["left", "upper", "full"].includes(location)) {
+		scarArray.push("left breast");
+		if (getLeftArmID(slave) === 1) {
+			scarArray.push("left upper arm", "left lower arm", "left hand");
+		}
+	}
+
+	/* Top right */
+	if (["right", "upper", "full"].includes(location)) {
+		scarArray.push("right breast");
+		if (getRightArmID(slave) === 1) {
+			scarArray.push("right upper arm", "right lower arm", "right hand");
+		}
+	}
+
+	/* Lower left */
+	if (["left", "lower", "full"].includes(location)) {
+		scarArray.push("left buttock");
+		if (getLeftLegID(slave) === 1) {
+			scarArray.push("left thigh", "left calf", "left foot");
+		}
+	}
+
+	/* Lower Right */
+	if (["right", "lower", "full"].includes(location)) {
+		scarArray.push("right buttock");
+		if (getRightLegID(slave) === 1) {
+			scarArray.push("right thigh", "right calf", "right foot");
+		}
+	}
+
+	/* Extra */
+	if (["upper", "full"].includes(location)) {
+		scarArray.push("back", "lower back");
+	}
+
+	if (scarArray.length === 0) {
+		return;
+	}
+
+	let i = 0;
+	for (i = 0; i < scarArray.length; i++) {
+		App.Medicine.Modification.addScar(slave, scarArray[i], type, weight);
+	}
+};
+
-- 
GitLab