code:
:: Walk Past JS [script]

/* temporary container until the entire thing is complete. No point in not deploying the working functions, you know? */

window.primeSlave = function(activeSlave, seed) {

	/* will be moved up once this becomes a single, contained function. */
	var _target = ""
	var t = ""
	var V = State.variables
	var race
	if (V.seeRace == 1) { race = activeSlave.race } else { race = "" }

	var pronouns = getPronouns(activeSlave)
	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)

	if (V.partner !== "relationship" || activeSlave.relationship == 1 || activeSlave.relationship == 2 || activeSlave.releaseRules == "restrictive") {
		t += `${activeSlave.slaveName} `
		t += walkPasts(activeSlave, seed)
		/* WALKPASTS END */
	}
	/* TIME TOGETHER EXCEPTION ENDS */

	return t;
}

window.rivalSlave = function(activeSlave, seed) {
	var _partnerSlave = getSlave(activeSlave.rivalryTarget)

	var _target = ""
	var t = ""
	var V = State.variables

	var pronouns = getPronouns(activeSlave)
	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)

	if (_partnerSlave != undefined) { /* potential problem point */

		var race2
		if (V.seeRace == 1) { race2 = _partnerSlave.race } else { race2 = "" }

		t += " Meanwhile, "
		if (activeSlave.rivalry >= 3) {
			t += `${_partnerSlave.slaveName}, whom ${he} hates, `
		} else if (activeSlave.rivalry >= 2) {
			t += `${his} rival ${_partnerSlave.slaveName} `
		} else {
			t += `${_partnerSlave.slaveName}, whom ${he} dislikes, `
		}
		t += walkPasts(_partnerSlave, 100-seed)

		_target = "FRival", _partnerSlave = null
		V.target = "FRival" /*potentially removed later*/
	}

	return t;
}

window.walkPasts = function(slave, _seed) {

	/* will be moved up once this becomes a single, contained function. */
	var _target = ""
	var t = ""
	var V = State.variables
	var race
	if (V.seeRace == 1) { race = slave.race } else { race = "" }

	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)

	switch (slave.assignment) {
	case "be your agent":
		t += `is shaping society in ${his} assigned arcology.`
		break
	case "live with your agent":
		t += `is helping ${his} lover shape society in ${his} assigned arcology.`
		break
	case "work in the dairy":
		if (V.dairyRestraintsSetting > 1) {
			t += `is strapped to a milking machine in ${V.dairyName}, `
			if (slave.ovaries == 1 && V.dairyPregSetting > 0 && jsRandom(1,2) == 2) {
				if (isFertile(slave)) {
					t += `and is wincing in pain as the machine forces another load of cum into ${his} womb. As you watch, ${his} ${race} stomach steadily swells with baby batter.`
				} else {
					t += `giving you a good view of ${his} ${race} body and heavy belly on the feeds.`
				}
			} else if (slave.lactation > 0) {
				if (slave.balls > 0 && jsRandom(1,2) == 1) {
					if (slave.dick > 0) {
						if (_seed > 50) {
							t += `and is having ${his} cock sucked dry. As you watch, `
							if (slave.scrotum) {
								t += `${his} balls tighten `
							} else {
								t += `${he} begins to thrust harder `
							}
							if (V.dairyStimulatorsSetting > 0) {
								t += `as the phallus up ${his} butt `
							} else {
								t += `as the suction to ${his} dick `
							}
							t += `forces ${him} closer to yet another ejaculation.`
						} else {
							t += `and is wincing in pain as the machine sucks ${his} sore cock, but you have a good view of ${his} ${race} body on the feeds.`
						}
					} else {
						if (_seed > 50) {
							t += `and is having ${his} balls sucked dry. As you watch, `
							if (slave.scrotum) {
								t += `${his} scrotum tightens `
							} else {
								t += `${he} begins to thrust harder `
							}
							if (V.dairyStimulatorsSetting) {
								t += `as the phallus up ${his} butt `
							} else {
								t += `as the suction against ${his} crotch `
							}
							t += `forces ${him} closer to yet another leaking ejaculation.`
						} else {
							t += `and is wincing in pain as the machine sucks ${his} empty balls, but you have a good view of ${his} ${race} body on the feeds.`
						}
					}
				} else {
					if (_seed > 50) {
						t += `and is having ${his} tits drained, but you have a good view of ${his} ${race} body on the feeds.`
					} else {
						t += `and is recovering after having ${his} tits sucked dry, but you have a good view of ${his} ${race} body on the feeds.`
					}
				}
			} else if (slave.balls > 0) {
				if (slave.dick > 0) {
					if (_seed > 50) {
						t += `and is having ${his} cock sucked dry. As you watch, `
						if (slave.scrotum) {
							t += `${his} balls tighten `
						} else {
							t += `${he} begins to thrust harder `
						}
						if (V.dairyStimulatorsSetting > 0) {
							t += `as the phallus up ${his} butt `
						} else {
							t += `as the suction to ${his} dick `
						}
						t += `forces ${him} closer to yet another ejaculation.`
					} else {
						t += `and is wincing in pain as the machine sucks ${his} sore cock, but you have a good view of ${his} ${race} body on the feeds.`
					}
				} else {
					if (_seed > 50) {
						t += `and is having ${his} balls sucked dry. As you watch, `
						if (slave.scrotum) {
							t += `${his} scrotum tightens `
						} else {
							t += `${he} begins to thrust harder `
						}
						if (V.dairyStimulatorsSetting) {
							t += `as the phallus up ${his} butt `
						} else {
							t += `as the suction against ${his} crotch `
						}
						t += `forces ${him} closer to yet another leaking ejaculation.`
					} else {
						t += `and is wincing in pain as the machine sucks ${his} empty balls, but you have a good view of ${his} ${race} body on the feeds.`
					}
				}
			} else {
				t += `and is massaging ${his} sore, milkless tits, but you have a good view of ${his} ${race} body on the feeds.`
			}
		} else {
			t += `is working in ${V.dairyName}, `
			if (slave.lactation > 0) {
				if (slave.balls > 0 && jsRandom(1,2) == 1) {
					if (slave.dick > 0) {
						if (_seed > 50) {
							t += `and is having ${his} cock milked. As you watch, `
							if (slave.scrotum) {
								t += `${his} balls tighten `
							} else {
								t += `${he} begins to thrust harder `
							}
							if (V.dairyStimulatorsSetting > 0) {
								t += `as the phallus up ${his} butt `
							} else {
								t += `as the suction to ${his} dick `
							}
							t += `brings ${him} closer to a copious ejaculation.`
						} else {
							t += `and is massaging ${his} sore swollen cock, but you have a good view of ${his} ${race} body on the feeds.`
						}
					} else {
						if (_seed > 50) {
							t += `and is having ${his} balls drained. As you watch, `
							if (slave.scrotum) {
								t += `${his} scrotum tightens `
							} else {
								t += `${he} begins to thrust harder `
							}
							if (V.dairyStimulatorsSetting) {
								t += `as the phallus up ${his} butt `
							} else {
								t += `as the suction against ${his} crotch `
							}
							t += `brings ${him} closer to a copious squirting.`
						} else {
							t += `and is massaging ${his} aching balls, but you have a good view of ${his} ${race} body on the feeds.`
						}
					}
				} else {
					if (_seed > 50) {
						t += `and is having ${his} tits milked, but you have a good view of ${his} ${race} body on the feeds.`
					} else {
						t += `and is massaging ${his} sore tits, but you have a good view of ${his} ${race} body on the feeds.`
					}
				}
			} else if (slave.balls > 0) {
				if (slave.dick > 0) {
					if (_seed > 50) {
						t += `and is having ${his} cock milked. As you watch, `
						if (slave.scrotum) {
							t += `${his} balls tighten `
						} else {
							t += `${he} begins to thrust harder `
						}
						if (V.dairyStimulatorsSetting) {
							t += `as the phallus up ${his} butt `
						} else {
							t += `as the suction to ${his} dick `
						}
						t += `brings ${him} closer to a copious ejaculation.`
					} else {
						t += `and is massaging ${his} sore swollen cock, but you have a good view of ${his} ${race} body on the feeds.`
					}
				} else {
					if (_seed > 50) {
						t += `and is having ${his} balls drained. As you watch, `
						if (slave.scrotum) {
							t += `${his} scrotum tightens `
						} else {
							t += `${he} begins to thrust harder `
						}
						if (V.dairyStimulatorsSetting) {
							t += `as the phallus up ${his} butt `
						} else {
							t += `as the suction against ${his} crotch `
						}
						t += `brings ${him} closer to a copious squirting.`
					} else {
						t += `and is massaging ${his} aching balls, but you have a good view of ${his} ${race} body on the feeds.`
					}
				}
			} else {
				t += `and is massaging ${his} sore, milkless tits, but you have a good view of ${his} ${race} body on the feeds.`
			}
		}
		break
	case "work in the brothel":
		/* Beauty is being supplanted here until it is JS'd, after which it should be retured! */
		t += `is working in ${V.brothelName}, and is `
		if (slave.whoreSkill >= 100 && jsRandom(1,2) == 1) {
			if (_seed > 80) {
				if (canDoAnal(slave) || canDoVaginal(slave)) {
					t += `riding one customer's dick while ${he} gives another a blowjob.`
				} else {
					t += "deep throating a pair of customer's dicks."
				}
			} else if (_seed > 60 && slave.amp != 1) {
				t += "sucking one customer's cock while giving another a handjob."
			} else if (_seed > 40) {
				t += "eating out one customer's cunt while another "
				if (canDoAnal(slave) || canDoVaginal(slave)) {
					t += `uses a strap-on on ${him}.`
				} else {
					t += `teases ${his} butt.`
				}
			} else if (_seed > 20) {
				if (canDoAnal(slave) || canDoVaginal(slave)) {
					t += "getting pounded by "
				} else {
					t += "amusing "
				}
				t += "two women wearing strap-ons."
			} else {
				if (canDoAnal(slave) || canDoVaginal(slave)) {
					t += "being double penetrated by "
				} else {
					t += `using ${her} body to please `
				}
				t += "a pair of customers."
			}
		} else if (_seed > 80) {
			if (canDoAnal(slave) || canDoVaginal(slave)) {
				t += "pleasing "
			} else {
				t += "riding "
			}
			t += "a customer's dick."
		} else if (_seed > 60) {
			t += "sucking a customer's cock."
		} else if (_seed > 40) {
			t += "pleasuring a customer's cunt."
		} else if (_seed > 20) {
			t += "getting pounded by a woman wearing a strap-on."
		} else {
			t += "being held down and "
			if (canDoAnal(slave)) {
				t += "buttfucked "
			} else {
				t += "raped "
			}
			t += "by a customer."
		}
		t += ` You have a voyeuristic view of ${his} ${race} body on the feeds.`
		break
	case "serve in the club":
		t += `is working in ${V.clubName}, `
		if (_seed > 50) {
			t += `displaying ${his} ${race} body, keeping citizens company, and flirting with anyone who shows interest.`
		} else {
			t += `or rather just off it, having taken a prominent citizen back to a discreet room so he can use ${his} ${race} body.`
		}
		break
	case "work as a servant":
		if (_seed > 50) {
			t += "was scrubbing the penthouse floor, until another slave requested oral service."
		} else {
			t += "is scrubbing the penthouse floor."
		}
		break
	case "serve in the master suite":
		if (slave.fuckdoll > 0) {
			t += `waiting for use in ${V.masterSuiteName}, next to a display case full of other sex toys.`
		} else if (V.masterSuiteUpgradeLuxury == 1) {
			if (_seed > 50) {
				t += `is sitting on the big bed in ${V.masterSuiteName}, awaiting your return.`
			} else {
				t += `is beautifying ${himself} in ${V.masterSuiteName} so ${he}'ll be pretty when you return.`
			}
		} else if (V.masterSuiteUpgradeLuxury == 2) {
			t += `is in ${V.masterSuiteName}'s fuckpit, `
			if (_seed > 80) {
				t += `with a pair of ${his} fellow fucktoys industriously sucking on ${his} nipples.`
			} else if (_seed > 60) {
				if ((slave.anus > 0 && canDoAnal(slave)) || (slave.vagina > 0 && canDoVaginal(slave))) {
					t += "taking double penetration from "
				} else {
					t += "being spitroasted by "
				}
				t += `a pair of ${his} fellow fucktoys.`
			} else if (_seed > 40) {
				if (canPenetrate(slave)) {
					t += `with ${his} dick inside `
				} else if (slave.dick > 0 && slave.dickAccessory != "chastity" && slave.dick != "combined chastity") {
					t += `getting ${his} soft dick sucked by `
				} else if (canDoVaginal(slave) || canDoAnal(slave)) {
					t += "getting eaten out by "
				} else {
					t += "making out with "
				}
				t += "a fellow fucktoy."
			} else if (_seed > 20) {
				if (slave.vagina > 0 && canDoVaginal(slave)) {
					t += "getting pounded "
				} else if (slave.anus > 0 && canDoAnal(slave)) {
					t += `getting ${his} ass pounded `
				} else if (canDoVaginal(slave) || canDoAnal(slave)) {
					t += "getting eaten out "
				} else {
					t += "getting deepthroated "
				}
				t += "by a fellow fucktoy."
			} else {
				t += "performing oral sex on a fellow fucktoy."
			}
		} else {
			if (slave.energy > 95) {
				t += `is having enthusiastic sex with your other pets while waiting for you to ravish ${him}.`
			} else {
				t += "is having idle sex with several of your other toys while they await your pleasure."
				if (slave.fetishKnown == 1) {
					switch (slave.fetish) {
					case "buttslut":
						if (canDoAnal(slave) && slave.anus > 0) {
							t += `${He}'s happily taking a strap-on up ${his} asspussy.`
						} else {
							t += `${He}'s happily got another slave between ${his} buttcheeks.`
						}
						break
					case "cumslut":
						t += `${He}'s happily performing oral on another slave.`
						break
					case "dom":
						t += `${He}'s pinning another slave down while ${he} fucks her.`
						break
					case "submissive":
						t += `${He}'s letting another slave have her way with ${him}.`
						break
					case "sadist":
						if (slave.amp != 1) {
							t += `${He}'s spanking another slave with one hand and fingering her with the other.`
						} else {
							t += `${He}'s painfully teasing another slave's nipple with ${his} teeth.`
						}
						break
					case "masochist":
						t += `Another slave is spanking ${him} while molesting everything she can.`
						break
					case "boobs":
						t += `${He} has a slave sucking on each of ${his} nipples`
						if (slave.amp != 1) {
							t += ` while ${he} gives each a handjob.`
						} else {
							t += "."
						}
						break
					case "pregnancy":
						if (slave.belly >= 5000) {
							t += `${He}'s sighing contentedly as ${his} rounded belly is sensually rubbed.`
						} else if (canPenetrate(slave)) {
							t += `${He}'s happily roleplaying impregnating the slave ${he}'s fucking.`
						} else if ((slave.anus > 0 && canDoAnal(slave)) || (slave.vagina > 0 && canDoVaginal(slave))) {
							t += `${He}'s happily roleplaying conceiving a child as ${he} gets fucked.`
						} else {
							t += `${He}'s happily roleplaying being hugely pregnant.`
						}
					}
				}
			}
		}
		break
	/*
	case "guard you":
		t += "is standing discreetly behind your left shoulder, watching for threats."
		break
	*/
	case "stay confined":
		t += `is confined, but you have a fine view of ${his} ${race} body on the feed from ${his} cell.`
		break
	case "be confined in the cellblock":
		t += `is confined in ${V.cellblockName}, but you have a fine view of ${his} ${race} body on the feed from ${his} cell.`
		break
	case "be confined in the arcade":
	case "work a glory hole":
		t += "is confined in "
		if (slave.assignment == "be confined in the arcade") {
			t += `${V.arcadeName}; `
		} else {
			t += "a glory hole; "
		}
		if (_seed > 80 && (canDoAnal(slave) || canDoVaginal(slave))) {
			t += `${his} ass is held out at cock height, and a customer is using ${his} fuckhole.`
		} else if (_seed > 60) {
			t += `${his} mouth is held open at cock height, and a customer is fucking ${his} throat.`
		} else if (_seed > 40) {
			t += `a woman is abusing ${him} with a couple of dildos.`
		} else if (_seed > 20 && canDoAnal(slave)) {
			t += `a customer is harshly using ${his} defenseless anus.`
		} else {
			t += `a customer is cruelly spanking ${his} helpless butt.`
		}
		break
	case "be the Madam":
		t += `is managing ${V.brothelName}: ${he} is making sure all the customers are satisfied and all the whores are working hard.`
		break
	case "be your Concubine":
		if (jsRandom(1,2) == 1) {
			t += `is looking after ${himself}; ${he} spends many hours every day on ${his} beauty regimen.`
		} else {
			t += "is checking over the appearance of your harem, making sure everyone looks perfect."
		}
		break
	case "be the Wardeness":
		t += `is looking after the cells: ${he} is `
		if (_seed > 50) {
			t += `forcing a resistant slave to orally service ${him}.`
		} else {
			t += "beating a rebellious slave across the buttocks."
		}
		break
	case "live with your Head Girl":
		if (V.HeadGirl != 0) {
			t += `is getting the Head Girl's suite cleaned up while ${V.HeadGirl.slaveName} is out working.`
		} else {
			t += "is making sure the Head Girl's suite is in order for your next Head Girl."
		}
		break
	case "be the Stewardess":
		t += `is managing the house servants in ${V.servantsQuartersName}: ${he} overseeing the laboring house slaves and punishing any that step out of line.`
		break
	case "be the Schoolteacher":
		t += `is teaching classes in ${V.schoolroomName}: ${he} is leading the slave students in rote recitation.`
		break
	case "be the Attendant":
		t += `is seeing to girls in ${V.spaName}: ${he} is gently soaping an exhausted slave.`
		break
	case "be the DJ":
		if (_seed > 50) {
			t += `is right where ${he} belongs, in the DJ booth in ${V.clubName} ${he} leads. ${He}'s bouncing in time with the beat to show off ${his} `
			if (slave.boobs > 300) {
				t += "tits."
			} else {
				t += "goods."
			}
		} else {
			t += `is taking the lead on ${V.clubName}'s floor: ${he} greets new arrivals, flirts with them prettily, and subtly guides them towards choice sluts.`
		}
		break
	case "be the Milkmaid":
		t += `is working in ${V.dairyName}, looking after your stock.`
		break
	default: /* WALKPASTS START HERE */
		if (slave.heels == 1 && !["flats", "none"].includes(slave.shoes)) {
			t += `walks past your desk with the tiny swaying steps ${he} must take in order to walk on ${his} surgically altered legs. ${He} is on ${his} way to `
		} else if (["heels", "pumps"].includes(slave.shoes)) {
			t += `walks past your desk with the swaying steps ${he} must take in ${his} high heels. ${He} is on ${his} way to `
		} else if (slave.shoes == "boots") {
			t += `walks past your desk with the confident gait encouraged by ${his} high heeled boots. ${He} is on ${his} way to `
		} else if (slave.shoes == "extreme heels") {
			t += `walks past your desk with the tiny swaying steps ${he} must take in ${his} ridiculous heels. ${He} is on ${his} way to `
		} else if (slave.heels == 1) {
			t += `crawls past your desk on all fours, since ${he} has not been allowed the heels ${he} needs to walk upright. ${He} is on ${his} way to `
		} else if (slave.amp == 1) {
			t += `is carried past your desk by one of your other slaves. ${He} is on ${his} way to `
		} else if (!canWalk(slave)) {
			t += `is helped past your desk by one of your other slaves. ${He} is on ${his} way to `
		} else {
			t += `walks past your desk on ${his} way to `
		}
		if (slave.inflation > 0 && jsRandom(1,100) > 70) {
			if (slave.inflationMethod == 1) {
				t += `gorge ${himself} with ${slave.inflationType}; `
			} else if (slave.inflationMethod == 2) {
				t += `fill ${his} rear with `
				switch (slave.inflationType) {
				case "water":
				case "milk":
				case "cum":
				case "food":
					t += `${slave.inflationType}; `
					break
				default:
					t += `${slave.inflationType}s; `
					break
				}
			} else if (slave.inflationMethod == 3) {
				if (slave.inflationType == "milk") {
					t += `suckle from ${his} assigned nipple until ${he} is sufficiently filled with milk; `
				} else {
					t += `suck ${his} assigned dick until ${he} is sufficiently filled with cum; `
				}
			}
		} else {
			switch (slave.assignment) {
			case "rest":
				if (_seed > 50) {
					t += "bed; "
				} else {
					t += "eat; "
				}
				break
			case "get milked":
				if (_seed > 50) {
					if (slave.lactation) {
						t += `milk ${his} overfull ${race} tits; `
					} else {
						t += `empty ${his} aching balls; `
					}
				} else {
					if (slave.lactation) {
						t += `drain ${his} milky ${race} udders; `
					} else {
						t += `relieve ${his} heavy balls; `
					}
				}
				break
			case "whore":
				if (_seed > 50) {
					t += `sell ${his} ${race} body; `
				} else {
					t += `ply ${his} trade as a whore; `
				}
				break
			case "serve the public":
				if (_seed > 50) {
					t += "serve the public; "
				} else {
					t += "be a public slut; "
				}
				break
			case "rest in the spa":
				t += `relax in ${V.spaName}; `
				break
			case "please you":
				t += `wait next to you and wait for you to fuck ${him}; `
				break
			case "be a subordinate slave":
				t += "service your other slaves; "
				break
			case "be a servant":
				t += "clean up after your other slaves; "
				break
			case "learn in the schoolroom":
				t += "attend classes "
				if (V.Schoolteacher == 0) {
					t += `in ${V.schoolroomName}; `
				} else {
					t += `under ${V.Schoolteacher.slaveName}, perhaps literally; `
				}
				break
			case "be a subordinate slave":
				t += "service your other slaves; "
				break
			case "be the Attendant":
				t += `look after the girls in ${V.spaName}; `
				break
			case "take classes":
				t += `attend classes with ${V.assistantName}; `
				break
			case "be your Head Girl":
				t += "oversee your other slaves; "
				break
			case "recruit girls":
				t += `use ${his} connections to recruit slaves; `
				break
			default:
				t += `${slave.assignment}; `
				break
			}
		} /* end inflation blurb */
		if (slave.fetish == "mindbroken") {
			t += `${he} does not even glance at you as ${he} goes mindlessly to ${his} next task.`
		} else if (slave.devotion < -50) {
			t += `${he} directs a look of pure hatred at where you sit as ${he} passes.`
		} else if (slave.devotion < -20) {
			t += `${he} cannot keep the loathing from ${his} face as ${he} passes.`
		} else if (slave.devotion <= 20) {
			t += `${he} passes quickly, obviously hoping to avoid you.`
		} else if (slave.devotion <= 50) {
			t += `${he} rushes by, hurrying to ${his} next task.`
		} else {
			t += `as ${he} passes ${he} gives you a look of adoration.`
		}
		break
	}
	return t
}

repo_name: nook/fc


code:
:: wombJS [script]

/*
This is womb processor/simulator script. It's take care about calculation of belly sizes based on individual foetus sizes,
with full support of broodmothers implant random turning on and off possibility. Also this can be expanded to store more parents data in each individual fetus in future.
Design limitations:
- Mother can't gestate children with different speeds at same time. All speed changes apply to all fetuses.
- Sizes of inividual fetuses updated only on call of WombGetVolume - not every time as called WombProgress. This is for better overail code speed.
- For broodmothers we need actual "new ova release" code now. But it's possible to control how many children will be added each time, and so - how much children is ready to birth each time.

Usage from sugarcube code (samples):

WombInit($slave) - before first pregnancy, at slave creation, of as backward compatibility update.

WombImpregnate($slave, $fetus_count, $fatherID, $initial_age) - should be added after normal impregnation code, with already calcualted fetus count. ID of father - can be used in future for prcess children from different fathers in one pregnancy. Initial age normally 1 (as .preg normally set to 1), but can be raised if needed. Also should be called at time as broodmother implant add another fetus(es), or if new fetuses added from other sources in future (transplanting maybe?)

WombProgress($slave, $time_to_add_to_fetuses) - after code that update $slave.preg, time to add should be the same.

$isReady = WombBirthReady($slave, $birth_ready_age) - how many children ready to be birthed if their time to be ready is $birth_ready_age (40 is for normal length pregnancy). Return int - count of ready to birth children, or 0 if no ready exists.

$children = WombBirth($slave, $birth_ready_age) - for actual birth. Return array with fetuses objects that birthed (can be used in future) and remove them from womb array of $slave. Should be called at actual birth code in sugarcube. fetuses that not ready remained in womb (array).

WombFlush($slave) - clean womb (array). Can be used at broodmother birthstorm or abortion situations in game. But birthstorm logically should use WombBirth($slave, 35) or so before - some children in this event is live capable, others is not.

$slave.bellyPreg = WombGetWolume($slave) - return double, with current womb volume in CC - for updating $slave.bellyPreg, or if need to update individual fetuses sizes.

*/

//Init womb system.
window.WombInit = function(actor) {

	if (!Array.isArray(actor.womb)) {
		//alert("creating new womb"); //debugging
		actor.womb = [];
	}

	//console.log("broodmother:" + typeof actor.broodmother);

	if ( typeof actor.broodmother != "number" ) {
		actor.broodmother = 0;
		actor.broodmotherFetuses = 0;
	}

	if ( typeof actor.readyOva != "number" ) {
		actor.readyOva = 0;
	}

	//backward compatibility setup. Fully accurate for normal pregnancy only.
	if (actor.womb.length > 0 && actor.womb[0].genetics == undefined) {
		var i=0
		actor.womb.forEach(function(ft){
			ft.genetics = generateGenetics(actor.ID, actor.pregSource, i);
			i++;
		});
	} else if (actor.womb.length == 0 && actor.pregType != 0 && actor.broodmother == 0) {
		WombImpregnate(actor, actor.pregType, actor.pregSource, actor.preg);
	} else if (actor.womb.length == 0 && actor.pregType != 0 && actor.broodmother > 0 && actor.broodmotherOnHold < 1) {
		//sorry but for already present broodmothers it's impossible to calculate fully, aproximation used.
		var i, pw = actor.preg, bCount, bLeft;
		if (pw > 40) pw = 40; //to avoid disaster.
		bCount = Math.floor(actor.pregType/pw);
		bLeft = actor.pregType - (bCount*pw);
		if (pw > actor.pregType) {
			pw = actor.pregType; // low children count broodmothers not supported here. It's emergency/backward compatibility code, and they not in game anyway. So minimum is 1 fetus in week.
			actor.preg = pw; // fixing initial pregnancy week.
		}
		for (i=0; i<pw; i++) {
			WombImpregnate(actor, bCount, actor.pregSource, i); // setting fetuses for every week, up to 40 week at max.
		}

		if (bLeft > 0) {
			WombImpregnate(actor, bLeft, actor.pregSource, i+1); // setting up leftower of fetuses.
		}
	}
};

window.WombImpregnate = function(actor, fCount, fatherID, age) {
	var i;
	var tf;
	for (i=0; i<fCount; i++) {
		tf = {}; //new Object
		tf.age = age; //initial age
		tf.motherID = actor.ID; //Initial biological mother ID setup.
		tf.fatherID = fatherID; //We can store who is father too.
		tf.volume = 1; //Initial, to create property. Updated with actual data after WombGetVolume call.
		tf.reserve = ""; //Initial, to create property. Used later to mark if this child is to be kept.
		tf.identical = 0; //Initial, to create property. Updated with actual data during fetalSplit call.
		tf.splitted = 0; //marker for already splitted fetus.
		tf.genetics = generateGenetics(actor, fatherID, i+1); //Stored genetic information.
		tf.ID = genUUID();

		try {
			if (actor.womb.length == 0) {
				actor.pregWeek = age;
				actor.preg = age;
			}
			actor.womb.push(tf);
		} catch(err){
			WombInit(actor);
			actor.womb.push(tf);
			alert("WombImpregnate warning - " + actor.slaveName+" "+err);
		}

	}
	MissingParentIDCorrection(actor);
};

window.WombSurrogate = function(actor, fCount, mother, fatherID, age) {
	var i;
	var tf;
	for (i=0; i<fCount; i++) {
		tf = {}; //new Object
		tf.age = age; //initial age
		tf.motherID = mother.ID; //Initial biological mother ID setup.
		tf.fatherID = fatherID; //We can store who is father too.
		tf.volume = 1; //Initial, to create property. Updated with actual data after WombGetVolume call.
		tf.reserve = ""; //Initial, to create property. Used later to mark if this child is to be kept.
		tf.identical = 0; //Initial, to create property. Updated with actual data during fetalSplit call.
		tf.splitted = 0; //marker for already splitted fetus.
		tf.genetics = generateGenetics(mother, fatherID, i+1); //Stored genetic information.

		try {
			if (actor.womb.length == 0) {
				actor.pregWeek = age;
				actor.preg = age;
			}
			actor.womb.push(tf);
		} catch(err){
			WombInit(actor);
			actor.womb.push(tf);
			alert("WombImpregnate warning - " + actor.slaveName+" "+err);
		}

	}
	MissingParentIDCorrection(actor);
};

window.WombProgress = function(actor, ageToAdd) {
	var i, ft;
	ageToAdd = Math.ceil(ageToAdd*10)/10;
	try {
		actor.womb.forEach(ft => ft.age += ageToAdd);
	} catch(err){
		WombInit(actor);
		alert("WombProgress warning - " + actor.slaveName+" "+err);
	}
};

window.WombBirth = function(actor, readyAge) {
	try {
		WombSort(actor); //For normal processing fetuses that more old should be first. Now - they are.
		} catch(err){
		WombInit(actor);
		alert("WombBirth warning - " + actor.slaveName+" "+err);
		}

	var birthed = [];
	var ready = WombBirthReady(actor, readyAge);
	var i;

	for (i=0; i<ready; i++) { //here can't be used "for .. in .." syntax.
		birthed.push(actor.womb.shift());
	}

	return birthed;
};

window.WombFlush = function(actor) {
	actor.womb = [];
};

window.WombBirthReady = function(actor, readyAge) {
	var i, ft;
	var readyCnt = 0;
	try {
		readyCnt += actor.womb.filter(ft => ft.age >= readyAge).length;
	} catch(err){
		WombInit(actor);
		alert("WombBirthReady warning - " + actor.slaveName+" "+err);
		return 0;
	}

	return readyCnt;
};

window.WombGetVolume = function(actor) { //most code from pregJS.tw with minor adaptation.
	var gestastionWeek;
	var phi = 1.618;
	var targetLen;
	var wombSize = 0;
	try {
		actor.womb.forEach(ft => {
			gestastionWeek = ft.age;
			if (gestastionWeek <= 32) {
				targetLen = (0.00006396 * Math.pow(gestastionWeek, 4)) -
					(0.005501 * Math.pow(gestastionWeek, 3)) +
					(0.161 * Math.pow(gestastionWeek, 2)) -
					(0.76 * gestastionWeek) +
					0.208;
			} else if (gestastionWeek <= 106) {
				targetLen = (-0.0000004675 * Math.pow(gestastionWeek, 4)) +
					(0.0001905 * Math.pow(gestastionWeek, 3)) -
					(0.029 * Math.pow(gestastionWeek, 2)) +
					(2.132 * gestastionWeek) -
					16.575;
			} else {
				targetLen = (-0.00003266 * Math.pow(gestastionWeek,2)) +
					(0.076 * gestastionWeek) +
					43.843;
			}
			ft.volume = ((4 / 3) * (Math.PI) * (phi / 2) * (Math.pow((targetLen / 2), 3)));
			wombSize += ft.volume;
		});
	} catch(err){
		WombInit(actor);
		alert("WombGetVolume warning - " + actor.slaveName + " " + err);
	}
	if (wombSize < 0) //catch for strange cases, to avoid messing with outside code.
		wombSize = 0;
	return wombSize;
};

window.WombUpdatePregVars = function(actor) {
	WombSort(actor);
	if (actor.womb.length > 0) {
		if (actor.preg > 0 && actor.womb[0].age > 0) {
			actor.preg = actor.womb[0].age;
		}
		actor.pregType = actor.womb.length;
		actor.bellyPreg = WombGetVolume(actor);
	}
};

window.WombMinPreg = function(actor) {
	WombSort(actor);
	if (actor.womb.length > 0)
		return actor.womb[actor.womb.length-1].age;
	else
		return 0;
};

window.WombMaxPreg = function(actor) {
	WombSort(actor);
	if (actor.womb.length > 0)
		return actor.womb[0].age;
	else
		return 0;
};

window.WombNormalizePreg = function(actor)
{
	// console.log("New actor: " + actor.slaveName + " ===============" + actor.name);
	WombInit(actor);

	// this is broodmother on hold.
	if (actor.womb.length == 0 && actor.broodmother >= 1) {
		actor.pregType = 0;
		actor.pregKnown = 0;

		// to avoid legacy code conflicts - broodmother on hold
		// can't be impregnated, but she not on normal contraceptives.
		// So we set this for special case.
		if (actor.preg >= 0)
			actor.preg = 0.1;

		if (actor.pregSource > 0)
			actor.pregSource = 0;

		if (actor.pregWeek > 0)
			actor.pregWeek = 0;

		actor.broodmotherCountDown = 0;
	}

	if (actor.womb.length > 0) {
		var max = WombMaxPreg(actor);
		// console.log("max: " + max);
		// console.log(".preg: "+ actor.preg);
		if (actor.pregWeek < 1 )
			actor.pregWeek = 1;

		if (max < actor.preg) {
			WombProgress(actor, actor.preg - max);
			// console.log("progressin womb");
		}
		else if ( max > actor.preg) {
			actor.preg = max;
			// console.log("advancing .preg");
		}

		actor.pregType = actor.womb.length;
		actor.pregSource = actor.womb[0].fatherID;
	} else if (actor.womb.length == 0 && actor.broodmother < 1) {
		//not broodmother
		// console.log("preg fixing");
		actor.pregType = 0;
		actor.pregKnown = 0;

		if (actor.preg > 0)
			actor.preg = 0;

		if (actor.pregSource > 0)
			actor.pregSource = 0;

		// We can't properly set postpartum here,
		// but can normalize obvious error with forgotten property.
		if (actor.pregWeek > 0)
			actor.pregWeek = 0;
	}
	actor.bellyPreg = WombGetVolume(actor);
};

window.WombZeroID = function(actor, id) {
	WombInit(actor);
	actor.womb
		.filter(ft => ft.fatherID === id)
		.forEach(ft => ft.fatherID = 0);
	WombNormalizePreg(actor);
};

window.WombChangeID = function(actor, fromID, toID) {
	WombInit(actor);
	actor.womb
		.filter(ft => ft.fatherID === fromID)
		.forEach(ft => ft.fatherID = toID);
	WombNormalizePreg(actor);
};

window.WombChangeGeneID = function(actor, fromID, toID) {
	WombInit(actor);
	actor.womb
		.filter(ft => ft.genetics.father === fromID)
		.forEach(ft => ft.genetics.father = toID);
	actor.womb
		.filter(ft => ft.genetics.mother === fromID)
		.forEach(ft => ft.genetics.mother = toID);
	WombNormalizePreg(actor);
};

/* Sorts the womb object by age with oldest and thus soonest to be born, first. This will be needed in the future once individual fertilization is a possibility.*/
window.WombSort = function(actor) {
	actor.womb.sort((a, b) => { return b.age - a.age; });
};

//now function work with chance. Literary we give it "one from X" as chance.
window.fetalSplit = function(actor, chance) {
	var i, ft;
	var nft;

	actor.womb.forEach(function(s){
		if ((jsRandom(1,chance) >= chance) && s.splitted !== 1)
		{
			nft = {};
			nft.age = s.age;
			nft.fatherID = s.fatherID;
			nft.motherID = s.motherID;
			nft.volume = s.volume;
			nft.reserve = ""; //splitted fetus is new separate, reserve - it's not genetic to split.
			nft.genetics = deepCopy(s.genetics);
			s.splitted = 1; //this is marker that this is already splitted fetus (to not split second time in loop), only source fetus needed it.
			nft.identical = 1; //this is marker that this fetus has at least one twin.
			s.identical = 1; //this is marker that this fetus has at least one twin.

			if (s.twinID == "" || s.twinID == undefined)
				s.twinID = genUUID();

			nft.twinID = s.twinID;

			actor.womb.push(nft);

		}
	});
	WombNormalizePreg(actor);
};

//safe alternative to .womb.length.
window.WombFetusCount = function(actor)
{
	WombInit(actor);
	return actor.womb.length;
}

//give reference to fetus object, but not remove fetus, use for manupulation in the womb.
window.WombGetFetus = function(actor, fetusNum)
{
	WombInit(actor);
	if (actor.womb.length >= fetusNum)
		return actor.womb[fetusNum];
	else
		return null;
}

//give reference to fetus object, and remove it form the womb.
window.WombRemoveFetus = function(actor, fetusNum)
{
	WombInit(actor);
	if (actor.womb.length >= fetusNum){
		let ft = actor.womb[fetusNum];
		actor.womb.splice(fetusNum, 1);
		WombSort(actor);
		return ft;
	}
	else
		return null;
}

/*to add fetus object in the womb. Be warned - you can add one single fetus to many wombs, or even add it many times to one womb. It's will not show error, but behavior become strange, as fetus object will be the same - it's reference, not full copies. If this not desired - use deepCopy on fetus before adding.*/
window.WombAddFetus = function(actor, fetus)
{
	WombInit(actor);
	actor.womb.push(fetus);
	WombSort(actor);
}

// change property for all fetuses. Like fetus.age = X.
window.WombChangeFetus = function(actor, propName, newValue)
{
	WombInit(actor);
	actor.womb.forEach(ft => ft[propName] = newValue);
}

// change genetic property of all fetuses. Like fetus.genetic.intelligence = X
window.WombChangeGene = function(actor, geneName, newValue)
{
	WombInit(actor);
	actor.womb.forEach(ft => ft.genetics[geneName] = newValue);
}

// replaces untraceable fatherIDs with missingParentID. Required for concurrent pregancy to differentiate between siblings.
window.MissingParentIDCorrection = function(actor) {
	WombInit(actor);
	actor.womb
		.filter(ft => (ft.genetics.father === 0 || (ft.genetics.father < -1 && ft.genetics.father >= -20)))
		.forEach(ft => ft.genetics.father = State.variables.missingParentID);
	State.variables.missingParentID--;
}

window.WombCleanYYFetuses = function(actor)
{
	var reserved = [];

	var i = actor.womb.length-1;
	var ft;

	while (i >= 0)
	{
		ft = actor.womb[i];

		if (ft.genetics.gender == "YY")
		{
			reserved.push(ft);
			actor.womb.splice(i, 1);
		}

		i--;
	}

	return reserved;
}

window.FetusGlobalReserveCount = function(reserveType)
{
	var cnt = 0;
	var SV = State.variables;

	if (typeof reserveType != 'string' )
		return 0;

	SV.slaves.forEach(function(slave){
		slave.womb.forEach(function(ft){
			if (ft.reserve == reserveType)
				cnt++;
			});
		});

	SV.PC.womb.forEach(function(ft){
		if (ft.reserve == reserveType)
			cnt++;
		});

	return cnt;
}

window.WombSetGenericReserve = function(actor, type, count)
{
	//console.log ("actor: " + actor + "  type: " + type + "  typeof: " + typeof type + "  count: " + count);
	actor.womb.forEach(function(ft){
		//console.log ("  type: " + ft.reserve + "  typeof: " + typeof ft.reserve);
		if ((ft.reserve == "" || ft.reserve == type) && count > 0)
		{
			//console.log ("!trigger");
			ft.reserve = type;
			count--;
		}

	});
}

window.WombAddToGenericReserve = function(actor, type, count)
{

	WombSetGenericReserve(actor, type, (WombReserveCount(actor, type)+count));

}

window.WombChangeReserveType = function(actor, oldType, newType)
{

	var count = 0;

	actor.womb.forEach(function(ft){
		if (ft.reserve == oldType)
		{
			ft.reserve = newType;
			count++;
		}
	});

	return count;
}

window.WombCleanGenericReserve = function(actor, type, count)
{

	actor.womb.forEach(function(ft){

		if (ft.reserve == type && count > 0)
		{
			ft.reserve = "";
			count--;
		}

	});
}

window.WombReserveCount = function(actor, type)
{

	var cnt = 0;

	actor.womb.forEach(function(ft){

		if (ft.reserve == type)
		{
			cnt++;
		}

	});

	return cnt;
}

window.WombGetReservedFetuses = function(actor, type)
{
	var reserved = [];

	actor.womb.forEach(function(ft){

		if (ft.reserve == type)
		{
			reserved.push(ft);
		}

	});

	return reserved;
}

window.WombRemoveReservedFetuses = function(actor, type)
{
	var reserved = [];

	var i = actor.womb.length-1;
	var ft;

	while (i >= 0)
	{
		ft = actor.womb[i];

		if (ft.reserve == type)
		{
			reserved.push(ft);
			actor.womb.splice(i, 1);
		}

		i--;
	}

	return reserved;
}

window.WombCleanAllReserve = function(actor)
{

	actor.womb.forEach(function(ft){
		ft.reserve = "";
	});

}

window.BCReserveInit = function()
{
	var SV = State.variables;

	SV.slaves.forEach(function(slave)
	{
		slave.womb.forEach(function(ft)
		{
			if (typeof ft.reserve != 'string')
				ft.reserve = "";
				if (typeof ft.motherID != 'number') //setting missing biological mother ID for fetus.
					ft.motherID = slave.ID;

				if (ft.ID == undefined)
					ft.ID = genUUID();

			try {
					if (slave.reservedChildren > 0)
						WombSetGenericReserve(slave, "incubator", reservedChildren);

					if (slave.reservedChildrenNursery > 0)
						WombSetGenericReserve(slave, "nursery", reservedChildren);
					} catch (err) {

					console.log (err + " slave ID: " + slave.ID + " slave name: " + slave.slaveName + " " + slave.slaveSurname);
					slave.reservedChildren = 0;
				}
		});
	});

	SV.PC.womb.forEach(function(ft){
		if (typeof ft.reserve != 'string')
			ft.reserve = "";
			ft.motherID = SV.PC.ID;
		});

}

/* alt
window.fetalSplit = function(actor, chance)
{
	var i, ft, nft;

	actor.womb.forEach(function(s){
		if ((jsRandom(1,chance) >= chance) && s.identical !== 1)
		{
			nft = deepCopy(s);
			actor.womb.push(nft);
			s.identical = 1;
		}
	});
	WombNormalizePreg(actor);

}
*/


code:
:: Abort [nobr]

<<set $nextButton = "Back", $nextLink = "Slave Interact">>
<<run clearSummaryCache($activeSlave)>>

The remote surgery makes aborting a pregnancy quick and efficient. $activeSlave.slaveName is
<<if $activeSlave.fuckdoll == 0 && $activeSlave.fetish != "mindbroken">>
	completely unmoved by the development.
<<elseif $activeSlave.sexualFlaw == "breeder">>
	@@.red;fundamentally broken.@@ $His entire concept of self and sexuality was wrapped up in the life growing within $him, and now it is gone.
	<<set $activeSlave.fetish = "mindbroken", $activeSlave.behavioralQuirk = "none", $activeSlave.behavioralFlaw = "none", $activeSlave.sexualQuirk = "none", $activeSlave.sexualFlaw = "none", $activeSlave.devotion = 0, $activeSlave.trust = 0>>
<<elseif $activeSlave.devotion < -50>>
	@@.mediumorchid;filled with violent, consuming hatred@@. Even though $he knew $his baby was destined for a slave orphanage, it seems $he cared for it and views you as its killer. $He is @@.gold;terrified of your power@@ over $his body.
	<<set $activeSlave.trust -= 10, $activeSlave.devotion -= 25>>
<<elseif $activeSlave.devotion < -20>>
	@@.mediumorchid;afflicted by desperate, inconsolable sobbing@@. Even though $he knew $his baby was destined for a slave orphanage, it seems $he cared for it. $He is @@.gold;terrified of your power@@ over $his body.
	<<set $activeSlave.trust -= 10, $activeSlave.devotion -= 10>>
<<elseif $activeSlave.fetish == "pregnancy">>
	@@.mediumorchid;filled with a deep sorrow.@@ To a pregnancy fetishest, having a pregnancy end like this hurts far worse than birth ever would. $He is @@.gold;terrified of a repeat perfomance.@@
	<<set _fetishModifier = $activeSlave.fetishStrength/2>>
	<<set $activeSlave.devotion -= 1*_fetishModifier, $activeSlave.trust -= 1*_fetishModifier>>
<<elseif $activeSlave.devotion <= 20>>
	@@.mediumorchid;consumed by muted weeping and enduring sorrow@@. Even though $he knew $his baby was destined for a slave orphanage, it seems $he cared for it. $He is @@.gold;terrified of your power@@ over $his body.
	<<set $activeSlave.trust -= 10, $activeSlave.devotion -= 5>>
<<elseif $activeSlave.devotion <= 50>>
	dully obedient. $He has been broken to slave life so thoroughly that even this is neither surprising nor affecting. $He is @@.gold;terrified of your power@@ over $his body.
	<<set $activeSlave.trust -= 10>>
<<else>>
	@@.hotpink;pleased by this stark development@@, since $he is so attentive to your will. $He also expects $he'll be able to fuck better now.
	<<set $activeSlave.devotion += 4>>
<</if>>

<<if lastPregRule($activeSlave,$defaultRules)>><<set $activeSlave.preg = -1>><<else>><<set $activeSlave.preg = 0>><</if>>

<<set $reservedChildren = FetusGlobalReserveCount("incubator")>>
<<set $reservedChildrenNursery = FetusGlobalReserveCount("nursery")>>

<<set $activeSlave.pregType = 0>>
<<set $activeSlave.pregSource = 0>>
<<set $activeSlave.pregKnown = 0>>
<<set $activeSlave.pregWeek = -2>>
<<set WombFlush($activeSlave)>>
<<run SetBellySize($activeSlave)>>


code:
:: Acquisition [nobr]

<<unset $slaveWithoutBonuses, $startingGirlCopied, $startingGirlRelation>>

<<set $fixedNationality = 0, $encyclopedia = " ">>

<<if $saveImported == 1>><<set _valueOwed = 5000>><<else>><<set _valueOwed = 50000>><</if>>
<<if $freshPC == 1 || $saveImported == 0>>
	<<if $PC.career == "servant">>
		<<set $PC.geneticQuirks.fertility = 1>>
	<</if>>
	<<if $PC.vagina == 1>>
		<<set $PC.births = 0>>
		<<if $PC.career == "servant">>
			<<if $PC.pregType != 8>>
				<<if $PC.actualAge >= 50>>
					<<set $PC.births = 9>>
					<<set $PC.birthMaster = 9>>
				<<elseif $PC.actualAge >= 35>>
					<<set $PC.births = 6>>
					<<set $PC.birthMaster = 6>>
				<<else>>
					<<set $PC.births = 3>>
					<<set $PC.birthMaster = 3>>
				<</if>>
			<<else>> /* Master kept you pregged up */
				<<if $PC.actualAge >= 50>>
					<<set $PC.births = 70>>
					<<set $PC.birthMaster = 70>>
				<<elseif $PC.actualAge >= 35>>
					<<set $PC.births = 40>>
					<<set $PC.birthMaster = 40>>
				<<else>>
					<<set $PC.births = 16>>
					<<set $PC.birthMaster = 16>>
				<</if>>
			<</if>>
			<<set $PC.geneticQuirks.fertility = 2>>
			<<for $i = 0; $i < $slaves.length; $i++>>
				<<if $slaves[$i].origin == "She was another of your late master's servants. She spent nine months in your womb, courtesy of your master." || $slaves[$i].origin == "Your late master took pleasure in using his servants in creative ways. He inseminated you with your own sperm, and nine months later, your daughter was born.">>
				<<set $PC.births += 1>>
				<<set $PC.birthMaster += 1>>
				<</if>>
			<</for>>
		<<elseif $PC.career == "escort">>
			<<for $i = 0; $i < $slaves.length; $i++>>
				<<if $slaves[$i].origin == "She was the result of unprotected sex with a client. He paid you quite well to enjoy your body as you grew heavy with his child." || $slaves[$i].origin == "A client paid you a large sum of credits to prove you could literally fuck yourself. She is the result of that lucrative night.">>
				<<set $PC.births += 1>>
				<<set $PC.birthClient += 1>>
				<</if>>
			<</for>>
		<<else>>
			<<for $i = 0; $i < $slaves.length; $i++>>
				<<if $slaves[$i].mother == -1>>
				<<set $PC.births += 1>>
				<<set $PC.birthOther += 1>>
				<</if>>
			<</for>>
		<</if>>
		<<if $PC.preg > 0>>
			<<set $PC.pregWeek = $PC.preg>>
			<<if $PC.pregType != 8>>
				<<set $PC.pregType = 1>>
			<<else>>
				<<set $PC.geneticQuirks.hyperFertility = 2>>
			<</if>>
			<<if $PC.career == "servant">>
				<<set $PC.pregSource = -3>>
				<<if $PC.pregType != 8>>
					<<set $PC.pregType += random(0,0,1)>>
				<</if>>
			<<elseif $PC.career == "escort">>
				<<set $PC.pregSource = -5>>
			<</if>>
			<<set $PC.pregKnown = 1>>
			<<set $PC.belly = getPregBellySize($PC)>>
			<<set WombImpregnate($PC, $PC.pregType, $PC.pregSource, $PC.preg)>>
		<</if>>
	<</if>>
	<<if $PC.dick == 1>>
		<<set $PC.geneticQuirks.wellHung = 2>>
	<</if>>
	<<set $PC.ovaryAge = $PC.physicalAge>>
<<else>> /*testtest*/
	<<set $PC.sisters = 0>>
	<<set $PC.daughters = 0>>
<</if>> /*closes ng*/
<<if $familyTesting == 1>>
	<<set _pcMomFound = 0, _pcDadFound = 0>>
	<<if def $slaveIndices[$PC.mother]>>
		<<set _pcMomFound = 1>>
	<</if>>
	<<if def $slaveIndices[$PC.father]>>
		<<set _pcDadFound = 1>>
	<</if>>
	<<for _i = 0; _i < $slaves.length; _i++>>
		<<if $slaves[_i].mother == $PC.ID || $slaves[_i].father == $PC.ID>>
			<<set $PC.daughters += 1>>
		<</if>>
		<<if areSisters($slaves[_i], $PC) > 0>>
			<<set $PC.sisters += 1>>
		<</if>>
	<</for>>
	<<if _pcMomFound == 0 && $PC.mother > 0>>
		<<set _lostMom = $PC.mother>>
		<<set $PC.mother = $missingParentId>>
		<<for _i = 0; _i < $slaves.length; _i++>>
			<<if $slaves[_i].mother == _lostMom>>
				<<set $slaves[_i].mother = $missingParentId>>
			<</if>>
		<</for>>
		<<set $missingParentId-->>
	<</if>>
	<<if _pcDadFound == 0 && $PC.father > 0>>
		<<set _lostDad = $PC.father>>
		<<set $PC.father = $missingParentId>>
		<<for _i = 0; _i < $slaves.length; _i++>>
			<<if $slaves[_i].father == _lostDad>>
				<<set $slaves[_i].father = $missingParentId>>
			<</if>>
		<</for>>
		<<set $missingParentId-->>
	<</if>>
	<<for _i = 0; _i < $slaves.length; _i++>>
		<<set _slaveMomFound = 0, _slaveDadFound = 0>>
		<<if def $slaveIndices[$slaves[_i].mother]>>
			<<set _slaveMomFound = 1>>
		<</if>>
		<<if def $slaveIndices[$slaves[_i].father]>>
			<<set _slaveDadFound = 1>>
		<</if>>
		<<if _slaveMomFound == 0 && $slaves[_i].mother > 0>>
			<<set _lostMom = $slaves[_i].mother>>
			<<set $slaves[_i].mother = $missingParentID>>
			<<for _j = 0; _j < $slaves.length; _j++>>
				<<if $slaves[_j].mother == _lostMom>>
					<<set $slaves[_j].mother = $missingParentID>>
				<</if>>
			<</for>>
			<<set $missingParentID-->>
		<</if>>
		<<if _slaveDadFound == 0 && $slaves[_i].father > 0>>
			<<set _lostDad = $slaves[_i].father>>
			<<set $slaves[_i].father = $missingParentID>>
			<<for _j = 0; _j < $slaves.length; _j++>>
				<<if $slaves[_j].father == _lostDad>>
					<<set $slaves[_j].father = $missingParentID>>
				<</if>>
			<</for>>
			<<set $missingParentID-->>
		<</if>>
	<</for>>
<</if>>
<<if $plot == 1 && $neighboringArcologies > 0>>
	<<set _bestProsperity = 0, _bestProsperityIndex = 1>>
	<<for _acq = 1; _acq < $arcologies.length; _acq++>>
		<<if $arcologies[_acq].prosperity > _bestProsperity>>
			<<set _bestProsperity = $arcologies[_acq].prosperity>>
			<<set _bestProsperityIndex = _acq>>
		<</if>>
	<</for>>
	<<set $rivalSet = 1>>
	<<set $arcologies[_bestProsperityIndex].rival = 1>>
<</if>>

You've done it.

You arrive at your new arcology, $arcologies[0].name, and head straight to the penthouse to enter the access codes that will tell the $arcologies[0].name systems to recognize you as their owner. The penthouse office is ready to receive the codes, and they authenticate. A voice activates in your earpiece.

//Congratulations. I am a personal assistant program, and it is my pleasure to assist you,
<<= PlayerName()>>
the new owner of $arcologies[0].name. I will offer useful information whenever possible in italics. Your new arcology has some unusual equipment. The previous owner kept a small stable of sex slaves. The penthouse therefore has a body modification studio for tattooing, bleaching and piercing, and an auto salon for more prosaic things like hair care. It also has a remote surgery, a small surgical theater that can be operated remotely by a qualified surgeon if you can pay the fee. Finally, it has a slave nutrition system connected to the arcology's hydroponics bays. This system produces a tasty protein-rich drink that provides the physically active female body all its necessary nutrients while leaving the lower digestive tract extremely clean. It even causes a mild increase in sex drive.

The previous owner seems to have left in something of a hurry.
<<if $cheatMode == 1>>
	Since you've elected to take over an arcology with special advantages, you've acquired a very special group of slaves.
<<elseif $saveImported == 1>>
	Since it took some time for you to ensure that your existing stable of slaves were safely moved to $arcologies[0].name, the previous owner had the time to get most of their things away.
<<elseif ($targetArcology.type != "New") && ($targetArcology.type != "Multiculturalist")>>
	<<switch $targetArcology.type>>
	<<case "Supremacist">>
		They kept a personal stable of fearful $arcologies[0].FSSupremacistRace sex slaves, but their sexual training is incomplete. Several of them are still here.
	<<case "Subjugationist">>
		They made it a special goal to enslave and whore out as many $arcologies[0].FSSubjugationistRace people as possible. Several of them are still here.
	<<case "GenderRadicalist">>
		They were in the process of building a stable of pretty young shemale whores. Several of them are still here. They're are all very attracted to men, and skilled at pleasing them.
	<<case "GenderFundamentalist">>
		They kept a personal stable of slaves for breeding purposes. Several of them are still here. They've been kept pregnant, and work as servants when they aren't being bred.
	<<case "Paternalist">>
		Their slaves were all very well treated. Several of them are still here. They were allowed to work as maids, and weren't even forced to have sex.
	<<case "Degradationist">>
		Their personal slaves were all Fuckdolls, slaves who have been permanently encased in advanced latex suits and converted into living sex toys. Several of them are still here.
	<<case "AssetExpansionist">>
		They kept a collection of bejeweled boobs for company, but they focused on breast expansion to the exclusion the slaves' emotional training. Several of them are still here.
	<<case "SlimnessEnthusiast">>
		They kept a harem of slim, pretty girls, and treated them very well. Several of them are still here. They should be very trusting of a new owner.
	<<case "TransformationFetishist">>
		They were just putting the finishing touches on a planned brothel's worth of surgically enhanced whores. Several of them are still here. They are already used to prostitution.
	<<case "BodyPurist">>
		Their slaves were trained for sexual use, but their health, fitness, and natural appearance were the main priorities. Several of them are still here.
	<<case "MaturityPreferentialist">>
		They preferred to keep their MILFs as scantily clad servants. Several of them are still here. They aren't all happy to be sex objects, but they're used to it.
	<<case "YouthPreferentialist">>
		They treated their young slaves very well. Several of them are still here. Virgins have been carefully preserved, but have learned to use their mouths through experience.
	<<case "Pastoralist">>
		Their herd of cow girls was progressing nicely, though more progress had been made on milk production than on training. Several of them are still here.
	<<case "PhysicalIdealist">>
		Their slaves worked as prostitutes, but mostly to fund a program of muscle building for all of them, which was nearing completion. Several of them are still here.
	<<case "ChattelReligionist">>
		They were recruiting a stable of slave whores by targeting people with religious complexes that made them particularly vulnerable to recruitment. Several of them are still here.
	<<case "RomanRevivalist">>
		The only one of their slaves left is the bodyguard. She should be very willing to transfer her loyalty to you, as her new owner.
	<<case "AztecRevivalist">>
		They maintained a combination of disobedient slaves, deemed incorrigible and blood priestesses. Since they offer themselves as slaves willingly, one has remained loyal to the owner of the arcology.
	<<case "EgyptianRevivalist">>
		They kept a harem of beautiful slave girls, who have been well-treated and well-trained. They should be very willing to serve you in turn.
	<<case "EdoRevivalist">>
		They put considerable effort into creating modern slave geisha, elegant Japanese slaves who were assigned to serve the public. Several of them are still here.
	<<case "ArabianRevivalist">>
		They trained slaves personally, and never kept slaves for very long. The slaves they left are all partway through being trained.
	<<case "ChineseRevivalist">>
		The only one of their slaves left is the Head Girl. She should be willing to transfer her loyalty to you, as her proper superior.
	<<case "Eugenics">>
		The only one of their slaves left is an absolute beauty of a girl. She is too smart for her own good and will likely not trust you.
	<<case "Repopulationist">>
		They kept a personal stable of slaves for breeding purposes. Several of them are still here. They've been kept heavily pregnant, and are used to being used whilst so.
	<<case "HedonisticDecadence">>
		Their slaves were heavily pampered; free to lie about, fuck, and eat as much as they wanted. Several of them are still here, too lazy and spoiled to leave. They eagerly paw at you upon your arrival, begging for their bellies to be filled with food and for a good, hard fucking.
	<<default>>
		ERROR: bad arcology type
	<</switch>>
<<else>>
	They could not get all of their personal effects away. Since they <<if $targetArcology.type == "Multiculturalist">>tried to sample different kinds of sexual slavery<<else>>did not have the time in control of the arcology to develop a specific stable of sex slaves<</if>>, their slaves were quite varied.
<</if>>

<<set $heroSlaves = $heroSlaves.shuffle()>>
<<set _valueGiven = 0>>
<<if $cheatMode == 1>>
	<<include [[Cheatmode Database]]>>
<<elseif $saveImported == 1>>
<<elseif ($targetArcology.type != "New") && ($targetArcology.type != "Multiculturalist")>>
	<<for $j = 0; $j < 5; $j++>>
	<<if _valueOwed - _valueGiven <= 5000>><<break>><</if>>
	<<switch $targetArcology.type>>
	<<case "Supremacist">>
		<<set $oneTimeDisableDisability = 1>>
		<<set $arcologies[0].FSSupremacistLawME = 1>><<include "Generate New Slave">><<set $arcologies[0].FSSupremacistLawME = 0>>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-25,-45), $activeSlave.health = random(0,15)>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = random(15,35)>>
		<<if $activeSlave.vagina > -1>>
			<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
			<<set $activeSlave.vaginalSkill = random(15,35)>>
		<</if>>
		<<set $activeSlave.entertainSkill = random(15,35)>>
		<<set $activeSlave.clothes = "uncomfortable straps", $activeSlave.collar = "uncomfortable leather", $activeSlave.shoes = "flats">>
		<<set $activeSlave.assignment = "please you">>
	<<case "Subjugationist">>
		<<set $oneTimeDisableDisability = 1>>
		<<set $fixedRace = $activeArcology.FSSubjugationistRace>><<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-25,-45), $activeSlave.health = random(0,15)>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = random(15,35)>>
		<<if $activeSlave.vagina > -1>>
			<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
			<<set $activeSlave.vaginalSkill = random(15,35)>>
		<</if>>
		<<set $activeSlave.whoreSkill = random(15,35)>>
		<<set $activeSlave.clothes = "uncomfortable straps", $activeSlave.collar = "uncomfortable leather", $activeSlave.shoes = "flats">>
		<<set $activeSlave.assignment = "whore">>
	<<case "GenderRadicalist">>
		<<set $activeSlaveOneTimeMaxAge = 25>>
		<<set $oneTimeDisableDisability = 1>>
		<<include "Generate XY Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(15,-15), $activeSlave.health = 100>>
		<<set $activeSlave.face = random(0,55)>>
		<<set $activeSlave.boobs += 100*random(2,4)>>
		<<set $activeSlave.butt += random(1,2)>>
		<<set $activeSlave.attrXY = random(70,90), $activeSlave.attrXX = 0>>
		<<set $activeSlave.oralSkill = random(35,65), $activeSlave.analSkill = random(35,65), $activeSlave.whoreSkill = random(35,65)>>
		<<run SoftenSexualFlaw($activeSlave)>>
		<<set $activeSlave.clothes = "uncomfortable straps", $activeSlave.collar = "stylish leather", $activeSlave.shoes = "heels">>
		<<set $activeSlave.assignment = "whore">>
	<<case "GenderFundamentalist">>
		<<set $activeSlaveOneTimeMinAge = $fertilityAge>>
		<<set $activeSlaveOneTimeMaxAge = 25>>
		<<set $oneTimeDisableDisability = 1>>
		<<include "Generate XX Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-25,-45), $activeSlave.health = random(55,65)>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.preg = random(1,40), $activeSlave.lactation = 1>>
		<<run SetBellySize($activeSlave)>>
		<<if $activeSlave.vagina > -1>>
			<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
			<<set $activeSlave.vaginalSkill = random(15,35)>>
		<</if>>
		<<set $activeSlave.clothes = "a nice maid outfit", $activeSlave.collar = "tight steel", $activeSlave.shoes = "flats">>
		<<set $activeSlave.assignment = "be a servant">>
	<<case "Paternalist">>
		<<set $oneTimeDisableDisability = 1>>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(55,65), $activeSlave.health = random(55,65)>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.intelligence = random(0,100), $activeSlave.intelligenceImplant = 30>>
		<<set $activeSlave.entertainSkill = random(15,35)>>
		<<set $activeSlave.clothes = "conservative clothing", $activeSlave.collar = "none", $activeSlave.shoes = "flats">>
		<<set $activeSlave.assignment = "be a servant">>
	<<case "Degradationist">>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = 25, $activeSlave.trust = -25, $activeSlave.health = random(0,15)>>
		<<set $activeSlave.fuckdoll = 100>>
		<<set $activeSlave.career = "a Fuckdoll">>
		<<set $activeSlave.fetish = "mindbroken">>
		<<set $activeSlave.boobs += 100*random(10,20)>>
		<<set $activeSlave.butt += random(2,3)>>
		<<set $activeSlave.lips = random(2,4)>>
		<<set $activeSlave.weight = random(-15,15)>>
		<<set $activeSlave.oralSkill = 0, $activeSlave.analSkill = 0, $activeSlave.vaginalSkill = 0, $activeSlave.entertainSkill = 0, $activeSlave.whoreSkill = 0>>
		<<set $activeSlave.behavioralFlaw = "none", $activeSlave.sexualFlaw = "none">>
		<<set $activeSlave.clothes = "a Fuckdoll suit">>
		<<set $activeSlave.assignment = "please you">>
	<<case "AssetExpansionist">>
		<<set $oneTimeDisableDisability = 1>>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-15,15), $activeSlave.health = random(25,45)>>
		<<set $activeSlave.chem = 50>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.boobs += 100*random(10,20)>>
		<<set $activeSlave.butt += random(2,3)>>
		<<set $activeSlave.lips += random(0,1)>>
		<<if $activeSlave.balls > 0>><<set $activeSlave.balls++>><</if>>
		<<if $activeSlave.dick > 0>><<set $activeSlave.dick++>><</if>>
		<<set $activeSlave.weight = random(15,90)>>
		<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = 0, $activeSlave.anus = 0>>
		<<if $activeSlave.vagina > -1>>
			<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
			<<set $activeSlave.vaginalSkill = random(15,35)>>
		<</if>>
		<<set $activeSlave.entertainSkill = random(15,35)>>
		<<set $activeSlave.clothes = "slutty jewelry", $activeSlave.collar = "pretty jewelry", $activeSlave.shoes = "heels">>
		<<set $activeSlave.assignment = "please you">>
	<<case "SlimnessEnthusiast">>
		<<set $oneTimeDisableDisability = 1>>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(55,65), $activeSlave.health = random(55,65)>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.boobs = 100*random(1,4)>>
		<<set $activeSlave.butt = random(1,2)>>
		<<set $activeSlave.weight = random(-25,-15)>>
		<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = 0, $activeSlave.anus = 0>>
		<<if $activeSlave.vagina > -1>>
			<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
			<<set $activeSlave.vaginalSkill = random(15,35)>>
		<</if>>
		<<set $activeSlave.entertainSkill = random(15,35)>>
		<<set $activeSlave.clothes = "a leotard", $activeSlave.collar = "pretty jewelry", $activeSlave.shoes = "flats">>
		<<set $activeSlave.assignment = "please you">>
	<<case "TransformationFetishist">>
		<<set $oneTimeDisableDisability = 1>>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-15,15), $activeSlave.health = random(-15,0)>>
		<<set $activeSlave.faceImplant = random(40,70)>>
		<<set $activeSlave.face = Math.trunc($activeSlave.face+$activeSlave.faceImplant/2,-100,100)>>
		<<set $activeSlave.boobsImplant = 200*random(4,8)>>
		<<set $activeSlave.boobs += $activeSlave.boobsImplant>>
		<<set $activeSlave.buttImplant = random(2,4)>>
		<<set $activeSlave.butt += $activeSlave.buttImplant>>
		<<set $activeSlave.lipsImplant = random(1,2)>>
		<<set $activeSlave.lips = Math.trunc($activeSlave.lipsImplant+2,-3,3)>>
		<<set $activeSlave.weight = random(-25,-15)>>
		<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = random(15,35)>>
		<<if $activeSlave.vagina > -1>>
			<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
			<<set $activeSlave.vaginalSkill = random(15,35)>>
		<</if>>
		<<set $activeSlave.clothes = "a string bikini", $activeSlave.collar = "shock punishment", $activeSlave.shoes = "extreme heels">>
		<<set $activeSlave.assignment = "whore">>
	<<case "BodyPurist">>
		<<set $oneTimeDisableDisability = 1>>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(55,65), $activeSlave.trust = random(25,45), $activeSlave.health = 100>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.weight = random(-5,5)>>
		<<set $activeSlave.muscles = random(10,25)>>
		<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = random(15,35)>>
		<<if $activeSlave.vagina > -1>>
			<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
			<<set $activeSlave.vaginalSkill = random(15,35)>>
		<</if>>
		<<set $activeSlave.clothes = "a nice maid outfit", $activeSlave.collar = "pretty jewelry", $activeSlave.shoes = "heels">>
		<<set $activeSlave.assignment = "be a servant">>
	<<case "MaturityPreferentialist">>
		<<set $activeSlaveOneTimeMinAge = 36>>
		<<set $activeSlaveOneTimeMaxAge = 39>>
		<<set $one_time_age_overrides_pedo_mode = 1>>
		<<set $oneTimeDisableDisability = 1>>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(55,65), $activeSlave.trust = random(-15,15), $activeSlave.health = random(25,45)>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.boobs += 100*random(1,4)>>
		<<set $activeSlave.butt += random(1,2)>>
		<<set $activeSlave.weight = random(-5,90)>>
		<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = random(15,35)>>
		<<if $activeSlave.vagina > -1>>
			<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
			<<set $activeSlave.vaginalSkill = random(15,35)>>
		<</if>>
		<<run SoftenBehavioralFlaw($activeSlave)>>
		<<set $activeSlave.clothes = "a slutty maid outfit", $activeSlave.collar = "pretty jewelry", $activeSlave.shoes = "heels">>
		<<set $activeSlave.assignment = "be a servant">>
	<<case "YouthPreferentialist">>
		<<set $activeSlaveOneTimeMaxAge = 19>>
		<<set $oneTimeDisableDisability = 1>>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(55,65), $activeSlave.health = random(25,45)>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.boobs = 100*random(1,4)>>
		<<set $activeSlave.butt = random(1,3)>>
		<<set $activeSlave.weight = random(-25,25)>>
		<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = 0, $activeSlave.anus = 0>>
		<<if $activeSlave.vagina > -1>><<set $activeSlave.vaginalSkill = 0, $activeSlave.vagina = 0>><</if>>
		<<set $activeSlave.entertainSkill = random(15,35)>>
		<<set $activeSlave.clothes = "a schoolgirl outfit", $activeSlave.collar = "pretty jewelry", $activeSlave.shoes = "heels">>
		<<set $activeSlave.assignment = "be a servant">>
	<<case "Pastoralist">>
		<<set $oneTimeDisableDisability = 1>>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-25,-45), $activeSlave.health = random(25,45)>>
		<<set $activeSlave.boobs += 100*random(10,20)>>
		<<if $activeSlave.balls > 0>><<set $activeSlave.balls++>><</if>>
		<<set $activeSlave.lactation = 2>>
		<<set $activeSlave.clothes = "Western clothing", $activeSlave.collar = "leather with cowbell", $activeSlave.shoes = "flats">>
		<<set $activeSlave.assignment = "get milked">>
	<<case "PhysicalIdealist">>
		<<set $oneTimeDisableDisability = 1>>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(25,45), $activeSlave.health = 100>>
		<<set $activeSlave.muscles = random(50,100)>>
		<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = random(15,35)>>
		<<if $activeSlave.vagina > -1>>
			<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
			<<set $activeSlave.vaginalSkill = random(15,35)>>
		<</if>>
		<<set $activeSlave.whoreSkill = random(15,35)>>
		<<set $activeSlave.clothes = "body oil", $activeSlave.collar = "none", $activeSlave.shoes = "none">>
		<<set $activeSlave.assignment = "whore">>
	<<case "ChattelReligionist">>
		<<set $oneTimeDisableDisability = 1>>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(55,65), $activeSlave.trust = random(55,65), $activeSlave.health = random(0,15)>>
		<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
		<<set $activeSlave.whoreSkill = random(10,20)>>
		<<set $activeSlave.behavioralFlaw = "none", $activeSlave.behavioralQuirk = "sinful">>
		<<set $activeSlave.clothes = "a chattel habit", $activeSlave.collar = "heavy gold", $activeSlave.shoes = "flats">>
		<<set $activeSlave.assignment = "whore">>
	<<case "RomanRevivalist">>
		<<set $activeSlaveOneTimeMaxAge = 19>>
		<<set $oneTimeDisableDisability = 1>>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = 100, $activeSlave.trust = random(55,65), $activeSlave.health = 100>>
		<<set $activeSlave.face = random(0,55)>>
		<<set $activeSlave.muscles = random(25,50)>>
		<<set $activeSlave.combatSkill = 1>>
		<<set $activeSlave.behavioralFlaw = "none", $activeSlave.behavioralQuirk = "fitness">>
		<<set $activeSlave.behavioralFlaw = "none">>
		<<set $activeSlave.clothes = "a toga", $activeSlave.collar = "pretty jewelry", $activeSlave.shoes = "flats">>
		<<set $activeSlave.assignment = "guard you", $Bodyguard = $activeSlave>>
	<<case "AztecRevivalist">>
		<<set $oneTimeDisableDisability = 1>>
		<<set $fixedRace = "latina">>
		<<set $fixedNationality = "Mexican">>
		<<include "Generate New Slave">>
		<<set $activeSlave.accent = 0>>
		<<set $activeSlave.devotion = 75, $activeSlave.trust = 75, $activeSlave.health = random(-20,20)>>
		<<set $activeSlave.muscles = random(50,75)>>
		<<set $activeSlave.combatSkill = 1>>
		<<set $activeSlave.behavioralFlaw = "malicious", $activeSlave.behavioralQuirk = "none">>
		<<set $activeSlave.clothes = "a huipil", $activeSlave.collar = "pretty jewelry", $activeSlave.shoes = "none">>
		<<set $activeSlave.assignment = "be your Head Girl", $HeadGirl = $activeSlave>>
	<<case "EgyptianRevivalist">>
		<<set $oneTimeDisableDisability = 1>>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(25,45), $activeSlave.health = random(25,45)>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = random(15,35)>>
		<<if $activeSlave.vagina > -1>>
			<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
			<<set $activeSlave.vaginalSkill = random(15,35)>>
		<</if>>
		<<set $activeSlave.entertainSkill = random(15,35)>>
		<<run SoftenSexualFlaw($activeSlave)>>
		<<set $activeSlave.clothes = "slutty jewelry", $activeSlave.collar = "ancient Egyptian", $activeSlave.shoes = "flats">>
		<<set $activeSlave.assignment = "please you">>
	<<case "EdoRevivalist">>
		<<set $oneTimeDisableDisability = 1>>
		<<set $fixedRace = "asian">>
		<<set $fixedNationality = "Japanese">>
		<<include "Generate New Slave">>
		<<set $activeSlave.accent = 0>>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(25,45), $activeSlave.health = random(25,45)>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.intelligence = random(0,100), $activeSlave.intelligenceImplant = 30>>
		<<set $activeSlave.entertainSkill = 100>>
		<<set $activeSlave.clothes = "a kimono", $activeSlave.collar = "satin choker", $activeSlave.shoes = "heels">>
		<<set $activeSlave.assignment = "serve the public">>
	<<case "ArabianRevivalist">>
		<<set $oneTimeDisableDisability = 1>>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-15,15), $activeSlave.health = random(25,45)>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.intelligence = random(-15,80), $activeSlave.intelligenceImplant = 0>>
		<<set $activeSlave.clothes = "harem gauze", $activeSlave.collar = "uncomfortable leather", $activeSlave.shoes = "flats">>
		<<set $activeSlave.assignment = "take classes">>
	<<case "ChineseRevivalist">>
		<<set $activeSlaveOneTimeMinAge = 36>>
		<<set $activeSlaveOneTimeMaxAge = 38>>
		<<set $one_time_age_overrides_pedo_mode = 1>>
		<<set $oneTimeDisableDisability = 1>>
		<<set $fixedRace = "asian">>
		<<set $fixedNationality = "Chinese">>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = random(55,65), $activeSlave.trust = random(25,45), $activeSlave.health = random(25,45)>>
		<<set $activeSlave.face = random(0,55)>>
		<<set $activeSlave.accent = 0>>
		<<set $activeSlave.intelligence = 100, $activeSlave.intelligenceImplant = 30>>
		<<set $activeSlave.oralSkill = 100, $activeSlave.analSkill = 100>>
		<<if $activeSlave.vagina > -1>>
			<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
			<<set $activeSlave.vaginalSkill = 100>>
		<</if>>
		<<set $activeSlave.entertainSkill = 100, $activeSlave.whoreSkill = 100>>
		<<run SoftenBehavioralFlaw($activeSlave)>>
		<<run SoftenSexualFlaw($activeSlave)>>
		<<set $activeSlave.clothes = "a slutty qipao", $activeSlave.collar = "pretty jewelry", $activeSlave.shoes = "heels">>
		<<set $activeSlave.assignment = "be your Head Girl", $HeadGirl = $activeSlave>>
	<<case "Eugenics">>
		<<set $oneTimeDisableDisability = 1>>
		<<include "Generate New Slave">>
		<<set $activeSlave.devotion = -100, $activeSlave.trust = -100, $activeSlave.health = random(80,90)>>
		<<set $activeSlave.intelligence = 100>>
		<<set $activeSlave.intelligenceImplant = 30>>
		<<set $activeSlave.face = 100>>
		<<set $activeSlave.faceShape = "sensual">>
		<<set $activeSlave.oralSkill = random(35,75), $activeSlave.analSkill = random(35,75)>>
		<<if $activeSlave.vagina > -1>>
			<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
			<<set $activeSlave.vaginalSkill = random(35,75)>>
		<</if>>
		<<set $activeSlave.entertainSkill = random(15,35)>>
		<<set $activeSlave.whoreSkill = 0>>
		<<run SoftenSexualFlaw($activeSlave)>>
		<<set $activeSlave.clothes = "a ball gown", $activeSlave.shoes = "flats">>
		<<set $activeSlave.assignment = "rest">>
	<<case "Repopulationist">>
		<<set $activeSlaveOneTimeMinAge = $fertilityAge+3>>
		<<set $activeSlaveOneTimeMaxAge = 25>>
		<<set $one_time_age_overrides_pedo_mode = 1>>
		<<set $oneTimeDisableDisability = 1>>
		<<include "Generate XX Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-25,-45), $activeSlave.health = random(55,65)>>
		<<set $activeSlave.face = random(15,100)>>
		<<set $activeSlave.preg = random(10,40), $activeSlave.pregType = random(3,8), $activeSlave.lactation = 1>>
		<<run SetBellySize($activeSlave)>>
		<<set $activeSlave.birthsTotal = 5>>
		<<set $activeSlave.bellySag = 20, $activeSlave.bellySagPreg = 20>>
		<<if $activeSlave.vagina > -1>>
			<<set $activeSlave.vagina = 4>>
			<<set $activeSlave.vaginalSkill = random(15,35)>>
		<</if>>
		<<set $activeSlave.clothes = "a nice maid outfit", $activeSlave.shoes = "flats">>
		<<set $activeSlave.assignment = "please you">>
	<<case "HedonisticDecadence">>
		<<set $activeSlaveOneTimeMaxAge = 25>>
		<<set $oneTimeDisableDisability = 1>>
		<<include "Generate XX Slave">>
		<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-25,-45), $activeSlave.health = random(-20,20)>>
		<<set $activeSlave.face = random(15,40)>>
		<<set $activeSlave.boobs += 100*random(3,6)>>
		<<set $activeSlave.butt += random(2,5)>>
		<<set $activeSlave.weight = random(100,200)>>
		<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = random(15,35), $activeSlave.anus = 2>>
		<<if $activeSlave.vagina > -1>><<set $activeSlave.vaginalSkill = random(15,35), $activeSlave.vagina = 3>><</if>>
		<<set $activeSlave.entertainSkill = 0>>
		<<set $activeSlave.energy = random(60,80)>>
		<<set $activeSlave.behavioralFlaw = "gluttonous">>
		<<set $activeSlave.clothes = "attractive lingerie", $activeSlave.shoes = "flats">>
		<<set $activeSlave.diet = "fattening">>
		<<set $activeSlave.livingRules = "luxurious">>
		<<set $activeSlave.assignment = "rest">>
	<<default>>
		ERROR: bad arcology type
	<</switch>>
	<<set $activeSlave.origin = "You acquired her along with the arcology.", $activeSlave.career = "a slave">>
	<<slaveCost $activeSlave>>
	<<if $targetArcology.type == "Eugenics">>
		<<set _valueGiven += $slaveCost*4>>
	<<else>>
	<<set _valueGiven += $slaveCost>>
	<</if>>
	<<run newSlave($activeSlave)>>
	<</for>>
<<else>>
	<<for $j = 0; $j < $heroSlaves.length; $j++>>
	<<if _valueOwed - _valueGiven <= 5000>>
		<<break>>
	<</if>>
	<<set $activeSlave = getHeroSlave($heroSlaves[$j], $baseHeroSlave)>>
	<<run $heroSlaves.splice($j,1)>>
	<<slaveCost $activeSlave>>
	<<if _valueGiven + $slaveCost < _valueOwed*2>>
		<<run nationalityToAccent($activeSlave)>>
		<<set $activeSlave.oldDevotion = $activeSlave.devotion>>
		<<set $activeSlave.oldTrust = $activeSlave.trust>>
		<<set _valueGiven += $slaveCost>>
		<<run newSlave($activeSlave)>>
		<<if $activeSlave.fetish == "mindbroken">>
			$activeSlave.slaveName is, sadly, not mentally competent, and is wandering through the penthouse at the moment.
		<<elseif $activeSlave.amp == 1>>
			$activeSlave.slaveName is a quadruple amputee and is quite helpless, so you can attend to her at your leisure.
		<<elseif $activeSlave.devotion < -50>>
			$activeSlave.slaveName is quite rebellious and was attempting to escape, so I have locked her in the slave quarters.
		<<elseif $activeSlave.devotion < -20>>
			$activeSlave.slaveName resists my orders and was considering escape, so I have locked her in the slave quarters.
		<<elseif $activeSlave.devotion <= 20>>
			$activeSlave.slaveName is reasonably obedient, and is waiting for you in the dormitory, I believe in the hope of making a good impression.
		<<elseif $activeSlave.energy > 95>>
			$activeSlave.slaveName is a remarkable sexual addict, and I believe she will be very happy to meet you.
		<<elseif $activeSlave.fetish == "pregnancy">>
			<<if $activeSlave.preg > 10>>
				$activeSlave.slaveName is currently in the dormitory masturbating over her growing pregnancy, and <<if $PC.belly >= 5000>>will certainly be eager to meet you<<else>>I believe she will be happy to show it to you<</if>>.
			<<else>>
				$activeSlave.slaveName is currently in the dormitory examining herself to try to discern her fertility, and I believe she will be <<if $PC.belly >= 5000>>eager to get acquainted with you<<else>>happy to meet you<</if>>.
			<</if>>
		<<elseif $activeSlave.belly >= 5000>> /*had to be placed after pregnancy or it would intercept*/
			$activeSlave.slaveName is currently in the dormitory massaging her greatly distended belly.
		<<elseif $activeSlave.fetish == "buttslut">>
			$activeSlave.slaveName is currently in the dormitory masturbating anally, and I believe she will be happy to meet you.
		<<elseif $activeSlave.fetish == "cumslut">>
			$activeSlave.slaveName is currently in the dormitory exhibiting oral fixation, and I believe she will be happy to meet you.
		<<elseif $activeSlave.fetish == "boobs">>
			$activeSlave.slaveName is currently in the dormitory playing with her nipples, and I believe she will be happy to meet you.
		<<elseif $activeSlave.fetish == "humiliation">>
			$activeSlave.slaveName is currently in the entryway flashing passersby, and I believe she will be happy to meet you.
		<<elseif $activeSlave.fetish == "submissive">>
			$activeSlave.slaveName is currently in the dormitory, experimenting with self-bondage using the sheets; I believe she will be happy to meet you.
		<<elseif $activeSlave.fetish == "dom">>
			$activeSlave.slaveName is currently in the exercise area keeping fit; she likes to take an active role sexually and is using this down time to work out.
		<<elseif $activeSlave.fetish == "sadist">>
			$activeSlave.slaveName is currently outside your office; she enjoys being superior to other slaves and I believe she means to ingratiate herself to you.
		<<elseif $activeSlave.fetish == "masochist">>
			$activeSlave.slaveName is a sexual masochist; she is currently in the bathroom, experimenting with auto-flagellation with a wet towel.
		<<else>>
			$activeSlave.slaveName is currently outside your office, and I believe she is attempting to maintain sexual arousal to make a good first impression on you.
		<</if>>
	<</if>>
	<</for>>
<</if>>
<<if _valueOwed-_valueGiven > 0>>
	There are some valuables present, worth <<print cashFormat(_valueOwed-_valueGiven)>>.
	<<set $cash += _valueOwed-_valueGiven>>
<</if>>
//

/* RELATIONSHIP MUTUALITY CHECK, OLDMENTAL */

<<set $averageTrust = 0>>
<<set $averageDevotion = 0>>
<<set _slavesContributing = 0>>
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].relation != 0>>
		<<set $seed = $slaveIndices[$slaves[$i].relationTarget]>>
		<<if (def $seed && $slaves[$seed].relationTarget != $slaves[$i].ID) || (ndef $seed)>>
			<<set $slaves[$i].relation = 0>>
			<<set $slaves[$i].relationTarget = 0>>
			<<goto "Acquisition">>
		<</if>>
	<</if>>
	<<set $slaves[$i].oldDevotion = $slaves[$i].devotion>>
	<<set $slaves[$i].oldTrust = $slaves[$i].trust>>
	/* AVERAGE VALUES UPDATE */
	<<if $slaves[$i].assignmentVisible == 1>>
		<<set $averageTrust += $slaves[$i].trust, $averageDevotion += $slaves[$i].devotion, _slavesContributing += 1>>
	<<else>>
		<<if $slaves[$i].assignment != "be confined in the cellblock">>
		<<if $slaves[$i].assignment != "be confined in the arcade">>
		<<if ($slaves[$i].assignment != "work in the dairy") || ($dairyRestraintsSetting < 2)>>
			<<set $averageTrust += $slaves[$i].trust*0.5, $averageDevotion += $slaves[$i].devotion*0.5, _slavesContributing += 0.5>>
		<</if>>
		<</if>>
		<</if>>
	<</if>>
<</for>>
<<if $familyTesting == 1>>
	<<set $slaves.forEach(function(s) { s.sisters = 0; s.daughters = 0; })>>
	<<set $PC.daughters = 0, $PC.sisters = 0>>
	<<for _fp = 0; _fp < $slaves.length; _fp++>>
		<<if ($slaves[_fp].mother == -1 || $slaves[_fp].father == -1)>>
			<<set $PC.daughters++>>
		<</if>>
		<<if areSisters($slaves[_fp], $PC) > 0>>
			<<set $PC.sisters++>>
		<</if>>
		<<for _fpt = 0; _fpt < $slaves.length; _fpt++>>
			<<if ($slaves[_fpt].mother == $slaves[_fp].ID) || ($slaves[_fpt].father == $slaves[_fp].ID)>>
				<<set $slaves[_fp].daughters++>>
			<</if>>
			<<if areSisters($slaves[_fpt], $slaves[_fp]) > 0>>
				<<set $slaves[_fp].sisters++>>
			<</if>>
		<</for>>
	<</for>>
<</if>>
<<if _slavesContributing != 0>>
	<<set $averageTrust = $averageTrust/_slavesContributing>>
	<<set $averageDevotion = $averageDevotion/_slavesContributing>>
<</if>>
<<set $enduringTrust = $averageTrust>>
<<set $enduringDevotion = $averageDevotion>>

<<link "Continue">>
	<<set $ui = "main">>
	<<if $terrain == "urban">>
		<<set $minimumSlaveCost = 2000>>
		<<set $slaveCostFactor = 0.85>>
		<<set $menialSupplyFactor = 30000>>
		<<set $menialDemandFactor = -30000>>
	<<elseif $terrain == "marine">>
		<<set $minimumSlaveCost = 2500>>
		<<set $slaveCostFactor = 1>>
	<<else>>
		<<set $minimumSlaveCost = 3000>>
		<<set $slaveCostFactor = 1.15>>
		<<set $menialDemandFactor = 30000>>
		<<set $menialSupplyFactor = -30000>>
	<</if>>
	<>
	<<goto "Main">>
<</link>>


code:
:: Agent Company [nobr]

<<set $nextButton = "Continue", $nextLink = "AS Dump", $returnTo = "Neighbor Interact", _ID = $activeSlave.ID>>

<<= assignJob($activeSlave, "live with your agent")>>

<<set $reservedChildren = FetusGlobalReserveCount("incubator")>>
<<set $reservedChildrenNursery = FetusGlobalReserveCount("nursery")>>

<<if $activeSlave.rivalry > 0>>
	<<set _i = $slaveIndices[$activeSlave.rivalryTarget]>>
	<<if def _i>>
		<<set $slaves[_i].rivalry = 0, $slaves[_i].rivalryTarget = 0>>
	<<else>>
		@@.red;Error, activeSlave rival not found.@@
	<</if>>
	<<set $activeSlave.rivalry = 0, $activeSlave.rivalryTarget = 0>>
<</if>>

<<for _i = 0; _i < $arcologies.length; _i++>>
	<<if $subSlave.ID == $arcologies[_i].leaderID>>
		<<set $activeArcology = $arcologies[_i]>>
	<</if>>
<</for>>

<<setLocalPronouns $subSlave 2>>

Working in $activeArcology.name's penthouse office, $subSlave.slaveName gets a video call from you. Naturally, _his2 personal assistant program has been instructed to give these the highest priority, and your face appears in front of _him2 immediately. _He2 greets you properly, and asks you what _he2 can do to serve you. You tell _him2 you're planning to send one of your slaves over to _his2 arcology to assist _him2. Exchanges of this kind are neither unusual nor particularly interesting, so a slight look of perplexity clouds $subSlave.slaveName's face as _he2 wonders why this merits a personal call. Normally, <<if $HeadGirl != 0>>$HeadGirl.slaveName<<else>>$assistantName<</if>> would handle it with _him2 directly.

_His2 question is answered when you bring $activeSlave.slaveName in close, putting $him in $subSlave.slaveName's view. $subSlave.slaveName's $subSlave.eyeColor eyes fly open with pleased surprise, but before _he2 can speak, $activeSlave.slaveName goes first.
<<if !canTalk($activeSlave)>>
  Unable to speak $himself, $he simply makes a heart shape with $his hands in view of the video call, and blows $his <<if $activeSlave.relationship == 4>>lover<<else>>wife<</if>> a kiss.
<<else>>
  <<run Enunciate($activeSlave)>>
  "Hi <<if $activeSlave.relationship == 4>>lover<<else>><<s>>weetheart<</if>>," $he <<say>>s in a syrupy tone. "Mi<<ss>> me?"
<</if>>

$subSlave.slaveName smiles back at $him, glowing with pleasure, and responds with exaggerated arousal.

<<run Enunciate($subSlave)>>

<<switch $subSlave.fetish>>
<<case "submissive">>
	"Looking forward to <<s>>leeping in your arm<<s>>, babe," the submissive
<<case "cumslut">>
	"Can't wait to ki<<ss>> you, babe," the orally fixated
<<case "humiliation">>
	"Can't wait to take you right in the middle of the pla<<z>>a here," the exhibitionist
<<case "buttslut">>
	"I can't wait to fuck you in your hot little a<<ss>>," the anally fixated
<<case "boobs">>
	"Looking forward to feeling your brea<<s>>t<<s>> again," the boob-loving
<<case "pregnancy">>
	"Can't wait to share all the pregnant girl<<s>> here with you," the impregnation fetishist
<<case "dom">>
	"Looking forward to <<sh>>oving you fa<<c>>edown, bitch," the dominant
<<case "sadist">>
	"Looking forward to making you bite the pillow again, bitch," the sadistic
<<case "masochist">>
	"Can't wait to feel you hurt me again, babe," the masochistic
<<default>>
	"Babe, I can't wait to give you a hug and tell you about $activeArcology.name," the loving
<</switch>>
leader of an entire arcology <<say>>s.


code:
:: Agent Retrieve [silently]

<<set _ID = $activeArcology.leaderID>>

<<set _i = $slaveIndices[_ID]>>
<<if def _i>>
	<<= removeJob($slaves[_i], "be your agent")>>
<</if>>

<<set $activeArcology.leaderID = 0, $activeArcology.government = "your trustees">>

<<goto "Neighbor Interact">>


code:
:: Agent Select [nobr]

<<set $nextButton = "Back", $nextLink = "Neighbor Interact", $showEncyclopedia = 1, $encyclopedia = "Agents">>
''Appoint an Agent from your devoted slaves:''
<<include "Slave Summary">>


code:
:: Agent Workaround [nobr]

<<set $nextButton = "Continue", $nextLink = "Neighbor Interact", _ID = $slaves[$i].ID>>

<<= assignJob($slaves[$i], "be your agent")>>

<<set $reservedChildren = FetusGlobalReserveCount("incubator")>>
<<set $reservedChildrenNursery = FetusGlobalReserveCount("nursery")>>

<<if $slaves[$i].rivalry > 0>>
	<<set _i = $slaveIndices[$slaves[$i].rivalryTarget]>>
	<<if def _i>>
		<<set $slaves[_i].rivalry = 0, $slaves[_i].rivalryTarget = 0>>
	<<else>>
		@@.red;Error, rival not found.@@
	<</if>>
	<<set $slaves[$i].rivalry = 0, $slaves[$i].rivalryTarget = 0>>
<</if>>

<<if $slaves[$i].relationship > 0 && $slaves[$i].relationship < 4>>
	<<set _i = $slaveIndices[$slaves[$i].relationshipTarget]>>
	<<if def _i>>
		<<set $slaves[_i].relationship = 0, $slaves[_i].relationshipTarget = 0>>
	<<else>>
		@@.red;Error, relationshipTarget not found.@@
	<</if>>
	<<set $slaves[$i].relationship = 0, $slaves[$i].relationshipTarget = 0>>
<</if>>

<<set $activeArcology.leaderID = _ID, $activeArcology.government = "your agent">>

<<set $desc = SlaveTitle($slaves[$i])>>
<<setLocalPronouns $slaves[$i]>>

You order $slaves[$i].slaveName to come into your office for orders. The devoted $desc has no prior warning that this is anything unusual, and from the <<if $slaves[$i].energy > 95>>horny glint<<else>>glow of sexual availability<</if>> in $his $slaves[$i].eyeColor eyes as $he <<if canWalk($slaves[$i])>>enters<<else>>is helped in<</if>>, $he <<if $slaves[$i].energy > 95>>seems to be hoping<<else>>wouldn't mind hearing<</if>> that you've called $him in for a quick fuck. In fact, the matter at hand is about as far as it could possibly be from that, on the spectrum of interactions between <<if $PC.title != 0>>master<<else>>mistress<</if>> and slave.

You offer $him, without preamble, agency on your behalf in $activeArcology.name. As a $woman of intelligence, $he knows the basics of such an arrangement, but $he's stunned into silence by the offer, so you outline it briefly. Having a slave lead an arcology would be too much, even for the most open minded of Free Cities societies. So, $he would be freed, albeit subject to a set of private, restrictive contracts that would allow you to recall $him if you wish, and require $him to follow your directions, if you give $him any. But other than that, $he would be the effective leader of an entire arcology. It's an unusual arrangement, but one that's becoming more common as multiple arcologies come under united control.

$He's intelligent and confident of $his place within society as a valued slave, and knows that with your resources behind $him, this is likely something $he's capable of succeeding at. Nevertheless, $his feelings are obviously mixed. It will be a challenge,
<<switch $slaves[$i].fetish>>
<<case "submissive">>
	especially for a sexual submissive like $him.
<<case "cumslut">>
	and $he'll have to find dominant ways to sate $his oral appetites.
<<case "humiliation">>
	especially for a humiliation addict like $him.
<<case "buttslut">>
	though $he'll probably be able to live $his anal life vicariously by buttfucking others.
<<case "boobs">>
	but $he'll have a practically infinite procession of breasts to judge and fondle.
<<case "pregnancy">>
	but the potential for impregnation of hundreds of slaves excites $him.
<<case "dom">>
	but the prospect of having more slaves at $his whim than even $he could possibly use is incredibly exciting to $him.
<<case "sadist">>
	but the prospect of having more slaves at $his whim than even $he could possibly break is incredibly exciting to $him.
<<case "masochist">>
	especially for a masochist like $him.
<<default>>
	though one $he's willing to take on.
<</switch>>
It will mean that $he'll see much less of you, something such a devoted slave may struggle with. Oppressed by the confusion and strength of $his feelings, $he begins to cry.

"Thank you, <<Master $slaves[$i]>>," $he gasps out. "I'll do my be<<s>>t."


code:
:: AS Dump

<<if (ndef $activeSlave) || ($activeSlave == 0)>>

	@@.red;ERROR:@@  AS Dump, activeSlave invalid, returnTo is '$returnTo', previous passage was '<<print previous()>>'. Please report this.

	<<link "Continue">><<goto $returnTo>><</link>> | [[Go Back|previous()]]

<<else>>

	<<silently>>

	<<set _SL = $slaves.length, _ID = $activeSlave.ID>>

	<<if $i >= 0 && $i < _SL && $slaves[$i].ID == _ID>> /* shortcut if $i is already pointing to this slave */
		<<set $slaves[$i] = $activeSlave>>
	<<else>>
		<<set $i = $slaveIndices[_ID]>> /* find $i if exists */
		<<if ndef $i>> /* not found, so new slave */
			<<run newSlave($activeSlave)>>
		<<else>>
			<<set $slaves[$i] = $activeSlave>>
		<</if>>
	<</if>>

	<<switch _ID>>
		<<case $HeadGirl.ID>><<set $HeadGirl = $activeSlave>>
		<<case $Recruiter.ID>><<set $Recruiter = $activeSlave>>
		<<case $Bodyguard.ID>><<set $Bodyguard = $activeSlave>>
		<<case $Madam.ID>><<set $Madam = $activeSlave>>
		<<case $DJ.ID>><<set $DJ = $activeSlave>>
		<<case $Milkmaid.ID>><<set $Milkmaid = $activeSlave>>
		<<case $Farmer.ID>><<set $Farmer = $activeSlave>>
		<<case $Schoolteacher.ID>><<set $Schoolteacher = $activeSlave>>
		<<case $Attendant.ID>><<set $Attendant = $activeSlave>>
		<<case $Matron.ID>><<set $Matron = $activeSlave>>
		<<case $Nurse.ID>><<set $Nurse = $activeSlave>>
		<<case $Stewardess.ID>><<set $Stewardess = $activeSlave>>
		<<case $Wardeness.ID>><<set $Wardeness = $activeSlave>>
		<<case $Concubine.ID>><<set $Concubine = $activeSlave>>
		<<case $Collectrix.ID>><<set $Collectrix = $activeSlave>>
		<<case $Matron.ID>><<set $Matron = $activeSlave>>
	<</switch>>

	<<run clearSummaryCache($activeSlave)>>

	<</silently>>

	<<goto $returnTo>>

<</if>>


code:
:: custom Slaves Database

<<set _i = 1000000>>


code:
:: FAssistedSex [nobr]

<<run clearSummaryCache($activeSlave)>>
<<setLocalPronouns $activeSlave>>

You order $his servants forward so that $he can tease you with $his enormously swollen body.
<<if $activeSlave.devotion > 95>>
	Smirking, $he leans backwards,
	<<if $activeSlave.amp < 1>>
		raising $his hands above $his head
	<<else>>
		with two slender arms rising upward behind $him, making it look like $he has limbs once more
	<</if>>
	as a gaggle of $his trained menials slide underneath $his belly, lifting the monolithic organ off the ground and setting the tightly packed orb to wobbling.
<<elseif ($activeSlave.trust < -20) && ($activeSlave.devotion > -10)>>
	Smiling nervously, $he leans backwards,
	<<if $activeSlave.amp < 1>>
		raising $his hands above $his head
	<<else>>
		with two slender arms rising upward behind $him, making it look like $he has limbs once more
	<</if>>
	as a gaggle of $his trained menials slide underneath $his belly, lifting the monolithic organ off the ground and setting the tightly packed orb to wobbling.
<<else>>
	<<if $activeSlave.amp < 1>>
		$he covers $his eyes with $his hands,
	<<else>>
		Two slender arms snake around from behind $him, almost making it look like $he has limbs once more. They cover $his quivering eyes
	<</if>>
	as a gaggle of $his trained menials slide underneath $his belly, lifting the monolithic organ off the ground and setting the tightly packed orb to wobbling.
	<<if $activeSlave.amp < 1>>
		Two more servants take hold of $his arms, forcing $him to lift them above $his head.
	<<else>>
		The hands covering $his eyes draw away, revealing $his crying face, then lift above $his head in a deliberately provocative pose.
	<</if>>
	$He tenses in a moment of instinctive resistance, then surrenders $his body to $his aids' total control, clearly afraid of punishment.
<</if>>
You remove your clothes and lie back on the office couch,
<<if $PC.dick == 1>>
	allowing your exposed, full-mast dick to loll in front of you.
<<else>>
	spreading your exposed, oozing twat.
<</if>>
<<if $activeSlave.devotion > 95>>
	Licking $his lips,
<<elseif ($activeSlave.trust < -20) && ($activeSlave.devotion > -10)>>
	Breathing heavily,
<<else>>
	Smiling fakely,
<</if>>
$he draws toward you, half-floating on a river of silent, groping hands. When $he is inches away from you, $his servants lift $him higher, and $he
<<if $PC.dick == 1>>
	teases your dick with a series of masterful--and carefully balanced--belly isolations, rubbing the thick nub of $his belly button in small semicircles around your oozing cockhead as $he does so. Right when you feel ready to explode, $he rotates around, bringing
	<<if $activeSlave.butt > 11>>
		$his overgrown, wobbling ass cheeks
	<<elseif $activeSlave.butt > 5>>
		$his huge, wobbling ass cheeks
	<<elseif Math.floor($activeSlave.buttImplant/$activeSlave.butt) > .60>>
		$his saline inflated ass cheeks
	<<elseif $activeSlave.butt > 2>>
		$his wobbling ass cheeks
	<<else>>
		the shallow inverted bowls of $his petite ass cheeks
	<</if>>
	level with your erection. Two of $his servants reach around $his inflated profile and push $his cheeks together, wrapping your dick in a firm layer of butt cleavage. $He lifts $his ass, then drops it, again and again, smacking your chest on the downswing as $his servants manipulate $his hotdogging to maximize your pleasure.
	<<if canDoVaginal($activeSlave)>>
		When you feel the tension within you reaching its apex, you signal to $his servants to hold $him in place. With $his silent menials, still as statues, anchoring $his bloated body at the perfect angle for fucking while contorting their anonymous bodies to frame $him in a manner that maximizes $his visual attractiveness, you grab hold of $his flanks and ram into $his pregnant pussy, driving $him to the first of many orgasms in just a few casual thrusts.
		<<= VaginalVCheck()>>
		When you feel your own orgasm approaching, you pull out, ejaculating
	<<elseif canDoAnal($activeSlave)>>
		When you feel the tension within you reaching its apex, you signal to $his servants to hold $him in place. With $his silent menials, still as statues, anchoring $his bloated body at the perfect angle for fucking while contorting their anonymous bodies to frame $him in a manner that maximizes $his visual attractiveness, you grab hold of $his flanks and ram into $his asshole, driving $him to the first of many orgasms with just a few casual thrusts.
		 <<= AnalVCheck()>>
		When you feel your own orgasm approaching, you pull out, ejaculating
	<<else>>
		When you feel the tension with your reaching its apex, you signal to $his servants and they pull him forward. You ejaculate
	<</if>>
	a thick stream of semen all over $his ass and back, $he shifts into a kneeling position on the ground in front of you, tilted sideways so that $his massive fecundity can pool on the ground beside $him, and gently sucks you off, cleaning your dick with $his mouth.
	<<set $activeSlave.oralCount++, $oralTotal++>>
<<else>>
	Presses the thick nub of $his belly button into your pussy, rubbing it back and forth against your engorged clit as $he performs a series of masterful--and carefully balanced--belly isolations. After $he has you quaking at the edge of release, $he rolls forward and buries $his head in your lap, plying you with $his
	<<if $activeSlave.devotion > 95>>
		devoted tongue
	<<elseif ($activeSlave.trust < -20) && ($activeSlave.devotion > -10)>>
		dedicated tongue
	<<else>>
		tongue
	<</if>>
	and driving you into a series of crashing orgasms. When $his tongue tires, $he tries to draw away, but you grab hold of $his head and hold $him in place until you are finished.
	<<set $activeSlave.oralCount++, $oralTotal++>>
<</if>>
Once you are satisfied, you send $him away to clean $himself up before returning to $his duties.

<<if passage() != "Slave Interact">>
	<<set _fv = $slaveIndices[$activeSlave.ID]>>
	<<if def _fv>>
		<<set $slaves[_fv] = $activeSlave>>
	<</if>>
<</if>>