Skip to content
Snippets Groups Projects
penthouseReport.js 2.08 KiB
Newer Older
  • Learn to ignore specific revisions
  • lowercasedonkey's avatar
    lowercasedonkey committed
    globalThis.penthouseReport = function() {
    	const el = document.createElement("p");
    	let r;
    
    	const _HGSuitSlaves = App.Utils.jobForAssignment(Job.HEADGIRLSUITE).employees();
    
    	for (const slave of V.slaves) {
    		if (assignmentVisible(slave)) {
    			r = [];
    			const {He} = getPronouns(slave);
    			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), " ");
    			r.push(App.UI.DOM.makeElement("span", SlaveFullName(slave), "slave-name"));
    			if (slave.choosesOwnAssignment === 2) {
    				r.push(App.SlaveAssignment.choosesOwnJob(slave));
    				r.push(He);
    			}
    			//<<include "Full Report">>
    			App.Events.addNode(el, r, "p");
    
    			if (slave.ID === V.HeadGirlID && _HGSuitSlaves.length > 0) {
    				/* We found the Head Girl, now let's find her slave */
    				const hgSlave = getSlave(_HGSuitSlaves[0].ID);
    				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;
    };