Skip to content
Snippets Groups Projects
penthouseReport.js 31 KiB
Newer Older
  • Learn to ignore specific revisions
  • App.EndWeek.penthouseReport = function() {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    	const el = document.createElement("p");
    	let r;
    
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    	const HGSuiteSlaves = App.Utils.jobForAssignment(Job.HEADGIRLSUITE).employees();
    
    	const HGTrainSlavesIDs = slavesToTrain();
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    
    	for (const slave of V.slaves) {
    		if (assignmentVisible(slave)) {
    			r = [];
    			const slaveEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report");
    			if (V.seeImages && V.seeReportImages) {
    				App.UI.DOM.appendNewElement("div", slaveEntry, App.Art.SlaveArtElement(slave, 0, 0), ["imageRef", "tinyImg"]);
    			}
    			slaveEntry.append(App.EndWeek.favoriteIcon(slave), " ");
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			r.push(fullReport(slave));
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			App.Events.addNode(el, r, "p");
    
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			if (slave.ID === V.HeadGirlID && HGSuiteSlaves.length > 0) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				/* We found the Head Girl, now let's find her slave */
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				const hgSlave = getSlave(HGSuiteSlaves[0].ID);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				const {He2, he2} = getPronouns(hgSlave).appendSuffix("2");
    				r = [];
    				if (hgSlave.assignment !== "live with your Head Girl") {
    					r.push(`<span class="red">${hgSlave.slaveName} had been assigned to live with your Head Girl, but this week ${he2} was assigned to ${hgSlave.assignment}. ${He2} has been released to your penthouse for reassignment.</span>`);
    					removeJob(hgSlave, "live with your Head Girl");
    				} else {
    					r.push(App.UI.DOM.makeElement("span", SlaveFullName(hgSlave), "slave-name"));
    					if (hgSlave.choosesOwnAssignment === 2) {
    						r.push(App.SlaveAssignment.choosesOwnJob(hgSlave));
    						r.push(He2);
    					}
    					r.push(App.SlaveAssignment.liveWithHG(hgSlave));
    				}
    				App.Events.addNode(el, r, "p");
    			}
    		}
    	}
    
    	/* count open spots in facilities after all assignments have been decided for the week */
    	V.brothelSpots = App.Entity.facilities.brothel.freeSpace;
    	V.clubSpots = App.Entity.facilities.club.freeSpace;
    	V.dairySpots = App.Entity.facilities.dairy.freeSpace;
    	V.servantsQuartersSpots = App.Entity.facilities.servantsQuarters.freeSpace;
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    
    
    	return el;
    
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    	/**
    	 * @param {App.Entity.SlaveState} slave
    	 */
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    	function fullReport(slave) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    		const el = new DocumentFragment();
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    		const {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			He, His,
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			he, him
    		} = getPronouns(slave);
    		let r = [];
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    		let milkResults;
    		let milkResult;
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    		r.push(App.UI.DOM.makeElement("span", SlaveFullName(slave), "slave-name"));
    		if (slave.choosesOwnAssignment === 2) {
    			r.push(App.SlaveAssignment.choosesOwnJob(slave));
    			r.push(He);
    		}
    
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    		switch (slave.assignment) {
    			case "rest":
    				r.push(App.SlaveAssignment.rest(slave));
    				break;
    			case "whore":
    				r.push(App.SlaveAssignment.whore(slave));
    				break;
    			case "serve the public":
    				r.push(App.SlaveAssignment.serveThePublic(slave));
    				break;
    			case "work a glory hole":
    				r.push(App.SlaveAssignment.workAGloryHole(slave));
    				break;
    			case "get milked":
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				milkResults = App.SlaveAssignment.getMilked(slave);
    				r.push(milkResults.text);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				break;
    			case "take classes":
    				r.push(App.SlaveAssignment.takeClasses(slave));
    				break;
    			case "please you":
    				r.push(App.SlaveAssignment.pleaseYou(slave));
    				break;
    			case "be a subordinate slave":
    				r.push(App.SlaveAssignment.serveYourOtherSlaves(slave));
    				break;
    			case "be a servant":
    				r.push(App.SlaveAssignment.servant(slave));
    				break;
    			case "stay confined":
    				r.push(App.SlaveAssignment.stayConfined(slave));
    				break;
    			case "guard you":
    				r.push(App.SlaveAssignment.guardYou(slave));
    				break;
    			case "be your Head Girl":
    				r.push(App.SlaveAssignment.beYourHeadGirl(slave));
    				break;
    			case "recruit girls":
    				r.push(App.SlaveAssignment.recruitGirls(slave));
    				break;
    			default:
    				removeJob(slave, slave.assignment);
    				r.push(App.SlaveAssignment.rest(slave));
    		}
    
    		if (V.servantMilkers === 1 && slave.lactation > 0 && slave.assignment !== "get milked") {
    			r.push(`${His} assignment`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			if (App.Data.misc.servantMilkersJobs.includes(slave.assignment)) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				r.push(`is not strenuous, so ${he}`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				if (slave.devotion > 20) {
    					if (slave.fetish === "boobs") {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    						r.push(`eagerly`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					}
    					r.push(`uses`);
    				} else if (slave.devotion >= -20) {
    					r.push(`is required to use`);
    				} else {
    					r.push(`is forced to use`);
    				}
    				r.push(`the penthouse milkers frequently,`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				milkResult = App.SlaveAssignment.getMilked(slave, 0.5);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			} else {
    				r.push(`keeps ${him} busy, but ${he}`);
    				if (slave.devotion > 20) {
    					if (slave.fetish === "boobs") {
    						r.push(`eagerly`);
    					}
    					r.push(`uses`);
    				} else if (slave.devotion >= -20) {
    					r.push(`is required to use`);
    				} else {
    					r.push(`is forced to use`);
    				}
    				r.push(`the penthouse milkers whenever ${he} can,`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				milkResult = App.SlaveAssignment.getMilked(slave, 0.25);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			}
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			r.push(`and ${he} gives ${milkResult.milk} liters of milk over the week, which is sold for <span class="yellowgreen">${cashFormat(milkResult.milkSale)}.</span>`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    		}
    
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    		App.Events.addNode(el, r, "div");
    
    		r = [];
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    		if (slave.minorInjury !== 0) {
    			r.push(`${His} ${slave.minorInjury} will heal by the end of the week.`);
    		}
    
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    		if (V.showEWD !== 0) {
    			r.push(App.SlaveAssignment.standardSlaveReport(slave, false));
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    		} else {
    			// discard return values silently
    			App.SlaveAssignment.standardSlaveReport(slave, true);
    		}
    
    		if (V.PC.health.shortDamage < 30 && Array.isArray(V.personalAttention) && V.personalAttention.findIndex(function(s) { return s.ID === slave.ID; }) !== -1) {
    			r.push(personalAttention(slave));
    		}
    
    
    		if (HGTrainSlavesIDs.length > 0) {
    			const trainee = HGTrainSlavesIDs.find(trainee => slave.ID === trainee.ID);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			if (trainee) {
    				r.push(HGApplication(slave, trainee.training));
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			}
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    		}
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    		r.push(App.SlaveAssignment.devotion(slave));
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    		App.Events.addNode(el, r);
    		return el;
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    	}
    
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    	/**
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    	 * @param {App.Entity.SlaveState} slave
    	 * @param {string} headGirlsTraining
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    	 */
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    	function HGApplication(slave, headGirlsTraining) {
    
    		const el = document.createElement("span");
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    		const {
    			He, His,
    			he, his, him, himself, girl
    		} = getPronouns(S.HeadGirl);
    		const {he2, his2, him2, himself2, girl2} = getPronouns(slave).appendSuffix("2");
    		let r = [];
    
    		slave.training = Math.clamp(slave.training, 0, 150);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    		let effectiveness = S.HeadGirl.actualAge + ((S.HeadGirl.intelligence + S.HeadGirl.intelligenceImplant) / 3) - (S.HeadGirl.accent * 5) + (V.HGSeverity * 10) + ((slave.intelligence + slave.intelligenceImplant) / 4) - (slave.accent * 5);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    		if (V.AgePenalty === 0) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			effectiveness += Math.max(0, (30 - S.HeadGirl.actualAge));
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    		}
    		if (S.HeadGirl.sexualFlaw === "abusive" && V.HGSeverity >= 0) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			effectiveness += 10;
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    		}
    
    		if (headGirlsTraining !== "health") {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			slave.health.tired += 25;
    		}
    
    		r.push(`<span style="font-weight: bold">Your Head Girl</span> <span class='slave-name'>${S.HeadGirl.slaveName}</span> notices that <span class='slave-name'>${slave.slaveName}</span>`);
    
    		switch (headGirlsTraining) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			case "health":
    				r.push(`is unwell.`);
    				break;
    			case "obedience":
    				r.push(`is disobedient.`);
    				break;
    			case "paraphilia":
    				r.push(`has a paraphilia.`);
    				break;
    			case "flaw":
    				r.push(`has an unpleasant flaw worth fixing.`);
    				break;
    			case "soften":
    				r.push(`has an unpleasant flaw that ${he} can try to soften into a unique quirk.`);
    				break;
    			case "oral skill":
    				r.push(`isn't as orally skilled as ${he} is.`);
    				break;
    			case "anal skill":
    				r.push(`isn't as skilled at taking anal as ${he} is.`);
    				break;
    			case "fuck skill":
    				r.push(`isn't as skilled at vaginal intercourse as ${he} is.`);
    				break;
    			case "whore skill":
    				r.push(`isn't as skilled at the fine art of sex for money as ${he} is.`);
    				break;
    			case "entertain skill":
    				r.push(`isn't as skilled at entertainment as ${he} is.`);
    		}
    
    
    		if (headGirlsTraining === "health") {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			r.push(`${He} helps ${slave.slaveName} however ${he} can. The tender care has <span class="green">improved ${slave.slaveName}'s health.</span>`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			improveCondition(slave, 10);
    			slave.health.tired = Math.clamp(slave.health.tired - 10, 0, 1000);
    			slave.training = 0;
    		} else {
    			if (S.HeadGirl.career === "an arcology owner") {
    				r.push(`${He} was once an arcology owner ${himself}, making ${him} truly peerless as a Head Girl.`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				effectiveness += 50;
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			} else if (setup.HGCareers.includes(S.HeadGirl.career)) {
    				r.push(`${He} was used to giving commands and being obeyed in ${his} life before ${he} was a slave, experience ${he} can call on now.`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				effectiveness += 5;
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			} else if (S.HeadGirl.skill.headGirl >= V.masteredXP) {
    				r.push(`${He} is used to giving commands and being obeyed through experience, rendering ${him} more effective.`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				effectiveness += 5;
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			}
    
    			if (S.HeadGirl.actualAge > 30) {
    				r.push(`${His} age and experience help ${him} as ${he} works with ${slave.slaveName}.`);
    			} else if (S.HeadGirl.actualAge < 25 && V.AgePenalty > 0) {
    				r.push(`${His} youth and inexperience impede ${him} as ${he} works with ${slave.slaveName}.`);
    			}
    
    			if (S.HeadGirl.accent >= 3) {
    				r.push(`${He} does ${his} best to give orders in ${V.language}, but has to resort to a lot of unseemly gesticulation and shouting, making ${him} much less effective.`);
    			} else if (S.HeadGirl.accent === 2) {
    				r.push(`${His} heavy ${aNational(S.HeadGirl.nationality)} accent impedes ${his} clarity in ${V.language}, making ${him} somewhat less effective.`);
    			}
    
    
    			if (headGirlsTraining === "obedience" || headGirlsTraining === "flaw" || headGirlsTraining === "soften") {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				if (S.HeadGirl.intelligence + S.HeadGirl.intelligenceImplant > 50) {
    					if (slave.intelligence + slave.intelligenceImplant > 50) {
    						r.push(`${He} needs ${his} wits about ${him} to mold ${slave.slaveName}, who's quite intelligent ${himself2}.`);
    					} else if (slave.intelligence + slave.intelligenceImplant >= -50) {
    						r.push(`${His} intelligence helps ${him} mold ${slave.slaveName}.`);
    					} else {
    						r.push(`Molding ${slave.slaveName} is very easy, especially for a smart Head Girl like ${him}.`);
    					}
    				}
    			} else {
    				if (S.HeadGirl.intelligence + S.HeadGirl.intelligenceImplant > 50) {
    					if (slave.intelligence + slave.intelligenceImplant > 50) {
    						r.push(`Both slaves are quite intelligent, making ${his} job much easier.`);
    					} else if (slave.intelligence + slave.intelligenceImplant >= -50) {
    						r.push(`${He}'s quite intelligent and can teach ${slave.slaveName} well.`);
    					} else {
    						r.push(`${He} needs all ${his} considerable intelligence to get through to the idiot ${he} has to teach.`);
    					}
    				}
    			}
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			if (V.HGSeverity > 0) {
    				r.push(`Your directives encourage ${him} to rape any slave that fails in the slightest way, a task ${he} approaches`);
    				if (S.HeadGirl.sexualFlaw === "abusive") {
    					r.push(`eagerly, since ${he} prefers to take ${his} pleasure without consent.`);
    				} else if (S.HeadGirl.fetish === "sadist") {
    					r.push(`with sadistic enthusiasm.`);
    				} else if (S.HeadGirl.fetish === "dom") {
    					r.push(`with confidence.`);
    				} else if (S.HeadGirl.energy > 95) {
    					r.push(`as a convenient way to`);
    					if (S.HeadGirl.balls > 0) {
    						r.push(`drain ${his} perpetually overfilled balls into a series of spasming holes.`);
    					} else {
    						r.push(`sate ${his} excess sexual appetite.`);
    					}
    				} else {
    					r.push(`dutifully.`);
    				}
    				if (slave.vagina === 0) {
    					r.push(`In ${slave.slaveName}'s case, ${he}'s careful to limit ${his2} sexual abuse to things that won't take the ${girl2}'s virginity. The slave`);
    				} else if (slave.anus === 0) {
    					r.push(`${He}'s careful to molest ${slave.slaveName} in ways that don't involve penetrating ${his2} virgin ass. The slave`);
    				} else {
    					r.push(`${slave.slaveName}`);
    				}
    				if (slave.devotion > 50) {
    					r.push(`accepts the abuse, believing ${he2} deserves to be raped.`);
    				} else if (slave.devotion >= -20) {
    					r.push(`is <span class="gold">frightened</span> by the unceasing abuse.`);
    					slave.trust -= 1;
    				} else {
    					r.push(`<span class="mediumorchid">hates</span> and <span class="gold">fears</span> the constant abuse.`);
    					slave.trust -= 1;
    					slave.devotion -= 1;
    				}
    				r.push(`${S.HeadGirl.slaveName} makes sure ${his} victim hates it, every time, and ${slave.slaveName} can't help but do ${his2} very best to avoid this treatment.`);
    			} else if (V.HGSeverity === 0) {
    				r.push(`You allow ${him} to use ${his} own judgment when punishing failures,`);
    				if (S.HeadGirl.sexualFlaw === "abusive") {
    					r.push(`and ${he} usually decides in favor of forcing misbehaving slaves to get ${him} off.`);
    				} else if (S.HeadGirl.fetish === "sadist") {
    					r.push(`permission the sadist uses for ${his} own gratification.`);
    				} else if (S.HeadGirl.fetish === "dom") {
    					r.push(`which the dominant ${girl} uses confidently.`);
    				} else if (S.HeadGirl.energy > 95) {
    					r.push(`which ${he} uses to`);
    					if (S.HeadGirl.balls > 0) {
    						r.push(`force ${his} subordinates to keep ${his} balls drained.`);
    					} else {
    						r.push(`extract the constant sexual favors ${his} libido demands.`);
    					}
    				} else {
    					r.push(`and ${he} does ${his} best to be fair.`);
    				}
    				r.push(`${slave.slaveName}`);
    				if (slave.devotion > 50) {
    					r.push(`is <span class="mediumaquamarine">grateful</span> that ${he2} is punished justly when ${he2} makes mistakes.`);
    					slave.trust += 1;
    				} else if (slave.devotion >= -20) {
    					r.push(`does ${his2} best to learn quickly and avoid punishment.`);
    				} else {
    					r.push(`is <span class="gold">scared</span> by ${his2} inability to get away with the smallest disobedience.`);
    					slave.trust -= 1;
    				}
    			} else {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				r.push(`You require ${him} to use respect when punishing; ${he} does ${his} best to motivate, but is unable to use real fear as a tool. ${slave.slaveName} understands this, and <span class="mediumaquamarine">trusts</span> that if ${he2} fails, the consequences won't be too awful.`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				slave.trust += 1;
    			}
    
    
    			if (headGirlsTraining === "obedience") {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				slave.training = 0;
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				effectiveness -= (slave.intelligence + slave.intelligenceImplant) / 3;
    				if (effectiveness <= 0) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					r.push(`${slave.slaveName} is smart enough to complicate things; ${he2} manages to outwit ${him} this week and makes no progress.`);
    				} else {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					slave.devotion += Math.ceil(effectiveness / 4);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					if (slave.devotion < -50) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    						r.push(`${He} helps watch and restrain the rebellious ${slave.slaveName}, helping wear ${him2} down, <span class="gold">breaking ${slave.slaveName}'s rebelliousness.</span>`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					} else if (slave.devotion < -20) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    						r.push(`${He} keeps ${slave.slaveName} constantly aware of ${his2} slavery, <span class="gold">breaking ${slave.slaveName}'s resistance.</span>`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					} else {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    						r.push(`${He} acts as another pair of eyes watching ${slave.slaveName} and metes out punishments, <span class="gold">improving ${slave.slaveName}'s servitude.</span>`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					}
    				}
    
    			} else if (headGirlsTraining === "paraphilia") {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				effectiveness -= (slave.intelligence + slave.intelligenceImplant) / 3;
    				slave.training += effectiveness;
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				r.push(`${S.HeadGirl.slaveName} does ${his} best to get ${slave.slaveName} past it with punishments and rewards,`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				if (slave.training > 100) {
    					r.push(`and <span class="green">resolves ${slave.slaveName}'s paraphilia.</span>`);
    					slave.training = 0;
    					slave.sexualFlaw = "none";
    				} else {
    					r.push(`and makes partial progress.`);
    				}
    
    			} else if (headGirlsTraining === "flaw") {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				effectiveness -= (slave.intelligence + slave.intelligenceImplant) / 3;
    				slave.training += effectiveness;
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				r.push(`${S.HeadGirl.slaveName} punishes ${slave.slaveName} whenever ${he} catches ${him2} indulging in ${his2} bad habits,`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				if (slave.training > 100) {
    					r.push(`and <span class="green">fixes ${slave.slaveName}'s flaw.</span>`);
    					slave.training = 0;
    					if (slave.behavioralFlaw !== "none") {
    						slave.behavioralFlaw = "none";
    					} else if (slave.sexualFlaw !== "none") {
    						slave.sexualFlaw = "none";
    					}
    				} else {
    					r.push(`and makes partial progress.`);
    				}
    
    			} else if (headGirlsTraining === "soften") {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				effectiveness -= (slave.intelligence + slave.intelligenceImplant) / 3;
    				slave.training += effectiveness;
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				r.push(`${He} punishes ${slave.slaveName} whenever ${he} sees ${him2} breaking the rules yet does ${his} best to retain what makes the slave special,`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				if (slave.training > 150) {
    					slave.training = 0;
    					r.push(`and successfully <span class="green">softens ${slave.slaveName}'s flaw.</span>`);
    					if (slave.behavioralFlaw !== "none") {
    						SoftenBehavioralFlaw(slave);
    					} else if (slave.sexualFlaw !== "none") {
    						SoftenSexualFlaw(slave);
    					}
    				} else {
    					r.push(`and makes partial progress.`);
    				}
    
    			} else if (headGirlsTraining === "oral skill") {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				slave.training = 0;
    				if (S.HeadGirl.fetish === "cumslut" && S.HeadGirl.fetishStrength > 60) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					r.push(`In spare moments ${he} teaches ${slave.slaveName} how to suck cocks, cunts, and assholes. ${His} enthusiasm for oral sex is infectious. ${slave.slaveName}'s <span class="green">oral skills have improved.</span>`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					slaveSkillIncrease('oral', slave, random(5, 10));
    				} else if ((S.HeadGirl.dick > 0) && canPenetrate(S.HeadGirl)) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					r.push(`In spare moments ${he} teaches ${slave.slaveName} how to suck cocks, cunts, and assholes. Your Head Girl uses ${his} penis as an effective teaching tool. ${slave.slaveName}'s <span class="green">oral skills have improved.</span>`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					slaveSkillIncrease('oral', slave, random(5, 10));
    				} else if ((S.HeadGirl.clit > 2)) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					r.push(`In spare moments ${he} teaches ${slave.slaveName} how to suck cocks, cunts, and assholes. Your Head Girl uses ${his} pseudophallus-sized clit as an effective teaching tool. ${slave.slaveName}'s <span class="green">oral skills have improved.</span>`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					slaveSkillIncrease('oral', slave, random(5, 10));
    				} else {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					r.push(`In spare moments ${he} teaches ${slave.slaveName} how to suck cocks, cunts, and assholes. ${slave.slaveName}'s <span class="green">oral skills have improved.</span>`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				}
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				slaveSkillIncrease('oral', slave, Math.ceil(effectiveness / 10));
    
    			} else if (headGirlsTraining === "anal skill") {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				slave.training = 0;
    				if (S.HeadGirl.fetish === "buttslut" && S.HeadGirl.fetishStrength > 60) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					r.push(`In spare moments ${he} teaches ${slave.slaveName} how to take it up the ass. Your Head Girl's enthusiasm for backdoor loving is infectious. ${slave.slaveName}'s <span class="green">anal skills have improved.</span>`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					slaveSkillIncrease('anal', slave, random(5, 10));
    				} else if ((S.HeadGirl.dick > 0) && canPenetrate(S.HeadGirl)) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					r.push(`In spare moments ${he} teaches ${slave.slaveName} how to take a dick up the butt. Your Head Girl uses ${his} penis as an effective teaching tool. ${slave.slaveName}'s <span class="green">anal skills have improved.</span>`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					slaveSkillIncrease('anal', slave, random(5, 10));
    				} else if ((S.HeadGirl.clit > 2)) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					r.push(`In spare moments ${he} teaches ${slave.slaveName} how to take a phallus up the butt. Your Head Girl uses ${his} pseudophallus-sized clit as an effective teaching tool. ${slave.slaveName}'s <span class="green">anal skills have improved.</span>`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					slaveSkillIncrease('anal', slave, random(5, 10));
    				} else {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					r.push(`In spare moments ${he} teaches ${slave.slaveName} how to take a dick up the butt. ${slave.slaveName}'s <span class="green">anal skills have improved.</span>`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				}
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				slaveSkillIncrease('anal', slave, Math.ceil(effectiveness / 10));
    
    			} else if (headGirlsTraining === "fuck skill") {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				slave.training = 0;
    				if (S.HeadGirl.energy > 95) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					r.push(`In spare moments ${he} teaches ${slave.slaveName} how to take a dick. Your Head Girl's enthusiasm for sex is infectious. ${slave.slaveName}'s <span class="green">vanilla sex skills have improved.</span>`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					slaveSkillIncrease('vaginal', slave, random(5, 10));
    				} else if ((S.HeadGirl.dick > 0) && canPenetrate(S.HeadGirl)) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					r.push(`In spare moments ${he} teaches ${slave.slaveName} how to take a dick. Your Head Girl uses ${his} penis as an effective teaching tool. ${slave.slaveName}'s <span class="green">vanilla sex skills have improved.</span>`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					slaveSkillIncrease('vaginal', slave, random(5, 10));
    				} else if ((S.HeadGirl.clit > 2)) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					r.push(`In spare moments ${he} teaches ${slave.slaveName} how to take a phallus. Your Head Girl uses ${his} pseudophallus-sized clit as an effective teaching tool. ${slave.slaveName}'s <span class="green">vanilla sex skills have improved.</span>`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					slaveSkillIncrease('vaginal', slave, random(5, 10));
    				} else {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					r.push(`In spare moments ${he} teaches ${slave.slaveName} how to take a dick. ${slave.slaveName}'s <span class="green">vanilla sex skills have improved.</span>`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				}
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				slaveSkillIncrease('vaginal', slave, Math.ceil(effectiveness / 10));
    
    			} else if (headGirlsTraining === "whore skill") {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				slave.training = 0;
    				r.push(`In spare moments ${he} teaches ${slave.slaveName} how to prostitute ${himself2}. ${slave.slaveName}'s <span class="green">whoring skills have improved.</span>`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				slaveSkillIncrease('whoring', slave, Math.ceil(effectiveness / 10));
    
    			} else if (headGirlsTraining === "entertain skill") {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				slave.training = 0;
    				if (S.HeadGirl.fetish === "humiliation" && S.HeadGirl.fetishStrength > 60) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					r.push(`In spare moments ${he} teaches ${slave.slaveName} how to entertain. Your Head Girl's enthusiasm for public display is infectious. ${slave.slaveName}'s <span class="green">entertainment skills have improved.</span>`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					slaveSkillIncrease('entertainment', slave, random(5, 10));
    				} else {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					r.push(`In spare moments ${he} teaches ${slave.slaveName} how to entertain. ${slave.slaveName}'s <span class="green">entertainment skills have improved.</span>`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				}
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				slaveSkillIncrease('entertainment', slave, Math.ceil(effectiveness / 10));
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			}
    		}
    
    		if (slave.devotion >= -20) {
    			if (slave.attrKnown === 0) {
    				slave.attrKnown = 1;
    				r.push(`${S.HeadGirl.slaveName} also investigates the slave's basic sexual orientation, finding that ${he2} is`);
    				if (slave.attrXY <= 40) {
    					r.push(`<span class="red">disgusted by men</span>`);
    				} else if ((slave.attrXY <= 60)) {
    					r.push(`indifferent to men`);
    				} else if ((slave.attrXY <= 80)) {
    					r.push(`<span class="green">attracted to men</span>`);
    				} else {
    					r.push(`<span class="green">intensely attracted to men</span>`);
    				}
    				r.push(`and`);
    				if (slave.attrXX <= 40) {
    					r.push(`<span class="red">disgusted by women.</span>`);
    				} else if ((slave.attrXX <= 60)) {
    					r.push(`indifferent to women.`);
    				} else if ((slave.attrXX <= 80)) {
    					r.push(`<span class="green">attracted to women.</span>`);
    				} else {
    					r.push(`<span class="green">intensely attracted to women.</span>`);
    				}
    			}
    		}
    
    		if (V.HGPiercings) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			if (slave.devotion >= -20 && slave.genes === "XY" && slave.attrXY <= 35 && V.arcologies[0].FSBodyPurist === "unset" && (V.arcologies[0].FSPaternalist === "unset" || SlaveStatsChecker.modScore(slave).total < 13)) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				piercingCheck();
    			}
    		}
    
    
    		App.Events.addNode(el, r, "div", "indent");
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    		return el;
    
    		function piercingCheck() {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			let piercingForbidden = 0;
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			if (slave.earPiercing === 0 && slave.earShape !== "none") {
    				if (V.arcologies[0].FSDegradationist !== "unset") {
    					slave.earPiercing = 2;
    				} else {
    					slave.earPiercing = 1;
    				}
    				RulesDeconfliction(slave);
    				if (slave.earPiercing !== V.slaveAfterRA.earPiercing) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					piercingForbidden = 1;
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					slave.earPiercing = 0;
    				} else {
    					if (V.arcologies[0].FSDegradationist !== "unset") {
    
    						r.push(`${S.HeadGirl.slaveName} knows that ${slave.slaveName} needs to adjust to life as a slave${girl2}, so ${he} has the slave's ears pierced. This will be a constant reminder that ${he2} is simply a sexual object here.`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					} else {
    
    						r.push(`${S.HeadGirl.slaveName} knows that ${slave.slaveName} needs help adjusting to life as a slave${girl2}, so ${he} has the slave's ears pierced. A little feminine touch can make a big difference.`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					}
    					cashX(forceNeg(V.modCost), "slaveMod", slave);
    					return;
    				}
    			}
    			if (slave.nosePiercing === 0) {
    				if (V.arcologies[0].FSDegradationist !== "unset") {
    					slave.nosePiercing = 2;
    				} else {
    					slave.nosePiercing = 1;
    				}
    				RulesDeconfliction(slave);
    				if (slave.nosePiercing !== V.slaveAfterRA.nosePiercing) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					piercingForbidden = 1;
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					slave.nosePiercing = 0;
    				} else {
    					if (V.arcologies[0].FSDegradationist !== "unset") {
    
    						r.push(`${S.HeadGirl.slaveName} knows that ${slave.slaveName} needs to adjust to life as a slave${girl2}, so ${he} gives the slave nasal studs and a large septum ring. It should push ${slave.slaveName} to see ${himself2} as a sexual object for others to use.`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					} else {
    
    						r.push(`${S.HeadGirl.slaveName} knows that ${slave.slaveName} needs help adjusting to life as a slave${girl2}, so ${he} gives the slave a cute little nose piercing. It should help ${slave.slaveName} see ${himself2} as a bit more feminine.`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					}
    					cashX(forceNeg(V.modCost), "slaveMod", slave);
    					return;
    				}
    			}
    			if (slave.eyebrowPiercing === 0) {
    				if (V.arcologies[0].FSDegradationist !== "unset") {
    					slave.eyebrowPiercing = 2;
    				} else {
    					slave.eyebrowPiercing = 1;
    				}
    				RulesDeconfliction(slave);
    				if (slave.eyebrowPiercing !== V.slaveAfterRA.eyebrowPiercing) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					piercingForbidden = 1;
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					slave.eyebrowPiercing = 0;
    				} else {
    					if (V.arcologies[0].FSDegradationist !== "unset") {
    
    						r.push(`${S.HeadGirl.slaveName} knows that ${slave.slaveName} needs to adjust to life as a slave${girl2}, so ${he} gives the slave multiple eyebrow piercings. A slutty touch for a slave${girl2} should help ${him2} feel a little hungrier for cock.`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					} else {
    
    						r.push(`${S.HeadGirl.slaveName} knows that ${slave.slaveName} needs help adjusting to life as a slave${girl2}, so ${he} gives the slave a cute little eyebrow piercing. A slutty touch for a slave${girl2} should help ${him2} feel a little hungrier for cock.`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					}
    					cashX(forceNeg(V.modCost), "slaveMod", slave);
    					return;
    				}
    			}
    			if (slave.lipsPiercing === 0) {
    				if (V.arcologies[0].FSDegradationist !== "unset") {
    					slave.lipsPiercing = 2;
    				} else {
    					slave.lipsPiercing = 1;
    				}
    				RulesDeconfliction(slave);
    				if (slave.lipsPiercing !== V.slaveAfterRA.lipsPiercing) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					piercingForbidden = 1;
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					slave.lipsPiercing = 0;
    				} else {
    					if (V.arcologies[0].FSDegradationist !== "unset") {
    
    						r.push(`${S.HeadGirl.slaveName} knows that ${slave.slaveName} needs to adjust to life as a slave${girl2}, so ${he} has the slave's lower lip pierced. ${his2} mouth is for pleasing penises now, so it'll help ${him2} if it looks like it.`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					} else {
    
    						r.push(`${S.HeadGirl.slaveName} knows that ${slave.slaveName} needs help adjusting to life as a slave${girl2}, so ${he} has the slave's lower lip pierced. ${his2} mouth is for pleasing penises now, so it'll help ${him2} if it looks like it.`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					}
    					cashX(forceNeg(V.modCost), "slaveMod", slave);
    					return;
    				}
    			}
    			if (slave.navelPiercing === 0) {
    				if (V.arcologies[0].FSDegradationist !== "unset") {
    					slave.navelPiercing = 2;
    				} else {
    					slave.navelPiercing = 1;
    				}
    				RulesDeconfliction(slave);
    				if (slave.navelPiercing !== V.slaveAfterRA.navelPiercing) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					piercingForbidden = 1;
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					slave.navelPiercing = 0;
    				} else {
    					if (V.arcologies[0].FSDegradationist !== "unset") {
    
    						r.push(`${S.HeadGirl.slaveName} knows that ${slave.slaveName} needs help adjusting to life as a slave${girl2}, so ${he} has the slave's navel pierced with a big ring. Whatever ${he2} thinks in ${his2} mind, S.HeadGirl.slaveName makes clear to ${him2} that ${his2} body belongs to you.`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					} else {
    
    						r.push(`${S.HeadGirl.slaveName} knows that ${slave.slaveName} needs help adjusting to life as a slave${girl2}, so ${he} has the slave's navel pierced. The prettier ${his2} lower half looks, the less reluctant ${he2} should feel to take it up the butt.`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					}
    					cashX(forceNeg(V.modCost), "slaveMod", slave);
    					return;
    				}
    			}
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    			if (piercingForbidden) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				if (V.arcologies[0].FSDegradationist !== "unset") {
    
    					r.push(`${S.HeadGirl.slaveName} thinks some piercings might push ${slave.slaveName} to adjust to life as a slave${girl2}, but ${he} also knows you have rules applied to this slave that forbid it.`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				} else {
    
    					r.push(`${S.HeadGirl.slaveName} thinks some cute piercings might help ${slave.slaveName} adjust to life as a slave${girl2}, but ${he} also knows you have rules applied to this slave that forbid it.`);
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    				}
    			}
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    		}
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    	}
    
    
    	function slavesToTrain() {
    		if (S.HeadGirl) {
    			/** @type {FC.HeadGirlTrainee[][]} */
    			const HGPossibleSlaves = [[], [], [], [], [], []];
    			for (const slave of V.slaves) {
    				if (!assignmentVisible(slave) || slave.fuckdoll === 1 || slave.ID === V.BodyguardID || slave.ID === V.HeadGirlID || slave.fetish === "mindbroken") {
    					continue;
    				} else if (Array.isArray(V.personalAttention) && V.personalAttention.some(p => p.ID === slave.ID)) {
    					continue;
    				}
    
    				if (V.headGirlTrainsHealth && slave.health.condition < -20) {
    					HGPossibleSlaves[0].push({ID: slave.ID, training: "health"});
    					continue;
    				}
    
    				if (slave.health.tired < 50) {
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    					const hasParaphilia = (App.Data.misc.paraphiliaList.includes(slave.sexualFlaw));
    
    					if (V.headGirlTrainsParaphilias && hasParaphilia) {
    						HGPossibleSlaves[1].push({ID: slave.ID, training: "paraphilia"});
    						continue;
    					}
    
    					if (V.headGirlTrainsFlaws || V.headGirlSoftensFlaws) {
    						if (slave.behavioralFlaw !== "none" || (slave.sexualFlaw !== "none" && !hasParaphilia)) {
    							if (V.headGirlSoftensFlaws) {
    								if (slave.devotion > 20) {
    									if ((slave.behavioralFlaw !== "none" && slave.behavioralQuirk === "none") || (slave.sexualFlaw !== "none" && slave.sexualQuirk === "none" && !hasParaphilia)) {
    										HGPossibleSlaves[3].push({ID: slave.ID, training: "soften"});
    									} else {
    										HGPossibleSlaves[3].push({ID: slave.ID, training: "flaw"});
    									}
    									continue;
    								}
    							} else if (V.headGirlTrainsFlaws) {
    								HGPossibleSlaves[2].push({ID: slave.ID, training: "flaw"});
    								continue;
    							}
    						}
    					}
    
    					if (V.headGirlTrainsObedience && slave.devotion <= 20 && slave.trust >= -20) {
    						HGPossibleSlaves[4].push({ID: slave.ID, training: "obedience"});
    						continue;
    					}
    
    					if (V.headGirlTrainsSkills) {
    						if (slave.skill.oral < S.HeadGirl.skill.oral) {
    							HGPossibleSlaves[5].push({ID: slave.ID, training: "oral skill"});
    						} else if ((slave.skill.vaginal < S.HeadGirl.skill.vaginal) && (slave.vagina > 0) && (canDoVaginal(slave))) {
    							HGPossibleSlaves[5].push({ID: slave.ID, training: "fuck skill"});
    						} else if ((slave.skill.anal < S.HeadGirl.skill.anal) && (slave.anus > 0) && (canDoAnal(slave))) {
    							HGPossibleSlaves[5].push({ID: slave.ID, training: "anal skill"});
    						} else if (slave.skill.whoring < S.HeadGirl.skill.whoring) {
    							HGPossibleSlaves[5].push({ID: slave.ID, training: "whore skill"});
    						} else if ((slave.skill.entertainment < S.HeadGirl.skill.entertainment) && !isAmputee(slave)) {
    							HGPossibleSlaves[5].push({ID: slave.ID, training: "entertain skill"});
    						}
    					}
    				}
    			}
    			return HGPossibleSlaves.flatten().slice(0, App.EndWeek.saVars.HGEnergy);
    		} else {
    			return [];
    		}
    	}
    
    lowercasedonkey's avatar
    lowercasedonkey committed
    };