From 272c9d92f13d11799b3d3e96a9ee827dd3ab7063 Mon Sep 17 00:00:00 2001
From: Trashman1138 <11461-Trashman1138@users.noreply.gitgud.io>
Date: Thu, 11 Jul 2019 17:08:41 -0700
Subject: [PATCH] Replace economyJS.js

---
 src/js/economyJS.js | 26 ++++++++++----------------
 1 file changed, 10 insertions(+), 16 deletions(-)

diff --git a/src/js/economyJS.js b/src/js/economyJS.js
index e435f4fdd23..6c77e5e20ff 100644
--- a/src/js/economyJS.js
+++ b/src/js/economyJS.js
@@ -1143,30 +1143,24 @@ window.slaveJobValues = function() {
 		// Injuries
 		if (s.curatives < 1 && s.inflationType !== "curative") {
 			if (s.health < -50) {
-				s.health -= 8;
+				s.health -= 13;
 				s.minorInjury = 1;
 			} else if (s.health < -20 && jsRandom(1, 100) > 50) {
-				s.health -= 5;
+				s.health -= 10;
 				s.minorInjury = 1;
-			} else if (!canDoVaginal(s)) {
-				if (canDoAnal(s)) {
-					if (jsRandom(1, 100) > 40 + (3 * (s.skill.anal + s.skill.oral)/10)) {
-						s.health -= 5;
-						s.minorInjury = 1;
-					}
-				} else if (jsRandom(1, 100) > 70 + (3/10 * s.skill.oral)) {
-					s.health -= 5;
-					s.minorInjury = 1;
-				}
-			} else if (s.skill.anal + s.skill.oral + s.skill.vaginal < 300) {
-				if (jsRandom(1, 100) > 10 + (3*(s.skill.anal + s.skill.oral + s.skill.vaginal) / 10)) {
+			} else {
+				let skilltarget = (100 + ((s.skill.anal - 100)*canDoAnal(s)*(1 + .5*!canDoVaginal(s)) + (s.skill.vaginal - 100)*canDoVaginal(s)*(1 + .5*!canDoAnal(s)) + (s.skill.oral - 100)*(1 + .5*!canDoAnal(s) + .5*!canDoVaginal(s) + !canDoAnal(s)*!canDoVaginal(s)))*3/10);
+				//Complicated, I know - but it should automatically account for what acts are possible to scale the injury risk smoothly between 90% when totally unskilled
+				//and 0% when perfectly skilled in the relevant method or methods.
+				
+				if (jsRandom(1,100) > skilltarget) {
+					s.health -= 10 - 7*canDoAnal(s)*canDoVaginal(s);		//Any limitations means an injury inflicts the harsher 10 instead of 3
 					s.minorInjury = 1;
 				}
 			}
 		}
-		if (s.minorInjury === 1 && s.assignment === "serve the public") {
+		if (s.minorInjury === 1) {
 			let injuryChance;
-			s.health -= 5;
 			beautyMultiplier -= 0.05;
 			if (canDoAnal(s)) {
 				injuryChance = jsRandom(1, 100);
-- 
GitLab