:: SA servant [script]

window.saServant = function saServant(slave) {

	var pronouns = getPronouns(slave);
	var he = pronouns.pronoun, him = pronouns.object, his = pronouns.possessive, hers = pronouns.possessivePronoun, himself = pronouns.objectReflexive, boy = pronouns.noun;
	var He = capFirstChar(he), His = capFirstChar(his);
	var V = State.variables;

	var t = `works as a servant. ${He} performs the lowest jobs in your penthouse, cleaning up after your other slaves, bathing them, helping them dress, and giving them sexual relief.`;

	if (V.servantsQuarters > 0) {
		if ((V.universalRulesFacilityWork == 1 && slave.assignment == "be a servant" && V.servantsQuartersSpots > 0) || (slave.assignment == "work as a servant")) {
			if (slave.assignment == "be a servant") {
				t += ` Since there's extra space in the servants' quarters, ${V.assistantName} attaches ${him} to the cadre of maids there.`;
				V.servantsQuartersSpots--;
			}
			if (V.Stewardess != 0) {
				t += ` This brings ${him} under ${V.Stewardess.slaveName}'s supervision. The Stewardess `;
				if (slave.devotion < -20) {
					t += `subjects ${him} to <span class='gold'>corrective rape</span> when ${his} service is imperfect, <span class='hotpink'>when ${he} steps out of line</span>, or when the Stewardess just feels like raping ${him}, forcing the poor slave to <span class='yellowgreen'>find refuge in work.</span>`;
					slave.devotion += 2;
					slave.trust -= 2;
				} else if (slave.devotion <= 20) {
					t += `molests ${him}, encouraging the poor slave to <span class='hotpink'>keep ${his} head down</span> and <span class='yellowgreen'>work harder.</span>`;
					slave.devotion += 2;
				} else {
					t += `uses <span class='hotpink'>sex as a reward</span>, getting ${him} off when ${he} <span class='yellowgreen'>works harder.</span>`;
					slave.devotion++;
				}
				if (!(canHear(slave))) {
					t += ` However, ${his} inability to hear often leaves ${him} oblivious to ${V.Stewardess.slaveName}'s orders, limiting their meaningful interactions.`;
					V.cash += (V.stewardessBonus/4);
				} else if ((slave.hears == -1 && slave.earwear != "hearing aids") || (slave.hears == 0 && slave.earwear == "muffling ear plugs")) {
					t += ` However, ${he} often doesn't catch what ${V.Stewardess.slaveName} says, leading to frustration, confusion and less work done.`;
					V.cash += (V.stewardessBonus/2);
				} else {
					V.cash += V.stewardessBonus;
				}
			}
		}
	}

	t += ` ${He} is `;
	if (slave.trust < -20) {
		t += "frightened of punishment and works very hard, <span class='yellowgreen'>reducing the upkeep</span> of your slaves.";
	} else if (slave.devotion < -20) {
		if (slave.trust >= 20) {
			t += `uninterested in doing such work and barely lifts a finger to <span class='yellowgreen'>reduce the upkeep</span> of your slaves.`;
		} else {
			t += `reluctant, requiring your other slaves to force ${his} services, and does not <span class='yellowgreen'>reduce upkeep</span> of your slaves much.`;
		}
	} else if (slave.devotion <= 20) {
		t += `hesitant, requiring your other slaves to demand ${his} services, and only slightly <span class='yellowgreen'>reduces upkeep</span> of your slaves.`;
	} else if (slave.devotion <= 50) {
		t += `obedient, offering your other slaves ${his} services, and moderately <span class='yellowgreen'>reduces the upkeep</span> of your slaves.`;
	} else if (slave.devotion <= 95) {
		t += `devoted, happily giving your other slaves ${his} services, and <span class='yellowgreen'>reduces the upkeep</span> of your slaves.`;
	} else {
		t += `so happy to serve your other slaves that ${he} often sees to their needs before they know they have them, and greatly <span class='yellowgreen'>reduces the upkeep</span> of your slaves.`;
	}

	let _oral = jsRandom(5,10);
	slave.oralCount += _oral;
	V.oralTotal += _oral;

	if (slave.relationship == -2) {
		t += ` ${He} does ${his} best to perfect your domesticity due to ${his} emotional bond to you.`;
	} else if (slave.relationship == -3 && slave.devotion > 50) {
		t += ` ${He} does ${his}very best to be the perfect housewife, making ${him} an outstanding servant.`;
	}

	if (setup.servantCareers.includes(slave.career)) {
		t += ` ${He} has experience with house keeping from ${his} life before ${he} was a slave, making ${him} more effective.`;
	} else if (slave.skillS >= V.masteredXP) {
		t += ` ${He} has experience with house keeping from working for you, making ${him} more effective.`;
	} else {
		slave.skillS += jsRandom(1,Math.ceil((slave.intelligence+slave.intelligenceImplant)/15) + 8);
	}

	if (slave.fetishStrength > 60) {
		if (slave.fetish == "submissive" && slave.fetishKnown == 1) {
			t += ` ${His} natural affinity for submission increases ${his} effectiveness.`;
		} else if (slave.fetishKnown == 1 && slave.fetish == "dom") {
			t += ` ${His} sexual appetite for domination reduces ${his} effectiveness.`;
		}
	}

	if (slave.energy < 20) {
		t += ` ${His} frigidity allows ${him} to ignore the intercourse all around ${him}, making ${him} very efficient.`;
	} else if (slave.energy < 40) {
		t += ` ${His} low sex drive keeps ${him} from becoming too distracted by the intercourse all around ${him}, making ${him} more efficient.`;
	}

	if ((slave.eyes <= -1 && slave.eyewear != "corrective glasses" && slave.eyewear != "corrective contacts") || (slave.eyewear == "blurring glasses") || (slave.eyewear == "blurring contacts")) {
		t += ` ${His} bad vision makes ${him} a worse servant.`;
	}

	if (slave.lactation > 0) {
		t += ` Since ${he} is lactating, `;
		if (slave.devotion > 20 || slave.trust < -20) {
			t += ` ${he} serves `;
		} else {
			t += `and disobedient, ${he} is restrained to serve `;
		}
		t += `as a drink dispenser at mealtimes, and makes a meaningful contribution to ${his} fellow slaves' nutrition in concert with the feeding systems.`;
	}

	if (V.showVignettes == 1 && (slave.assignment === Job.SERVANT || slave.assignment === Job.SERVER)) {
		var _vignette = GetVignette(slave);
		t += ` __This week__ ${_vignette.text} `
		if (_vignette.type == "cash") {
			if (_vignette.effect > 0) {
				t += `<span class='yellowgreen'>making you an extra ${cashFormat(Math.trunc(V.FResult*_vignette.effect))}.</span>`;
			} else if (_vignette.effect < 0) {
				t += `<span class='red'>losing you ${cashFormat(Math.abs(Math.trunc(V.FResult*_vignette.effect)))}.</span>`;
			} else {
				t += `an incident without lasting effect.`;
			}
			V.cash += Math.trunc(V.FResult*_vignette.effect);
		} else if (_vignette.type == "devotion") {
			if (_vignette.effect > 0) {
				if (slave.devotion > 50) {
					t += `<span class='hotpink'>increasing ${his} devotion to you.</span>`;
				} else if (slave.devotion >= -20) {
					t += `<span class='hotpink'>increasing ${his} acceptance of you.</span>`;
				} else if (slave.devotion > -10) {
					t += `<span class='hotpink'>reducing ${his} dislike of you.</span>`;
				} else {
					t += `<span class='hotpink'>reducing ${his} hatred of you.</span>`;
				}
			} else if (_vignette.effect < 0) {
				if (slave.devotion > 50) {
					t += `<span class='mediumorchid'>reducing ${his} devotion to you.</span>`;
				} else if (slave.devotion >= -20) {
					t += `<span class='mediumorchid'>reducing ${his} acceptance of you.</span>`;
				} else if (slave.devotion > -10) {
					t += `<span class='mediumorchid'>increasing ${his} dislike of you.</span>`;
				} else {
					t += `<span class='mediumorchid'>increasing ${his} hatred of you.</span>`;
				}
			} else {
				t += `an incident without lasting effect.`;
			}
			slave.devotion += (1*_vignette.effect);
		} else if (_vignette.type == "trust") {
			if (_vignette.effect > 0) {
				if (slave.trust > 20) {
					t += `<span class='mediumaquamarine'>increasing ${his} trust in you.</span>`;
				} else if (slave.trust > -10) {
					t += `<span class='mediumaquamarine'>reducing ${his} fear of you.</span>`;
				} else {
					t += `<span class='mediumaquamarine'>reducing ${his} terror of you.</span>`;
				}
			} else if (_vignette.effect < 0) {
				if (slave.trust > 20) {
					t += `<span class='gold'>reducing ${his} trust in you.</span>`;
				} else if (slave.trust >= -20) {
					t += `<span class='gold'>increasing ${his} fear of you.</span>`;
				} else {
					t += `<span class='gold'>increasing ${his} terror of you.</span>`;
				}
			} else {
				t += `an incident without lasting effect.`;
			}
			slave.trust += (1*_vignette.effect);
		} else if (_vignette.type == "health") {
			if (_vignette.effect > 0) {
				t += `<span class='green'>improving ${his} health.</span>`;
			} else if (_vignette.effect < 0) {
				t += `<span class='red'>affecting ${his} health.</span>`;
			} else {
				t += `an incident without lasting effect.`;
			}
			slave.health += (2*_vignette.effect);
		} else {
			if (_vignette.effect > 0) {
				t += `<span class='green'>gaining you a bit of reputation.</span>`;
			} else if (_vignette.effect < 0) {
				t += `<span class='red'>losing you a bit of reputation.</span>`;
			} else {
				t += `an incident without lasting effect.`;
			}
			V.rep += Math.trunc(V.FResult*_vignette.effect*0.1);
		}
	}

	return t;
};