code:
App.EndWeek.rulesAssistantReport = function() {
	const frag = $(document.createDocumentFragment());
	for (const slave of V.slaves) {
		if (slave.useRulesAssistant === 1) {
			try {
				frag.append(DefaultRules(slave));
			} catch (e) {
				console.log("Exception thrown in rule evaluation:", slave, e);
				frag.append(`<p><span class="error">Exception thrown executing Rules Assistant for ${SlaveFullName(slave)}: "${e.message}". One of your rules is probably broken.</span></p>`);
			}
		}
	}
	return frag[0];
};

repo_name: Welptard/fc

license: mit


code:
/**
 * @param {App.Entity.SlaveState} slave
 */
App.SlaveAssignment.agent = function(slave) {
	const gigantomastiaMod = slave.geneticQuirks.gigantomastia === 2 ? (slave.geneticQuirks.macromastia === 2 ? 3 : 2) : 1;

	if (slave.boobsImplantType === "string") {
		slave.boobsImplant += 50;
		slave.boobs += 50;
		if (slave.boobs > 50000) {
			slave.boobs -= 100;
			slave.boobsImplant -= 100;
			if (slave.geneMods.NCS === 1) {
				slave.boobs -= 100;
				slave.boobsImplant -= 100;
			}
		}
	}

	if (slave.geneMods.NCS === 1) { /* NCS is blocking boob expansion. */
		if (slave.boobsImplant > 1000) {
			if ((slave.boobs - slave.boobsImplant < 1000) && (random(1, 100) > 60)) {
				slave.boobs += 50;
			}
		} else if (slave.boobsImplant > 600) {
			if ((slave.boobs - slave.boobsImplant < 500) && (random(1, 100) > 60)) {
				slave.boobs += 50;
			}
		} else if (slave.boobsImplant > 0) {
			if ((slave.boobs - slave.boobsImplant < 300) && (random(1, 100) > 60)) {
				slave.boobs += 50;
			}
		}
	}
	if (slave.geneticQuirks.macromastia === 2 && slave.geneticQuirks.gigantomastia === 2) {
		if (slave.boobs < 100000 && slave.weight >= -95) {
			slave.boobs += 30;
		}
	} else if (slave.geneticQuirks.gigantomastia === 2) {
		if (slave.boobs < 25000 && slave.weight >= -95) {
			slave.boobs += 20;
		}
	} else if (slave.geneticQuirks.macromastia === 2) {
		if (slave.boobs < 5000 && slave.weight >= -95) {
			slave.boobs += 10;
		}
	}
	if (slave.buttImplantType === "string") {
		slave.buttImplant += 0.25;
		slave.butt += 0.25;
		if (slave.butt > 10) {
			slave.butt -= 1;
			slave.buttImplant -= 1;
			if (slave.geneMods.NCS === 1) {
				slave.butt -= 1;
				slave.buttImplant -= 1;
			}
		}
	}
	if (slave.geneticQuirks.rearLipedema === 2 && slave.butt < 20) {
		slave.butt += 0.1;
	}

	if (slave.genes === "XX") {
		if (slave.ovaries === 1 || slave.mpreg === 1) {
			if (slave.balls > 0 && slave.ballType !== "sterile") {
				if (slave.hormoneBalance > 20) {
					slave.hormoneBalance -= 1;
				} else if (slave.hormoneBalance < 20) {
					slave.hormoneBalance += 1;
				}
			} else {
				if (slave.hormoneBalance > 60) {
					slave.hormoneBalance -= 1;
				} else if (slave.hormoneBalance < 60) {
					slave.hormoneBalance += 1;
				}
			}
		} else {
			if (slave.balls > 0 && slave.ballType !== "sterile") {
				if (slave.hormoneBalance > -20) {
					slave.hormoneBalance -= 1;
				} else if (slave.hormoneBalance < -20) {
					slave.hormoneBalance += 1;
				}
			} else {
				if (slave.hormoneBalance > 20) {
					slave.hormoneBalance -= 1;
				} else if (slave.hormoneBalance < 20) {
					slave.hormoneBalance += 1;
				}
			}
		}
	} else if (slave.genes === "XY") {
		if (slave.ovaries === 1 || slave.mpreg === 1) {
			if (slave.balls > 0 && slave.ballType !== "sterile") {
				if (slave.hormoneBalance > 20) {
					slave.hormoneBalance -= 1;
				} else if (slave.hormoneBalance < 20) {
					slave.hormoneBalance += 1;
				}
			} else {
				if (slave.hormoneBalance > 40) {
					slave.hormoneBalance -= 1;
				} else if (slave.hormoneBalance < 40) {
					slave.hormoneBalance += 1;
				}
			}
		} else {
			if (slave.balls > 0 && slave.ballType !== "sterile") {
				if (slave.hormoneBalance > -40) {
					slave.hormoneBalance -= 1;
				} else if (slave.hormoneBalance < -40) {
					slave.hormoneBalance += 1;
				}
			} else {
				if (slave.hormoneBalance > 20) {
					slave.hormoneBalance -= 1;
				} else if (slave.hormoneBalance < 20) {
					slave.hormoneBalance += 1;
				}
			}
		}
	}

	/* puberty - not announced for allowing surprise pregnancy */
	if (slave.ovaries === 1 || slave.mpreg === 1) {
		if (slave.pubertyXX === 0) {
			if (slave.physicalAge >= slave.pubertyAgeXX) {
				slave.pubertyXX = 1;
				if (slave.geneticQuirks.gigantomastia === 3 && random(1, 100) < slave.hormoneBalance) {
					slave.geneticQuirks.gigantomastia = 2;
				}
				if (slave.geneticQuirks.macromastia === 3 && random(1, 100) < slave.hormoneBalance) {
					slave.geneticQuirks.macromastia = 2;
				}
				if (slave.geneticQuirks.galactorrhea === 3) {
					slave.geneticQuirks.galactorrhea = 2;
					if (random(1, 100) < slave.hormoneBalance && slave.lactation === 0) {
						slave.lactationDuration = 2;
						slave.lactation = 1;
					}
				}
			}
		}
	}
	if (slave.balls > 0 && slave.ballType !== "sterile") {
		if (slave.pubertyXY === 0) {
			if (slave.physicalAge >= slave.pubertyAgeXY) {
				slave.pubertyXY = 1;
				if (slave.geneticQuirks.galactorrhea === 3) {
					slave.geneticQuirks.galactorrhea = 2;
					if (random(1, 100) < slave.hormoneBalance && slave.lactation === 0) {
						slave.lactationDuration = 2;
						slave.lactation = 1;
					}
				}
			}
		}
	}

	if (slave.inflation > 0) {
		deflate(slave);
	}

	if (slave.preg > 0) { // EFFECTS OF PREGNANCY
		if (slave.preg === slave.pregData.normalBirth / 8) { /* !!! Very bad condition logic - with pregnancy control drugs can be not triggered. Or may be trigged by broodmother several times. Need to be reworked. !!! */
			if (slave.pregSource === -1) {
				V.PC.counter.slavesKnockedUp++;
			} else if (slave.pregSource > 0) {
				const babyDaddy = findFather(slave.pregSource);
				if (babyDaddy) {
					const adjust = babyDaddy.counter.slavesKnockedUp++;
					adjustFatherProperty(babyDaddy, "slavesKnockedUp", adjust);
				}
			}
		}
		if (slave.preg >= slave.pregData.normalBirth / 4) {
			if (slave.geneticQuirks.gigantomastia === 3 && random(1, 200) < slave.hormoneBalance) {
				slave.geneticQuirks.gigantomastia = 2;
			}
			if (slave.geneticQuirks.macromastia === 3 && random(1, 200) < slave.hormoneBalance) {
				slave.geneticQuirks.macromastia = 2;
			}
			let boobTarget = 0;
			if (slave.geneMods.NCS === 1) {
				/* Sort-of No-op, NCS prevents boob growth */
				boobTarget = 0;
			} else if (slave.physicalAge >= 18) {
				if (slave.pregType >= 50) {
					boobTarget = 10000;
				} else if (slave.pregType >= 30) {
					boobTarget = 5000;
				} else if (slave.pregType >= 10) {
					boobTarget = 2000;
				} else {
					boobTarget = 1000;
				}
			} else if (slave.physicalAge >= 13) {
				if (slave.pregType >= 50) {
					boobTarget = 5000;
				} else if (slave.pregType >= 30) {
					boobTarget = 3200;
				} else if (slave.pregType >= 10) {
					boobTarget = 1800;
				} else {
					boobTarget = 800;
				}
			} else if (slave.physicalAge >= 8) {
				if (slave.pregType >= 50) {
					boobTarget = 1800;
				} else if (slave.pregType >= 30) {
					boobTarget = 1400;
				} else if (slave.pregType >= 10) {
					boobTarget = 1000;
				} else {
					boobTarget = 600;
				}
			} else {
				if (slave.pregType >= 50) {
					boobTarget = 1000;
				} else if (slave.pregType >= 30) {
					boobTarget = 800;
				} else if (slave.pregType >= 10) {
					boobTarget = 600;
				} else {
					boobTarget = 400;
				}
			}
			boobTarget *= gigantomastiaMod;
			if (slave.pregType >= 30) {
				if (slave.weight <= 65) {
					slave.weight += 1;
				}
				if ((slave.geneMods.NCS === 0) && (random(1, 100) > 60)) {
					if ((slave.boobs - slave.boobsImplant) < boobTarget) {
						slave.boobs += 200;
						if (slave.boobShape !== "saggy" && slave.preg > slave.pregData.normalBirth / 1.25 && (slave.breastMesh !== 1)) {
							slave.boobShape = "saggy";
						}
					}
					if (slave.hips < 2) {
						slave.hips += 1;
					}
					if (slave.butt < 14) {
						slave.butt += 1;
					}
				}
			} else if ((slave.geneMods.NCS === 0) && (slave.pregType >= 10)) {
				if (random(1, 100) > 80 && ((slave.boobs - slave.boobsImplant) < boobTarget)) {
					slave.boobs += 100;
					if (slave.boobShape !== "saggy" && (slave.breastMesh !== 1)) {
						if (slave.preg > random(slave.pregData.normalBirth / 1.25, slave.pregData.normalBirth * 2)) {
							slave.boobShape = "saggy";
						}
					}
				}
			} else if (((slave.geneMods.NCS === 0) && ((slave.boobs - slave.boobsImplant) < boobTarget))) {
				if (random(1, 100) > 80) {
					slave.boobs += 50;
					if (slave.boobShape !== "saggy" && slave.preg > random(slave.pregData.normalBirth / 1.25, slave.pregData.normalBirth * 2.5) && (slave.breastMesh !== 1)) {
						slave.boobShape = "saggy";
					}
				}
			}
			if (slave.geneMods.NCS === 1) {
				/* No-op, we don't grow hips on NCS */
			} else if (slave.preg > slave.pregData.normalBirth / 1.25 && slave.physicalAge >= 18 && slave.hips === 1 && slave.hipsImplant === 0 && random(1, 100) > 90) {
				slave.hips += 1;
			} else if (slave.preg > slave.pregData.normalBirth / 1.42 && slave.physicalAge >= 18 && slave.hips === 0 && slave.hipsImplant === 0 && random(1, 100) > 70) {
				slave.hips += 1;
			}
			if (slave.bellyPreg >= 1500) {
				if (setup.fakeBellies.includes(slave.bellyAccessory)) {
					slave.bellyAccessory = "none";
				}
				if ((slave.preg > slave.pregData.normalBirth / 2) && (slave.lactation === 0) && slave.health.condition >= -20 && slave.weight > -30) {
					if (slave.preg > random(slave.pregData.normalBirth / 2.22, slave.pregData.normalBirth / 1.33)) {
						slave.lactation = 1;
					}
				}
				if (slave.lactation === 1) {
					slave.lactationDuration = 2;
				}
			}
		} // closes .preg >= 10
	} // END PREG EFFECTS

	if (slave.belly >= 1000000) {
		if (slave.bellySag < 50) {
			slave.bellySag += 1;
			if (slave.preg > 0) {
				slave.bellySagPreg += 1;
			}
		} else if (slave.preg > 0 && slave.bellySagPreg < 20) {
			slave.bellySagPreg += 1;
		}
		if (slave.pregControl === "speed up") {
			slave.bellySag += 5;
			slave.bellySagPreg += 5;
		}
		if (slave.geneMods.rapidCellGrowth === 1) {
			slave.bellySag += 3;
			if (slave.preg > 0) {
				slave.bellySagPreg += 3;
			}
		}
	} else if (slave.belly >= 750000) {
		if (slave.bellySag < 30) {
			slave.bellySag += 0.7;
			if (slave.preg > 0) {
				slave.bellySagPreg += 0.7;
			}
		} else if (slave.preg > 0 && slave.bellySagPreg < 30) {
			slave.bellySagPreg += 0.7;
		}
		if (slave.pregControl === "speed up") {
			slave.bellySag += 2;
			slave.bellySagPreg += 2;
		}
		if (slave.geneMods.rapidCellGrowth === 1) {
			slave.bellySag += 1;
			if (slave.preg > 0) {
				slave.bellySagPreg += 1;
			}
		}
	} else if (slave.belly >= 600000) {
		if (slave.bellySag < 20) {
			slave.bellySag += 0.5;
			if (slave.preg > 0) {
				slave.bellySagPreg += 0.5;
			}
		} else if (slave.preg > 0 && slave.bellySagPreg < 20) {
			slave.bellySagPreg += 0.5;
		}
		if (slave.pregControl === "speed up") {
			slave.bellySag += 1;
			slave.bellySagPreg += 1;
		}
		if (slave.geneMods.rapidCellGrowth === 1) {
			slave.bellySag += 1;
			if (slave.preg > 0) {
				slave.bellySagPreg += 1;
			}
		}
	} else if (slave.belly >= 450000) {
		if (slave.bellySag < 15) {
			slave.bellySag += 0.4;
			if (slave.preg > 0) {
				slave.bellySagPreg += 0.4;
			}
		} else if (slave.preg > 0 && slave.bellySagPreg < 15) {
			slave.bellySagPreg += 0.4;
		}
		if (slave.pregControl === "speed up") {
			slave.bellySag += 0.6;
			slave.bellySagPreg += 0.6;
		}
		if (slave.geneMods.rapidCellGrowth === 1) {
			slave.bellySag += 0.5;
			if (slave.preg > 0) {
				slave.bellySagPreg += 0.5;
			}
		}
	} else if (slave.belly >= 300000) {
		if (slave.bellySag < 10) {
			slave.bellySag += 0.3;
			if (slave.preg > 0) {
				slave.bellySagPreg += 0.3;
			}
		} else if (slave.preg > 0 && slave.bellySagPreg < 10) {
			slave.bellySagPreg += 0.3;
		}
		if (slave.pregControl === "speed up") {
			slave.bellySag += 0.5;
			slave.bellySagPreg += 0.5;
		}
		if (slave.geneMods.rapidCellGrowth === 1) {
			slave.bellySag += 0.5;
			if (slave.preg > 0) {
				slave.bellySagPreg += 0.5;
			}
		}
	} else if (slave.belly >= 100000) {
		if (slave.bellySag < 10) {
			slave.bellySag += 0.2;
			if (slave.preg > 0) {
				slave.bellySagPreg += 0.2;
			}
		} else if (slave.preg > 0 && slave.bellySagPreg < 10) {
			slave.bellySagPreg += 0.2;
		}
		if (slave.pregControl === "speed up") {
			slave.bellySag += 0.3;
			slave.bellySagPreg += 0.3;
		}
		if (slave.geneMods.rapidCellGrowth === 1) {
			slave.bellySag += 0.3;
			if (slave.preg > 0) {
				slave.bellySagPreg += 0.3;
			}
		}
	} else if ((slave.bellyPreg >= 10000) || (slave.bellyImplant >= 10000)) {
		if (slave.bellySag < 5) {
			slave.bellySag += 0.1;
			if (slave.preg > 0) {
				slave.bellySagPreg += 0.1;
			}
		} else if (slave.preg > 0 && slave.bellySagPreg < 5) {
			slave.bellySagPreg += 0.1;
		}
		if (slave.pregControl === "speed up") {
			slave.bellySag += 0.2;
			slave.bellySagPreg += 0.2;
		}
		if (slave.geneMods.rapidCellGrowth === 1) {
			slave.bellySag += 0.2;
			if (slave.preg > 0) {
				slave.bellySagPreg += 0.2;
			}
		}
	}
	if (slave.bellySagPreg > slave.bellySag) {
		slave.bellySagPreg = slave.bellySag;
	}

	if (slave.bellySag > 0 && slave.belly < 1500 && slave.geneMods.rapidCellGrowth !== 1) {
		if (slave.muscles > 95) {
			if (random(1, 100) > 1) {
				if (slave.bellySagPreg > 0) {
					slave.bellySag -= 0.5;
					slave.bellySagPreg -= 0.5;
					if (slave.bellySag < 0) {
						slave.bellySag = 0;
						slave.bellySagPreg = 0;
					}
				} else {
					slave.bellySag -= 0.5;
					if (slave.bellySag < 0) {
						slave.bellySag = 0;
					}
				}
			}
		} else if (slave.muscles >= 30) {
			if (random(1, 100) > 20) {
				if (slave.bellySagPreg > 0) {
					slave.bellySag -= 0.4;
					slave.bellySagPreg -= 0.4;
					if (slave.bellySag < 0) {
						slave.bellySag = 0;
						slave.bellySagPreg = 0;
					}
				} else {
					slave.bellySag -= 0.4;
					if (slave.bellySag < 0) {
						slave.bellySag = 0;
					}
				}
			}
		} else if (slave.muscles >= 5) {
			if (random(1, 100) > 40) {
				if (slave.bellySagPreg > 0) {
					slave.bellySag -= 0.3;
					slave.bellySagPreg -= 0.3;
					if (slave.bellySag < 0) {
						slave.bellySag = 0;
						slave.bellySagPreg = 0;
					}
				} else {
					slave.bellySag -= 0.3;
					if (slave.bellySag < 0) {
						slave.bellySag = 0;
					}
				}
			}
		} else {
			if (random(1, 100) > 60) {
				if (slave.bellySagPreg > 0) {
					slave.bellySag -= 0.2;
					slave.bellySagPreg -= 0.2;
					if (slave.bellySag < 0) {
						slave.bellySag = 0;
						slave.bellySagPreg = 0;
					}
				} else {
					slave.bellySag -= 0.2;
					if (slave.bellySag < 0) {
						slave.bellySag = 0;
					}
				}
			}
		}
	}

	if ((slave.preg > slave.pregData.minLiveBirth) && (slave.broodmother === 0) && (random(1, 100) < 90)) {
		slave.counter.birthsTotal += WombBirthReady(slave, slave.pregData.minLiveBirth);
		WombBirth(slave, slave.pregData.minLiveBirth);
		WombFlush(slave);
		if (slave.geneticQuirks.fertility + slave.geneticQuirks.hyperFertility >= 4) {
			slave.pregWeek = -2;
		} else if (slave.geneticQuirks.hyperFertility > 1) {
			slave.pregWeek = -3;
		} else {
			slave.pregWeek = -4;
		}
		if (slave.birthsTat > -1) {
			slave.birthsTat++;
		}
	} else if ((slave.preg > slave.pregData.normalBirth) && (slave.broodmother === 0)) {
		slave.counter.birthsTotal += WombBirthReady(slave, slave.pregData.minLiveBirth);
		WombBirth(slave, slave.pregData.minLiveBirth);
		WombFlush(slave);
		if (slave.geneticQuirks.fertility + slave.geneticQuirks.hyperFertility >= 4) {
			slave.pregWeek = -2;
		} else if (slave.geneticQuirks.hyperFertility > 1) {
			slave.pregWeek = -3;
		} else {
			slave.pregWeek = -4;
		}
		if (slave.birthsTat > -1) {
			slave.birthsTat++;
		}
	} else if ((slave.preg > 37) && (slave.broodmother > 0)) {
		if (slave.broodmother > 0) {
			slave.counter.birthsTotal += WombBirthReady(slave, 37);
			WombBirth(slave, 37);
			slave.preg = WombMaxPreg(slave);
		}
		if (slave.birthsTat > -1) {
			slave.birthsTat++;
		}
	}

	SetBellySize(slave); // Actually it's now better to set belly size without checking of any conditions. Just to be sure. Should correct forgotten variables too.

	if (slave.lactation === 1) {
		if (slave.fetish !== "boobs") {
			if (slave.lactationDuration === 0) {
				slave.boobs -= slave.boobsMilk;
				slave.boobsMilk = 0;
				slave.lactation = 0;
			} else if (slave.lactationDuration === 1) {
				slave.boobsMilk += 10 * slave.lactationAdaptation;
				slave.boobs += slave.boobsMilk;
			} else {
				slave.lactationDuration--;
			}
		} else {
			slave.lactationDuration = 2;
		}
	} else if (slave.lactation === 2) {
		slave.lactationDuration = 2;
	} else if (slave.fetish === "boobs" && slave.boobs - slave.boobsImplant >= 2000) {
		slave.induceLactation += 2;
		if (slave.lactationDuration >= 20) {
			slave.induceLactation = 0;
			slave.lactationDuration = 2;
			slave.lactation = 1;
		}
	}

	if (slave.induceLactation > 0) {
		slave.induceLactation--;
	}
	if (slave.lactation === 0 && slave.geneticQuirks.galactorrhea === 2 && random(1, 100) <= slave.hormoneBalance) {
		slave.lactationDuration = 2;
		slave.lactation = 1;
	}

	if (slave.geneticQuirks.neoteny === 3 && slave.physicalAge >= 12) {
		slave.geneticQuirks.neoteny = 2;
	}
	if (slave.geneticQuirks.progeria === 3 && slave.physicalAge >= 3) {
		slave.geneticQuirks.progeria = 2;
	}
	if (slave.geneticQuirks.gigantomastia === 3 && random(70 - slave.physicalAge, 300) < slave.hormoneBalance) {
		slave.geneticQuirks.gigantomastia = 2;
	}
	if (slave.geneticQuirks.macromastia === 3 && random(70 - slave.physicalAge, 300) < slave.hormoneBalance) {
		slave.geneticQuirks.macromastia = 2;
	}

	if (slave.geneticQuirks.uterineHypersensitivity === 2) {
		if (slave.vaginaLube < 2 && slave.vagina > 0 && random(70 - slave.physicalAge, 200) < slave.hormoneBalance) {
			slave.vaginaLube += 1;
		}
		if (slave.geneMods.NCS === 0) {
			if (slave.hips < 2 && random(70 - slave.physicalAge, 300) < slave.hormoneBalance && slave.physicalAge > 9 && slave.physicalAge < 20) {
				slave.hips += 1;
			}
		}
	}

	if (slave.geneMods.immortality === 1) {
		if (slave.physicalAge > 26) {
			slave.physicalAge--;
		}
		if (slave.visualAge > 26) {
			slave.visualAge--;
		}
	}
	if (slave.geneticQuirks.progeria === 2 && slave.birthWeek > 2) {
		if (((slave.birthWeek - 2) % 5) === 0) {
			slave.physicalAge++;
			slave.visualAge++;
			slave.ovaryAge += 5;
		}
	}

	if ((slave.hStyle !== "shaved" && slave.bald !== 1 && slave.haircuts === 0) && (slave.hLength < 150)) {
		slave.hLength += 1;
	}

	slave.health.illness = 0;
};


code:
App.SlaveAssignment.beYourHeadGirl = (function() {
	"use strict";

	let r;

	// eslint-disable-next-line no-unused-vars
	let he, him, his, hers, himself, girl, loli, He, His, wife, wives;

	let fetishChange;
	let arcology;

	return saBeYourHeadGirl;

	/**
	 * @param {App.Entity.SlaveState} slave
	 * @returns {string}
	 */
	function saBeYourHeadGirl(slave) {
		r = [];
		fetishChange = fetishChangeChance(slave);
		arcology = V.arcologies[0];

		({
			// eslint-disable-next-line no-unused-vars
			he, him, his, hers, himself, girl, He, His, loli, wife, wives
		} = getPronouns(slave));

		updateHGState(slave);
		jobPreface(slave);
		theHGLife(slave);
		if (V.personalAttention === "HG") {
			playerHelpsHG(slave);
		}
		if (V.HGFormality === 0) {
			HGFormality(slave);
		}
		jobEffects(slave);
		if (slave.prestige === 0) {
			prestigeGain(slave);
		}
		cleanupVars(slave);

		return r.join(" ");
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 *
	 */
	function updateHGState(slave) {
		V.HGTimeInGrade += 1;
		if (V.HGSuite === 1) {
			slave.rules.living = "luxurious";
		}
		slave.rules.rest = "restrictive";
		tired(slave);
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 * */
	function jobPreface(slave) {
		if (arcology.FSEgyptianRevivalistLaw === 0) {
			r.push(`helps manage your other slaves. ${He} helps them when they try and fail, and punishes them when they fail to try.`);
		} else {
			r.push(`serves as your Consort. Though ${he} is still your slave, ${his} status is scarcely below that of a citizen. ${He} contributes to your reputation just like a Concubine, and ${he} is conscious of the trust you place in ${him}.`);
			slave.devotion += 1;
			slave.trust += 1;
			App.SlaveAssignment.pleaseYou(slave);
			if (slave.relationship > 4) {
				if (slave.relationshipTarget === V.ConcubineID) {
					const concubine = S.Concubine;
					if (areRelated(concubine, slave)) {
						const concubinePronouns = getPronouns(concubine);
						if (concubine.mother === slave.ID || concubine.father === slave.ID) {
							r.push(`Your Concubine is your Consort's ${concubinePronouns.daughter}-${concubinePronouns.wife}. Truly, ${arcology.name} looks up to you <span class="green">as children to a father.</span>`);
							repX(1000, "headGirl", slave);
						} else if (slave.mother === V.ConcubineID) {
							r.push(`Your Concubine is your Consort's mother-${concubinePronouns.wife}. Truly, ${arcology.name} looks up to you <span class="green">as children to a father.</span>`);
							repX(1000, "headGirl", slave);
						} else if (slave.father === V.ConcubineID) {
							r.push(`Your Concubine is your Consort's father-${concubinePronouns.wife}. Truly, ${arcology.name} looks up to you <span class="green">as children to a father.</span>`);
							repX(1000, "headGirl", slave);
						} else {
							switch (areSisters(slave, concubine)) {
								case 1:
									r.push(`Your Concubine is your Consort's twin-${concubinePronouns.wife}. Truly, ${arcology.name} looks up to you <span class="green">as children to a father.</span>`);
									repX(1000, "headGirl", slave);
									break;
								case 2:
									r.push(`Your Concubine is your Consort's ${concubinePronouns.sister}-${concubinePronouns.wife}. Truly, ${arcology.name} looks up to you <span class="green">as children to a father.</span>`);
									repX(1000, "headGirl", slave);
									break;
								case 3:
									r.push(`Your Concubine is your Consort's half-${concubinePronouns.sister}-${concubinePronouns.wife}. Truly, ${arcology.name} looks up to you <span class="green">as children to a father.</span>`);
									repX(1000, "headGirl", slave);
									break;
								default:
									r.push(`<span style="bold">Shit went wrong! Post this in a bug report!</span> This is <span class="red">NOT as it should be.</span>`);
									repX(500, "headGirl", slave);
							}
						}
					}
				} else {
					if (totalRelatives(slave) > 0) {
						let relation = getSlave(slave.relationshipTarget);
						const relationPronouns = getPronouns(relation);
						if (relation.mother === slave.ID || relation.father === slave.ID) {
							r.push(`Your Consort has a ${relationPronouns.daughter}-${relationPronouns.wife}. This is <span class="green">as it should be.</span>`);
							repX(500, "headGirl", slave);
						} else if (slave.mother === relation.ID) {
							r.push(`Your Consort has a mother-${relationPronouns.wife}. This is <span class="green">as it should be.</span>`);
							repX(500, "headGirl", slave);
						} else if (slave.father === relation.ID) {
							r.push(`Your Consort has a father-${relationPronouns.wife}. This is <span class="green">as it should be.</span>`);
							repX(500, "headGirl", slave);
						} else {
							switch (areSisters(slave, relation)) {
								case 1:
									r.push(`Your Consort has a twin-${relationPronouns.wife}. This is <span class="green">as it should be.</span>`);
									repX(500, "headGirl", slave);
									break;
								case 2:
									r.push(`Your Consort has a ${relationPronouns.sister}-${relationPronouns.wife}. This is <span class="green">as it should be.</span>`);
									repX(500, "headGirl", slave);
									break;
								case 3:
									r.push(`Your Consort has a half-${relationPronouns.sister}-${relationPronouns.wife}. This is <span class="green">as it should be.</span>`);
									repX(500, "headGirl", slave);
									break;
							}
						}
					}
				}
			}
		}
		if (App.EndWeek.saVars.HGEnergy === 0) {
			r.push(`${He} notices ${his} <span class="red">fatigue getting in the way</span> of training your slaves, so ${he} focuses ${his} attention on ${himself} this week to <span class="green">rectify this.</span>`);
		}
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 * */
	function theHGLife(slave) {
		if (V.HGTimeInGrade > 12) {
			if (V.HGSuite === 1) {
				r.push(`Being continually trusted with this position increases ${his} devotion to you, and encourages ${him} to trust you in turn; ${he}'s also grateful for ${his} nice suite, which makes ${him} one of the best provided for slaves in the Free Cities.`);
				slave.devotion += 4;
				slave.trust += 4;
			} else if (slave.rules.living === "luxurious") {
				r.push(`Being continually trusted with this position <span class="hotpink">increases ${his} devotion to you</span> and encourages ${him} to <span class="mediumaquamarine">trust you in turn.</span>`);
				slave.devotion += 4;
				slave.trust += 4;
			} else {
				r.push(`Being continually trusted with this position slightly increases ${his} devotion to you, though ${he} harbors some doubts because ${he} isn't allowed a room of ${his} own to set ${him} apart from the other slaves.`);
				slave.devotion += 1;
			}
		} else {
			if (V.HGSuite === 1) {
				r.push(`${He}'s <span class="mediumaquamarine">grateful</span> for ${his} nice suite, which makes ${him} one of the best provided for slaves in the Free Cities.`);
				slave.trust += 4;
			} else if (slave.rules.living !== "luxurious" && slave.devotion <= 50) {
				r.push(`Given ${his} lofty position, ${he} harbors some doubts in ${his} value to you since ${he} isn't allowed a room of ${his} own to set ${him} apart from the other slaves.`);
				slave.devotion -= 2;
			}
		}
		if (slave.rules.living !== "luxurious") {
			r.push(`${His} duties are <span class="red">physically and mentally taxing,</span> especially with nothing more than a`);
			if (slave.rules.living === "normal") {
				r.push(`bed`);
			} else {
				r.push(`cot`);
			}
			r.push(`waiting for ${him} in the slave dormitory.`);
		}
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 *
	 */
	function playerHelpsHG(slave) {
		r.push(`You're cooperating with ${him} this week, working with ${V.assistant.name} to free up some of ${his} time so ${he} can target more slaves in need of individual attention.`);
		if (slave.trust > 95) {
			r.push(`${He} is so trusting of you that ${he} can act as your own right hand, allowing ${him} to oversee your slaves with remarkable efficiency.`);
		} else {
			r.push(`This arrangement <span class="mediumaquamarine">builds trust</span> between you.`);
			slave.trust += 2;
		}
		if (slave.health.tired > 30) {
			r.push(`It also takes a load off ${his} tired shoulders.`);
		}
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 *
	 */
	function HGFormality(slave) {
		if (slave.trust > 95) {
			r.push(`Every so often, when you're alone, ${he} calls you ${properTitle()}. ${He} treats your permission to do this as a sacred thing, and <span class="hotpink">loves you for it.</span>`);
			slave.devotion += 1;
		} else {
			r.push(`Your permission to be informal in private <span class="mediumorchid">confuses ${him}</span> a little, since ${he} isn't perfectly confident enough to be comfortable with the idea.`);
			slave.devotion -= 1;
		}
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 *
	 */
	function jobEffects(slave) {
		if (slave.fetishKnown === 1) {
			if (slave.fetish === "dom") {
				if (slave.fetishKnown === 1 && slave.fetishStrength <= 95) {
					r.push(`Having all the slaves look up to and obey ${him} advances ${his} <span class="lightcoral">dominant tendencies.</span>`);
					slave.fetishStrength += 4;
				}
			} else if (fetishChange > jsRandom(0, 100)) {
				r.push(`Having all the slaves look up to and obey ${him} affects ${his} sexuality, turning ${him} into a <span class="lightcoral">bit of a dominatrix.</span>`);
				slave.fetish = "dom";
				slave.fetishStrength = 20;
				slave.fetishKnown = 1;
			} else if (slave.fetishStrength <= jsRandom(20, 60)) {
				r.push(`The sheer variety of sexual situations ${he} sees and participates in <span class="pink">broaden ${his} sexual interests</span> and incline ${him} to take a dominant sexual role.`);
				slave.fetishStrength -= 4;
			}
		} else {
			if (slave.fetish === "dom") {
				r.push(`Having all the slaves look up to and obey ${him} clearly excites ${him}; <span class="lightcoral">${he}'s a natural dom!</span>`);
			} else if (fetishChange > jsRandom(0, 100)) {
				r.push(`Having all the slaves look up to and obey ${him} affects ${his} sexuality, turning ${him} into a <span class="lightcoral">bit of a dominatrix.</span>`);
				slave.fetish = "dom";
				slave.fetishStrength = 20;
				slave.fetishKnown = 1;
			}
		}

		if (slave.rules.lactation === "induce") {
			r.push(`${He} works mammary stimulation into ${his} slave training regimen in an effort to bring in ${his} milk for you.`);
			slave.induceLactation += 3;
			r.push(`${induceLactation(slave)}`);
			if (slave.lactation === 1) {
				slave.rules.lactation = "maintain";
			}
		} else if (slave.rules.lactation === "maintain") {
			r.push(`Proper nursing and milking technique is a strong aspect of ${his} slave training regimen, both to keep ${his} milk flowing and to prevent the mounting pressure from distracting from ${his} work.`);
			slave.lactationDuration = 2;
			slave.boobs -= slave.boobsMilk;
			slave.boobsMilk = 0;
		}

		if (slave.dick > 0 && V.universalRulesImpregnation === "HG" && canPenetrate(slave)) {
			r.push(`${He} finds ${his} duty to impregnate slaves at will sexually satisfying.`);
			slave.need = 0;
		} else if (V.slaves.length > 5) {
			r.push(`Seldom a day goes by without ${him} finding an outlet among your slaves for ${his} sexual desires.`);
			slave.need = 0;
		}
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 *
	 */
	function prestigeGain(slave) {
		if (V.HGTimeInGrade + ((slave.intelligence + slave.intelligenceImplant) / 10) + (slave.devotion / 10) + (slave.trust / 10) > 50) {
			r.push(`${slave.slaveName} has rendered such long and competent service as your Head Girl that many of your citizens have come to rely on ${his} word as an extension of yours, trusting that if ${he} does something, it's because you trust ${him} to. ${He} has become prestigious on ${his} own merits, a remarkable achievement for a slave!`);
			slave.prestige += 1;
			slave.prestigeDesc = `Many citizens respect $his long and able service as your Head Girl.`;
		}
	}

	/**
	 * @param {App.Entity.SlaveState} slave
	 *
	 */
	function cleanupVars(slave) {
		if (!setup.HGCareers.includes(slave.career) && slave.skill.headGirl < V.masteredXP) {
			slave.skill.headGirl += jsRandom(1, Math.ceil((slave.intelligence + slave.intelligenceImplant) / 15) + 8);
		}
		slave.health.tired = Math.clamp(slave.health.tired, 0, 1000);
	}
})();