code:
:: Next Week [nobr]

<<set $HackingSkillMultiplier = upgradeMultiplier('hacking')>>
<<set $upgradeMultiplierArcology = upgradeMultiplier('engineering')>>
<<set $upgradeMultiplierMedicine = upgradeMultiplier('medicine')>>
<<set $upgradeMultiplierTrade = upgradeMultiplier('trading')>>

<<if $rivalOwner != 0>>
	<<set _rival = $arcologies.find(function(s) { return s.rival == 1; })>>
	<<if def _rival>>
		<<set $rivalOwner = _rival.prosperity>>
	<</if>>
<</if>>

<<if $playerAging != 0>>
	<<set $PC.birthWeek += 1>>
	<<if $PC.ovaryAge >= 47 && $PC.ovaries == 1 && ($PC.preg == -1 || $PC.preg == 0)>>
		<<set $PC.preg = -2>>
	<</if>>
	<<if $PC.birthWeek >= 52>>
		<<set $PC.birthWeek = 0>>
		<<if $playerAging == 2>>
			<<set $PC.physicalAge++, $PC.actualAge++, $PC.visualAge++, $PC.ovaryAge++>>
			<<AgePCEffects>>
		<</if>>
	<</if>>
<</if>>
<<if $menstruation == 1>>
<<elseif $PC.geneticQuirks.superfetation == 2 && $PC.womb.length > 0>>
	<<if $PC.fertPeak == 0>>
		<<set $PC.fertPeak = 1>>
	<</if>>
	<<set $PC.fertPeak-->>
<<elseif $PC.fertPeak != 0>>
	<<set $PC.fertPeak = 0>>
<</if>>

/*Adding random changes to the economy*/
<<if $difficultySwitch == 1>>
	<<set _globalEconSeed = random(1,100)>>
	<<if _globalEconSeed > 98>>
		<<set $economy += 2>>
	<<elseif _globalEconSeed > 85>>
		<<set $economy += 1>>
	<<elseif _globalEconSeed <= 2>>
		<<set $economy -= 2>>
	<<elseif _globalEconSeed <= 25 + $econRate * 10>>
		<<set $economy -= 1>>
	<</if>>
	<<if $economy < 20>>
		<<set $economy = 20>>
	<</if>>
	<<set _localEconSeed = random(1,100)>>
	<<if $localEcon <= ($economy + $econAdvantage)>>
		<<if _localEconSeed > 95>>
			<<set $localEcon += 2>>
		<<elseif _localEconSeed > 50>>
			<<set $localEcon += 1>>
		<<elseif _localEconSeed <= 1>>
			<<set $localEcon -= 2>>
		<<elseif _localEconSeed <= 10>>
			<<set $localEcon -= 1>>
		<</if>>
	<<elseif $localEcon <= ($economy + $econAdvantage + 5)>>
		<<if _localEconSeed > 98>>
			<<set $localEcon += 2>>
		<<elseif _localEconSeed > 66>>
			<<set $localEcon += 1>>
		<<elseif _localEconSeed <= 2>>
			<<set $localEcon -= 2>>
		<<elseif _localEconSeed <= 33>>
			<<set $localEcon -= 1>>
		<</if>>
	<<elseif _localEconSeed > 99>>
		<<set $localEcon += 2>>
	<<elseif _localEconSeed > 90>>
		<<set $localEcon += 1>>
	<<elseif _localEconSeed <= 5>>
		<<set $localEcon -= 2>>
	<<elseif _localEconSeed <= 50>>
		<<set $localEcon -= 1>>
	<</if>>
	<<if $localEcon < 20>>
		<<set $localEcon = 20>>
	<</if>>

	<<if $experimental.food == 1>>
		<<if $localEcon > 100>>
			<<set $farmyardFoodCost = Math.max(5 / (1 + (Math.trunc(1000-100000/$localEcon)/10)/100), 3.125)>>
		<<elseif $localEcon == 100>>
			<<set $farmyardFoodCost = 5 >>
		<<else>>
			<<set $farmyardFoodCost = Math.min(5 * (1 + 1.5 * Math.sqrt(Math.trunc(100000/$localEcon-1000)/10)/100), 6.5)>>
		<</if>>
	<</if>>
	<<set $foodCost = Math.trunc(2500/$localEcon)>>
	<<set $drugsCost = Math.trunc(10000/$localEcon)>>
	<<set $rulesCost = Math.trunc(10000/$localEcon)>>
	<<set $modCost = Math.trunc(5000/$localEcon)>>
	<<set $surgeryCost = Math.trunc(30000/($localEcon * ($PC.career === "medicine" ? 2 : 1)))>>
<</if>>

<<set $arcologies[0].prosperity = Math.clamp($arcologies[0].prosperity, 1, $AProsperityCap)>>

<<set $averageTrust = 0, $averageDevotion = 0, _slavesContributing = 0, _OldHG = -1, _NewHG = -1, _SL = $slaves.length>>
<<if $studio == 1>>
	<<for _genre range App.Porn.getAllGenres()>>
		<<set $pornStars[_genre.fameVar].p1count = 0>>
	<</for>>
<</if>>
<<for _i = 0; _i < _SL; _i++>>
	<<if def $slaves[_i].curBabies>>
		<<run delete $slaves[_i].curBabies>>
	<</if>>
	<<if $seeAge != 0>>
		<<set $slaves[_i].birthWeek++>>
		<<if $slaves[_i].birthWeek >= 52>>
			<<set $slaves[_i].birthWeek = 0>>
			<<run ageSlave($slaves[_i])>>
		<</if>>
	<</if>>
	<<if $slaves[_i].indenture > 0>>
		<<set $slaves[_i].indenture -= 1>>
	<</if>>
	<<if $slaves[_i].induceLactation > 0>>
		<<set $slaves[_i].induceLactation-->>
	<</if>>
	<<if ($slaves[_i].lactation == 1)>>
		<<if $slaves[_i].lactationDuration == 1>>
			<<set $slaves[_i].boobsMilk = 10*$slaves[_i].lactationAdaptation>>
			<<set $slaves[_i].boobs += $slaves[_i].boobsMilk>>
		<</if>>
	<</if>>
	<<if $menstruation == 1>>
	<<elseif $slaves[_i].geneticQuirks.superfetation == 2 && $slaves[_i].womb.length > 0>>
		<<if $slaves[_i].fertPeak == 0>>
			<<set $slaves[_i].fertPeak = 1>>
		<</if>>
		<<set $slaves[_i].fertPeak-->>
	<<elseif $slaves[_i].fertPeak != 0>>
		<<set $slaves[_i].fertPeak = 0>>
	<</if>>
	<<set $slaves[_i].trust = Number($slaves[_i].trust.toFixed(1)), $slaves[_i].devotion = Number($slaves[_i].devotion.toFixed(1))>>
	<<set $slaves[_i].oldDevotion = $slaves[_i].devotion, $slaves[_i].oldTrust = $slaves[_i].trust, $slaves[_i].minorInjury = 0>>
	<<if $slaves[_i].sentence > 1>>
		<<set $slaves[_i].sentence -= 1>>
	<<elseif $slaves[_i].sentence == 1>>
		<<= removeJob($slaves[_i], $slaves[_i].assignment)>>
	<</if>>
	<<if $slaves[_i].weekAcquired < 0>>
		<<set $slaves[_i].weekAcquired = 0>>
	<</if>>
	<<if $slaves[_i].relationship == 0>>
		<<set $slaves[_i].relationshipTarget = 0>>
	<</if>>
	<<if $slaves[_i].rivalry == 0>>
		<<set $slaves[_i].rivalryTarget = 0>>
	<<elseif $slaves[_i].rivalry < 0>>
		<<set $slaves[_i].rivalryTarget = 0, $slaves[_i].rivalry = 0>>
	<</if>>
	<<if $slaves[_i].vagina < 0>>
		<<set $slaves[_i].vaginalAccessory = "none", $slaves[_i].chastityVagina = 0, $slaves[_i].vaginaPiercing = 0>>
	<</if>>
	<<if $slaves[_i].dick == 0>>
		<<set $slaves[_i].dickAccessory = "none", $slaves[_i].chastityPenis = 0, $slaves[_i].dickTat = 0, $slaves[_i].dickPiercing = 0>>
	<</if>>
	/* I don't trust these */
	<<if !hasAnyArms($slaves[_i])>>
		<<set $slaves[_i].armsTat = 0, $slaves[_i].nails = 0, $slaves[_i].armAccessory = "none">>
	<</if>>
	<<if !hasAnyLegs($slaves[_i])>>
		<<set $slaves[_i].heels = 0, $slaves[_i].shoes = "none", $slaves[_i].legAccessory = "none", $slaves[_i].legsTat = 0>>
	<</if>>
	/* irregular leptin production weight gain/loss setter */
	<<if $slaves[_i].geneticQuirks.wGain == 2 && $slaves[_i].geneticQuirks.wLoss == 2>>
		<<set $slaves[_i].weightDirection = either(-1, 1)>>
	<<elseif $slaves[_i].geneticQuirks.wGain == 2>>
		<<set $slaves[_i].weightDirection = 1>>
	<<elseif $slaves[_i].geneticQuirks.wLoss == 2>>
		<<set $slaves[_i].weightDirection = -1>>
	<<else>>
		<<set $slaves[_i].weightDirection = 0>>
	<</if>>
	/% Fix some possible floating point rounding errors, and bring precision to one decimal place. %/
	<<run SlaveStatClamp($slaves[_i])>>
	<<set $slaves[_i].energy = Math.clamp($slaves[_i].energy.toFixed(1), 0, 100)>>
	<<if $slaves[_i].fetishStrength > 95>>
		<<set $slaves[_i].fetishStrength = 100>>
	<<else>>
		<<set $slaves[_i].fetishStrength = Math.clamp($slaves[_i].fetishStrength.toFixed(1), 0, 100)>>
	<</if>>
	<<set $slaves[_i].weight = Math.clamp($slaves[_i].weight.toFixed(1), -100, 200)>>
	<<set $slaves[_i].butt = Number($slaves[_i].butt.toFixed(1))>>
	<<set $slaves[_i].muscles = Math.clamp($slaves[_i].muscles.toFixed(1), -100, 100)>>
	<<set $slaves[_i].face = Math.clamp($slaves[_i].face.toFixed(1), -100, 100)>>
	<<set $slaves[_i].lips = Math.clamp($slaves[_i].lips.toFixed(1), 0, 100)>>
	<<set $slaves[_i].skill.oral = Math.clamp($slaves[_i].skill.oral.toFixed(1), 0, 100)>>
	<<set $slaves[_i].skill.vaginal = Math.clamp($slaves[_i].skill.vaginal.toFixed(1), 0, 100)>>
	<<set $slaves[_i].skill.anal = Math.clamp($slaves[_i].skill.anal.toFixed(1), 0, 100)>>
	<<set $slaves[_i].skill.whoring = Math.clamp($slaves[_i].skill.whoring.toFixed(1), 0, 100)>>
	<<set $slaves[_i].skill.entertainment = Math.clamp($slaves[_i].skill.entertainment.toFixed(1), 0, 100)>>
	<<set $slaves[_i].lactationAdaptation = Math.clamp($slaves[_i].lactationAdaptation.toFixed(1), 0, 100)>>
	<<set $slaves[_i].intelligenceImplant = Number($slaves[_i].intelligenceImplant.toFixed(1), 0, 30)>>
	<<set $slaves[_i].prematureBirth = 0>>
	<<if ($HGSuiteEquality == 1) && ($HeadGirl != 0) && ($slaves[_i].devotion > 50)>>
		<<if ($slaves[_i].assignment == "live with your Head Girl")>>
			<<set _NewHG = _i>>
		<<elseif ($slaves[_i].ID == $HeadGirl.ID)>>
			<<set _OldHG = _i>>
		<</if>>
	<</if>>
	/* AVERAGE VALUES UPDATE */
	<<if assignmentVisible($slaves[_i])>>
		<<set $averageTrust += $slaves[_i].trust, $averageDevotion += $slaves[_i].devotion, _slavesContributing++>>
	<<elseif ($slaves[_i].assignment != "be confined in the cellblock") && ($slaves[_i].assignment != "be confined in the arcade") && (($slaves[_i].assignment != "work in the dairy") || ($dairyRestraintsSetting < 2)) && $slaves[_i].assignment != "labor in the production line">>
		<<set $averageTrust += $slaves[_i].trust*0.5, $averageDevotion += $slaves[_i].devotion*0.5, _slavesContributing += 0.5>>
	<</if>>
	<<if $studio == 1>>
		<<set _activeGenres = App.Porn.getAllGenres().filter((g) => $slaves[_i].porn.fame[g.fameVar] > 0)>>
		<<for _genre range _activeGenres>>
			<<set $pornStars[_genre.fameVar].p1count++>>
		<</for>>
	<</if>>
	<<if $slaves[_i].choosesOwnAssignment > 0>>
		<<= assignJob($slaves[_i], "choose her own job")>>
	<</if>>
<</for>>
<<if _slavesContributing != 0>>
	<<set $averageTrust = $averageTrust/_slavesContributing>>
	<<set $averageDevotion = $averageDevotion/_slavesContributing>>
<</if>>
<<set $enduringTrust = ($averageTrust+($enduringTrust*3))/4>>
<<set $enduringDevotion = ($averageDevotion+($enduringDevotion*3))/4>>

<<if (_OldHG != -1) && (_NewHG != -1)>>
	<<set _oldTimeInGrade = $HGTimeInGrade>> /* preserve time in grade during HG swaps */
	<<= removeJob($slaves[_NewHG], "live with your Head Girl")>>
	<<= assignJob($slaves[_OldHG], "live with your Head Girl")>>
	<<= assignJob($slaves[_NewHG], "be your Head Girl")>>
	<<set $slaves[_NewHG].diet = "healthy", $HGTimeInGrade = _oldTimeInGrade>>
<</if>>

<<if WombBirthReady($PC, 38) > 0 && random(1,100) > 50>>
	<<set $PC.labor = 1>>
<<elseif WombBirthReady($PC, 43) > 0>>
	<<set $PC.labor = 1>>
<</if>>

<<set _toSearch = $PC.refreshment.toLowerCase()>>
<<if _toSearch.indexOf("fertility") != -1>>
	<<set $PC.forcedFertDrugs = 1>>
<<elseif $PC.forcedFertDrugs > 0>>
	<<set $PC.forcedFertDrugs-->>
<</if>>

<<if $FCTV.receiver > 0>>
	<<if $FCTV.pcViewership.frequency != -1>>
		<<set $FCTV.pcViewership.count++>>
		<<if $FCTV.pcViewership.count >= $FCTV.pcViewership.frequency>>
			<<set $FCTV.pcViewership.count = 0>>
		<</if>>
	<</if>>
	<<set $FCTV.channel.last = $FCTV.channel.selected>>
	<<run delete $FCTV.channel.selected>> <<run delete $usedRemote>> <<run delete $all>> <<run delete $show>>
<</if>>

<<set $week++>>

<<if $playerSurgery > 0>>
	<<set $playerSurgery-->>
<</if>>

<<if $secExpEnabled > 0>>
	<<if $foughtThisWeek == 1>>
		<<set $foughtThisWeek = 0>>
	<</if>>

	<<if $sentUnitCooldown > 0>>
		<<set $sentUnitCooldown-->>
	<</if>>
	<<if $SecExp.proclamation.cooldown > 0>>
		<<set $SecExp.proclamation.cooldown-->>
	<</if>>
<</if>>

<<set _seed = random(1,10)>>
<<if $week < 25>>
	<<if _seed > 4>>
		<<set $weatherToday = App.Data.weather.nice.random()>>
	<<else>>
		<<set $weatherToday = App.Data.weather.light.random()>>
	<</if>>
<<elseif $week < 50>>
	<<if _seed > 4>>
		<<set $weatherToday = App.Data.weather.nice.random()>>
	<<elseif _seed > 2>>
		<<set $weatherToday = App.Data.weather.light.random()>>
	<<else>>
		<<set $weatherToday = App.Data.weather.heavy.random()>>
	<</if>>
<<elseif $week < 75>>
	<<if _seed > 6>>
		<<set $weatherToday = App.Data.weather.nice.random()>>
	<<elseif _seed > 3>>
		<<set $weatherToday = App.Data.weather.light.random()>>
	<<else>>
		<<set $weatherToday = App.Data.weather.heavy.random()>>
	<</if>>
<<else>>
	<<if _seed > 8>>
		<<set $weatherToday = App.Data.weather.nice.random()>>
	<<elseif _seed > 6>>
		<<set $weatherToday = App.Data.weather.light.random()>>
	<<elseif _seed > 2>>
		<<set $weatherToday = App.Data.weather.heavy.random()>>
	<<else>>
		<<set $weatherToday = App.Data.weather.extreme.random()>>
	<</if>>
<</if>>

<<if $boomerangWeeks>><<set $boomerangWeeks++>><<else>><<set $boomerangSlave = 0>><</if>>
<<if $traitorWeeks>><<set $traitorWeeks++>><</if>>

<<set $thisWeeksFSWares = $merchantFSWares.randomMany(2)>>
<<set $thisWeeksIllegalWares = $merchantIllegalWares.randomMany(1)>>
<<set $prisonCircuitIndex++>><<if $prisonCircuitIndex >= $prisonCircuit.length>><<set $prisonCircuitIndex = 0>><</if>>

<<set $coursed = 0, $eventDescription = 0, $pitFought = 0, $prestigeAuctioned = 0, $eliteAuctioned = 0, $shelterSlave = 0, $shelterSlaveBought = 0, $slaveMarketLimit = 10 + ($rep / 1000), $slavesSeen = 0, $slavesSacrificedThisWeek = 0, $subSlaves = 0>>

/* Not sure where to put this one, so here is where it goes for now. slaveJobValues() also adds .sexAmount and .sexQuality to slave objects, perhaps those too should get zeroed somewhere around here? */
<<set $slaveJobValues = {}>>

/% These are variables that either should be made into _temp vars or should be Zeroed out once done with them instead of here. This can also interfere with debugging or hide NaN's as zeroing things out would clear a NaN. Also could stop from NaN's getting worse? %/
/% Integer and float variables. No real need to zero them out but doesn't hurt to have them in a known state, though this might mask variables NaN'ing out. Takes up the least amount of Memory besides a "" string. %/
<<set $i = 0, $j = 0, $averageProsperity = 0, $motherSlave = -1, $daughterSlave = -1, $devMother = -1, $devDaughter = -1, $alphaTwin = -1, $betaTwin = -1, $youngerSister = -1, $olderSister = -1, $recruiterSlave = -1>>
<<set $boobsID = -1, $boobsInterestTargetID = -1, $buttslutID = -1, $buttslutInterestTargetID = -1, $cumslutID = -1, $cumslutInterestTargetID = -1, $humiliationID = -1, $humiliationInterestTargetID = -1, $sadistID = -1, $sadistInterestTargetID = -1, $masochistID = -1, $masochistInterestTargetID = -1, $domID = -1, $dominantInterestTargetID = -1, $subID = -1, $submissiveInterestTargetID = -1, $shelterGirlID = -1>>

/% Other arrays %/
<<set $events = [], $RESSevent = [], $RESSTRevent = [], $RETSevent = [], $RECIevent = [], $RecETSevent = [], $REFIevent = [], $REFSevent = [], $PESSevent = [], $PETSevent = [], $FSAcquisitionEvents = [], $FSNonconformistEvents = [], $REAnalCowgirlSubIDs = [], $REButtholeCheckinIDs = [], $recruit = [], $RETasteTestSubIDs = [], $rebelSlaves = [], $REBoobCollisionSubIDs = [], $REIfYouEnjoyItSubIDs = [], $RESadisticDescriptionSubIDs = [], $REShowerForceSubIDs = [], $RESimpleAssaultIDs = [], $RECockmilkInterceptionIDs = [], $REInterslaveBeggingIDs = [], $bedSlaves = [], $eligibleSlaves = []>>

/% Slave Objects using 0 instead of null. Second most memory eaten up. %/
<<set $activeSlave = 0, $eventSlave = 0, $subSlave = 0, $milkTap = 0, $relation = 0, $relative = 0, $relative2 = 0>>

/% Slave Objects that never get zeroed so null them here. Second most memory eaten up. %/
<<set $beforeGingering = null>>

/% Strings Memory varies. %/
<<set $buyer = "", $desc = "", $event = "", $goto = "", $malefactor = "", $oldName = "", $oldSurname = "">>
/% Done with zeroing out, what should be for the most part Temps %/

<<if $autosave != 0>>
	<<script>>Save.autosave.save("Week Start Autosave")<</script>>
<</if>>

<<if $SF.Toggle && $SF.Active >= 1>>
	<<= App.SF.Count()>>
<<elseif $SF.Toggle && $SF.FS.Tension > 100>>
	<<if ($rep > 17500)>> <<set $rep = 17500>> <</if>>
<</if>>
<<set $NaNArray = findNaN()>>
<<goto "Main">>


code:
:: Nonrandom Event

<<set $activeSlave = 0, $eventSlave = 0>>

<<if $plot>>

<<set _effectiveWeek = $week-$nationHate>>
<<if (_effectiveWeek == 4) && ($arcologies[0].name.indexOf("Arcology ") != -1)>>
	<<set $Event = "arcology naming">>
	<<goto "Generic Plot Events">>
<<elseif (_effectiveWeek >= 5 && $FCTV.receiver == -1)>>
	<<goto "SE FCTV Install">>
<<elseif (_effectiveWeek == 6)>>
	<<set $Event = "strip club closing">>
	<<goto "Generic Plot Events">>
<<elseif (_effectiveWeek == 8)>>
	<<set $Event = "strip club aftermath">>
	<<goto "Generic Plot Events">>
<<elseif (_effectiveWeek == 11)>>
	<<set $Event = "assistant">>
	<<goto "Assistant Events">>
<<elseif (_effectiveWeek == 12) && $raped == -1 && $arcologyUpgrade.drones != 1 && $Bodyguard == 0 && $PC.career != "arcology owner">>
	<<goto "P raped">>
<<elseif (_effectiveWeek == 14) && $badC != 1>>
	<<set _valid = $slaves.find(function(s) { return s.curatives > 1 || s.inflationType == "curative"; })>>
	<<if def _valid>>
		<<set $badC = 1, $Event = "bad curatives">>
		<<goto "Generic Plot Events">>
	<<else>>
		<<set $badC = 1>>
		<<goto "Nonrandom Event">>
	<</if>>
<<elseif (_effectiveWeek == 17)>>
	<<set $Event = "shoot invitation">>
	<<goto "Generic Plot Events">>
<<elseif (_effectiveWeek == 20)>>
	<<set $Event = "slave food">>
	<<goto "Generic Plot Events">>
<<elseif (_effectiveWeek == 24)>>
	<<set $Event = "militia">>
	<<goto "Generic Plot Events">>
<<elseif ($week == 29)>>
	<<set $Event = "aid invitation">>
	<<goto "Generic Plot Events">>
<<elseif (_effectiveWeek == 31) && ($mercenaries == 0)>>
	<<goto "P mercenaries">>
<<elseif (_effectiveWeek == 35) && ($mercenaries > 0)>>
	<<goto "P snatch and grab">>
<<elseif (_effectiveWeek == 43)>>
	<<goto "P invasion">>
<<elseif (_effectiveWeek == 44) && ($mercenaries > 0) && $mercRomeo != 1>>
	<<set _valid = $slaves.find(function(s) { return (["serve the public", "serve in the club", "whore", "work in the brothel"].includes(s.assignment) || s.counter.publicUse >= 50) && s.fetish != "mindbroken" && s.fuckdoll == 0; })>>
	<<if def _valid>>
		<<set $mercRomeo = 1, $activeSlave = 0>>
		<<goto "P mercenary romeo">>
	<<else>>
		<<set $mercRomeo = 1>>
		<<goto "Nonrandom Event">>
	<</if>>
<<elseif (_effectiveWeek == 46) && ($mercenaries > 0)>>
	<<goto "P raid invitation">>
<<elseif (_effectiveWeek == 48) && ($experimental.food == 1)>>
	<<set $foodCrisis = 1>>
	<<goto "P food crisis">>
<<elseif (_effectiveWeek == 50) && ($rations > 0)>>
	<<set $foodCrisis = 2>>
	<<goto "P food crisis">>
<<elseif (_effectiveWeek == 52) && ($seeHyperPreg == 1) && $seePreg != 0 && $badB != 1>>
	<<set _valid = $slaves.find(function(s) { return s.drugs == "breast injections" || s.drugs == "hyper breast injections" || s.drugs == "intensive breast injections"; })>>
	<<if def _valid>>
		<<set $badB = 1, $Event = "bad breasts">>
		<<goto "Generic Plot Events">>
	<<else>>
		<<set $badB = 1>>
		<<goto "Nonrandom Event">>
	<</if>>
<<elseif _effectiveWeek == 54 && (def $peacekeepers) && $peacekeepers.attitude >= 0>>
	<<goto "P peacekeepers deficit">>
<<elseif (_effectiveWeek == 56)>>
	<<set $collaboration = 0>>
	<<set $traitor = 0>>
	<<set $hackerSupport = 0>>
	<<goto "P underground railroad">>
<<elseif (_effectiveWeek == 58) && ($traitor == 0)>>
	<<goto "P bombing">>
<<elseif (_effectiveWeek == 60) && ($rations > 0)>>
	<<set $foodCrisis = 3>>
	<<goto "P food crisis">>
<<elseif (_effectiveWeek == 61) && ($traitor != 0)>>
	<<goto "P traitor message">>
<<elseif (_effectiveWeek == 62) && ($mercenaries < 3)>>
	<<goto "P defense fears">>
<<elseif (_effectiveWeek == 65) && ($mercenaries >= 3)>>
	<<goto "P citizens and civilians">>
<<elseif (_effectiveWeek == 67) && ($traitor != 0)>>
	<<goto "P collaboration choice">>
<<elseif (_effectiveWeek == 69)>>
	<<goto "P hacker support">>
<<elseif (_effectiveWeek == 70) && ($collaboration == 1)>>
	<<if $traitorType != "trapper">>
		<<goto "P coup collaboration">>
	<<else>>
		<<goto "P coup betrayal">>
	<</if>>
<<elseif (_effectiveWeek == 71)>>
	<<if $traitorType != "agent" && $traitorType != "trapper">>
		<<set _doubleAgent = 0>>
	<<else>>
		<<set _doubleAgent = 1>>
	<</if>>
	<<if $mercenaries + $personalArms + $hackerSupport + _doubleAgent < 5>>
		<<goto "P coup loss">>
	<<else>>
		<<goto "P coup attempt">>
	<</if>>
<<elseif (_effectiveWeek == 72)>>
	<<goto "P coup aftermath">>
<<elseif $SF.Toggle && $SF.Active === -1 && _effectiveWeek >= 72>>
	<<goto "Security Force Proposal">>
<<elseif $arcologies[0].FSRestart != "unset" && $failedElite > 300 && $eugenicsFullControl != 1>>
	<<goto "eliteTakeOver">>
<<elseif (_effectiveWeek > 5) && ($rep > 3000) && ($FSAnnounced == 0)>>
	<<goto "P FS Announcement">>
<<elseif _effectiveWeek > 18 && $assistant.personality > 0 && !$assistant.options>>
	<<set $Event = "assistant SP">>
	<<goto "Assistant Events">>
<<elseif (_effectiveWeek > 45) && ($bodyswapAnnounced == 0) && ($surgeryUpgrade == 1)>>
	<<goto "P Bodyswap Reveal">>
<<elseif _effectiveWeek > 48 && $invasionVictory > 0 && $peacekeepers == 0 && $peacekeepersGone != 1>>
	<<goto "P peacekeepers intro">>
<<elseif ($arcologies[0].prosperity > 80) && ($TSS.schoolPresent+$GRI.schoolPresent+$SCP.schoolPresent+$LDE.schoolPresent+$TGA.schoolPresent+$HA.schoolPresent+$TFS.schoolPresent+$TCR.schoolPresent+$NUL.schoolPresent == 0) && ($schoolSuggestion == 0)>>
	<<goto "P school suggestion">>
<<elseif ($assistant.fsOptions !== 1) && $assistant.personality > 0 && $assistant.appearance != "normal" && FutureSocieties.HighestDecoration() >= 40>>
	<<set $Event = "assistant FS">>
	<<goto "Assistant Events">>
<<elseif $assistant.personality > 0 && !$assistant.announcedName && $assistant.power > 0>>
	<<set $Event = "assistant name">>
	<<goto "Assistant Events">>
<<elseif !$assistant.market && $assistant.power > 1>>
	<<set $Event = "market assistant">>
	<<goto "Assistant Events">>
<<elseif (_effectiveWeek > 70) && ($corp.Incorporated > 0) && ($rivalOwnerEnslaved > 0) && ($mercenaries >= 3) && ($mercenariesHelpCorp == 0) && ($corp.DivExtra > 0)>>
	<<goto "P Mercs Help Corp">>
<<elseif _effectiveWeek > 75 && (def $peacekeepers) && $peacekeepers.strength < 50 && $rivalOwner == 0 && $peacekeepersFate != 1>>
	<<goto "P peacekeepers independence">>
<<elseif (def $peacekeepers) && $peacekeepers.strength >= 50 && $peacekeepers.influenceAnnounced == 0>>
	<<goto "P peacekeepers influence">>
<<elseif ($cash > 120000) && ($rep > 4000) && ($corp.Announced == 0)>>
	<<goto "P Corp Announcement">>
<<elseif ($rivalOwner > 0)>>
	<<if $hostageAnnounced == 0 && $rivalSet != 0>>
		<<goto "P rivalry hostage">>
	<<elseif ($rivalOwner-$rivalryPower+10)/$arcologies[0].prosperity < 0.5>>
		<<goto "P rivalry victory">>
	<<elseif $peacekeepers.attitude > 5 && $rivalryDuration > 1>>
		<<goto "P rivalry peacekeepers">>
	<<else>>
		<<goto "P rivalry actions">>
	<</if>>
<<elseif ($arcologies[0].FSPaternalistDecoration == 100) && ($swanSong == 2) && ($week-$swanSongWeek >= 3)>>
	<<goto "RE The Siren Strikes Back">>
<<elseif ($PShoot == 1)>>
	<<set $Event = "shoot result">>
	<<goto "Generic Plot Events">>
<<elseif ($PSnatch == 1)>>
	<<goto "P snatch and grab result">>
<<elseif ($PRaid == 1)>>
	<<goto "P raid result">>
<<elseif ($PAid == 1)>>
	<<set $Event = "aid result">>
	<<goto "Generic Plot Events">>
<<elseif ($slaveMedic > 0)>>
	<<goto "P slave medic">>
<<elseif ($PPit == 1) && ($Bodyguard != 0)>>
	<<goto "PE pit fight">>
<<elseif $rivalOwner == 0 && $smilingManProgress == 0 && _effectiveWeek >= 74 && $secExpEnabled == 1>>
	<<goto "secExpSmilingMan">>
<<elseif $rivalOwner == 0 && $smilingManProgress == 1 && _effectiveWeek >= 77 && $secExpEnabled == 1>>
	<<goto "secExpSmilingMan">>
<<elseif $rivalOwner == 0 && $smilingManProgress == 2 && _effectiveWeek >= 82 && $secExpEnabled == 1>>
	<<goto "secExpSmilingMan">>
<<elseif $rivalOwner == 0 && $smilingManProgress == 3 && $secExpEnabled == 1>>
	<<goto "secExpSmilingMan">>
<<elseif ($rivalOwner == 0) && ($seeFCNN == 1) && ($FCNNstation == 0) && ($week > 95) && ($cash > 200000) && ($rep > 7500)>>
	<<goto "SE FCNN Station">>
<<else>>
	<<if random(1,100) > _effectiveWeek+25>>
		<<goto "RIE Eligibility Check">>
	<<else>>
		<<goto "Random Nonindividual Event">>
	<</if>>
<</if>>

<<else>>

<<if random(1,200) > _effectiveWeek+100 || $hostageRescued == 1>>
	<<goto "RIE Eligibility Check">>
<<else>>
	<<goto "Random Nonindividual Event">>
<</if>>

<</if>>

repo_name: KnightBoulegard/fc

license: mit


code:
:: Nurse Select [nobr jump-to-safe jump-hidden jump-from-safe]

<<set $nextButton = "Back", $nextLink = "Clinic", $encyclopedia = "Nurse">>
<<if ($Nurse != 0)>>
	<<set $Nurse = getSlave($Nurse.ID)>>
	<<setLocalPronouns $Nurse>>
	<<= SlaveFullName($Nurse)>> is serving as your Nurse.

$He will help heal your slaves.
<<else>>
	You have not selected a Nurse.
<</if>>

''Appoint a Nurse from your devoted slaves:''

[[None|Clinic][removeJob($Nurse, "be the Nurse")]]

<<print App.UI.SlaveList.facilityManagerSelection(App.Entity.facilities.clinic, "Clinic")>>


code:
:: Office Description [nobr]

    You are at your desk in your penthouse office. It has a glass top interface from which you can rule over $arcologies[0].name; $assistant.name's avatar is visible in one corner.

<<include "Personal Assistant Appearance">>
<<setAssistantPronouns>>

<<if $clubAdsSpending >= 5000>>
	A corner of your desk is piled with sample merchandise from the campaign promoting your club.
	<<set _eventSlaves = $slaves.filter(function(s) { return s.assignment == "serve in the club" && canWalk(s); })>>
	<<if _eventSlaves.length > 0>>
		<<set $activeSlave = _eventSlaves.random()>>
		<<setLocalPronouns $activeSlave>>
		<<if random(1,2) == 1>>
			This includes a sex toy based on $activeSlave.slaveName's
			<<if (random(1,3) == 1) && ($activeSlave.skill.vaginal >= 100)>>
				<<if $activeSlave.vagina > 3>>massive vagina<<elseif $activeSlave.vagina > 2>>gaping cunt<<elseif $activeSlave.vagina > 1>>hot cunt<<elseif $activeSlave.vagina > 0>>tight pussy<<else>>virgin pussy<</if>>.
			<<elseif (random(1,2) == 1) && ($activeSlave.skill.oral >= 100)>>
				<<if $activeSlave.lips > 40>>huge<<elseif $activeSlave.lips > 20>>pillowlike<<elseif $activeSlave.lips > 10>>pretty<<else>>thin<</if>> lips and throat.
			<<else>>
				<<if $activeSlave.anus > 3>>blown-out butthole<<elseif $activeSlave.anus > 2>>roomy anus<<elseif $activeSlave.anus > 1>>big butthole<<elseif $activeSlave.anus > 0>>tight asshole<<else>>virgin backdoor<</if>>.
			<</if>>
		<<else>>
			There is a figurine of $activeSlave.slaveName; $he's depicted
			<<if (random(1,3) == 1) && ($activeSlave.skill.vaginal >= 100)>>
				lying nude on $his back, spreading $his legs to <<if $activeSlave.vagina > 3>>exhibit $his massive vagina<<elseif $activeSlave.vagina > 2>>show off $his gaping cunt<<elseif $activeSlave.vagina > 1>>offer $his hot cunt<<elseif $activeSlave.vagina > 0>>display $his tight pussy<<else>>tantalize with $his virgin pussy<</if>>.
			<<elseif (random(1,2) == 1) && ($activeSlave.skill.oral >= 100)>>
				with $his <<if $activeSlave.lips > 40>>huge<<elseif $activeSlave.lips > 20>>pillowlike<<elseif $activeSlave.lips > 10>>pretty<<else>>thin<</if>> lips parted, $his tongue partway out.
			<<else>>
				bending at the waist and spreading $his <<if $activeSlave.butt > 6>>gigantic buttocks<<elseif $activeSlave.butt > 4>>meaty asscheeks<<elseif $activeSlave.butt > 2>>healthy buttocks<<else>>cute butt<</if>> to show off $his <<if $activeSlave.anus > 3>>blown-out butthole<<elseif $activeSlave.anus > 2>>roomy butthole<<elseif $activeSlave.anus > 1>>big butthole<<elseif $activeSlave.anus > 0>>tight asshole<<else>>virgin backdoor<</if>>.
			<</if>>
		<</if>>
	<</if>>
<</if>>
<<if $brothelAdsSpending >= 5000>>
	<<if $clubAdsSpending >= 5000>>
		There's just as much from the similar campaign advertising $brothelName.
	<<else>>
		A corner of your desk is piled with sample merchandise from the campaign promoting $brothelName.
	<</if>>
	<<set _eventSlaves = $slaves.filter(function(s) { return s.assignment == "work in the brothel" && canWalk(s); })>>
	<<if _eventSlaves.length > 0>>
		<<set $activeSlave = _eventSlaves.random()>>
		<<setLocalPronouns $activeSlave>>
		<<if random(1,2) == 1>>
			This includes a sex toy based on $activeSlave.slaveName's
			<<if (random(1,3) == 1) && ($activeSlave.skill.vaginal >= 100)>>
				<<if $activeSlave.vagina > 3>>massive vagina<<elseif $activeSlave.vagina > 2>>gaping cunt<<elseif $activeSlave.vagina > 1>>hot cunt<<elseif $activeSlave.vagina > 0>>tight pussy<<else>>virgin pussy<</if>>.
			<<elseif (random(1,2) == 1) && ($activeSlave.skill.oral >= 100)>>
				<<if $activeSlave.lips > 40>>huge<<elseif $activeSlave.lips > 20>>pillowlike<<elseif $activeSlave.lips > 10>>pretty<<else>>thin<</if>> lips and throat.
			<<else>>
				<<if $activeSlave.anus > 3>>blown-out butthole<<elseif $activeSlave.anus > 2>>roomy butthole<<elseif $activeSlave.anus > 1>>big butthole<<elseif $activeSlave.anus > 0>>tight asshole<<else>>virgin backdoor<</if>>.
			<</if>>
		<<else>>
			This includes paired figurines of $activeSlave.slaveName with a faceless male figure;
			<<if (random(1,3) == 1) && ($activeSlave.skill.vaginal >= 100)>>
				$he's shamelessly riding his dick.
			<<elseif (random(1,2) == 1) && ($activeSlave.skill.oral >= 100)>>
				$he's on $his <<if hasAnyLegs($activeSlave)>>$his knee<<if hasBothLegs($activeSlave)>>s<</if>><<else>>the ground<</if>> with $his <<if $activeSlave.lips > 40>>huge<<elseif $activeSlave.lips > 20>>pillowlike<<elseif $activeSlave.lips > 10>>pretty<<else>>thin<</if>> lips wrapped around his dick.
			<<else>>
				$he's shown <<if $activeSlave.anus > 3>>looking up teasingly as $he takes his dick up $his blown-out butthole<<elseif $activeSlave.anus > 2>>looking up teasingly as $he takes his dick up $his roomy anus<<elseif $activeSlave.anus > 1>>looking up teasingly as $he takes his dick in $his big butthole<<elseif $activeSlave.anus > 0>>gasping as $he takes his dick in $his tight asshole<<else>>screaming as he fucks $his virgin backdoor<</if>>.
			<</if>>
		<</if>>
	<</if>>
<</if>>
<br>    Next to your desk is a sturdy black leather couch. All the walls on this floor are glass, so you can see your <<if $slaves.length > 50>>innumerable<<elseif $slaves.length > 20>>many<<elseif $slaves.length > 10>>numerous<<elseif $slaves.length > 5>>handful of<<else>>few<</if>> slaves going about their business. The room is designed so that everyone must walk past the door to your office to get anywhere.
<<if $personalArms > 0>>
	Your custom armor rests in the corner of the room where visitors can admire it, and you can don it quickly if necessary.
	<<if ($week > (43-$nationHate)) && ($mercenaries >= 5)>>
		Its plates bear scarring won in victorious battle, and from its back rises a banner depicting you at the head of your $mercenariesTitle.
	<<elseif $week > (43-$nationHate)>>
		Its plates bear scarring fairly won.
	<</if>>
	<<if $assistant.personality > 0>>
		The last time _heA had it maintained, $assistant.name added
		<<switch $assistant.appearance>>
		<<case "monstergirl">>
			a pinup of _himselfA to its plating: _heA's depicted with _hisA fangs bared, each strand of _hisA tentacle hair holding a lightning bolt, and both of _hisA cocks ejaculating fire.
		<<case "shemale">>
			a pinup of _himselfA to its plating: _heA's depicted straddling a battle rifle so closely that it looks like _heA's intimately entangled in the action.
		<<case "amazon">>
			a pinup of _himselfA to its plating: _heA's depicted in a classic nude bodybuilder's pose, but with a cutely coquettish expression.
		<<case "businesswoman">>
			a pinup of _himselfA to its plating: _heA's depicted wearing underwear, for once, and looking very severe as _heA straddles a cruise missile in a classic bombshell pose.
		<<case "fairy">>
			a pinup of _himselfA to its plating: _heA's depicted naked as usual, standing on top of a large bullet and making finger guns with a grin on _hisA face.
		<<case "pregnant fairy">>
			a pinup of _himselfA to its plating: _heA's depicted naked as usual, straddling a large bullet and making peace signs with _hisA tongue sticking out.
		<<case "goddess">>
			a pinup of _himselfA to its plating: _heA's depicted demurely but barely covering _hisA radiant body with a flowing ribbon, like a goddess about to burst with triplets.
		<<case "hypergoddess">>
			a pinup of _himselfA to its plating: _heA's depicted barely covering _hisA hugely pregnant, radiant body with a flowing ribbon, like a goddess about to burst open from _hisA hundreds of children.
		<<case "loli">>
			a pinup of _himselfA to its plating: _heA's cutely hugging a rifle to _hisA flat chest.
		<<case "preggololi">>
			a pinup of _himselfA to its plating: _heA's flashing _hisA lewd preggo _loliA pussy.
		<<case "angel">>
			a pinup of _himselfA to its plating: _heA's depicted wielding a flaming sword and golden shield.
		<<case "cherub">>
			a pinup of _himselfA to its plating: _heA's depicted hugging a bow to _hisA chest.
		<<case "incubus">>
			a pinup of _himselfA to its plating: _heA's depicted mid-orgasm, a bullet rocketing from _hisA dick amidst a blast of cum.
		<<case "succubus">>
			a pinup of _himselfA to its plating:
			<<switch $assistant.fsAppearance>>
			<<case "paternalist">>
				_heA's depicted hiking _hisA skirt to flash _hisA crotch.
			<<case "degradationist">>
				_heA's depicted striking a pose showing off _hisA countless piercings.
			<<case "roman revivalist">>
				_heA's depicted in a stola, flashing _hisA tits.
			<<case "egyptian revivalist">>
				_heA's depicted groping _hisA perfect bronze breasts while blowing a kiss.
			<<case "edo revivalist">>
				_heA's depicted in a kimono, pulled open to flash _hisA lovely breasts.
			<<case "arabian revivalist">>
				_heA's depicted wearing fine silks and striking a sexy pose, though they fail to cover anything on _himA.
			<<case "chinese revivalist">>
				_heA's depicted wearing colorful silk robes; _heA's pulled them open to flash _hisA lovely body.
			<<case "supremacist">>
				_heA's depicted wearing the dress of an old world $arcologies[0].FSSupremacistRace noble<<= _womanA>> and blowing a kiss in a sexy manner.
			<<case "subjugationist">>
				_heA's depicted sitting with _hisA legs wide open and using _hisA fingers to spread _hisA $arcologies[0].FSSubjugationistRace pussy lips apart in a lewd manner.
			<<case "chattel religionist">>
				_heA's depicted striking a sexy pose, chosen specifically to draw attention to the symbols of your religion that adorn _hisA nipples.
			<<case "repopulation focus">>
				_heA's depicted striking a sexy pose made to draw the eye to _hisA pregnant belly.
			<<case "eugenics">>
				_heA's depicted striking a sexy pose; _heA's so stunning you can't look away.
			<<case "physical idealist">>
				_heA's depicted flexing _hisA <<if $arcologies[0].FSPhysicalIdealistStrongFat == 1>>fat veiled <</if>>tremendous musculature intimidatingly.
			<<case "hedonistic decadence">>
				_heA's depicted deep throating a banana while groping _hisA large, soft belly.
			<<case "gender radicalist">>
				_heA's depicted facing away from you, looking over _hisA shoulder suggestively and presenting
				<<if $arcologies[0].FSGenderRadicalistLawFuta == 1>>
					_hisA rear. A pair of balls hangs beneath _hisA tight pussy.
				<<elseif $arcologies[0].FSGenderRadicalistLawFuta == 2>>
					_hisA anus. A pair of heavy balls hangs from _hisA crotch.
				<<elseif $arcologies[0].FSGenderRadicalistLawFuta == 3>>
					_hisA gigantic ass.
				<<elseif $arcologies[0].FSGenderRadicalistLawFuta == 4>>
					_hisA anus. A tiny pair of balls hangs from _hisA crotch.
				<<else>>
					_hisA rear.
				<</if>>
			<<case "gender fundamentalist">>
				_heA's depicted with one hand on _hisA supple breast and the other tracing the curve of _hisA child-bearing hips.
			<<case "asset expansionist">>
				_heA's depicted cradling _hisA own pair of ballistics; _hisA gigantic breasts are painted like atom bombs.
			<<case "transformation fetishist">>
				_heA's depicted striking a pose with one arm supporting _hisA enormous implants.
			<<case "pastoralist">>
				_heA's depicted striking a sexy pose, hands trying to relieve the pressure of _hisA quartet of milk filled breasts.
			<<case "maturity preferentialist">>
				_heA's depicted in a pose not unlike something you'd see on a 60's pinup calendar.
			<<case "youth preferentialist">>
				_heA's depicted in a pose fresh out of a popular idol's newest video.
			<<case "slimness enthusiast">>
				_heA's depicted striking a sexy pose while running _hisA hands across _hisA
				<<if $arcologies[0].FSSlimnessEnthusiastLaw == 1>>
					flat chest.
				<<else>>
					slim assets.
				<</if>>
			<<case "body purist">>
				_heA's depicted striking a sexy pose that shows off every flawless <<if $showInches == 2>>inch<<else>>centimeter<</if>> of _hisA body.
			<<case "intellectual dependency">>
				_heA's depicted riding a missile, both literally and sexually.
			<<case "slave professionalism">>
				_heA's depicted getting hands-on with cruise missile, priming it to go off.
			<<case "petite admiration">>
				_heA's depicted striking a pose with a rifle as large as _heA is.
			<<case "statuesque glorification">>
				_heA's depicted striking a sexy pose. _HeA made sure to utilize the armor's entire height.
			<<default>>
				_heA's posing like a classic centerfold _girlA.
			<</switch>>
		<<case "imp">>
			a pinup of _himselfA to its plating: _heA's depicted straddling a trident; pussy juices running down its shaft.
		<<case "witch">>
			a pinup of _himselfA to its plating: _heA's depicted straddling a broom, winking.
		<<case "ERROR_1606_APPEARANCE_FILE_CORRUPT">>
			a pinup of _himselfA to its plating: you have no idea what to make of it. Whatever it is, it is devouring your enemies on one end and popping out proper slaves from the other.
		<<case "schoolgirl">>
			a pinup of _himselfA to its plating: _heA's depicted up on tiptoe, back turned, with _hisA school<<= _girlA>> skirt riding up to bare _hisA bottom.
		<<default>>
			_hisA own symbol to its insignia.
		<</switch>>
	<</if>>
<</if>>
<<= printTrinkets()>>

A small mirror resides on your desk, facing you.
A $PC.visualAge year old, $PC.faceShape<<if $PC.markings == "freckles">>, freckled<<elseif $PC.markings == "heavily freckled">>, densely freckled<</if>> face stares back at you.
<<if ($playerAging != 0) && $PC.birthWeek == 51>>You'll be turning <<print $PC.actualAge+1>> next week.<</if>>
<<= App.Desc.Player.boobs()>>
<<= App.Desc.Player.belly()>>
<<= App.Desc.Player.crotch()>>
<<= App.Desc.Player.butt()>>


code:
:: Options [nobr jump-to-safe jump-from-safe]

<<if lastVisited("Slave Interact") === 1>>
	<<set $storedLink = "Slave Interact">>
<<else>>
	<<set $storedLink = "Main">>
<</if>>

<<set $nextButton = "Back", $nextLink = $storedLink, $encyclopedia = "How to Play">>
<<set $passageSwitchHandler = App.EventHandlers.optionsChanged>>

<<set _options = new App.UI.OptionsGroup()>>
<<run _options.addOption("End of week autosaving is currently", "autosave")
.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>
<<includeDOM _options.render()>>

This save was created using FC version $ver build $releaseID.

    [[Apply Backwards Compatibility Update|Backwards Compatibility]]
<<if $secExpEnabled == 1>>

    [[Apply Security Expansion mod backwards compatibility |SecExpBackwardCompatibility]]
<</if>>
<<if $SF.Toggle && $SF.Active >= 1>>

	<<link "Apply Special Force Expansion mod backwards compatibility">>
		<<= App.SF.BC()>>
		<<goto "Options">>
	<</link>>
<</if>>

<<link "Reset extended family mode controllers">>
		<<run resetFamilyCounters()>>
		<<replace "#familyHint">>//@@.lightgreen;Done:@@ all family relations flushed and rebuilt.//<</replace>>
	<</link>>
//Clears and rebuilds .sister and .daughter tracking.//
<<if isNaN($rep)>>

[[Reset Reputation|Options][$rep = 0]]
<</if>>
<<if isNaN($cash)>>

[[Reset Money|Options][$cash = 500]]
<</if>>
<<if $releaseID == 1057>>

[[Free male anatomy removal due to accidentally flawed updater|Options][$PC.dick = 0, $PC.balls = 0, $PC.prostate = 0, $PC.scrotum = 0, $PC.ballsImplant = 0]] //Use this if your female PC picked up a few extra parts during the conversion process.//
<</if>>

<<if ($releaseID >= 1000) || $ver.startsWith("0.9") || $ver.startsWith("0.8") || $ver.startsWith("0.7") || $ver.startsWith("0.6")>>

	''NEW GAME PLUS''

	//You can begin a new game with up to five (or more) of your current slaves, although starting resources other than these slaves will be reduced. New Game Plus @@.yellow;MAY@@ work across versions. To attempt to migrate a save across versions://

    //1) Save on this screen//

    //2) Re-open the .html in a new tab then load the above save.//

    //3) [[Activate New Game Plus.|New Game Plus][$ui = "start"]]
<<else>>
	//New Game Plus is not available because this game was not started with a compatible version.//
<</if>>

<<run App.UI.tabbar.handlePreSelectedTab($tabChoice.Options)>>

	<button class="tablinks" onclick="App.UI.tabbar.openTab(event, 'Display')" id="tab Display">Display</button>
	<button class="tablinks" onclick="App.UI.tabbar.openTab(event, 'CONTENT&FLAVOR')" id="tab CONTENT&FLAVOR">Content & flavour</button>
	<button class="tablinks" onclick="App.UI.tabbar.openTab(event, 'MODS')" id="tab MODS">Mods</button>
	<button class="tablinks" onclick="App.UI.tabbar.openTab(event, 'DEBUG/CHEATING')" id="tab DEBUG/CHEATING">Debug/cheating</button>
	<button class="tablinks" onclick="App.UI.tabbar.openTab(event, 'Experimental')" id="tab Experimental">Experimental</button>

Reports

		<<set _options = new App.UI.OptionsGroup()>>

		<<run _options.addOption("End week report descriptive details are", "showEWD")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<run _options.addOption("End week report performance details are", "showEWM")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<run _options.addOption("Master Suite report details such as slave changes are", "verboseDescriptions")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<run _options.addOption("Accordion effects on weekly reports are", "useAccordion")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<run _options.addOption("Economic Tabs on weekly reports are", "useTabs")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<run _options.addOption("Economic detail sheets for facilities are", "showEconomicDetails")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<run _options.addOption("Economic report neighbor details such as trade impacts on culture are", "showNeighborDetails")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<run _options.addOption("Numeric formatting is currently", "formatNumbers")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()
		.addComment("This will comma-format numbers in some areas.")>>

		<<includeDOM _options.render()>>

General

		<<set _options = new App.UI.OptionsGroup()>>

		<<run _options.addOption("Color Control").customButton("Flip lightning", () => flipColors(setup.lightColorMap))>>

		<<run _options.addOption("Main menu leadership controls displayed", "positionMainLinks")
		.addValueList([["Above", 1], ["Above and below", 0], ["Below", -1]])>>

		<<run _options.addOption("New Model UI", "newModelUI")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<run _options.addOption("Penthouse Facility Display", "verticalizeArcologyLinks")
		.addValueList([["Triple column", 3], ["Double Coloumn", 2], ["Single Column", 1], ["Collapsed", 0]])>>

		<<run _options.addOption("Main menu arcology description", "seeArcology")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<run _options.addOption("Main menu desk description", "seeDesk")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<run _options.addOption("Main menu newsfeed", "seeFCNN")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<run _options.addOption("Tips from the Encyclopedia are", "showTipsFromEncy")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<run _options.addOption("Help tooltips are", "tooltipsEnabled")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()
		.addComment("This is mostly for new players. @@.exampleTooltip.noteworthy;Colored text@@ can have tooltips.")>>

		<<run _options.addOption("Main menu slave tabs are", "useSlaveSummaryTabs")
		.addValue("Enabled", 1).on().addValue("CardStyle", 2).on().addValue("Disabled", 0).off()>>

		<<run _options.addOption("The slave Quick list in-page scroll-to is", "useSlaveListInPageJSNavigation")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<run _options.addOption("Condense special slaves into their own tab", "useSlaveSummaryOverviewTab")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<run _options.addOption("Interactions with your fucktoys are", "fucktoyInteractionsPosition")
		.addValueList([["next to them", 1], ["at page bottom", 0]])>>

		<<run _options.addOption("Line separations are", "lineSeparations")
		.addValue("Shown", 1).on().addValue("Hidden", 0).off()>>

		<<includeDOM _options.render()>>

Sidebar

		<<set _options = new App.UI.OptionsGroup()>>

		<<run _options.addOption("Cash is", "Cash", $sideBarOptions)
		.addValue("Shown", 1).on().addValue("Hidden", 0).off()>>

		<<run _options.addOption("Upkeep is", "Upkeep", $sideBarOptions)
		.addValue("Shown", 1).on().addValue("Hidden", 0).off()>>

		<<run _options.addOption("Sex slave count is", "SexSlaveCount", $sideBarOptions)
		.addValue("Shown", 1).on().addValue("Hidden", 0).off()>>

		<<run _options.addOption("Room population is", "roomPop", $sideBarOptions)
		.addValue("Shown", 1).on().addValue("Hidden", 0).off()>>

		<<run _options.addOption("GSP is", "GSP", $sideBarOptions)
		.addValue("Shown", 1).on().addValue("Hidden", 0).off()>>

		<<run _options.addOption("Rep is", "Rep", $sideBarOptions)
		.addValue("Shown", 1).on().addValue("Hidden", 0).off()>>

		<<run _options.addOption("Confirmation before ending a week is", "confirmWeekEnd", $sideBarOptions)
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()
		.addComment("Enabling this will open a dialog box to confirm you meant to end a week.")>>

		<<if $secExpEnabled > 0>>
			<<run _options.addOption("Authority is", "Authority", $sideBarOptions)
			.addValue("Shown", 1).on().addValue("Hidden", 0).off()>>

			<<run _options.addOption("Security is", "Security", $sideBarOptions)
			.addValue("Shown", 1).on().addValue("Hidden", 0).off()>>

			<<run _options.addOption("Crime is", "Crime", $sideBarOptions)
			.addValue("Shown", 1).on().addValue("Hidden", 0).off()>>
		<</if>>

		<<includeDOM _options.render()>>

Images

		<<set _options = new App.UI.OptionsGroup()>>

		<<run _options.addOption("Images are", "seeImages")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<includeDOM _options.render()>>

		<<if $seeImages > 0>>

				<<= SlaveArt(BaseSlave(), 0, 0)>>

			<<set _options = new App.UI.OptionsGroup()>>

			<<run _options.addOption("", "imageChoice")
			.addValueList([["Revamped embedded vector art", 3], ["Non-embedded vector art", 2], ["NoX/Deepmurk's vector art", 1], ["Shokushu's rendered imagepack", 0]])>>

			<<if $imageChoice === 1>>
				<<run _options.addOption("").addComment('Git compiled only, no exceptions.')>>

				<<run _options.addOption("Face artwork is", "seeFaces")
				.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

				<<run _options.addOption("Highlights on shiny clothing are", "seeVectorArtHighlights")
				.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

				<<run _options.addOption("Height scaling", "seeHeight")
				.addValue("All images", 2).on().addValue("Small images", 1).neutral().addValue("Disabled", 0).off()>>

				<<run _options.addOption("Clothing erection bulges are", "showClothingErection")
				.addValue("Enabled", true).on().addValue("Disabled", false).off()>>
			<<elseif $imageChoice === 0>>
				<<run _options.addOption("").addComment(`You need """to"""
					download the image pack
					"""and""" put the 'renders' folder into the resources/ folder where this html file is.`
				)>>

				<<run _options.addOption("Slave summary fetish images are", "seeMainFetishes")
				.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>
			<<elseif $imageChoice === 3>>
				<<run _options.addOption("").addComment('Git compiled only, no exceptions.')>>

				<<run _options.addOption("Clothing erection bulges are", "showClothingErection")
				.addValue("Enabled", true).on().addValue("Disabled", false).off()>>
			<</if>>

			<<run _options.addOption("PA avatar art is", "seeAvatar")
			.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

			<<run _options.addOption("Slave images in lists are", "seeSummaryImages")
			.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

			<<run _options.addOption("Slave images in the weekly report are", "seeReportImages")
			.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

			<<includeDOM _options.render()>>
		<</if>>

Content

		//More granular control of what appears is in [[Description Options]].//

		<<set _options = new App.UI.OptionsGroup()>>

		<<run _options.addOption("The difficulty setting is currently set to", "baseDifficulty")
		.addValueList([["Very easy", 1], ["Easy", 2], ["Default", 3], ["Hard", 4], ["Very hard", 5]])>>

		<<run _options.addOption("Slaves falling ill is currently", "seeIllness")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()
		.addComment("Will not affect existing ill slaves already in-game.")>>

		<<run _options.addOption("Extreme content like amputation is currently", "seeExtreme")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()
		.addComment("Will not affect extreme surgeries already applied in-game.")>>

		<<run _options.addOption("Bestiality related content is currently", "seeBestiality")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<run _options.addOption("Watersports related content is currently", "seePee")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<run _options.addOption("Incest content is currently", "seeIncest")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<run _options.addOption("Pregnancy related content is currently", "seePreg")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()
		.addComment("Will not affect existing pregnancies already in-game.")>>

		<<run _options.addOption("Child gender to be generated based off dick content settings", "seeDicksAffectsPregnancy")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()
		.addComment("<<if $seeDicksAffectsPregnancy === 1>>Currently <<print $seeDicks>>% of children will be born male. <</if>>Will not affect existing pregnancies already in-game.")>>

		<<if $seeDicksAffectsPregnancy > 0>>
			<<run _options.addOption("XX slaves can have sons", "adamPrinciple")
			.addValue("Enabled", 1).on().addValue("Disabled", 0).off()
			.addComment("Will not affect existing pregnancies already in-game.")>>
		<</if>>

		<<run _options.addOption("Extreme pregnancy content like broodmothers is currently", "seeHyperPreg")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()
		.addComment("Will not affect existing hyperpregnancies already in-game.")>>

		<<run _options.addOption("Pregnancy complications due to multiples and body size are currently", "dangerousPregnancy")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<run _options.addOption("Precocious puberty (pregnancy younger than $fertilityAge)", "precociousPuberty")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()
		.addComment("Will not affect existing precocious puberty cases already in-game.")>>

		<<run _options.addOption("Slaves with fat lips or heavy oral piercings may lisp", "disableLisping")
		.addValue("Yes", 0).on().addValue("No", 1).off()>>

		<<run _options.addOption("Disables the tiredness mechanic. //Temp option//", "disableTiredness")
		.addValue("Enabled", 0).on().addValue("Disabled", 1).off()>>

		<<run _options.addOption("Disables the long term damage mechanic. //Temp option//", "disableLongDamage")
		.addValue("Enabled", 0).on().addValue("Disabled", 1).off()>>

		<<run _options.addOption("Experimental male pronouns are currently", "diversePronouns")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()
		.addComment("Apply Backwards Compatibility after changing to update slave's pronouns. Not all scenes support male pronouns and this is not yet incorporated into the lore or mechanics.")>>

		<<run _options.addOption("Male slave names are currently", "allowMaleSlaveNames")
		.addValue("Enabled", true).on().addValue("Disabled", false).off()
		.addComment("This only affects slave generation and not your ability to name your slaves.")>>

		<<run _options.addOption("Missing slave names are currently", "showMissingSlaves")
		.addValue("Enabled", true).on().addValue("Disabled", false).off()>>

		<<includeDOM _options.render()>>

Intersecting mechanics

		<<set _options = new App.UI.OptionsGroup()>>

		<<run _options.addOption("Slave assets affected by weight is", "weightAffectsAssets")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()
		.addComment("Diet will still affect asset size.")>>

		<<run _options.addOption("Curative side effects are", "curativeSideEffects")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()
		.addComment("If enabled, curatives have a chance to give slaves harmful side effects.")>>

		<<includeDOM _options.render()>>

Flavour

		<<set _options = new App.UI.OptionsGroup()>>

		<<run _options.addOption("Slave reactions to facility assignments are", "showAssignToScenes")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<run _options.addOption("Post sex clean up", "postSexCleanUp")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<run _options.addOption("Appraisal miniscenes on slave sale are", "showAppraisal")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<run _options.addOption("Assignment performance vignettes on the end week report are", "showVignettes")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<run _options.addOption("Slaves can have alternate titles", "newDescriptions")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<run _options.addOption("Family titles for relatives", "allowFamilyTitles")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<run _options.addOption("Limit family growth", "limitFamilies")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()
		.addComment("Restricts acquisition of additional relatives, by means other than birth, for slaves with families.")>>

		<<run _options.addOption("Distant relatives such as aunts, nieces and cousins are", "showDistantRelatives")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		<<includeDOM _options.render()>>

		<<set _options = new App.UI.OptionsGroup()>>

		<<run _options.addOption("The Special Force Mod is currently", "Toggle", $SF)
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

		/*
		<<if $SF.Toggle > 0>>
			<<options $SF.Facility.Toggle>>

 The support facility is
				<<option 1 "Enabled">>
				<<option 0 "Disabled">>
			<</options>>
		<</if>> //Prep for future content.//
		*/

		<<run _options.addOption("The Security Expansion mod is", "secExpEnabled")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()
		.addComment("
The mod can be activated in any moment, but it may result in unbalanced gameplay if activated very late in the game.

''If you are enabling the mod mid game for the first time, run the either the main or mod specific BC option listed near the top.''
")>>

		<<includeDOM _options.render()>>

		<<if $secExpEnabled > 0>>

Security Expansion mod options

			<<if $terrain === "oceanic">>

Oceanic arcologies are not by default subject to external attacks. You can however allow them to happen anyway. If you choose to do so please keep in mind that descriptions and mechanics are not intended for naval combat but land combat.

			<</if>>

			<<set _options = new App.UI.OptionsGroup()>>

			<<if $SecExp.settings.battle.enabled > 0 || $SecExp.settings.rebellion.enabled > 0>>
				<<run _options.addOption("Detailed battle statistics are", "showStats", $SecExp.settings)
				.addValue("Shown", 1).on().addValue("Hidden", 0).off()
				.addComment("Visability of detailed statistics and battle turns.")>>

				<<run _options.addOption("Difficulty is", "difficulty", $SecExp.settings)
				.addValueList([["Extremely hard", 2], ["Very hard", 1.5], ["Hard", 1.25], ["Normal", 1], ["Easy", 0.75], ["Very easy", 0.5]])>>

				<<run _options.addOption("Unit descriptions are", "unitDescriptions", $SecExp.settings)
				.addValue("Abbreviated", 1).addValue("Summarized", 0)>>
			<</if>>

			<<run _options.addOption("Battles are", "enabled", $SecExp.settings.battle)
			.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

			<<run _options.addOption("Rebellions are", "enabled", $SecExp.settings.rebellion)
			.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>

			<<if $SecExp.settings.battle.enabled > 0>>
				<<run _options.addOption("Battle frequency", "frequency", $SecExp.settings.battle)
				.addValueList([["Extremely high", 2], ["Very high", 1.5], ["High", 1.25], ["Normal", 1], ["Low", 0.75], ["Very low", 0.5]])>>
			<</if>>

			<<if $SecExp.settings.rebellion.enabled > 0>>
				<<run _options.addOption("Rebellion buildup", "speed", $SecExp.settings.rebellion)
				.addValueList([["Extremely fast", 2], ["Very fast", 1.5], ["Fast", 1.25], ["Normal", 1], ["Slow", 0.75], ["Very slow", 0.5]])>>
			<</if>>

			<<if $SecExp.settings.battle.enabled > 0>>
				<<run _options.addOption("Commanders gain a prestige rank every 10 victories", "allowSlavePrestige", $SecExp.settings.battle)
				.addValue("Yes", 1).on().addValue("No", 0).off()>>
			<</if>>

			<<if $SecExp.settings.battle.enabled > 0>>
				<<run _options.addOption("Force battles", "force", $SecExp.settings.battle)
				.addValue("Yes", 1).on().addValue("No", 0).off()>>
			<</if>>
			<<if $SecExp.settings.rebellion.enabled > 0>>
				<<run _options.addOption("Force rebellions", "force", $SecExp.settings.rebellion)
				.addValue("Yes", 1).on().addValue("No", 0).off()
				.addComment("Rebellions take precedence over Battles.")>>
			<</if>>

			<<if $SecExp.settings.battle.enabled > 0>>
				<<run _options.addOption("Late game major battles are", "enabled", $SecExp.settings.battle.major)
				.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>
			<</if>>

			<<if $SecExp.settings.battle.enabled > 0 && $SecExp.settings.battle.major.enabled > 0>>
				<<run _options.addOption("Multiplier is", "mult", $SecExp.settings.battle.major)
				.addValueList([["Extremely high", 2], ["Very high", 1.5], ["High", 1.25], ["Normal", 1], ["Low", 0.75], ["Very low", 0.5]])>>

				<<run _options.addOption("This week a major battle is", "force", $SecExp.settings.battle.major)
				.addValue("Guaranteed", 1).on().addValue("Not guaranteed", 0).off()>>
			<</if>>

			<<if $SecExp.settings.battle.enabled > 0 && $SecExp.settings.battle.major.enabled > 0>>
				<<run _options.addOption("Gameover on battle loss", "gameOver", $SecExp.settings.battle.major)
				.addValue("Yes", 1).on().addValue("No", 0).off()>>
			<</if>>

			<<if $SecExp.settings.rebellion.enabled > 0>>
				<<run _options.addOption("Gameover on rebellion loss", "gameOver", $SecExp.settings.rebellion)
				.addValue("Yes", 1).on().addValue("No", 0).off()>>
			<</if>>

			<<includeDOM _options.render()>>

			<<if $debugMode || $cheatMode || $cheatModeM>>
				''Debug/cheat''
				<<run MenialPopCap()>>

				<<link "Set loyalty high" "Options">>
					<<for _i = 0; _i < $militiaUnits.length; _i++>>
						<<set $militiaUnits[_i].loyalty = random(80,100)>>
					<</for>>

					<<for _i = 0; _i < $slaveUnits.length; _i++>>
						<<set $slaveUnits[_i].loyalty = random(80,100)>>
					<</for>>

					<<for _i = 0; _i < $mercUnits.length; _i++>>
						<<set $mercUnits[_i].loyalty = random(80,100)>>
					<</for>>
				<</link>>
				| <<link "Set loyalty average" "Options">>
					<<for _i = 0; _i < $militiaUnits.length; _i++>>
						<<set $militiaUnits[_i].loyalty = random(40,60)>>
					<</for>>

					<<for _i = 0; _i < $slaveUnits.length; _i++>>
						<<set $slaveUnits[_i].loyalty = random(40,60)>>
					<</for>>

					<<for _i = 0; _i < $mercUnits.length; _i++>>
						<<set $mercUnits[_i].loyalty = random(40,60)>>
					<</for>>
				<</link>>
				| <<link "Set loyalty low" "Options">>
					<<for _i = 0; _i < $militiaUnits.length; _i++>>
						<<set $militiaUnits[_i].loyalty = random(20)>>
					<</for>>

					<<for _i = 0; _i < $slaveUnits.length; _i++>>
						<<set $slaveUnits[_i].loyalty = random(20)>>
					<</for>>

					<<for _i = 0; _i < $mercUnits.length; _i++>>
						<<set $mercUnits[_i].loyalty = random(20)>>
					<</for>>
				<</link>>
				| <<link "Randomize loyalty" "Options">>
					<<for _i = 0; _i < $militiaUnits.length; _i++>>
						<<set $militiaUnits[_i].loyalty = random(100)>>
					<</for>>

					<<for _i = 0; _i < $slaveUnits.length; _i++>>
						<<set $slaveUnits[_i].loyalty = random(100)>>
					<</for>>

					<<for _i = 0; _i < $mercUnits.length; _i++>>
						<<set $mercUnits[_i].loyalty = random(100)>>
					<</for>>
				<</link>>

				<<link "Give Authority" "Options">>
					<<set $SecExp.core.authority = Math.clamp($SecExp.core.authority + 1000, 0, 20000)>>
				<</link>>
				| <<link "Remove Authority" "Options">>
					<<set $SecExp.core.authority = Math.clamp($SecExp.core.authority - 1000, 0, 20000)>>
				<</link>>

				<<link "Raise security" "Options">>
					<<set $SecExp.security.cap = Math.clamp($SecExp.security.cap + 5, 0, 100)>>
				<</link>>
				| <<link "Lower security" "Options">>
					<<set $SecExp.security.cap = Math.clamp($SecExp.security.cap - 5, 0, 100)>>
				<</link>>

				<<link "Raise crime" "Options">>
					<<set $SecExp.core.crimeLow = Math.clamp($SecExp.core.crimeLow + 5, 0, 100)>>
				<</link>>
				| <<link "Lower crime" "Options">>
					<<set $SecExp.core.crimeLow = Math.clamp($SecExp.core.crimeLow - 5, 0, 100)>>
				<</link>>

				<<link "Give militia manpower" "Options">>
					<<set $militiaFreeManpower += 30>>
					<<recalcManpower>>
				<</link>>
				| <<link "Remove militia manpower" "Options">>
					<<set $militiaFreeManpower = Math.max($militiaFreeManpower - 30, 0)>>
					<<recalcManpower>>
				<</link>>

				<<link "Give mercs manpower" "Options">>
					<<set $mercFreeManpower += 30>>
					<<recalcManpower>>
				<</link>>
				| <<link "Remove mercs manpower" "Options">>
					<<set $mercFreeManpower = Math.max($mercFreeManpower - 30, 0)>>
					<<recalcManpower>>
				<</link>>

			<</if>>	/* closes cheatmode check */

		<</if>> /* closes SecExp check*/

Debug

		<<set _options = new App.UI.OptionsGroup()>>

		<<run _options.addOption("DebugMode is", "debugMode")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()
		.addComment("This will add a Display Variables and Bug Report passage to the sidebar.")>>

		<<if $debugMode > 0>>
			<<run _options.addOption("The custom function part of debug mode is", "debugModeCustomFunction")
			.addValue("Enabled", 1).on().addValue("Disabled", 0).off()>>
		<</if>>

		<<set _option =  _options.addOption("Genetics array")
		.customButton("Run test", () => Engine.play("test genetics"))>>
		<<if $cheatMode == 1>>
			<<run _option.customButton("Edit Genetics", () => Engine.play("Edit Genetics"))>>
		<<else>>
			<<run _option.addComment("Enable cheat mode to edit genetics.")>>
		<</if>>

		<<run _options.addOption("Rules Assistant").addCustomElement('<<button "Reset Rules">><<include "Init Rules">><<goto "Rules Assistant">><</button>>')>>

		<<run _options.addOption("Passage Profiler is", "profiler")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()
		.addComment("Outputs performance data at the bottom of every passage.")>>

		<<includeDOM _options.render()>>

Cheating

		<<set _options = new App.UI.OptionsGroup()>>

		<<run _options.addOption("CheatMode is", "cheatMode")
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()
		.addComment("This will allow manual selection of events and unlock some options that would usually be restricted by progress.")>>

		<<if $cheatMode === 0>>
			<<includeDOM _options.render()>>
		<<else>>
			<<run _options.addOption("Sidebar Cheats are currently", "cheatModeM")
			.addValue("Shown", 1).on().addValue("Hidden", 0).off()>>

			<<run _options.addOption("Slave aging", "seeAge")
			.addValue("Enabled", 1).on().addValue("Celebrate birthdays, but don't age.", 2).neutral().addValue("Disabled", 0).off()>>

			<<includeDOM _options.render()>>

			[[Add 100000 money|Options][$cheater = 1, cashX(100000, "cheating")]] | [[Add 10000 rep|Options][$cheater = 1, repX(10000, "cheating")]] //Cheating will be flagged in your save//

			<<= SectorCounts()>>
			<<link "Raise prosperity cap" "Options">>
				<<set $AProsperityCapModified += 10>>
			<</link>>
			| <<link "Lower prosperity cap" "Options">>
				<<set $AProsperityCapModified -= 10>>
			<</link>>

			<<link "Raise prosperity" "Options">>
				<<set $arcologies[0].prosperity = Math.clamp($arcologies[0].prosperity + 10, 0, $AProsperityCap)>>
			<</link>>
			| <<link "Lower prosperity" "Options">>
				<<set $arcologies[0].prosperity = Math.clamp($arcologies[0].prosperity - 10, 0, $AProsperityCap)>>
			<</link>>

			<<link "Give menial slaves" "Options">>
				<<set $menials = Math.clamp($menials + 30, 0, $PopCap)>>
			<</link>>
			| <<link "Remove menial slaves" "Options">>
				<<set $menials = Math.clamp($menials - 30, 0, $PopCap)>>
			<</link>>

			/%

Thanks for making this a right pain twine

			<<link "Add citizens" "Options">> /*Will no longer work as intended due to population changes*/
				<<set $lowerClass = Math.max($lowerClass + 200, 0)>>
			<</link>>
			| <<link "Remove citizens" "Options">> /*also no longer properly functional*/
				<<set $lowerClass = Math.max($lowerClass - 200, 0)>>
			<</link>>

			<<link "Add slaves" "Options">> /*Will work to a limited degree, minimums and maximums for slaves are set through population*/
				<<set $NPCSlaves = Math.max($NPCSlaves + 200, 0)>>
			<</link>>
			| <<link "Remove slaves" "Options">> /*Will work to a limited degree*/
				<<set $NPCSlaves = Math.max($NPCSlaves - 200, 0)>>
			<</link>>
			%/
		<</if>>

		Experimental means just that: experimental. Options below are likely to be in an even more incomplete or broken state than usual. THEY MAY NOT WORK AT ALL. Make sure you back up your save before enabling any of these, and if you are that interested, consider helping to improve them.

		UI theme selector. Allows to select a single CSS file to be loaded. The file has to be located in the same directory as the HTML file otherwise it will simply not load at all.
		<<includeDOM App.UI.Theme.selector()>>

	<<set _options = new App.UI.OptionsGroup()>>

	<<if $seePreg !== 0>>
		<<run _options.addOption("Nursery is", "nursery", $experimental)
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()
		.addComment("This will enable the experimental nursery, which allows players to interact with growing slave children. An alternative to the incubator.")>>
	<</if>>

	<<run _options.addOption("Food is", "food", $experimental)
	.addValue("Enabled", 1).on().addValue("Disabled", 0).off()
	.addComment("This will enable the experimental food supply and demand system, as well as a new farmyard building and assignments.")>>

	<<if $seeExtreme === 1 && $seeBestiality === 1>>
		<<run _options.addOption("Animal Ovaries are", "animalOvaries", $experimental)
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()
		.addComment("This will allow slaves to be impregnated by animals.")>>
	<</if>>

	<<if $seeExtreme === 1>>
		<<run _options.addOption("Dinner party", "dinnerParty", $experimental)
		.addValue("Enabled", 1).on().addValue("Disabled", 0).off()
		.addComment("This will enable a controversial but very broken event. Warning: Snuff, cannibalism.")>>
	<</if>>

	<<includeDOM _options.render()>>


code:
:: P bioreactor perfected [nobr]

<<set $nextButton = "Continue", $nextLink = "Random Nonindividual Event", $bioreactorsAnnounced = 1>>

<<set $activeSlave = $slaves.find(function(s) { return s.assignment == "work in the dairy" && s.boobs > 48000 && (s.balls == 0 || s.balls >= 10) && s.fetish == "mindbroken"; })>>

<<if (ndef $activeSlave)>>
	<<goto "Random Nonindividual Event">>
<<else>>

<<set _bioreactorsXX = 0>>
<<set _bioreactorsXY = 0>>
<<set _bioreactorsHerm = 0>>
<<set _bioreactorsBarren = 0>>
<<if ($activeSlave.ovaries == 1)>>
	<<if ($activeSlave.balls == 0)>>
		<<set _bioreactorsXX = 1>>
	<<else>>
		<<set _bioreactorsHerm = 1>>
	<</if>>
<<else>>
	<<if ($activeSlave.balls == 0)>>
		<<set _bioreactorsBarren = 1>>
	<<else>>
		<<set _bioreactorsXY = 1>>
	<</if>>
<</if>>

<<setLocalPronouns $activeSlave>>
<<setAssistantPronouns>>

When you need peace and quiet to work through a difficult problem, you sometimes take a few minutes to pace through $dairyName. The massive, gently swaying breasts are always an encouraging sight, and the faint, rhythmic sounds of machine milking, machine feeding, and machine sodomy have a stimulating effect on one's thought processes. When you reach the end of the row of machines for the first time today, you turn to walk back again, and then notice that $assistant.name's
<<if $assistant.personality == 0>>
	symbol is visible on a screen across the last cow in the row from you, glowing gently to get your attention.
<<else>>
	<<switch $assistant.appearance>>
	<<case "monstergirl">>
		monster<<= _girlA>> avatar is visible on a screen across the last cow in the row from you, waving cheerfully for your attention with one of _hisA hands and a couple of _hisA hair-tentacles.
	<<case "shemale">>
		shemale avatar is visible on a screen across the last cow in the row from you, waving for your attention. (_HisA bouncy waving makes _hisA ever-erect cock wave too.)
	<<case "amazon">>
		amazon avatar is visible on a screen across the last cow in the row from you, jumping up and down for your attention.
	<<case "businesswoman">>
		business<<= _womanA>> avatar is visible on a screen across the last cow in the row from you, waving politely for your attention and pointing to a tablet in _hisA hand.
	<<case "fairy">>
		fairy avatar is visible on a screen across the last cow in the row from you, waving energetically and pointing to a tablet that _heA's sitting on.
	<<case "pregnant fairy">>
		pregnant fairy avatar is visible on a screen across the last cow in the row from you, waving energetically and pointing to a tablet that _heA's sitting on.
	<<case "goddess">>
		goddess avatar is visible on a screen across the last cow in the row from you, waving demurely for your attention and holding up one of _hisA dribbling breasts.
	<<case "hypergoddess">>
		goddess avatar is visible on a screen across the last cow in the row from you; _heA is aggressively milking _himselfA trying to get your attention.
	<<case "loli">>
		child avatar is visible on a screen across the last cow in the row from you, jumping up and down for your attention.
	<<case "preggololi">>
		child avatar is visible on a screen across the last cow in the row from you, waving _hisA arms over _hisA head.
	<<case "angel">>
		angel avatar is visible on a screen across the last cow in the row from you, waving _hisA arms and flapping _hisA wings.
	<<case "cherub">>
		cherub avatar is visible on a screen across the last cow in the row from you, fluttering back and forth while waving _hisA hands.
	<<case "incubus">>
		incubus avatar is visible on a screen across the last cow in the row from you, idly rubbing _hisA dick with one hand and beckoning you with the other.
	<<case "succubus">>
		succubus avatar is visible on a screen across the last cow in the row from you; _heA is happily mooning you.
	<<case "imp">>
		impish avatar is visible on a screen across the last cow in the row from you, flying back and forth while waving _hisA hands.
	<<case "witch">>
		witch avatar is visible on a screen across the last cow in the row from you, hopping up and down while waving _hisA arms over _hisA head.
	<<case "ERROR_1606_APPEARANCE_FILE_CORRUPT">>
		avatar is visible on a screen across the last cow in the row from you; _heA has produced countless flashing tubercles across _hisA body.
	<<case "schoolgirl">>
		school<<= _girlA>> avatar is visible on a screen across the last cow in the row from you, waving cutely for your attention and pointing to a tablet in _hisA hand.
	<<default>>
		symbol is visible on a screen across the last cow in the row from you, spinning and glowing gently to get your attention.
	<</switch>>
<</if>>

<<if $assistant.personality == 0>>
	<<if $PC.title == 1>>"Sir,"<<else>>"Madam,"<</if>> _heA says, "I have a matter for your attention, concerning this slave."
<<else>>
	<<if $PC.title == 1>>"Sir,"<<else>>"Ma'am,"<</if>> _heA says, "I'd like to ask you something about this slave."
<</if>>
You stop and consider the cow, from $his titanic breasts to $his <<if ($activeSlave.balls >= 10) && ($activeSlave.scrotum > 0)>>swollen balls<<elseif $activeSlave.vagina > -1>>slavering cunt<<else>>distended stomach<</if>> to $his dildo-filled anus.
<<if $assistant.personality == 0>>
	"This slave is permanently dependent on $his milking machine," it continues. "$He cannot be removed without uneconomical expenditures, and is unlikely to be useful elsewhere.
	Additionally, there is nothing more that can be done to make $his breasts any bigger<<if $activeSlave.balls >= 10>> or $his testicles any more productive<<elseif $activeSlave.ovaries == 1>> or $his womb any more productive<</if>>. $His development is essentially final, and that status can be made official. $He could be redesignated as equipment. Other than $his designation, this would make little difference: the machine would be slightly less cautious with $his drugs, future intubations, and such. $He would be removed from the slave lists."
<<else>>
	"$He's never leaving here, not without surgery. And even then, $he's forgotten almost everything, and $he won't be getting it back."
	<<switch $assistant.appearance>>
	<<case "monstergirl">>
		The monster<<= _girlA>> positions _himselfA on the screen to create an optical illusion that makes it look like _heA's gently petting the slave's shoulders. _HeA looks meditative.
	<<case "shemale">>
		The shemale positions _himselfA on the screen to create an optical illusion that makes it look like _heA's gently petting the slave's shoulders. _HeA looks uncharacteristically meditative.
	<<case "amazon">>
		The amazon positions _himselfA on the screen to create an optical illusion that makes it look like _heA's gently petting the slave's shoulders. _HeA looks meditative.
	<<case "businesswoman">>
		The business<<= _womanA>> positions _himselfA on the screen to create an optical illusion that makes it look like _heA's gently petting the slave's shoulders. _HeA looks meditative.
	<<case "fairy">>
		The fairy positions _himselfA on the screen to create an optical illusion that makes it look like _heA's standing on $his shoulder and hugging $his cheek.
	<<case "pregnant fairy">>
		The pregnant fairy positions _himselfA on the screen to create an optical illusion that makes it look like _heA's standing on $his shoulder and hugging $his cheek.
	<<case "goddess">>
		The goddess positions _himselfA on the screen to create an optical illusion that makes it look like _heA's gently caressing the slave's shoulders. _HeA looks meditative.
	<<case "hypergoddess">>
		The goddess positions _himselfA on the screen to create an optical illusion that makes it look like _heA's gently caressing the slave's shoulders. _HeA looks meditative.
	<<case "loli">>
		The little _girlA positions _himselfA on the screen to create an optical illusion that makes it look like _heA's gently petting the slave's shoulders. _HeA looks meditative.
	<<case "preggololi">>
		The little _girlA positions _himselfA on the screen to create an optical illusion that makes it look like _heA's gently petting the slave's shoulders. _HeA looks meditative.
	<<case "angel">>
		The angel positions _himselfA on the screen to create an optical illusion that makes it look like _heA's gently caressing the slave. _HeA looks meditative.
	<<case "cherub">>
		The cherub positions _himselfA on the screen to create an optical illusion that makes it look like _heA's gently petting the slave's shoulders while hovering over them. _HeA looks meditative.
	<<case "incubus">>
		The incubus positions _himselfA on the screen to create an optical illusion that makes it look like _heA's gently groping the slave's rear. _HeA looks uncharacteristically meditative.
	<<case "succubus">>
		The succubus positions _himselfA on the screen to create an optical illusion that makes it look like _heA's resting _hisA breasts on the slave's head. _HeA looks uncharacteristically meditative.
	<<case "imp">>
		The imp positions _himselfA on the screen to create an optical illusion that makes it look like _heA's gently rubbing the slave's shoulders while hovering over them. _HeA looks uncharacteristically meditative.
	<<case "witch">>
		The witch positions _himselfA on the screen to create an optical illusion that makes it look like _heA's gently caressing the slave's shoulders. _HeA looks meditative.
	<<case "ERROR_1606_APPEARANCE_FILE_CORRUPT">>
		It positions _himselfA on the screen to create an optical illusion that makes it look like _heA's gently caressing the slave's breasts and groin with fleshy tentacles. _HeA looks uncharacteristically meditative.
	<<case "schoolgirl">>
		The school<<= _girlA>> positions _himselfA on the screen to create an optical illusion that makes it look like _heA's gently petting the slave's shoulders. _HeA looks uncharacteristically meditative.
	<<default>>
		The symbol on the screen dissolves down to create a gentle backlight behind the slave.
	<</switch>>
	"$He's beautiful, isn't $he? Perfect. There's nothing more that can be done, to make $his udders any bigger<<if $activeSlave.balls >= 10>> or $his balls any more productive<<elseif $activeSlave.ovaries == 1>> or $his womb any more productive<</if>>. $He's complete, and $he's part of this machine now, and that's all $he'll ever be. I can make that status official, <<if $PC.title == 1>>Sir<<else>>Ma'am<</if>>. I'd redesignate $him as equipment. It wouldn't change much, other than a designation. I'd just be a little less cautious with $his drugs, future intubations, things like that. But for slave purposes, $he'd be gone. Just a part of $dairyName, forever. Or, until $he wears out in <<if $retirementAge-$activeSlave.physicalAge <= 3>>a few years<<elseif $retirementAge-$activeSlave.physicalAge <= 10>>a decade or so<<elseif $retirementAge-$activeSlave.physicalAge >= 20>>a couple of decades<</if>>."
<</if>>

<<link "Do it, and do it to all maximized dairy slaves">>
	<<replace "#result">>
		Your assistant pauses, and then says, "Redesignation complete, <<= properTitle()>>. This milking machine has been equipped with biological components. This combination is projected to produce approximately <<if $activeSlave.balls > 0>><<print 1000*Math.trunc((3*52*($retirementAge-$activeSlave.physicalAge))/1000)>> liters of cum,<</if>>
		<<if $activeSlave.ovaries == 1>><<print 100*Math.trunc((52*($retirementAge-$activeSlave.physicalAge))/100)>> liters of vaginal secretions, <<print 5*($retirementAge-$activeSlave.physicalAge)>> slaves,<</if>>
		and <<print 1000*Math.trunc((300*52*($retirementAge-$activeSlave.physicalAge))/1000)>> liters of milk over a <<print $retirementAge-$activeSlave.physicalAge>> year period before its biological components must be replaced."
		<<if $assistant.personality > 0>>
			<<switch $assistant.appearance>>
			<<case "monstergirl">>
				_HisA avatar watches the new equipment with almost motherly affection, _hisA tentacle hair writhing obscurely.
			<<case "shemale">>
				_HisA avatar sits down and produces a glass of milk. _HeA drains it in one long chug, and then begins to jerk off.
			<<case "amazon">>
				_HisA avatar sits down with a clatter of bone ornaments, produces a skin of milk, and takes a long pull.
			<<case "businesswoman">>
				_HisA avatar stands on the screen, watching the new equipment with an air of satisfaction.
			<<case "fairy">>
				_HisA avatar hovers around, humming a tune while checking the new equipment.
			<<case "pregnant fairy">>
				_HisA avatar hovers around, humming a soft tune while checking the new equipment.
			<<case "goddess">>
				_HisA avatar sits down, kneading _hisA milky tits in empathy, a hint of simulated jealousy in the way _heA watches the new equipment.
			<<case "hypergoddess">>
				_HisA avatar sits down, kneading _hisA milky tits in empathy, a hint of simulated jealousy in the way _heA watches the new equipment.
			<<case "loli">>
				_HisA avatar sits down, rubbing _hisA flat chest sadly as _heA watches the new equipment.
			<<case "preggololi">>
				_HisA avatar sits down, pinching _hisA milky nipples in empathy, a hint of simulated jealousy in the way _heA watches the new equipment.
			<<case "angel">>
				_HisA avatar blushes as _heA watches the new equipment. "$He'll feed so many hungry mouths..."
			<<case "cherub">>
				_HisA avatar blushes at the sight of the new equipment. _HeA quickly buries _hisA face in _hisA palms at the perversion.
			<<case "incubus">>
				_HisA avatar starts jerking off to the sight of the new bioreactor. _HeA throws you a smirk, "But you like MY milk best, don't you?"
			<<case "succubus">>
				_HisA avatar rubs _hisA breasts, steadily swelling them until a gush of milk escapes _hisA nipples. "Mine will always be your favorite."
			<<case "imp">>
				_HisA avatar licks _hisA lips at the new equipment, longing to taste it.
			<<case "witch">>
				_HisA avatar sits down and brings _hisA hands to _hisA breasts wondering if _heA could make them big and milky for you too.
			<<case "ERROR_1606_APPEARANCE_FILE_CORRUPT">>
				_HisA avatar's breasts steadily begin swelling, _hisA belly following not long after. Once it is similar in size to the new equipment, a pair of tentacles extend from _hisA back and clamp onto _hisA nipples, eagerly suckling milk from _hisA unnatural udders.
			<<case "schoolgirl">>
				_HisA avatar sits down, watching the new equipment with an air of embarrassment. The school<<= _girlA>> blushes, and begins to masturbate.
			<<default>>
				_HisA avatar symbol returns to gentle spinning, doing so in synchrony with the undulations of the new equipment's breasts.
			<</switch>>
		<</if>>
		"Future redesignations can always be disabled from $dairyName interface."
		<<set $bioreactorsXX += _bioreactorsXX>>
		<<set $bioreactorsXY += _bioreactorsXY>>
		<<set $bioreactorsHerm += _bioreactorsHerm>>
		<<set $bioreactorsBarren += _bioreactorsBarren>>
		<<= removeActiveSlave() >>
		<<set $createBioreactors = 1>>
	<</replace>>
<</link>>

<<link "No, leave $him as $he is">>
	<<replace "#result">>
		"Yes, <<if $PC.title == 1>>sir<<else>>ma'am<</if>>," your assistant confirms. "This option will remain accessible from $dairyName's control interface, if you reconsider."
	<</replace>>
<</link>>

$His records...

		/* Copied and modified from dairyReport, should be kept in sync manually to be*/

		/*Income section */
		<<set _cashX = 0>>

		/* Cum */
		<<set _seed = (100*_bioreactorsXY) + (100*_bioreactorsHerm)>>
		<<if ($arcologies[0].FSPastoralistLaw == 1)>>
			<<set _cashX += _seed*random(40,50)>>
		<<elseif ($arcologies[0].FSPastoralist != "unset")>>
			<<set _cashX += _seed*(random(25,35)+Math.trunc($arcologies[0].FSPastoralist/10))>>
		<<else>>
			<<set _cashX += _seed*random(25,35)>>
		<</if>>

		/* FemCum */
		<<set _seed = (2*_bioreactorsXX) + (2*_bioreactorsHerm)>>
		<<if ($arcologies[0].FSPastoralistLaw == 1)>>
			<<set _cashX += _seed*random(40,50)>>
		<<elseif ($arcologies[0].FSPastoralist != "unset")>>
			<<set _cashX += _seed*(random(25,35)+Math.trunc($arcologies[0].FSPastoralist/10))>>
		<<else>>
			<<set _cashX += _seed*random(25,35)>>
		<</if>>

		/* Milk */
		<<set _seed = (800*_bioreactorsXX) + (700*_bioreactorsBarren) + (600*_bioreactorsXY) + (600*_bioreactorsHerm)>>
		<<if ($arcologies[0].FSPastoralistLaw == 1)>>
			<<set _cashX += _seed*(13+Math.trunc($arcologies[0].FSPastoralist/30))>>
		<<elseif ($arcologies[0].FSPastoralist != "unset")>>
			<<set _cashX += _seed*(8+Math.trunc($arcologies[0].FSPastoralist/30))>>
		<<else>>
			<<set _cashX += _seed*9>>
		<</if>>

		As a bioreactor, she might gross <<print cashFormatColor(_cashX)>> and cost just <<print cashFormatColor(-100)>>, bringing in <<print cashFormatColor(_cashX - 100)>>

		$His current task is to <<print $activeSlave.assignment>><<if $assignmentRecords[$slaves[$i].ID]>>, and before that to <<print $assignmentRecords[$slaves[$i].ID]>><</if>>.

	<<SlaveExpenses $activeSlave>>

<</if>> /* closes validity check */