Skip to content
Snippets Groups Projects
childrenReport.js 9.91 KiB
Newer Older
  • Learn to ignore specific revisions
  • /**
     * Details week-to-week changes in children in the Nursery
     * @returns {string}
     */
    App.Facilities.Nursery.childrenReport = function childrenReport() {
    	const
    		Matron = V.Matron,
    
    		nannies = App.Utils.sortedEmployees(App.Entity.facilities.nursery),
    
    		NL = App.Entity.facilities.nursery.employeesIDs().size,
    		CL = V.cribs.length;
    
    	let
    
    		r = [];
    
    brickode's avatar
    brickode committed
    	for (const child of V.cribs) {
    
    brickode's avatar
    brickode committed
    			{ he, his, He, His } = getPronouns(child);
    
    
    		if (child.growTime > 0) {
    
    			r.push(`<span class="pink">${child.slaveName}</span> is growing steadily. ${He} will be ready for release in about ${years(child.growTime)}.`);
    
    			r.push(`<span class="pink">${child.slaveName}</span> is <span class="lime">ready for release.</span> ${He} will be removed from ${V.nurseryName} upon your approach.`);
    
    		}
    
    		if (child.actualAge >= 3) {
    
    			if (Matron) {
    
    brickode's avatar
    brickode committed
    				r.push(matronFetishEffects());
    				r.push(matronEducationEffects());
    				r.push(matronFitnessEffects());
    
    			if (nannies) {
    
    brickode's avatar
    brickode committed
    				r.push(nannyEducationEffects());
    				r.push(nannyFitnessEffects());
    				r.push(nannyFetishEffects());
    
    			}
    
    			// TODO: add friend / rivalry system
    			// TODO: add relations to friend system
    			for (let j = 0; j < CL; j++) {
    				const
    					c = V.cribs[j];
    
    				let
    					friend = 0,
    					rival = 0,
    					chance = jsRandom(1, 100);
    
    				if (c.actualAge >= 3) {
    					if (c.fetish === child.fetish) {
    						r += ``; // TODO:
    						friend++;
    					}
    
    					if (c.sexualQuirk === child.sexualQuirk || c.behavioralQuirk === child.behavioralQuirk) {
    						r += ``; // TODO:
    						friend++;
    					}
    
    					if (c.fetish === "sadist" || c.fetish === "dom") {
    						r += ``; // TODO:
    						rival++;
    					} else if (child.fetish === "sadist" || child.fetish === "dom") {
    						r += ``; // TODO:
    						rival++;
    					}
    
    					if (friend) {
    						if (rival) {
    							if (friend > rival) {
    								if (chance > 75) {
    									r += ``;	// TODO:
    
    brickode's avatar
    brickode committed
    									child.relationship = 1;
    									child.relationshipTarget = c.ID;
    
    									c.relationship = 1;
    									c.relationshipTarget = child.ID;
    
    								}
    							}
    						} else {
    							if (chance > 60) {
    								r += ``;	// TODO:
    
    brickode's avatar
    brickode committed
    								child.relationship = 1;
    								child.relationshipTarget = c.ID;
    
    								c.relationship = 1;
    								c.relationshipTarget = child.ID;
    
    							}
    						}
    					}
    
    					if (rival) {
    						if (friend) {
    							if (rival > friend) {
    								if (chance > 75) {
    									r += ``;	// TODO:
    								}
    							}
    						} else {
    							if (chance > 60) {
    								r += ``;	// TODO:
    							}
    						}
    					}
    				}
    			}
    
    			// TODO: rework these entirely
    			if (Matron || NL) {
    				if (V.nurseryWeight) {
    					const firstNanny = NL > 0 ? App.Entity.facilities.nursery.employees()[0] : null;
    					r += `<br>`;
    					if (V.nurseryWeightSetting === 1) {
    						if (child.weight < 200) {
    							child.weight += 5;
    						}
    						r += `${He} is being fed an excessive amount of food, causing <span class="red">rapid weight gain.</span> `;
    					} else if (V.nurseryWeightSetting === 2) {
    						if (child.weight > 10) {
    							child.weight--;
    							r += `${Matron ? Matron.slaveName : NL > 1 ? `A nanny` : firstNanny.slaveName} notices ${he} is overweight and <span class="green">decreases the amount of food ${he} eats.</span> `;
    						} else if (child.weight <= -10) {
    							child.weight++;
    							r += `${Matron ? Matron.slaveName : NL > 1 ? `A nanny` : firstNanny.slaveName} notices ${he} is underweight and <span class="green">increases the amount of food ${he} eats.</span> `;
    						} else {
    							r += `${He} is <span class="lime">currently a healthy weight;</span> efforts will be made to maintain it. `;
    						}
    					} else if (V.nurseryWeightSetting === 0) {
    						if (child.weight > -20) {
    							r += `${His} developing body <span class="red">quickly sheds its gained weight.</span> `;
    							child.weight -= 40;
    						}
    					}
    				} else {
    					if (child.weight > -20) {
    						child.weight -= 40;
    						r += `${His} developing body <span class="red">quickly sheds its gained weight.</span>`;
    					}
    				}
    
    				// TODO: rewrite these
    				if (V.nurseryMuscles) {
    					r += `${He} is being given anabolic steroids causing <span class="green">rapid muscle development.</span> `;	// TODO: not happy with this
    					if (V.nurseryMusclesSetting === 2) {
    						if (child.muscles < 100) {
    							child.muscles += 5;
    						}
    						r += `${Matron ? Matron : NL > 1 ? `A nanny` : firstNanny.slaveName} notices ${he} is overly muscular and <span class="green">decreases ${his} steroid dosage.</span> `;
    					} else if (V.nurseryMusclesSetting === 1) {
    						if (child.muscles > 10) {
    							child.muscles--;
    							r += `${Matron ? Matron : NL > 1 ? `A nanny` : firstNanny.slaveName} notices ${he} is weak and <span class="green">increases ${his} steroid dosage.</span> `;
    						} else if (child.muscles < -10) {
    							child.muscles++;
    							r += `${He} has <span class="lime">a healthy musculature;</span> efforts will be made to maintain it. `;
    						} else {
    							r += `${His} developing body <span class="red">quickly loses its gained muscle.</span> `;
    						}
    					} else if (V.nurseryMusclesSetting === 0) {
    						if (child.muscles > -100) {
    							child.muscles -= 40;
    							r += `${His} developing body <span class="red">quickly loses its gained muscle.</span> `;
    						}
    					}
    				}
    			}
    		} else {
    			// TODO:
    		}
    		r += `<br>`;
    	}
    
    
    	function newChildFetish(fetish = "none") {
    		switch (fetish) {
    			case "submissive":
    				return `is now a submissive`;
    			case "cumslut":
    				return `is now a cumslut`;
    			case "humiliation":
    				return `now has a fetish for humiliation`;
    			case "buttslut":
    				return `is now a buttslut`;
    			case "boobs":
    				return `now has a fetish for all things breast-related`;
    			case "sadist":
    				return `now gets off on causing pain`;
    			case "masochist":
    				return `now gets off on pain`;
    			case "dom":
    				return `is now very sexually dominant`;
    			case "pregnancy":
    				return `has developed a facination for all things pregnancy-related`;
    			default:
    				throw `<span class="red">Something broke in newChildFetish(). Please report this.</span>`;
    		}
    	}
    
    
    
    	// MARK: Matron Effects
    
    
    	function matronFetishEffects() {
    		const chance = jsRandom(1, 100);
    
    		if (Matron.fetish !== "none") {
    			if (chance > 90) {
    				if (child.fetish === "none") {
    					child.fetish = Matron.fetish;
    
    					return `${child.slaveName} has taken a few cues from ${Matron.slaveName}, and ${newChildFetish(child.fetish)}.`;
    				} else {
    					if (chance > 95) {
    						child.fetish = Matron.fetish;
    
    						return `${Matron.slaveName} has rubbed off on ${child.slaveName}, in more ways than one. ${He} ${newChildFetish(child.fetish)}.`;
    					}
    				}
    			}
    		}
    	}
    
    
    	function matronEducationEffects() {
    
    		// TODO: expand this
    
    		const
    			{ he2, him2, his2 } = getPronouns(Matron).appendSuffix('2'),
    
    			theChildren = CL > 1 ? `the children` : `${child.slaveName}`;
    
    		if (Matron.intelligence + Matron.intelligenceImplant > 65) {
    			child.intelligenceImplant += 3;
    
    			return `${Matron.slaveName} is so intelligent and well-educated that ${he2} is able to teach ${theChildren} very effectively, and so ${CL > 1 ? `${child.slaveName} gradually grows` : `they gradually grow`} smarter. `;
    		} else if (Matron.intelligenceImplant > 30) {
    			child.intelligenceImplant += 2;
    
    			return `${Matron.slaveName}'s education makes up for the fact that ${he2} isn't the brightest and allows ${him2} to teach ${theChildren} quite effectively, and so ${theChildren} grows a bit smarter. `;
    		} else if (Matron.intelligence > 50) {
    			child.intelligenceImplant += 2;
    
    			return `Though ${Matron.slaveName} has had little to no formal education, ${his2} natural brilliance allows ${him2} to teach ${theChildren} quite effectively, and so ${CL > 1 ? `${child.slaveName} grows` : `they grow`} a bit smarter. `;
    		} else {
    			child.intelligenceImplant++;
    
    			return `${Matron.slaveName} isn't the brightest and is only somewhat effective at teaching ${theChildren}, so ${CL > 1 ? `${child.slaveName} grows` : `they grow`} just a little bit smarter. `;
    		}
    	}
    
    	function matronFitnessEffects() {
    		// TODO:
    		return;
    	}
    
    
    
    	// MARK: Nanny Effects
    
    
    	function nannyFetishEffects() {
    		for (const slave of nannies) {
    			if (slave.fetish !== "none") {
    				if (chance > 85) {
    					if (child.fetish === "none") {
    						child.fetish = slave.fetish;
    
    						return `${slave.slaveName} has left quite an impression on ${child.slaveName}, and ${he} ${newChildFetish(child.fetish)}.`;
    					} else {
    						if (chance > 90) {
    							child.fetish = slave.fetish;
    
    							return `${child.slaveName} seems to have taken to ${slave.slaveName}'s example, and ${newChildFetish(child.fetish)}.`;
    						}
    					}
    				}
    			}
    		}
    	}
    
    
    	function nannyEducationEffects() {
    
    		// TODO: expand this
    
    
    		let
    			averageIntelligence = 0,
    			averageIntelligenceImplant = 0;
    
    		for (const nanny of nannies) {
    			averageIntelligence += nanny.intelligence;
    			averageIntelligenceImplant += nanny.intelligenceImplant;
    		}
    
    		const
    			firstNanny = nannies[0],
    			theNanniesAre = NL > 1 ? `The nannies are mostly` : `${firstNanny.slaveName} is`,
    			theChildren = CL > 1 ? `the children` : child.slaveName;
    
    		averageIntelligence = averageIntelligence / NL;
    		averageIntelligenceImplant = averageIntelligenceImplant / NL;
    
    		if (averageIntelligence + averageIntelligenceImplant > 65) {
    			child.intelligenceImplant += 3;
    
    			return `${theNanniesAre} very intelligent and well educated and are able to teach ${theChildren} very effectively. `;
    		} else if (averageIntelligence > 50) {
    			child.intelligenceImplant += 2;
    
    			return `${theNanniesAre} very intelligent and able to teach ${theChildren} quite effectively. `;
    		} else if (averageIntelligenceImplant > 25) {
    			child.intelligenceImplant += 2;
    
    			return `${theNanniesAre} very well educated and able to teach ${theChildren} quite effectively. `;
    		} else if (averageIntelligenceImplant > 15) {
    			child.intelligenceImplant++;
    
    			return `${theNanniesAre} well educated and able to teach ${theChildren} fairly effectively. `;
    		}
    	}
    
    	function nannyFitnessEffects() {
    		// TODO:
    		return;
    	}
    
    
    brickode's avatar
    brickode committed
    	return r.join(' ');