code:
:: Slave Stats [nobr]

/* TODO: format this so it isn't so long */

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

slaveName: $activeSlave.slaveName	   /* TODO: figure out why this is being indented ingame */

slaveSurname: $activeSlave.slaveSurname

birthName: $activeSlave.birthName

birthSurname: $activeSlave.birthSurname

genes: $activeSlave.genes

pronoun: $activeSlave.pronoun

possessive: $activeSlave.possessive

possessivePronoun: $activeSlave.possessivePronoun

objectReflexive: $activeSlave.objectReflexive

object: $activeSlave.object

noun: $activeSlave.noun

weekAcquired: $activeSlave.weekAcquired

origin: $activeSlave.origin

career: $activeSlave.career

ID: $activeSlave.ID

prestige: $activeSlave.prestige

pornFeed: $activeSlave.pornFeed

pornFame: $activeSlave.pornFame

pornFameSpending: $activeSlave.pornFameSpending

pornPrestige: $activeSlave.pornPrestige

pornPrestigeDesc: $activeSlave.pornPrestigeDesc

pornFameType: $activeSlave.pornFameType

pornFocus: $activeSlave.pornFocus

pornTypeGeneral: $activeSlave.pornTypeGeneral

pornTypeFuckdoll: $activeSlave.pornTypeFuckdoll

pornTypeRape: $activeSlave.pornTypeRape

pornTypePreggo: $activeSlave.pornTypePreggo

pornTypeBBW: $activeSlave.pornTypeBBW

pornTypeGainer: $activeSlave.pornTypeGainer

pornTypeStud: $activeSlave.pornTypeStud

pornTypeLoli: $activeSlave.pornTypeLoli

pornTypeDeepThroat: $activeSlave.pornTypeDeepThroat

pornTypeStruggleFuck: $activeSlave.pornTypeStruggleFuck

pornTypePainal: $activeSlave.pornTypePainal

pornTypeTease: $activeSlave.pornTypeTease

pornTypeRomantic: $activeSlave.pornTypeRomantic

pornTypePervert: $activeSlave.pornTypePervert

pornTypeCaring: $activeSlave.pornTypeCaring

pornTypeUnflinching: $activeSlave.pornTypeUnflinching

pornTypeSizeQueen: $activeSlave.pornTypeSizeQueen

pornTypeNeglectful: $activeSlave.pornTypeNeglectful

pornTypeCumAddict: $activeSlave.pornTypeCumAddict

pornTypeAnalAddict: $activeSlave.pornTypeAnalAddict

pornTypeAttentionWhore: $activeSlave.pornTypeAttentionWhore

pornTypeBreastGrowth: $activeSlave.pornTypeBreastGrowth

pornTypeAbusive: $activeSlave.pornTypeAbusive

pornTypeMalicious: $activeSlave.pornTypeMalicious

pornTypeSelfHating: $activeSlave.pornTypeSelfHating

pornTypeBreeder: $activeSlave.pornTypeBreeder

pornTypeSub: $activeSlave.pornTypeSub

pornTypeCumSlut: $activeSlave.pornTypeCumSlut

pornTypeAnal: $activeSlave.pornTypeAnal

pornTypeHumiliation: $activeSlave.pornTypeHumiliation

pornTypeBoobs: $activeSlave.pornTypeBoobs

pornTypeDom: $activeSlave.pornTypeDom

pornTypeSadist: $activeSlave.pornTypeSadist

pornTypeMasochist: $activeSlave.pornTypeMasochist

pornTypePregnancy: $activeSlave.pornTypePregnancy

prestigeDesc: $activeSlave.prestigeDesc

recruiter: $activeSlave.recruiter

relation: $activeSlave.relation

relationTarget: $activeSlave.relationTarget

relationship: $activeSlave.relationship

relationshipTarget: $activeSlave.relationshipTarget

rivalry: $activeSlave.rivalry

rivalryTarget: $activeSlave.rivalryTarget

subTarget: $activeSlave.subTarget

father: $activeSlave.father

mother: $activeSlave.mother

daughters: $activeSlave.daughters

sisters: $activeSlave.sisters

canRecruit: $activeSlave.canRecruit

choosesOwnAssignment: $activeSlave.choosesOwnAssignment

assignment: $activeSlave.assignment

assignmentVisible: $activeSlave.assignmentVisible

sentence: $activeSlave.sentence

training: $activeSlave.training

toyHole: $activeSlave.toyHole

indenture: $activeSlave.indenture

indentureRestrictions: $activeSlave.indentureRestrictions

birthWeek: $activeSlave.birthWeek

actualAge: $activeSlave.actualAge

visualAge: $activeSlave.visualAge

physicalAge: $activeSlave.physicalAge

ovaryAge: $activeSlave.ovaryAge

ageImplant: $activeSlave.ageImplant

health: $activeSlave.health

minorInjury: $activeSlave.minorInjury

trust: $activeSlave.trust

oldTrust: $activeSlave.oldTrust

devotion: $activeSlave.devotion

oldDevotion: $activeSlave.oldDevotion

weight: $activeSlave.weight

muscles: $activeSlave.muscles

height: $activeSlave.height

heightImplant: $activeSlave.heightImplant

nationality: $activeSlave.nationality

race: $activeSlave.race

origRace: $activeSlave.origRace

markings: $activeSlave.markings

eyes: $activeSlave.eyes

eyeColor: $activeSlave.eyeColor

origEye: $activeSlave.origEye

pupil: $activeSlave.pupil

sclerae: $activeSlave.sclerae

eyewear: $activeSlave.eyewear

hears: $activeSlave.hears

earwear: $activeSlave.earwear

earImplant: $activeSlave.earImplant

origHColor: $activeSlave.origHColor

hColor: $activeSlave.hColor

pubicHColor: $activeSlave.pubicHColor

underArmHColor: $activeSlave.underArmHColor

eyebrowHColor: $activeSlave.eyebrowHColor

origSkin: $activeSlave.origSkin

skin: $activeSlave.skin

hLength: $activeSlave.hLength

eyebrowFullness: $activeSlave.eyebrowFullness

hStyle: $activeSlave.hStyle

pubicHStyle: $activeSlave.pubicHStyle

underArmHStyle: $activeSlave.underArmHStyle

eyebrowHStyle: $activeSlave.eyebrowHStyle

waist: $activeSlave.waist

corsetPiercing: $activeSlave.corsetPiercing

PLimb: $activeSlave.PLimb

amp: $activeSlave.amp

heels: $activeSlave.heels

voice: $activeSlave.voice

voiceImplant: $activeSlave.voiceImplant

accent: $activeSlave.accent

shoulders: $activeSlave.shoulders

shouldersImplant: $activeSlave.shouldersImplant

boobs: $activeSlave.boobs

boobsMilk: $activeSlave.boobsMilk

boobsImplant: $activeSlave.boobsImplant

boobsImplantType: $activeSlave.boobsImplantType

boobShape: $activeSlave.boobShape

nipples: $activeSlave.nipples

nipplesPiercing: $activeSlave.nipplesPiercing

nipplesAccessory: $activeSlave.nipplesAccessory

areolae: $activeSlave.areolae

areolaePiercing: $activeSlave.areolaePiercing

areolaeShape: $activeSlave.areolaeShape

boobsTat: $activeSlave.boobsTat

lactation: $activeSlave.lactation

lactationDuration: $activeSlave.lactationDuration

induceLactation: $activeSlave.induceLactation

lactationAdaptation: $activeSlave.lactationAdaptation

milk: $activeSlave.milk

cum: $activeSlave.cum

hips: $activeSlave.hips

hipsImplant: $activeSlave.hipsImplant

butt: $activeSlave.butt

buttImplant: $activeSlave.buttImplant

buttImplantType: $activeSlave.buttImplantType

buttTat: $activeSlave.buttTat

face: $activeSlave.face

faceImplant: $activeSlave.faceImplant

faceShape: $activeSlave.faceShape

lips: $activeSlave.lips

lipsImplant: $activeSlave.lipsImplant

lipsPiercing: $activeSlave.lipsPiercing

lipsTat: $activeSlave.lipsTat

teeth: $activeSlave.teeth

tonguePiercing: $activeSlave.tonguePiercing

vagina: $activeSlave.vagina

vaginaLube: $activeSlave.vaginaLube

vaginaPiercing: $activeSlave.vaginaPiercing

vaginaTat: $activeSlave.vaginaTat

preg: $activeSlave.preg

pregSource: $activeSlave.pregSource

pregType: $activeSlave.pregType

pregAdaptation: $activeSlave.pregAdaptation

ovaImplant: $activeSlave.ovaImplant

wombImplant: $activeSlave.wombImplant

broodmother: $activeSlave.broodmother

broodmotherFetuses: $activeSlave.broodmotherFetuses

broodmotherOnHold: $activeSlave.broodmotherOnHold

broodmotherCountDown: $activeSlave.broodmotherCountDown

labor: $activeSlave.labor

births: $activeSlave.births

laborCount: $activeSlave.laborCount

cSec: $activeSlave.cSec

bellyAccessory: $activeSlave.bellyAccessory

labia: $activeSlave.labia

clit: $activeSlave.clit

clitPiercing: $activeSlave.clitPiercing

clitSetting: $activeSlave.clitSetting

foreskin: $activeSlave.foreskin

anus: $activeSlave.anus

dick: $activeSlave.dick

analArea: $activeSlave.analArea

dickPiercing: $activeSlave.dickPiercing

dickTat: $activeSlave.dickTat

prostate: $activeSlave.prostate

balls: $activeSlave.balls

scrotum: $activeSlave.scrotum

ovaries: $activeSlave.ovaries

anusPiercing: $activeSlave.anusPiercing

anusTat: $activeSlave.anusTat

makeup: $activeSlave.makeup

nails: $activeSlave.nails

brand: $activeSlave.brand

brandLocation: $activeSlave.brandLocation

earPiercing: $activeSlave.earPiercing

nosePiercing: $activeSlave.nosePiercing

eyebrowPiercing: $activeSlave.eyebrowPiercing

navelPiercing: $activeSlave.navelPiercing

shouldersTat: $activeSlave.shouldersTat

armsTat: $activeSlave.armsTat

legsTat: $activeSlave.legsTat

backTat: $activeSlave.backTat

stampTat: $activeSlave.stampTat

vaginalSkill: $activeSlave.vaginalSkill

oralSkill: $activeSlave.oralSkill

analSkill: $activeSlave.analSkill

whoreSkill: $activeSlave.whoreSkill

entertainSkill: $activeSlave.entertainSkill

combatSkill: $activeSlave.combatSkill

livingRules: $activeSlave.livingRules

speechRules: $activeSlave.speechRules

releaseRules: $activeSlave.releaseRules

relationshipRules: $activeSlave.relationshipRules

lactationRules: $activeSlave.lactationRules

standardPunishment: $activeSlave.standardPunishment

standardReward: $activeSlave.standardReward

useRulesAssistant: $activeSlave.useRulesAssistant

diet: $activeSlave.diet

dietCum: $activeSlave.dietCum

dietMilk: $activeSlave.dietMilk

tired: $activeSlave.tired

hormones: $activeSlave.hormones

drugs: $activeSlave.drugs

curatives: $activeSlave.curatives

chem: $activeSlave.chem

aphrodisiacs: $activeSlave.aphrodisiacs

addict: $activeSlave.addict

fuckdoll: $activeSlave.fuckdoll

choosesOwnClothes: $activeSlave.choosesOwnClothes

clothes: $activeSlave.clothes

collar: $activeSlave.collar

shoes: $activeSlave.shoes

vaginalAccessory: $activeSlave.vaginalAccessory

dickAccessory: $activeSlave.dickAccessory

legAccessory: $activeSlave.legAccessory

buttplug: $activeSlave.buttplug

buttplugAttachment: $activeSlave.buttplugAttachment

intelligence: $activeSlave.intelligence

intelligenceImplant: $activeSlave.intelligenceImplant

energy: $activeSlave.energy

need: $activeSlave.need

attrXX: $activeSlave.attrXX

attrXY: $activeSlave.attrXY

attrKnown: $activeSlave.attrKnown

fetish: $activeSlave.fetish

fetishStrength: $activeSlave.fetishStrength

fetishKnown: $activeSlave.fetishKnown

behavioralFlaw: $activeSlave.behavioralFlaw

behavioralQuirk: $activeSlave.behavioralQuirk

sexualFlaw: $activeSlave.sexualFlaw

sexualQuirk: $activeSlave.sexualQuirk

''Genetic Quirks''

geneticQuirks: $activeSlave.geneticQuirks.gigantomastia

geneticQuirks: $activeSlave.geneticQuirks.fertility

geneticQuirks: $activeSlave.geneticQuirks.hyperFertility

geneticQuirks: $activeSlave.geneticQuirks.superfetation

geneticQuirks: $activeSlave.geneticQuirks.gigantism

geneticQuirks: $activeSlave.geneticQuirks.dwarfism

geneticQuirks: $activeSlave.geneticQuirks.pFace

geneticQuirks: $activeSlave.geneticQuirks.uFace

geneticQuirks: $activeSlave.geneticQuirks.albinism

geneticQuirks: $activeSlave.geneticQuirks.rearLipedema

geneticQuirks: $activeSlave.geneticQuirks.wellHung

geneticQuirks: $activeSlave.geneticQuirks.wGain

geneticQuirks: $activeSlave.geneticQuirks.wLoss

geneticQuirks: $activeSlave.geneticQuirks.androgyny

oralCount: $activeSlave.oralCount

vaginalCount: $activeSlave.vaginalCount

analCount: $activeSlave.analCount

mammaryCount: $activeSlave.mammaryCount

penetrativeCount: $activeSlave.penetrativeCount

publicCount: $activeSlave.publicCount

pitKills: $activeSlave.pitKills

customTat: $activeSlave.customTat

customLabel: $activeSlave.customLabel

customDesc: $activeSlave.customDesc

customTitle: $activeSlave.customTitle

customTitleLisp: $activeSlave.customTitleLisp

rudeTitle: $activeSlave.rudeTitle

customImage: $activeSlave.customImage

currentRules: $activeSlave.currentRules

bellyTat: $activeSlave.bellyTat

induce: $activeSlave.induce

mpreg: $activeSlave.mpreg

inflation: $activeSlave.inflation

inflationType: $activeSlave.inflationType

inflationMethod: $activeSlave.inflationMethod

milkSource: $activeSlave.milkSource

cumSource: $activeSlave.cumSource

burst: $activeSlave.burst

pregKnown: $activeSlave.pregKnown

pregWeek: $activeSlave.pregWeek

belly: $activeSlave.belly

bellyPreg: $activeSlave.bellyPreg

bellyFluid: $activeSlave.bellyFluid

bellyImplant: $activeSlave.bellyImplant

bellySag: $activeSlave.bellySag

bellySagPreg: $activeSlave.bellySagPreg

bellyPain: $activeSlave.bellyPain

cervixImplant: $activeSlave.cervixImplant

birthsTotal: $activeSlave.birthsTotal

pubertyAgeXX: $activeSlave.pubertyAgeXX

pubertyAgeXY: $activeSlave.pubertyAgeXY

scars: $activeSlave.scars

breedingMark: $activeSlave.breedingMark

bodySwap: $activeSlave.bodySwap

HGExclude: $activeSlave.HGExclude

ballType: $activeSlave.ballType

eggType: $activeSlave.eggType

choosesOwnChastity: $activeSlave.choosesOwnChastity

pregControl: $activeSlave.pregControl

readyLimbs: $activeSlave.readyLimbs

ageAdjust: $activeSlave.ageAdjust

bald: $activeSlave.bald

origBodyOwner: $activeSlave.origBodyOwner

origBodyOwnerID: $activeSlave.origBodyOwnerID

death: $activeSlave.death

hormoneBalance: $activeSlave.hormoneBalance

onDiet: $activeSlave.onDiet

breastMesh: $activeSlave.breastMesh

slavesFathered: $activeSlave.slavesFathered

PCChildrenFathered: $activeSlave.PCChildrenFathered

slavesKnockedUp: $activeSlave.slavesKnockedUp

PCKnockedUp: $activeSlave.PCKnockedUp

prematureBirth: $activeSlave.prematureBirth

premature: $activeSlave.premature

vasectomy: $activeSlave.vasectomy

haircuts: $activeSlave.haircuts

newGamePlus: $activeSlave.newGamePlus

skillHG: $activeSlave.skillHG

skillRC: $activeSlave.skillRC

skillBG: $activeSlave.skillBG

skillMD: $activeSlave.skillMD

skillDJ: $activeSlave.skillDJ

skillNU: $activeSlave.skillNU

skillTE: $activeSlave.skillTE

skillAT: $activeSlave.skillAT

skillMT: $activeSlave.skillMT

skillST: $activeSlave.skillST

skillMM: $activeSlave.skillMM

skillFA: $activeSlave.skillFA

skillWA: $activeSlave.skillWA

skillS: $activeSlave.skillS

skillE: $activeSlave.skillE

skillW: $activeSlave.skillW

tankBaby: $activeSlave.tankBaby

clone: $activeSlave.clone

''Gene Mods''

geneMods: $activeSlave.geneMods.NCS

geneMods: $activeSlave.geneMods.rapidCellGrowth

NCSyouthening: $activeSlave.NCSyouthening

override_Race: $activeSlave.override_Race

override_Skin: $activeSlave.override_Skin

override_Eye_Color: $activeSlave.override_Eye_Color

override_H_Color: $activeSlave.override_H_Color

override_Pubic_H_Color: $activeSlave.override_Pubic_H_Color

override_Arm_H_Color: $activeSlave.override_Arm_H_Color

override_Brow_H_Color: $activeSlave.override_Brow_H_Color

missingEyes: $activeSlave.missingEyes

missingArms: $activeSlave.missingArms

missingLegs: $activeSlave.missingLegs

slaveCost: $activeSlave.slaveCost

lifetimeCashExpenses: $activeSlave.lifetimeCashExpenses

lifetimeCashIncome: $activeSlave.lifetimeCashIncome

lastWeeksCashIncome: $activeSlave.lastWeeksCashIncome

lifetimeRepExpenses: $activeSlave.lifetimeRepExpenses

lifetimeRepIncome: $activeSlave.lifetimeRepIncome

lastWeeksRepIncome: $activeSlave.lastWeeksRepIncome

Deadliness <<print Deadliness($activeSlave)>>


code:
:: Slave Summary [nobr]

<<set setup.passagePreFilters = setup.passagePreFilters || {
	"Main":					  s => (s.assignmentVisible == 1),
	"Personal Attention Select": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0),
	"Agent Select":			  s => (s.fuckdoll == 0 && s.devotion > 20 && s.intelligence+s.intelligenceImplant > 15 && s.intelligenceImplant >= 15 && canWalk(s) && canSee(s) && canHear(s) && canTalk(s) && s.broodmother < 2 && (s.breedingMark != 1 || $propOutcome == 0)),
	"BG Select":				 s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.assignment != "guard you" && canWalk(s) && canSee(s) && canHear(s) && (s.breedingMark != 1 || $propOutcome == 0)),
	"Recruiter Select":		  s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.assignment != "recruit girls" && canWalk(s) && canSee(s) && canTalk(s)),
	"HG Select":				 s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.assignment != "be your Head Girl" && canWalk(s) && canHear(s) && canSee(s) && canTalk(s)),
	"Head Girl Suite":		   s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && (
		($Flag == 0 && s.assignment != "be your Head Girl" && s.indentureRestrictions <= 0 && (s.breedingMark != 1 || $propOutcome == 0))
		|| ($Flag != 0 && s.assignment == "live with your Head Girl"))),
	"Subordinate Targeting":	 s => (s.devotion >= -20 && s.fuckdoll == 0 && $activeSlave.ID != s.ID && ($activeSlave.amp != 1 || s.amp != 1)),
	"Spa":					   s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && (
		($Flag == 0 && s.assignment != "rest in the spa")
		|| ($Flag == 1 && s.assignment == "rest in the spa")
		|| ($Flag != 0 && $Flag != 1 && s.ID == $Attendant.ID))),
	"Attendant Select":		  s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canWalk(s) && canHear(s)),
	"Nursery":				   s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && (s.devotion > 20 || s.trust > 20) && (
		($Flag == 0 && s.assignment != "work as a nanny")
		|| ($Flag == 1 && s.assignment == "work as a nanny")
		|| ($Flag != 0 && $Flag != 1 && s.ID == $Matron.ID))),
	"Matron Select":			 s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canWalk(s) && canHear(s)),
	"Brothel":				   s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && (
		($Flag == 0 && s.assignment != "work in the brothel")
		|| ($Flag == 1 && s.assignment == "work in the brothel")
		|| ($Flag != 0 && $Flag != 1 && s.ID == $Madam.ID))),
	"Madam Select":			  s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.intelligence+s.intelligenceImplant >= -50 && canWalk(s) && canSee(s) && canHear(s) && (s.breedingMark != 1 || $propOutcome == 0)),
	"Club":					  s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && (
		($Flag == 0 && s.assignment != "serve in the club")
		|| ($Flag == 1 && s.assignment == "serve in the club")
		|| ($Flag != 0 && $Flag != 1 && s.ID == $DJ.ID))),
	"DJ Select":				 s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.intelligence+s.intelligenceImplant >= -50 && canTalk(s) && canHear(s) && canWalk(s) && (s.breedingMark != 1 || $propOutcome == 0)),
	"Clinic":					s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && (
		($Flag == 0 && s.assignment != "get treatment in the clinic")
		|| ($Flag == 1 && s.assignment == "get treatment in the clinic")
		|| ($Flag != 0 && $Flag != 1 && s.ID == $Nurse.ID))),
	"Nurse Select":			  s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canWalk(s) && canSee(s)),
	"Schoolroom":				s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && (
		($Flag == 0 && s.fetish != "mindbroken" && s.assignment != "learn in the schoolroom")
		|| ($Flag == 1 && s.assignment == "learn in the schoolroom")
		|| ($Flag != 0 && $Flag != 1 && s.ID == $Schoolteacher.ID))),
	"Schoolteacher Select":	  s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canTalk(s) && canHear(s) && canSee(s)),
	"Dairy":					 s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && (
		($Flag == 0 && s.assignment != "work in the dairy")
		|| ($Flag == 1 && s.assignment == "work in the dairy")
		|| ($Flag != 0 && $Flag != 1 && s.ID == $Milkmaid.ID))),
	"Milkmaid Select":		   s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 20 && canWalk(s) && canSee(s) && canHear(s)),
	"Farmyard":				  s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && canWalk(s) && (
		($Flag == 0 && s.assignment != "work as a farmhand")
		|| ($Flag == 1 && s.assignment == "work as a farmhand")
		|| ($Flag != 0 && $Flag != 1 && s.ID == $Farmer.ID))),
	"Farmer Select":			 s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canWalk(s) && canSee(s) && canHear(s)),
	"Servants' Quarters":		s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && (
		($Flag == 0 && s.assignment != "work as a servant")
		|| ($Flag == 1 && s.assignment == "work as a servant")
		|| ($Flag != 0 && $Flag != 1 && s.ID == $Stewardess.ID))),
	"Stewardess Select":		 s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.intelligence+s.intelligenceImplant >= -50 && canWalk(s) && canSee(s) && canHear(s)),
	"Master Suite":			  s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && (
		($Flag == 0 && s.assignment != "serve in the master suite")
		|| ($Flag == 1 && s.assignment == "serve in the master suite")
		|| ($Flag != 0 && $Flag != 1 && s.ID == $Concubine.ID))),
	"Concubine Select":		  s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.amp != 1),
	"Cellblock":				 s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && s.fetish != "mindbroken" && (
		($Flag == 0 && s.assignment != "be confined in the cellblock")
		|| ($Flag == 1 && s.assignment == "be confined in the cellblock")
		|| ($Flag != 0 && $Flag != 1 && s.ID == $Wardeness.ID))),
	"Wardeness Select":		  s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canWalk(s) && canSee(s) && canHear(s)),
	"Arcade":					s => (s.assignmentVisible == 1 && ($arcade >= $arcadeSlaves || $arcadeUpgradeFuckdolls == 1) && (
		($Flag == 0 && s.assignment != "be confined in the arcade")
		|| ($Flag != 0 && s.assignment == "be confined in the arcade"))),
	"Pit":					   s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && (
		($Flag == 0 && !$fighterIDs.includes(s.ID) && canWalk(s) && (s.assignment != "guard you") && (s.assignment != "work in the dairy" || $dairyRestraintsSetting < 2))
		|| ($Flag != 0 && $fighterIDs.includes(s.ID)))),
	"Coursing Association":	  s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && (
		($Flag == 0 && canWalk(s) && $Lurcher.ID != s.ID)
		|| ($Flag != 0 && $Lurcher.ID == s.ID))),
	"New Game Plus":			 s => (($Flag == 0 && s.assignment != "be imported") || ($Flag != 0 && s.assignment == "be imported")),
	"Rules Slave Select":		s => (($Flag == 0 && !ruleSlaveSelected(s, $currentRule)) || ($Flag != 0 && ruleSlaveSelected(s, $currentRule))),
	"Rules Slave Exclude":	   s => (($Flag == 0 && !ruleSlaveExcluded(s, $currentRule)) || ($Flag != 0 && ruleSlaveExcluded(s, $currentRule))),
	"Matchmaking":			   s => (s.devotion >= 100 && s.relationship == $activeSlave.relationship && s.ID != $activeSlave.ID),
	"Dinner Party Preparations": s => (s.assignmentVisible == 1 && s.fuckdoll == 0),
}>>
<<set _Pass = passage(), _SL = $slaves.length, $assignTo = _Pass, _indexed = 0,
	_passagePreFilter = (s => s.assignment != "be your agent" && s.assignment != "live with your agent" && (!setup.passagePreFilters.hasOwnProperty(_Pass) || setup.passagePreFilters[_Pass](s))),
	_filteredSlaveIdxs = $slaves.map(function(slave, idx) { return _passagePreFilter(slave) ? idx : null; }).filter(function(idx) { return idx !== null; }),
	_indexSlavesIdxs = $slaves.map(function(slave, idx) { return _passagePreFilter(slave) ? idx : null; }).filter(function(idx) { return idx !== null; })>>
<<for !_.isUndefined(_ssi = _filteredSlaveIdxs.shift())>>
<<set _Slave = $slaves[_ssi]>>
<<set _slaveName = SlaveFullName(_Slave);>>

<<capture _ssi>>

<<if $useSlaveListInPageJSNavigation == 1>>
	<<set _Count = _indexSlavesIdxs.length>>
	/* Useful for finding weird combinations — usages of this passage that don't yet generate the quick index.
	*	<<print 'pass/count/indexed/flag::[' + _Pass + '/' + _Count + '/' + _indexed + '/' + $Flag + ']'>>
	*/
	<<if ((_Count > 1) && (_indexed == 0) && (((_Pass == 'Main') && (ndef $Flag) && (($useSlaveSummaryTabs == 0) || ($slaveAssignmentTab == "all"))) || ($Flag == 1)))>>
		<<set _indexed = 1, _counter = 0, _buttons = [], _offset = -50>>
		<<if (/Select/i.test(_Pass))>>
			<<set _offset = -25>>
		<</if>>

		<<set _tableCount = _tableCount || 0>>
		<<set _tableCount++>>
		/*
		* we want <button data-quick-index="<<= _tableCount>>">...
		*/
		<<set _buttonAttributes = { 'data-quick-index': _tableCount }>>
		<<htag _buttonAttributes 'button'>>Quick Index<</htag>>
		/*
		* we want
...
		*/
		<<set _divAttributes = { id: 'list_index' + _tableCount, class: 'hidden'}>>
		<<htag _divAttributes>>
			<<for !_.isUndefined(_ssii = _indexSlavesIdxs.shift())>>
				<<set _IndexSlave = $slaves[_ssii]>>
				<<set _indexSlaveName = SlaveFullName(_IndexSlave);>>
				<<set _devotionClass = getSlaveDevotionClass(_IndexSlave);>>
				<<set _trustClass = getSlaveTrustClass(_IndexSlave);>>
				<<set _buttons.push({'data-name': _indexSlaveName, 'data-scroll-to': '#slave-' + _IndexSlave.ID, 'data-scroll-offset': _offset, 'data-devotion': _IndexSlave.devotion, 'data-trust': _IndexSlave.trust, class: _devotionClass + ' ' + _trustClass });>>
			<</for>>
			<<if !_.isUndefined(_buttons[0])>>
				<<set $sortQuickList = $sortQuickList || 'Devotion'>>
				//Sorting:// ''$sortQuickList.''
				<<link "Sort by Devotion">>
					<<set $sortQuickList = 'Devotion'>>
					<<replace "#qlSort">>$sortQuickList<</replace>>
					<>
				<</link>> |
				<<link "Sort by Trust">>
					<<set $sortQuickList = 'Trust'>>
					<<replace "#qlSort">>$sortQuickList<</replace>>
					<>
				<</link>>

					<<for !_.isUndefined(_buttons[0])>>
						<<set _button = _buttons.shift()>>
						<<if !_.isUndefined(_button)>>
							<<set _buttonSlaveName = _button['data-name'];>>
							<<htag _button 'button'>>_buttonSlaveName<</htag>>
						<</if>>
					<</for>>

			<</if>>
		<</htag>>
	<</if>>
<</if>>
<<switch _Pass>>
<<case "Main">>

	<<if $useSlaveSummaryTabs == 1>>
		<<if $slaveAssignmentTab == "overview">>
			<<if $showOneSlave == "Head Girl">>
				<<if (_Slave.assignment != "be your Head Girl")>><<continue>><</if>>
			<<elseif $showOneSlave == "recruit girls">>
				<<if (_Slave.assignment != "recruit girls")>><<continue>><</if>>
			<<elseif $showOneSlave == "guard you">>
				<<if (_Slave.assignment != "guard you")>><<continue>><</if>>
			<</if>>

		<<elseif $slaveAssignmentTab == "resting">>
			<<if _Slave.assignment != "rest">><<continue>><</if>>
		<<elseif $slaveAssignmentTab == "stay confined">>
			<<if (_Slave.assignment != "stay confined")>><<continue>><</if>>
		<<elseif $slaveAssignmentTab == "take classes">>
			<<if (_Slave.assignment != "take classes")>><<continue>><</if>>
		<<elseif $slaveAssignmentTab == "please you">>
			<<if (_Slave.assignment != "please you")>><<continue>><</if>>
		<<elseif $slaveAssignmentTab == "whore">>
			<<if (_Slave.assignment != "whore")>><<continue>><</if>>
		<<elseif $slaveAssignmentTab == "serve the public">>
			<<if (_Slave.assignment != "serve the public")>><<continue>><</if>>
		<<elseif $slaveAssignmentTab == "be a servant">>
			<<if (_Slave.assignment != "be a servant")>><<continue>><</if>>
		<<elseif $slaveAssignmentTab == "get milked">>
			<<if (_Slave.assignment != "get milked")>><<continue>><</if>>
		<<elseif $slaveAssignmentTab == "work a glory hole">>
			<<if (_Slave.assignment != "work a glory hole")>><<continue>><</if>>
		<<elseif $slaveAssignmentTab == "be a subordinate slave">>
			<<if (_Slave.assignment != "be a subordinate slave")>><<continue>><</if>>
		<</if>>
	<</if>>

	<<if (_Slave.choosesOwnClothes == 1) && (_Slave.clothes == "choosing her own clothes")>>
		<<set _oldDevotion = _Slave.devotion>>
		<<set _chosenClothes = saChoosesOwnClothes(_Slave)>>
		<<set $slaves[_ssi].devotion = _oldDevotion, _Slave = $slaves[_ssi]>> /* restore devotion value so repeatedly changing clothes isn't an exploit */
	<</if>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
	<<if "be your Head Girl" == _Slave.assignment>>''@@.lightcoral;HG@@''
	<<elseif "recruit girls" == _Slave.assignment>>''@@.lightcoral;RC@@''
	<<elseif "guard you" == _Slave.assignment>>''@@.lightcoral;BG@@''
	<</if>>
	<<if Array.isArray($personalAttention) && $personalAttention.findIndex(function(s) { return s.ID == _Slave.ID; }) != -1>>''@@.lightcoral;PA@@''<</if>>
	[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] /* lists their names */

<<case "Personal Attention Select">>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
	<<link _slaveName>>
		<<if !Array.isArray($personalAttention)>> /* first PA target */
			<<set $personalAttention = [{ID: $slaves[_ssi].ID, trainingRegimen: "undecided"}]>>
		<<else>>
			<<set _pai = $personalAttention.findIndex(function(s) { return s.ID == $slaves[_ssi].ID; })>>
			<<if _pai == -1>> /* not already a PA target; add */
				<<set $activeSlave = $slaves[_ssi], $personalAttention.push({ID: $slaves[_ssi].ID, trainingRegimen: "undecided"})>>
			<<else>> /* already a PA target; remove */
				<<set $personalAttention.deleteAt(_pai)>>
				<<if $personalAttention.length == 0>>
					<<set $personalAttention = "sex">>
				<</if>>
			<</if>>
		<</if>>
		<<goto "Personal Attention Select">>
	<</link>>
<<case "Agent Select">>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
	[[_slaveName|Agent Workaround][$i = _ssi]]
<<case "BG Select">>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
	[[_slaveName|Bodyguard Workaround][$i = _ssi]]
<<case "Recruiter Select">>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
	[[_slaveName|Recruiter Workaround][$i = _ssi]]
<<case "HG Select">>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
	[[_slaveName|HG Workaround][$i = _ssi]]
<<case "Head Girl Suite">>
<<if $Flag == 0>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<<else>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</if>>
<<case "Subordinate Targeting">>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
	[[_slaveName|Subordinate Targeting][$activeSlave.subTarget = $slaves[_ssi].ID]]
<<case "Spa">>
<<if $Flag == 0>>
	<<if $spa <= $spaSlaves>><<continue>><</if>>
	<<if (_Slave.health < 20) || (_Slave.trust < 60) || (_Slave.devotion <= 60) || (_Slave.fetish == "mindbroken") || _Slave.sexualFlaw !== "none" || _Slave.behavioralFlaw !== "none">>
	<<if _Slave.devotion >= -20 || _Slave.fetish == "mindbroken">>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
	<<else>>

//_Slave.slaveName cannot be trusted in the spa//
		<<continue>>
	<</if>>
	<<else>>

//_Slave.slaveName cannot benefit from the spa//
		<<continue>>
	<</if>>
<<elseif $Flag == 1>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<<else>>
		<<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</if>>
<<case "Attendant Select">>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
	[[_slaveName|Attendant Workaround][$i = _ssi]]
<<case "Nursery">>
<<if $Flag == 0>>
	<<if $nurseryNannies <= $nurserySlaves>><<continue>><</if>>
	<<if (_Slave.devotion >= -20) || ((_Slave.devotion >= -50) && (_Slave.trust <= 20)) || (_Slave.trust < -20)>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
	<<else>>

//_Slave.slaveName must be either more fearful of you or devoted to you//
		<<continue>>
	<</if>>
<<elseif $Flag == 1>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<<else>>
		<<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</if>>
<<case "Matron Select">>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
	[[_slaveName|Matron Workaround][$i = _ssi]]
<<case "Brothel">>
<<if $Flag == 0>>
	<<if $brothel <= $brothelSlaves>><<continue>><</if>>
	<<if (_Slave.breedingMark != 1 || $propOutcome == 0)>>
	<<if (_Slave.devotion > 50) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.trust > 50)>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
	<<else>>

//_Slave.slaveName must be either more fearful of you or devoted to you//
		<<continue>>
	<</if>>
	<<else>>

//_Slave.slaveName is for private use only//
		<<continue>>
	<</if>>
<<elseif $Flag == 1>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<<else>>
		<<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
				[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</if>>
<<case "Madam Select">>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
	[[_slaveName|Madam Workaround][$i = _ssi]]
<<case "Club">>
<<if $Flag == 0>>
	<<if $club <= $clubSlaves>><<continue>><</if>>
	<<if (_Slave.breedingMark != 1 || $propOutcome == 0)>>
	<<if (_Slave.devotion > 50) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.trust > 50)>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
	<<else>>

//_Slave.slaveName must be either more fearful of you or devoted to you//
		<<continue>>
	<</if>>
	<<else>>

//_Slave.slaveName is for private use only//
		<<continue>>
	<</if>>
<<elseif $Flag == 1>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<<else>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</if>>
<<case "DJ Select">>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
	[[_slaveName|DJ Workaround][$i = _ssi]]
<<case "Clinic">>
<<if $Flag == 0>>
	<<if $clinic <= $clinicSlaves>><<continue>><</if>>
	<<if (_Slave.health < 20) || ($Nurse != 0 && ((_Slave.chem > 15 && $clinicUpgradeFilters == 1) || ($bellyImplants == 1 && _Slave.bellyImplant > -1) || (_Slave.pregKnown == 1 && ($clinicSpeedGestation >= 0 || _Slave.pregControl == "speed up")) || (_Slave.pregAdaptation*1000 < _Slave.bellyPreg || _Slave.preg > _Slave.pregData.normalBirth/1.33)))>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
	<<else>>

//_Slave.slaveName cannot benefit from the clinic//
		<<continue>>
	<</if>>
<<elseif $Flag == 1>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<<else>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</if>>
<<case "Nurse Select">>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
	[[_slaveName|Nurse Workaround][$i = _ssi]]
<<case "Schoolroom">>
<<if $Flag == 0>>
	<<if $schoolroom <= $schoolroomSlaves>><<continue>><</if>>
	<<if (_Slave.devotion >= -20) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50)>>
		<<if (_Slave.intelligenceImplant < 30) || (_Slave.voice != 0 && _Slave.accent+$schoolroomUpgradeLanguage > 2) || (_Slave.oralSkill <= 10+$schoolroomUpgradeSkills*20) || (_Slave.whoreSkill <= 10+$schoolroomUpgradeSkills*20) || (_Slave.entertainSkill <= 10+$schoolroomUpgradeSkills*20) || (_Slave.analSkill < 10+$schoolroomUpgradeSkills*20) || ((_Slave.vagina >= 0) && (_Slave.vaginalSkill < 10+$schoolroomUpgradeSkills*20))>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
			[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
		<<else>>

//_Slave.slaveName already has a basic education//
			<<continue>>
		<</if>>
	<<else>>

//_Slave.slaveName is too resistant to learn//
		<<continue>>
	<</if>>
<<elseif $Flag == 1>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<<else>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</if>>
<<case "Schoolteacher Select">>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
	[[_slaveName|Schoolteacher Workaround][$i = _ssi]]
<<case "Dairy">>
<<if $Flag == 0>>
	<<set _dairySeed = $bioreactorsXY+$bioreactorsXX+$bioreactorsHerm+$bioreactorsBarren>>
	<<if _Slave.assignment == "work in the dairy">><<continue>><</if>>
	<<if $dairy <= $dairySlaves+_dairySeed>><<continue>><</if>>
	<<if (_Slave.indentureRestrictions > 0) && ($dairyRestraintsSetting > 1)>>

//_Slave.slaveName's indenture forbids extractive Dairy service.//
		<<continue>>
	<<elseif (_Slave.indentureRestrictions > 1) && ($dairyRestraintsSetting > 0)>>

//_Slave.slaveName's indenture allows only free range milking.//
		<<continue>>
	<<elseif _Slave.breedingMark == 1 && $propOutcome == 1 && $dairyRestraintsSetting > 0>>

//_Slave.slaveName may only be a free range cow//
		<<continue>>
	<<elseif ($dairyPregSetting > 0) && ((_Slave.bellyImplant != -1) || (_Slave.broodmother != 0))>>

//_Slave.slaveName's womb cannot accommodate current machine settings//
		<<continue>>
	<<else>>
		<<if (_Slave.lactation > 0) || (_Slave.balls > 0) || (($dairySlimMaintainUpgrade == 0 || $dairySlimMaintain == 0) && (_Slave.boobs > 300 || _Slave.balls == 0 || $dairyImplantsSetting == 1) && $dairyImplantsSetting != 2)>>
			<<if (_Slave.devotion > 20) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.amp == 1) || ($dairyRestraintsUpgrade == 1)>>
				<<if ($dairyStimulatorsSetting < 2) || (_Slave.anus > 2) || ($dairyPrepUpgrade == 1)>>
					<<if ($dairyPregSetting < 2) || (_Slave.vagina > 2) || (_Slave.ovaries == 0) || ($dairyPrepUpgrade == 1)>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
						[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
						<<else>>

//_Slave.slaveName's vagina cannot accommodate current machine settings//
							<<continue>>
						<</if>>
					<<else>>

//_Slave.slaveName's anus cannot accommodate current machine settings//
						<<continue>>
				<</if>>
			<<else>>

//_Slave.slaveName must be obedient in order to be milked here//
				<<continue>>
			<</if>>
		<<elseif (($dairySlimMaintainUpgrade == 1 && $dairySlimMaintain == 1) || ($dairyImplantsSetting == 2) || (_Slave.boobs <= 300 && _Slave.balls > 0 && ($dairyImplantsSetting == 0 || $dairyImplantsSetting == 3)))>>

//_Slave.slaveName is not lactating<<if $seeDicks > 0>> or producing semen<</if>>, and <<print $dairyName>>'s current settings forbid the automatic implantation of lactation inducing drugs or manual stimulation to induce it, so she cannot be a cow//
			<<continue>>
		<<else>>

//_Slave.slaveName is not lactating<<if $seeDicks > 0>> or producing semen<</if>> and cannot be a cow//
			<<continue>>
		<</if>>
	<</if>>
<<elseif $Flag == 1>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<<else>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</if>>
<<case "Milkmaid Select">>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
	[[_slaveName|Milkmaid Workaround][$i = _ssi]]
<<case "Farmyard">>
<<if $Flag == 0>>
	<<if _Slave.assignment == ("work as a farmhand")>><<continue>><</if>>
	<<if $farmyard <= $farmyardSlaves>><<continue>><</if>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<<elseif $Flag == 1>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<<else>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</if>>
<<case "Farmer Select">>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
	[[_slaveName|Farmer Workaround][$i = _ssi]]
<<case "Servants' Quarters">>
<<if $Flag == 0>>
	<<if $servantsQuarters <= $servantsQuartersSlaves>><<continue>><</if>>
	<<if (_Slave.devotion >= -20) || ((_Slave.devotion >= -50) && (_Slave.trust <= 20)) || (_Slave.trust < -20)>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
	<<else>>

//_Slave.slaveName must be either more fearful of you or devoted to you//
		<<continue>>
	<</if>>
<<elseif $Flag == 1>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<<else>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</if>>
<<case "Stewardess Select">>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
	[[_slaveName|Stewardess Workaround][$i = _ssi]]
<<case "Master Suite">>
<<if $Flag == 0>>
	<<if $masterSuite <= $masterSuiteSlaves>><<continue>><</if>>
	<<if (_Slave.devotion > 20) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50)>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
	<<else>>

//_Slave.slaveName is not sufficiently broken for the master suite//
		<<continue>>
	<</if>>
<<elseif $Flag == 1>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<<else>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</if>>
<<case "Concubine Select">>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
	[[_slaveName|Concubine Workaround][$i = _ssi]]
<<case "Cellblock">>
<<if _Slave.assignmentVisible != 1>><<continue>><</if>>
<<if $Flag == 0>>
	<<if $cellblock <= $cellblockSlaves>><<continue>><</if>>
	<<if (_Slave.devotion < -20 && _Slave.trust >= -20) || (_Slave.devotion < -50 && _Slave.trust >= -50)>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
	<<else>>

//_Slave.slaveName is sufficiently broken in so that the cellblock would have no effect//
		<<continue>>
	<</if>>
<<elseif $Flag == 1>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<<else>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</if>>
<<case "Wardeness Select">>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
	[[_slaveName|Wardeness Workaround][$i = _ssi]]
<<case "Arcade">>
<<if $Flag == 0>>
	<<if _Slave.assignment == "be confined in the arcade">><<continue>><</if>>
	<<if $arcade <= $arcadeSlaves && $arcadeUpgradeFuckdolls != 1>><<continue>><</if>>
	<<if (_Slave.breedingMark != 1 || $propOutcome == 0)>>
	<<if (_Slave.indentureRestrictions <= 0)>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
	<<else>>

//_Slave.slaveName's indenture forbids arcade service.//
		<<continue>>
	<</if>>
	<<else>>

//_Slave.slaveName is for private use only//
		<<continue>>
	<</if>>
<<else>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</if>>
<<case "Pit">>
<<if $Flag == 0>>
	<<if (_Slave.indentureRestrictions > 0) && ($pitLethal == 1)>>

//_Slave.slaveName's indenture forbids lethal fights.//
		<<continue>>
	<<elseif (_Slave.indentureRestrictions > 1)>>

//_Slave.slaveName's indenture forbids fighting.//
		<<continue>>
	<<elseif _Slave.breedingMark == 1 && $propOutcome == 1>>

//_Slave.slaveName may not participate in combat//
		<<continue>>
	<<else>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Assign][$i = _ssi]]
	<</if>>
<<else>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Retrieve][$i = _ssi]]
<</if>>
<<case "Coursing Association">>
<<if $Flag == 0>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Assign][$i = _ssi]]
<<else>>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
		[[_slaveName|Retrieve][$i = _ssi]]
<</if>>
<<case "New Game Plus">>
<<if $Flag == 0>>

__''@@.pink;_Slave.slaveName@@''__
<<else>>

__''@@.pink;_Slave.slaveName@@''__
<</if>>
<<case "Rules Slave Select">>
<<if $Flag == 0>>

__''
		[[_slaveName|Rules Slave Select Workaround][$activeSlave = $slaves[_ssi]]]''__
<<else>>

__''
		[[_slaveName|Rules Slave Deselect Workaround][$activeSlave = $slaves[_ssi]]]''__
<</if>>
<<case "Rules Slave Exclude">>
<<if $Flag == 0>>

__''
		[[_slaveName|Rules Slave Exclude Workaround][$activeSlave = $slaves[_ssi]]]''__
<<else>>

__''
		[[_slaveName|Rules Slave NoExclude Workaround][$activeSlave = $slaves[_ssi]]]''__
<</if>>
<<case "Matchmaking">>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
	[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<<case "Dinner Party Preparations">>

<<if $lineSeparations == 0>>
<<else>>
<</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>>
<<SlaveArt _Slave 1>>
<</if>>
	[[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]]
<</switch>>

<<run SlaveStatClamp(_Slave)>>

<<set _Slave.trust = Math.trunc(_Slave.trust), _Slave.devotion = Math.trunc(_Slave.devotion), _Slave.health = Math.trunc(_Slave.health)>>

<<set $slaves[_ssi] = _Slave>>

will
<<if (_Slave.assignment == "rest") && (_Slave.health >= -20)>>
	''__@@.lawngreen;rest.@@__''
<<elseif (_Slave.assignment == "stay confined") && ((_Slave.devotion > 20) || ((_Slave.trust < -20) && (_Slave.devotion >= -20)) || ((_Slave.trust < -50) && (_Slave.devotion >= -50)))>>
	''__@@.lawngreen;stay confined.@@__''<<if _Slave.sentence > 0>> (_Slave.sentence weeks)<</if>>
<<else>>
	<<if _Slave.choosesOwnAssignment == 1>>choose her own job<<else>>_Slave.assignment<<if _Slave.sentence > 0>> (_Slave.sentence weeks)<</if>><</if>>.
<</if>>

<<if ($displayAssignments == 1) && (_Pass == "Main") && (_Slave.ID != $HeadGirl.ID) && (_Slave.ID != $Recruiter.ID) && (_Slave.ID != $Bodyguard.ID)>>
	<<if _Slave.assignment != "rest">>
		<<link "Rest" "Main">><<= removeJob($slaves[_ssi], $slaves[_ssi].assignment)>><</link>>
	<<else>>
		Rest
	<</if>>
	<<if _Slave.assignment != "please you">>
		| <<link "Fucktoy" "Main">><<= assignJob($slaves[_ssi], "please you")>><</link>>
	<<else>>
		| Fucktoy
	<</if>>
	<<if _Slave.indentureRestrictions <= 0 && (_Slave.breedingMark != 1 || $propOutcome == 0)>>
		<<if _Slave.assignment != "work a glory hole">>
			| <<link "Gloryhole" "Main">><<= assignJob($slaves[_ssi], "work a glory hole")>><</link>>
		<<else>>
			| Hole
		<</if>>
	<</if>>
	<<if _Slave.fuckdoll == 0>> /* NON-FUCKDOLL ASSIGNMENTS */
		<<if (_Slave.assignment != "take classes")>>
			<<if (_Slave.intelligenceImplant < 15) && ((_Slave.devotion >= -20) || ((_Slave.trust < -20) && (_Slave.devotion >= -50)) || (_Slave.trust < -50)) && (_Slave.fetish != "mindbroken")>>
				| <<link "Classes" "Main">><<= assignJob($slaves[_ssi], "take classes")>><</link>>
			<</if>>
		<<else>>
			| Classes
		<</if>>
		<<if (_Slave.assignment != "be a servant")>>
			<<if ((_Slave.devotion >= -20) || ((_Slave.trust < -20) && (_Slave.devotion >= -50)) || (_Slave.trust < -50)) && canWalk(_Slave) && canSee(_Slave)>>
				| <<link "House Servant" "Main">><<= assignJob($slaves[_ssi], "be a servant")>><</link>>
			<</if>>
		<<else>>
			| House Servant
		<</if>>
		<<if (_Slave.assignment != "whore") && (_Slave.breedingMark != 1 || $propOutcome == 0)>>
			| <<link "Whore" "Main">><<= assignJob($slaves[_ssi], "whore")>><</link>>
		<<else>>
			| Whore
		<</if>>
		<<if (_Slave.assignment != "serve the public") && (_Slave.breedingMark != 1 || $propOutcome == 0)>>
			| <<link "Public Servant" "Main">><<= assignJob($slaves[_ssi], "serve the public")>><</link>>
		<<else>>
			| Public Servant
		<</if>>
		<<if (_Slave.lactation > 0) || (_Slave.balls > 0)>>
			<<if (_Slave.assignment != "get milked")>>
				| <<link "Milked" "Main">><<= assignJob($slaves[_ssi], "get milked")>><</link>>
			<<else>>
				| Milked
			<</if>>
		<</if>>
		<<if (_Slave.assignment != "stay confined")>>
			| <<link "Confinement" "Main">><<= assignJob($slaves[_ssi], "stay confined")>><</link>>
		<<else>>
			| Confinement
		<</if>>
		<<if (_Slave.assignment != "choose her own job")>>
			| <<link "Let _Slave.object choose" "Main">><<= assignJob($slaves[_ssi], "choose her own job")>><</link>>
		<<else>>
			| Let _Slave.object choose
		<</if>>
	<</if>> /* CLOSES FUCKDOLL CHECK */
<</if>>

<<set _numFacilities = $brothel+$club+$dairy+$farmyard+$servantsQuarters+$masterSuite+$spa+$clinic+$schoolroom+$cellblock+$arcade+$HGSuite>>

<<if _numFacilities > 0>>

	<<if _Pass == "Main" || _Pass == "Head Girl Suite" || _Pass == "Spa" || _Pass == "Brothel" || _Pass == "Club" || _Pass == "Arcade" || _Pass == "Clinic" || _Pass == "Schoolroom" || _Pass == "Dairy" || _Pass == "Farmyard" || _Pass == "Servants' Quarters" || _Pass == "Master Suite" || _Pass == "Cellblock" >>
	<<set $returnTo=_Pass >>

Transfer to:

	<<if _Slave.assignment != "rest" && _Slave.assignment != "please you" && _Slave.assignment != "take classes" && _Slave.assignment != "be a servant" && _Slave.assignment != "whore" && _Slave.assignment != "serve the public" && _Slave.assignment != "get milked" && _Slave.assignment != "stay confined">>
		<<link "Penthouse" "Main">><<= removeJob($slaves[_ssi], $slaves[_ssi].assignment)>><</link>> |
	<<else>>
		Penthouse |
	<</if>>

	<<if $arcade != 0>>
		<<if $arcade > $arcadeSlaves && (_Slave.indentureRestrictions <= 0) && (_Slave.breedingMark != 1 || $propOutcome == 0)>>
			[[Arcade|Assign][$assignTo = "Arcade", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */
		<<else>>Arcade<</if>>
		<<if _numFacilities-- > 1>>|<</if>>
	<</if>>

	<<if _Slave.fuckdoll == 0>> /* NON-FUCKDOLL FACILITIES */

	<<if $clinic != 0>>
		<<if $clinic > $clinicSlaves && (_Slave.health < 20 || ($Nurse != 0 && ((_Slave.chem > 15 && $clinicUpgradeFilters == 1) || ($bellyImplants == 1 && _Slave.bellyImplant > -1) || (_Slave.pregKnown == 1 && ($clinicSpeedGestation >= 0 || _Slave.pregControl == "speed up")) || (_Slave.pregAdaptation*1000 < _Slave.bellyPreg || _Slave.preg > _Slave.pregData.normalBirth/1.33))))>>
			[[Clinic|Assign][$assignTo = "Clinic", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */
		<<else>>Clinic<</if>>
		<<if _numFacilities-- > 1>>|<</if>>
	<</if>>

	<<if $masterSuite != 0>>
		<<if $masterSuite > $masterSuiteSlaves && ((_Slave.devotion > 20) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50))>>
			[[Master Suite|Assign][$assignTo = "Master Suite", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */
		<<else>>Master Suite<</if>>
		<<if _numFacilities-- > 1>>|<</if>>
	<</if>>

	<<if $cellblock != 0>>
		<<if $cellblock > $cellblockSlaves && ((_Slave.devotion < -20 && _Slave.trust >= -20) || (_Slave.devotion < -50 && _Slave.trust >= -50))>>
			[[Cellblock|Assign][$assignTo = "Cellblock", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */
		<<else>>Cellblock<</if>>
		<<if _numFacilities-- > 1>>|<</if>>
	<</if>>

	<<if $schoolroom != 0>>
		<<if $schoolroom > $schoolroomSlaves && (_Slave.fetish != "mindbroken" && (_Slave.devotion >= -20 || (_Slave.devotion >= -50 && _Slave.trust < -20) || _Slave.trust < -50) && ((_Slave.intelligenceImplant < 30) || (_Slave.voice != 0 && _Slave.accent+$schoolroomUpgradeLanguage > 2) || (_Slave.oralSkill <= 10+$schoolroomUpgradeSkills*20) || (_Slave.whoreSkill <= 10+$schoolroomUpgradeSkills*20) || (_Slave.entertainSkill <= 10+$schoolroomUpgradeSkills*20) || (_Slave.analSkill < 10+$schoolroomUpgradeSkills*20) || (_Slave.vagina >= 0 && _Slave.vaginalSkill < 10+$schoolroomUpgradeSkills*20)))>>
			[[Schoolroom|Assign][$assignTo = "Schoolroom", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */
		<<else>>Schoolroom<</if>>
		<<if _numFacilities-- > 1>>|<</if>>
	<</if>>

	<<if $servantsQuarters != 0>>
		<<if $servantsQuarters > $servantsQuartersSlaves && (canWalk(_Slave) && canSee(_Slave) && (_Slave.devotion >= -20 || (_Slave.devotion >= -50 && _Slave.trust <= 20) || _Slave.trust < -20))>>
			[[Servants' Quarters|Assign][$assignTo = "Servants' Quarters", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */
		<<else>>Servants' Quarters<</if>>
		<<if _numFacilities-- > 1>>|<</if>>
	<</if>>

	<<if $brothel != 0>>
		<<if $brothel > $brothelSlaves && (((_Slave.devotion > 50) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.trust > 50)) && (_Slave.breedingMark != 1 || $propOutcome == 0))>>
			[[Brothel|Assign][$assignTo = "Brothel", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */
		<<else>>Brothel<</if>>
		<<if _numFacilities-- > 1>>|<</if>>
	<</if>>

	<<if $club != 0>>
		<<if $club > $clubSlaves && (((_Slave.devotion > 50) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.trust > 50)) && (_Slave.breedingMark != 1 || $propOutcome == 0))>>
			[[Club|Assign][$assignTo = "Club", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */
		<<else>>Club<</if>>
		<<if _numFacilities-- > 1>>|<</if>>
	<</if>>

	<<if $dairy != 0>>
		<<set _dairySeed = $bioreactorsXY+$bioreactorsXX+$bioreactorsHerm+$bioreactorsBarren>>
		<<if $dairy <= $dairySlaves+_dairySeed>>
			Dairy
		<<elseif (((_Slave.indentureRestrictions > 0) && ($dairyRestraintsSetting > 1)) || ((_Slave.indentureRestrictions > 1) && ($dairyRestraintsSetting > 0)) || (_Slave.breedingMark == 1 && $propOutcome == 1 && $dairyRestraintsSetting > 0) || (($dairyPregSetting > 0) && ((_Slave.bellyImplant != -1) || (_Slave.broodmother > 0))))>>
			Dairy
		<<elseif ((_Slave.lactation > 0) || (_Slave.balls > 0)) || (($dairyFeedersUpgrade == 1) && ($dairyFeedersSetting > 0) && ($dairySlimMaintainUpgrade == 0))>>
			[[Dairy|Assign][$assignTo = "Dairy", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */
		<<else>>Dairy<</if>>
		<<if _numFacilities-- > 1>>|<</if>>
	<</if>>

	<<if $farmyard != 0>>
		<<if $farmyard > $farmyardSlaves>>
			[[Farmyard|Assign][$assignTo = "Farmyard", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */
		<<else>>Farmyard<</if>>
		<<if _numFacilities-- > 1>>|<</if>>
	<</if>>

	<<if $spa != 0>>
		<<if $spa > $spaSlaves && ((_Slave.devotion >= -20 || _Slave.fetish == "mindbroken") && (_Slave.health < 20 || _Slave.trust <= 60 || _Slave.devotion <= 60 || _Slave.fetish == "mindbroken" || _Slave.sexualFlaw !== "none" || _Slave.behavioralFlaw !== "none"))>>
			[[Spa|Assign][$assignTo = "Spa", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */
		<<else>>Spa<</if>>
		<<if _numFacilities-- > 1>>|<</if>>
	<</if>>

	<<if $nursery != 0>>
		<<if $nurseryNannies > $nurserySlaves && (_Slave.devotion > 20 || _Slave.trust > 20 || _Slave.fetish == "mindbroken")>>
			[[Nursery|Assign][$assignTo = "Nursery", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */
		<<else>>Nursery<</if>>
	<</if>>

	<</if>> /* Closes transfer options check */

	<</if>> /* CLOSES FUCKDOLL CHECK */

<</if>> /* closes _numFacilities */

<<if ((_Pass != 'Main') || (def $Flag) || ($useSlaveSummaryTabs == 0) || ($slaveAssignmentTab == "all"))>>
	<<print ' '>>
<</if>>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>

<<run clearSummaryCache()>>
<<= SlaveSummary(_Slave)>>

<<set $slaves[_ssi] = _Slave>>

<<switch _Pass>>
<<case "Main">>
	<<continue>>
<<case "HG Select">>
	<<if setup.HGCareers.includes(_Slave.career) || (_Slave.skillHG >= $masteredXP)>>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>@@.lime;Has applicable career experience.@@
	<</if>>
<<case "Head Girl Suite">>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>
	<<if $Flag == 0>>
		[[Send her to live with your Head Girl|Assign][$i = _ssi]]
	<<else>>
		[[Bring her out of the Head Girl's suite|Retrieve][$i = _ssi]]
		<<break>>
	<</if>>
<<case "Recruiter Select">>
	<<if setup.recruiterCareers.includes(_Slave.career) || (_Slave.skillRC >= $masteredXP)>>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>@@.lime;Has applicable career experience.@@
	<</if>>
<<case "BG Select">>
	<<if setup.bodyguardCareers.includes(_Slave.career) || (_Slave.skillBG >= $masteredXP)>>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>@@.lime;Has applicable career experience.@@
	<</if>>
<<case "Spa">>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>
	<<if $Flag == 0>>
		<<link "Send $him to $spaName" "Assign">><<set $i = _ssi>><</link>>
	<<elseif $Flag == 1>>
		<<link "Remove $him from $spaName" "Retrieve">><<set $i = _ssi>><</link>>
	<<else>>
		[[Change or remove Attendant|Attendant Select]]
		<<break>>
	<</if>>
<<case "Attendant Select">>
	<<if setup.attendantCareers.includes(_Slave.career) || (_Slave.skillAT >= $masteredXP)>>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>@@.lime;Has applicable career experience.@@
	<</if>>
<<case "Nursery">>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>
	<<if $Flag == 0>>
		<<link "Send $him to $nurseryName" "Assign">><<set $i = _ssi>><</link>>
	<<elseif $Flag == 1>>
		<<link "Remove $him from $nurseryName" "Retrieve">><<set $i = _ssi>><</link>>
	<<else>>
		[[Change or remove Matron|Matron Select]]
		<<break>>
	<</if>>
<<case "Matron Select">>
	<<if setup.matronCareers.includes(_Slave.career) || (_Slave.skillMT >= $masteredXP)>>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>@@.lime;Has applicable career experience.@@
	<</if>>
<<case "Brothel">>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>
	<<if $Flag == 0>>
		<<link "Send $him to $brothelName" "Assign">><<set $i = _ssi>><</link>>
	<<elseif $Flag == 1>>
		<<link "Release $him from $brothelName" "Retrieve">><<set $i = _ssi>><</link>>
	<<else>>
		[[Change or remove Madam|Madam Select]]
		<<break>>
	<</if>>
<<case "Madam Select">>
	<<if setup.madamCareers.includes(_Slave.career) || (_Slave.skillMD >= $masteredXP)>>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>@@.lime;Has applicable career experience.@@
	<</if>>
<<case "Club">>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>
	<<if $Flag == 0>>
		<<link "Send $him to $clubName" "Assign">><<set $i = _ssi>><</link>>
	<<elseif $Flag == 1>>
		<<link "Remove $him from $clubName" "Retrieve">><<set $i = _ssi>><</link>>
	<<else>>
		[[Change or remove DJ|DJ Select]]
		<<break>>
	<</if>>
<<case "Arcade">>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>
	<<if $Flag == 0>>
		<<link "Confine $him in $arcadeName" "Assign">><<set $i = _ssi>><</link>>
	<<else>>
		<<link "Release $him from $arcadeName" "Retrieve">><<set $i = _ssi>><</link>>
	<</if>>
<<case "DJ Select">>
	<<if setup.DJCareers.includes(_Slave.career) || (_Slave.skillDJ >= $masteredXP)>>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>@@.lime;Has applicable career experience.@@
	<</if>>
<<case "Clinic">>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>
	<<if $clinicUpgradeScanner == 1>>
		@@.cyan;Estimated DNA error value: <<print Math.ceil(_Slave.chem/10)>>@@
	<</if>>
	<<if $Flag == 0>>
		<<link "Send $him to $clinicName" "Assign">><<set $i = _ssi>><</link>>
	<<elseif $Flag == 1>>
		<<link "Take $him out of $clinicName" "Retrieve">><<set $i = _ssi>><</link>>
	<<else>>
		[[Change or remove Nurse|Nurse Select]]
		<<break>>
	<</if>>
<<case "Nurse Select">>
	<<if setup.nurseCareers.includes(_Slave.career) || (_Slave.skillNU >= $masteredXP)>>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>@@.lime;Has applicable career experience.@@
	<</if>>
<<case "Schoolroom">>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>
	<<if $Flag == 0>>
		<<link "Assign $him to $schoolroomName" "Assign">><<set $i = _ssi>><</link>>
	<<elseif $Flag == 1>>
		<<link "Release $him from $schoolroomName" "Retrieve">><<set $i = _ssi>><</link>>
	<<else>>
		[[Change or remove Schoolteacher|Schoolteacher Select]]
		<<break>>
	<</if>>
<<case "Schoolteacher Select">>
	<<if setup.schoolteacherCareers.includes(_Slave.career) || (_Slave.skillTE >= $masteredXP)>>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>@@.lime;Has applicable career experience.@@
	<</if>>
<<case "Dairy">>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>
	<<if $Flag == 0>>
		<<link "Send $him to $dairyName" "Assign">><<set $i = _ssi>><</link>>
	<<elseif $Flag == 1>>
		<<link "Release $him from $dairyName" "Retrieve">><<set $i = _ssi>><</link>>
	<<else>>
		[[Change or remove Milkmaid|Milkmaid Select]]
		<<break>>
	<</if>>
<<case "Milkmaid Select">>
	<<if setup.milkmaidCareers.includes(_Slave.career) || (_Slave.skillMM >= $masteredXP)>>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>@@.lime;Has applicable career experience.@@
	<</if>>
<<case "Farmyard">>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>
	<<if $Flag == 0>>
		<<link "Send $him to $farmyardName" "Assign">><<set $i = _ssi>><</link>>
	<<elseif $Flag == 1>>
		<<link "Release $him from $farmyardName" "Retrieve">><<set $i = _ssi>><</link>>
	<<else>>
		[[Change or remove Farmer|Farmer Select]]
		<<break>>
	<</if>>
<<case "Farmer Select">>
	<<if setup.farmerCareers.includes(_Slave.career) || (_Slave.skillFA >= $masteredXP)>>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>@@.lime;Has applicable career experience.@@
	<</if>>
<<case "Servants' Quarters">>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>
	<<if $Flag == 0>>
		<<link "Assign $him to $servantsQuartersName" "Assign">><<set $i = _ssi>><</link>>
	<<elseif $Flag == 1>>
		<<link "Release $him from $servantsQuartersName" "Retrieve">><<set $i = _ssi>><</link>>
	<<else>>
		[[Change or remove Stewardess|Stewardess Select]]
		<<break>>
	<</if>>
<<case "Stewardess Select">>
	<<if setup.stewardessCareers.includes(_Slave.career) || (_Slave.skillST >= $masteredXP)>>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>@@.lime;Has applicable career experience.@@
	<</if>>
<<case "Master Suite">>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>
	<<if $Flag == 0>>
		<<link "Add $him to $masterSuiteName" "Assign">><<set $i = _ssi>><</link>>
	<<elseif $Flag == 1>>
		<<link "Send $him out of $masterSuiteName" "Retrieve">><<set $i = _ssi>><</link>>
	<<else>>
		[[Change or remove Concubine|Concubine Select]]
		<<break>>
	<</if>>
<<case "Cellblock">>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>
	<<if $Flag == 0>>
		<<link "Confine $him in $cellblockName" "Assign">><<set $i = _ssi>><</link>>
	<<elseif $Flag == 1>>
		<<link "Release $him from $cellblockName" "Retrieve">><<set $i = _ssi>><</link>>
	<<else>>
		[[Change or remove Wardeness|Wardeness Select]]
		<<break>>
	<</if>>
<<case "Wardeness Select">>
	<<if setup.wardenessCareers.includes(_Slave.career) || (_Slave.skillWA >= $masteredXP)>>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>@@.lime;Has applicable career experience.@@
	<</if>>
<<case "New Game Plus">>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>
	<<if $Flag === 0>>
	<<link "Add to import list" "New Game Plus">>
		<<set $slavesToImport += 1,$Flag = 1>>
		<<= assignJob($slaves[_ssi], "be imported")>>
	<</link>>
<<else>>
	<<link "Remove from import list" "New Game Plus">>
		<<set $slavesToImport -= 1,$Flag = 0>>
		<<= removeJob($slaves[_ssi], $slaves[_ssi].assignment)>>
	<</link>>
<</if>>
<<case "Matchmaking">>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>
	[[Match them|Matchmaking][$subSlave = $slaves[_ssi]]]
<<case "Dinner Party Preparations">>

<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>>    <</if>>
	[[Make her the main course|Dinner Party Execution][$activeSlave = $slaves[_ssi]]]
<</switch>>

<</capture>>

<</for>>
<<set $activeSlave = 0, _Slave = 0>>

repo_name: Echoart/fc


code:
:: Spa [nobr]

<<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Spa", $showEncyclopedia = 1, $encyclopedia = "Spa", $spaSlaves = $SpaiIDs.length>>

<<if $spaName != "the Spa">>
	<<set $spaNameCaps = $spaName.replace("the ", "The ")>>
<</if>>
<<spaAssignmentFilter>>
$spaNameCaps
<<switch $spaDecoration>>
<<case "Roman Revivalist">>
	is built as a Roman bath. The flooring is pleasantly warm due to a modernized version of hypocaust heating, and is covered in mosaic depicting slaves enjoying sex.
<<case "Aztec Revivalist">>
	is built as an Aztec bathhouse. Water steams from the middle of the room and the air is heavy with the scent of herbs and essences. The idols by the door glisten with moisture.
<<case "Egyptian Revivalist">>
	is decorated like an Egyptian water garden. All but the hottest pools include aquatic plants around their edges, and the atmosphere is heavy with perfume.
<<case "Edo Revivalist">>
	is decorated like a traditional onsen. The stone-lined pools are surrounded by meticulously kept gardens, and there are proper provisions for bathing in the old Japanese style.
<<case "Arabian Revivalist">>
	looks like a dream of an Arabian palace garden. Every surface is richly tiled in vibrant colors, and the beguiling scents of perfumes from the Levant hang in the air.
<<case "Chinese Revivalist">>
	is gloomy and hot, filled with an oppressive steam that immediately dulls the senses. Though relaxation is possible and indeed easy here, it is a stultifying relaxation whose humid warmth seems to suppress independence.
<<case "Chattel Religionist">>
	is dedicated to the purification of the body and the spirit. The pools are arranged for the completion of self-purification procedures which include ritual masturbation.
<<case "Degradationist">>
	is utilitarian. There are waterproof cameras positioned throughout the spa so that anyone who wants to can watch the nude slaves. One wall has a screen showing the current viewer count to keep the slaves aware of this.
<<case "Asset Expansionist">>
	is utilitarian. It is equipped with all sorts of devices to help slaves care for huge assets, including lifts to help them in and out of the water, and all around showers to help clean and moisturize difficult to reach spots.
<<case "Transformation Fetishist">>
	is utilitarian. It is equipped with special devices to help speed surgical recovery, including a series of baths designed to prevent scarring.
<<case "Repopulation Focus">>
	is comfortable, with waterproof cushions lining the pools. It is equipped with all sorts of devices to aid pregnant slaves, including lifts to help them in and out of the water, baths just for their feet, and all around showers to help clean and moisturize difficult to reach spots.
<<case "Eugenics">>
	is comfortable, albeit split in half. One side for the lower classes' slaves, and the other for the elite and their pets.
<<case "Gender Radicalist">>
	is comfortable, with waterproof cushions lining the pools. There are screens on the walls showing slave girls with all different varieties of genitalia orgasming from penetration, to keep the idea at the forefront of the slaves' minds.
<<case "Gender Fundamentalist">>
	is comfortable, with waterproof cushions lining the pools. There are screens on the walls showing light entertainment featuring a lot of beautiful women and handsome men for the slaves' edification.
<<case "Physical Idealist">>
	is not the gym, but it does have some workout equipment, mostly low-impact machines designed to speed recovery. There are special hot baths to ease sore muscles.
<<case "Supremacist">>
	is comfortable, with waterproof cushions lining the pools. There are screens on the walls showing light entertainment featuring $arcologies[0].FSSupremacistRace main characters.
<<case "Subjugationist">>
	is comfortable, with waterproof cushions lining the pools. There are screens on the walls showing light entertainment featuring $arcologies[0].FSSubjugationistRace characters in comic relief roles.
<<case "Paternalist">>
	is comfortable, with waterproof cushions lining the pools. There are screens on the walls showing light entertainment written by and intended for smart, loyal slaves.
<<case "Pastoralist">>
	is utilitarian. It is equipped with all sorts of devices to help slaves care for huge assets, including lifts to help them in and out of the water, and all around showers to help clean and moisturize difficult to reach spots.
<<case "Maturity Preferentialist">>
	is comfortable, but surprisingly businesslike. It's all about beautification here; there's a bewildering array of mud baths, resting pools, and massage setups, all designed to keep mature slaves looking their very best.
<<case "Youth Preferentialist">>
	is comfortable and fun. There are hot tubs and massage tables for slaves who feel like relaxing, but there's also a colder pool with pool toys for girls who want to play. It even has a small waterslide.
<<case "Body Purist">>
	is comfortable, with waterproof cushions lining the pools. Everything is designed for the slaves' comfort; there are even special mud baths to perfect skin clarity.
<<case "Slimness Enthusiast">>
	is comfortable, with waterproof cushions lining the pools. Everything is designed for the slaves' comfort; there are even special mud baths to perfect skin clarity.
<<case "Hedonistic">>
	is comfortable, with waterproof cushions lining the pools. It is equipped with all sorts of devices to aid hefty slaves, including lifts to help them in and out of the water, specialized moisturizers to keep their skin healthy and smooth, and all around showers to help clean difficult to reach spots and between folds. <<if $arcologies[0].FSHedonisticDecadenceResearch == 1>>Platters of food and treats are readily available around the tubs so that relaxing slaves never have to strain to grab a bite to eat<<else>>Feeders connected to the slave food reserves line the pools so that so that relaxing slaves never have to strain to suck down their fill of food<</if>>.
<<default>>
	is well-appointed, with massage tables, hot tubs, and a cold pool.
<</switch>>

<<if $spaSlaves > 3>>
	It's busy in here. Slaves are relaxing in the warm water, splashing around or just floating. Here and there some of the more sex-starved are in the early stages of intercourse, but most prefer to take time off from it all.
<<elseif $spaSlaves > 0>>
	It's sparsely populated; though the few slaves here have little company they like having the water to themselves.
<<elseif $Attendant != 0>>
	<<setLocalPronouns $Attendant>>
	$Attendant.slaveName is alone here, and has nothing to do but keep the place (and $his own soft, wet body) spotlessly clean.
<<else>>
	It's empty and quiet. [[Decommission the Spa|Main][$spa = 0, $spaDecoration = "standard", $spaUpgrade = 0, $spaFix = 0]]
<</if>>

<<if $spaSlaves > 0>>
	<<if $Attendant != 0>><<set _X = 1>><<else>><<set _X = 0>><</if>>
	<<set _NewPop = $spaSlaves+$dormitoryPopulation+_X>>
	<<link "Remove all slaves" "Spa">>
		<<if $Attendant != 0>>
			<<= assignJob($Attendant, "rest")>>
		<</if>>
		<<for $spaSlaves > 0>>
			<<= assignJob($slaves[$slaveIndices[$SpaiIDs[0]]], "rest")>>
		<</for>>
	<</link>>
	<<if _NewPop > $dormitory>>
		@@.red;Dormitory capacity will be exceeded.@@
	<</if>>
<</if>>

<<set _Tmult0 = Math.trunc($spa*1000*$upgradeMultiplierArcology)>>

$spaNameCaps can house $spa slaves while they recuperate here. Currently $spaSlaves <<if $spaSlaves == 1>>is<<else>>are<</if>> recuperating.
[[Expand the spa|Spa][cashX(forceNeg(_Tmult0), "capEx"), $spa += 5]] //Costs <<print cashFormat(_Tmult0)>>//

<<if $spaUpgrade == 1>>
	$spaNameCaps has been upgraded with state of the art temperature treatment options, from hot and cold mineral water pools to baking saunas and dense steam rooms.
<<else>>
	<<set _Tmult1 = Math.trunc($spa*1000*$upgradeMultiplierArcology)>>
	$spaNameCaps is a standard spa. [[Upgrade the spa with saunas, steam rooms, and mineral water baths|Spa][cashX(forceNeg(_Tmult1), "capEx"), $spaUpgrade = 1]] //Costs <<print cashFormat(_Tmult1)>>//
<</if>>

<<if $Attendant != 0>>
<<setLocalPronouns $Attendant>>

<<if $spaFix == 2>>
	$Attendant.slaveName is focusing only on the health and wellness of the slaves under $his care, obeying your orders to avoid attempting to right mental flaws.
	[["Order " + $him + " to only fix mindbroken slaves"|Spa][$spaFix = 1]] |
	[["Let " + $him + " tend as she " + $he + " fit"|Spa][$spaFix = 0]]
<<elseif $spaFix == 1>>
	$Attendant.slaveName is focusing on the health and wellness of the slaves under $his care, as well as trying to bring mindbroken slaves back, while ignoring any mental hang-ups a slave may have.
	[["Order " + $him + " to not fix flaws"|Spa][$spaFix = 2]] |
	[["Let " + $him + " tend as " + $he + " sees fit"|Spa][$spaFix = 0]]
<<else>>
	$Attendant.slaveName is not following any special orders and is tending to your slaves as $he sees fit.
	[["Order " + $him + " to not fix any flaws"|Spa][$spaFix = 2]] |
	[["Order " + $him + " to only fix mindbroken slaves"|Spa][$spaFix = 1]]
<</if>>
<</if>>

<<if $Attendant != 0>>
	<<set $Flag = 2>>
	<<include "Slave Summary">>
<<else>>
	You do not have a slave serving as a spa Attendant. [[Appoint one|Attendant Select]]
<</if>>

<<if ($spa <= $spaSlaves)>>
	''$spaNameCaps is full and cannot hold any more slaves''
<<elseif ($slaves.length > $spaSlaves)>>
	<<link "''Let an obedient slave rest in $spaName''">>
		<<replace #ComingGoing>>
			<<resetAssignmentFilter>>
			<<set $Flag = 0>>
			<<include "Slave Summary">>
		<</replace>>
	<</link>>
<</if>>

<<if $spaSlaves > 0>>
	| <<link "''Prise a slave out of $spaName''">>
		<<replace #ComingGoing>>
			<<spaAssignmentFilter>>
			<<set $Flag = 1>>
			<<include "Slave Summary">>
			<<resetAssignmentFilter>>
		<</replace>>
	<</link>>
<<else>>

//$spaNameCaps is empty at the moment.
//
<</if>>

	<<spaAssignmentFilter>>
	<<set $Flag = 1>>
	<<include "Slave Summary">>
	<<resetAssignmentFilter>>

Rename $spaName: <<textbox "$spaName" $spaName "Spa">> //Use a noun or similar short phrase//


code:
:: Spa Report [nobr]

<<SlaveSort $SpaiIDs>>
<<set _DL = $SpaiIDs.length, $spaSlaves = _DL, _SL = $slaves.length, _bonusToggle = 0, _healthBonus = 0, _idleBonus = 0, _restedSlaves = 0, _trustBonus = 0>>

<<if $spaDecoration != "standard">>
	<<set _devBonus = 1>>
<<else>>
	<<set _devBonus = 0>>
<</if>>

<<if $Attendant != 0>>
	<<set _FLs = $slaveIndices[$Attendant.ID]>>

	<<if ($slaves[_FLs].health < 100)>>
		<<set $slaves[_FLs].health += 20>>
	<</if>>
	<<if ($slaves[_FLs].devotion <= 60)>>
		<<set $slaves[_FLs].devotion++>>
	<</if>>
	<<if $slaves[_FLs].trust < 60>>
		<<set $slaves[_FLs].trust++>>
	<</if>>
	<<if $slaves[_FLs].livingRules != "luxurious">>
		<<set $slaves[_FLs].livingRules = "luxurious">>
	<</if>>
	<<set _FLsFetish = 0>>
	<<if $slaves[_FLs].fetishStrength <= 95>>
		<<if $slaves[_FLs].fetish != "submissive">>
			<<if fetishChangeChance($slaves[_FLs]) > random(0,100)>>
				<<set _FLsFetish = 1, $slaves[_FLs].fetishKnown = 1, $slaves[_FLs].fetish = "submissive">>
			<</if>>
		<<elseif $slaves[_FLs].fetishKnown == 0>>
			<<set _FLsFetish = 1, $slaves[_FLs].fetishKnown = 1>>
		<<else>>
			<<set _FLsFetish = 2, $slaves[_FLs].fetishStrength += 4>>
		<</if>>
	<</if>>
	<<if ($Attendant.fetish == "none") || ($Attendant.fetish == "submissive")>>
		<<set _devBonus++>>
	<</if>>
	<<set $slaves[_FLs].devotion += _devBonus, $Attendant = $slaves[_FLs]>>
	<<setLocalPronouns $Attendant>>
	    <<= SlaveFullName($Attendant)>> is serving as the spa attendant.<<if $Attendant.relationship == -3 && $Attendant.devotion > 50>> $He tries $his best to be your perfect attentive, caring and loving wife.<</if>>
	<<if (_FLsFetish == 1)>>
		When $he is paid a visit by a slave with sexual issues to work out, $he provides her with an understanding, willing, giving partner. $He finds real satisfaction in helping your slaves find sexual gratification, and @@.lightsalmon;becomes a submissive.@@
	<<elseif (_FLsFetish == 2)>>
		Every new slave in the spa is a new girl $he gets to connect with and serve. Sexually. @@.lightsalmon;$He becomes more submissive.@@
	<</if>>
	<<if setup.attendantCareers.includes($Attendant.career)>>
		$He has experience with counseling from $his life before $he was a slave, making $him better at building rapport with troubled slaves, and giving $him a better chance of softening flaws into beneficial quirks.
		<<set _bonusToggle = 1, _idleBonus++>>
	<<elseif $Attendant.skillAT >= $masteredXP>>
		$He has experience with counseling from working for you, making $him better at building rapport with troubled slaves, and giving $him a better chance of softening flaws into beneficial quirks.
		<<set _bonusToggle = 1, _idleBonus++>>
	<<else>>
		<<set $slaves[_FLs].skillAT += random(1,Math.ceil(($Attendant.intelligence+$Attendant.intelligenceImplant)/15) + 8)>>
	<</if>>
	<<if ($Attendant.eyes == -2)>>
		$His blindness allows $him to deeply connect with $his girls.
		<<set _idleBonus++>>
	<</if>>
	<<if ($Attendant.fetish == "none")>>
		$Attendant.slaveName respects the slaves lounging in the spa, allowing them to relax completely.
		<<set _idleBonus++>>
	<<elseif ($Attendant.fetish == "submissive")>>
		$Attendant.slaveName lets the slaves resting in the spa take the lead sexually, doing $his best to please them.
		<<set _idleBonus++>>
	<<elseif ($Attendant.fetishKnown == 1)>>
		$Attendant.slaveName can't keep $his hands to $himself, preventing the slaves in the spa from relaxing completely.
	<</if>>
	<<if ($Attendant.visualAge > 35)>>
		$His apparent maturity encourages the slaves in the spa to relax and pour out their troubles to $him.
		<<set _healthBonus++, _idleBonus++>>
	<</if>>
	<<if ($Attendant.intelligence+$Attendant.intelligenceImplant > 15)>>
		$He's so intelligent $he can suss out the cause of slaves' emotional issues and counsel them effectively.
		<<set _idleBonus++>>
	<</if>>
	<<if isFertile($Attendant) || ($Attendant.bellyPreg >= 1500) || ($Attendant.birthsTotal > 0) || ($Attendant.bellyImplant >= 1500)>>
		$He has a natural mothering instinct and really makes $his girls feel at home.
		<<set _idleBonus++, _healthBonus++>>
	<</if>>
	<<set _attendantUsedCure = 0>>
	<<for _dI = 0; _dI < _DL; _dI++>>
		<<set $i = $slaveIndices[$SpaiIDs[_dI]]>>
		<<setLocalPronouns $slaves[$i] 2>>
		<<if ($slaves[$i].fetish == "mindbroken") && ($slaves[$i].health > 20) && (_attendantUsedCure == 0) && ($spaFix != 2)>>
			<<set _attendantUsedCure = 1>>
			<<if (random(1,100) > 90-$Attendant.devotion)>>

    @@.green;Something almost miraculous has happened.@@ $Attendant.slaveName has always refused to believe that $slaves[$i].slaveName could not be reached, and has lavished patient tenderness on _him2 in $spaName. $slaves[$i].slaveName has begun to respond, and is stirring from _his2 mental torpor.
				<<set $slaves[$i].devotion = -3, $slaves[$i].sexualFlaw = "apathetic", $slaves[$i].behavioralFlaw = either("hates men", "odd"), $slaves[$i].fetish = "none", $slaves[$i].fetishKnown = 1>>
				<<set _spr = $genePool.findIndex(function(s) { return s.ID == $slaves[$i].ID; })>>
				<<if $genePool[_spr].intelligence >= -95>>
					<<set $slaves[$i].intelligence = $genePool[_spr].intelligence-30>>
				<</if>>
				<<if ($arcologies[0].FSPaternalist > 0)>>
					Society @@.green;strongly approves@@ of $slaves[$i].slaveName being restored to sanity, which advances ideals about enlightened slaveownership.
					<<set $repGain += 2*$FSSingleSlaveRep*($arcologies[0].FSPaternalist/$FSLockinLevel), $arcologies[0].FSPaternalist += 0.01*$FSSingleSlaveRep>>
				<</if>>
			<</if>>
		<</if>>
		<<set _seed = _bonusToggle * 10>>
		<<if _bonusToggle == 1 && $slaves[$i].trust < 60>>
			<<set $slaves[$i].trust++>>
		<</if>>
		<<if $Attendant.rivalryTarget == $slaves[$i].ID>>
			$He constantly harasses $his <<print rivalryTerm($Attendant)>>, $slaves[$i].slaveName, preventing _him2 from getting comfortable and forcing _him2 to keep _his2 guard up.
			<<set $slaves[$i].devotion -= 4, $slaves[$i].trust -= 4>>
			<<if random(1,100) > 35>>
				<<set $Attendant.rivalry++, $slaves[_FLs].rivalry++, $slaves[$i].rivalry++>>
			<</if>>
		<<elseif $Attendant.relationshipTarget == $slaves[$i].ID>>
			$He dedicates most of $his attention to $his <<print relationshipTerm($Attendant)>>, $slaves[$i].slaveName, making _his2 stress, both physical and mental, wash away.
			<<set $slaves[$i].devotion += 3, $slaves[$i].trust += 3>>
		<<elseif $familyTesting == 1 && areRelated($Attendant, $slaves[$i]) > 0>>
			$He makes sure to spend extra time caring for $his <<print relativeTerm($Attendant.ID,$slaves[$i].ID)>>, $slaves[$i].slaveName.
			<<set $slaves[$i].trust++, $slaves[$i].health++>>
		<<elseif $Attendant.relationTarget == $slaves[$i].ID && $familyTesting == 0>>
			$He makes sure to spend extra time caring for $his $slaves[$i].relation, $slaves[$i].slaveName.
			<<set $slaves[$i].trust++>>
		<</if>>
		<<switch $slaves[$i].prestigeDesc>>
		<<case "She is a famed Free Cities whore, and commands top prices.">>
			$He does $his best to relax the famous whore, $slaves[$i].slaveName, making sure to
			<<if $slaves[$i].vagina > 2 || $slaves[$i].anus > 2>>
				pay special attention to _his2 worn holes.
			<<else>>
				get _him2 clean and relaxed for _his2 next usage.
			<</if>>
			<<set $slaves[$i].devotion += 3, $slaves[$i].trust += 3>>
		<<case "She is a famed Free Cities slut, and can please anyone.">>
			$He does $his best to soothe the famous entertainer, $slaves[$i].slaveName, letting _him2 relax in blissful peace.
			<<set $slaves[$i].devotion += 3, $slaves[$i].trust += 3>>
		<<case "She is remembered for winning best in show as a cockmilker.">>
			<<if ($slaves[$i].balls > 6) && ($slaves[$i].dick != 0)>>
				<<if $Attendant.fetish == "cumslut">>
					$He can't keep $his hands off $slaves[$i].slaveName's cock and balls, but _he2 doesn't mind being milked constantly. Before long, strands of cum can be found floating all throughout the bath.
					<<set $Attendant.fetishStrength += 4, $slaves[_FLs].fetishStrength += 4>>
				<<else>>
					$He does $his best to accommodate $slaves[$i].slaveName's massive genitals and tends to _him2 whenever _he2 feels a need for release.
					<<if random(1,100) > 65 && $Attendant.fetish == "none">>
						After taking several massive loads to the face, $Attendant.slaveName begins to find satisfaction in being coated in cum.
						<<set $Attendant.fetish = "cumslut", $slaves[_FLs].fetish = "cumslut">>
					<</if>>
				<</if>>
			<</if>>
			<<set $slaves[$i].devotion += 3, $slaves[$i].trust += 3>>
		<<case "She is remembered for winning best in show as a dairy cow.">>
			<<if ($slaves[$i].lactation > 0) && (($slaves[$i].boobs-$slaves[$i].boobsImplant) > 6000)>>
				<<if $Attendant.fetish == "boobs">>
					$He can't keep $his hands off $slaves[$i].slaveName's huge breasts, but _he2 doesn't mind being milked constantly. Before long the bath gains a white tint.
					<<set $Attendant.fetishStrength += 4, $slaves[_FLs].fetishStrength += 4>>
				<<else>>
					$He does $his best to accommodate $slaves[$i].slaveName's massive breasts and tends to _him2 whenever _he2 feels a need for release.
					<<if random(1,100) > 65 && $Attendant.fetish == "none">>
						After multiple milking sessions, $Attendant.slaveName begins to find $himself fantasizing about having giant milky breasts too.
						<<set $Attendant.fetish = "boobs", $slaves[_FLs].fetish = "boobs">>
					<</if>>
				<</if>>
				<<set $slaves[$i].devotion += 3, $slaves[$i].trust += 3, $slaves[$i].lactationDuration = 2, $slaves[$i].boobs -= $slaves[$i].boobsMilk, $slaves[$i].boobsMilk = 0>>
			<</if>>
		<<case "She is remembered for winning best in show as a breeder.">>
			<<if $slaves[$i].bellyPreg >= 5000>>
				<<if $Attendant.fetish == "pregnancy">>
					$He can't keep $his hands off $slaves[$i].slaveName's pregnancy, but _he2 doesn't mind _his2 full belly being fondled.
					<<set $Attendant.fetishStrength += 4, $slaves[_FLs].fetishStrength += 4>>
				<<else>>
					$He does $his best to accommodate $slaves[$i].slaveName's pregnancy and to make sure the mother-to-be is happy and comfortable.
					<<if random(1,100) > 65 && $Attendant.fetish == "none">>
						After massaging $slaves[$i].slaveName's growing belly multiple times, $Attendant.slaveName begins to find $himself fantasizing about being swollen with life too.
						<<set $Attendant.fetish = "pregnancy", $slaves[_FLs].fetish = "pregnancy">>
					<</if>>
				<</if>>
				<<set $slaves[$i].devotion += 3, $slaves[$i].trust += 3>>
			<<else>>
				<<if $Attendant.fetish == "pregnancy">>
					$He can't help but pester $slaves[$i].slaveName with questions about _his2 famous pregnancy, limiting _his2 ability to truly relax.
					<<set $slaves[$i].devotion += 1, $slaves[$i].trust += 1>>
				<<elseif canGetPregnant($slaves[$i])>>
					$He does $his best to encourage $slaves[$i].slaveName's fertilization by performing any fertility boosting actions $he can.
					<<set $slaves[$i].devotion += 3, $slaves[$i].trust += 3>>
				<</if>>
			<</if>>
		<</switch>>
		<<if ($Attendant.intelligence+$Attendant.intelligenceImplant > 15) && (_attendantUsedCure == 0) && (($Attendant.intelligence+$Attendant.intelligenceImplant)+_seed) > random(1,200) && ($spaFix == 0)>>
			<<if $slaves[$i].behavioralFlaw != "none">>
				<<run SoftenBehavioralFlaw($slaves[$i])>>
				<<set _attendantUsedCure += 1>>

    $Attendant.slaveName works carefully with $slaves[$i].slaveName, and successfully @@.green;softens _his2 behavioral flaw@@ into an appealing quirk.
			<<elseif $slaves[$i].sexualFlaw != "none">>
				<<run SoftenSexualFlaw($slaves[$i])>>
				<<set _attendantUsedCure += 1>>

    $Attendant.slaveName works carefully with $slaves[$i].slaveName, and successfully @@.green;softens _his2 sexual flaw@@ into an appealing quirk.
			<</if>>
		<</if>>
		<<if $slaves[$i].lactation > 0>>
			$Attendant.slaveName takes care to keep $slaves[$i].slaveName's breasts comfortably drained.
			<<set $slaves[$i].lactationDuration = 2, $slaves[$i].boobs -= $slaves[$i].boobsMilk, $slaves[$i].boobsMilk = 0>>
		<</if>>
	<</for>>
	<<if (_DL < $spa)>>
		<<set _seed = random(1,10)+(($spa-_DL)*(random(150,170)+(_idleBonus*10)))>>
		<<run cashX(_seed, "spa", $Attendant)>>

    Since $he doesn't have enough girls to occupy all $his time, the spa takes in citizens' slaves on a contract basis and $he helps them too, earning @@.yellowgreen;<<print cashFormat(_seed)>>.@@
		<<if ($arcologies[0].FSHedonisticDecadence > 0) && (_DL == 0)>>
			Society @@.green;loves@@ being allowed to lounge in your spa, greatly advancing your laid back culture.
			<<= FSChange("Hedonism", 2)>>
		<</if>>
	<</if>>
	<<if (_DL > 0)>>

<</if>>
<</if>>

<<if (_DL > 0)>>
	    ''<<if (_DL > 1)>>There are _DL slaves<<else>>There is one slave<</if>> resting and recuperating in the spa.''
	<<if ($arcologies[0].FSHedonisticDecadence > 0) && (_DL == 0)>>
		Society @@.green;approves@@ of your slaves being pampered this way, greatly advancing your laid back culture.
		<<= FSChange("Hedonism", 1)>>
	<</if>>
<</if>>

<<if $Attendant != 0>>
	<<set $i = _FLs>> /* apply following SA passages to facility leader */
	<<if $showEWD != 0>>

		/* 000-250-006 */
		<<if $seeImages && $seeReportImages>>

			<<SlaveArt $slaves[_FLs] 0 0>>

		<</if>>
		/* 000-250-006 */
		''__@@.pink;<<= SlaveFullName($slaves[$i])>>@@__'' is serving as the Attendant in $spaName.

		<<= saChoosesOwnClothes($slaves[$i])>>
		<<include "SA rules">>
		<<include "SA diet">>
		<<include "SA long term effects">>
		<<include "SA drugs">>
		<<include "SA relationships">>
		<<include "SA rivalries">>

<<include "SA devotion">>
	<<else>>
		<<silently>>
		<<set _chosenClothes = saChoosesOwnClothes($slaves[$i])>>
		<<include "SA rules">>
		<<include "SA diet">>
		<<include "SA long term effects">>
		<<include "SA drugs">>
		<<include "SA relationships">>
		<<include "SA rivalries">>
		<<include "SA devotion">>
		<</silently>>
	<</if>>
	<<set $Attendant = $slaves[_FLs]>>
<</if>>

<<for _dI = 0; _dI < _DL; _dI++>>
	<<set $i = $slaveIndices[$SpaiIDs[_dI]]>>
	<<setLocalPronouns $slaves[$i] 2>>
	<<set $slaves[$i].devotion += _devBonus, $slaves[$i].trust += _trustBonus, $slaves[$i].health += _healthBonus>>
	<<if ($slaves[$i].devotion < 60) && ($slaves[$i].trust < 60)>>
		<<set $slaves[$i].devotion++, $slaves[$i].trust++>>
	<<elseif ($slaves[$i].trust < 40)>>
		<<set $slaves[$i].trust += 10>>
	<<elseif ($slaves[$i].devotion < 40)>>
		<<set $slaves[$i].devotion += 10>>
	<</if>>
	<<if ($spaUpgrade == 1) && ($slaves[$i].health < 20)>>
		<<set $slaves[$i].health += 3>>
	<</if>>
	<<switch $spaDecoration>>
	<<case "Chattel Religionist" "Chinese Revivalist">>
		<<set $slaves[$i].livingRules = "normal">>
	<<case "Degradationist">>
		<<set $slaves[$i].livingRules = "spare">>
	<<default>>
		<<set $slaves[$i].livingRules = "luxurious">>
	<</switch>>
	<<if ($slaves[$i].health >= 20) && ($slaves[$i].trust > 60) && ($slaves[$i].devotion > 60) && ($slaves[$i].fetish != "mindbroken") && ($slaves[$i].sexualFlaw == "none") && ($slaves[$i].behavioralFlaw == "none")>>

''__@@.pink;$slaves[$i].slaveName@@__'' is feeling well enough to leave $spaName, so @@.yellow;_his2 assignment has defaulted to rest@@.
		<<= removeJob($slaves[$i], "rest in the spa")>>
		<<set _restedSlaves++, _DL--, _dI-->>
		<<continue>>
	<</if>>
	<<if $showEWD != 0>>

		/* 000-250-006 */
		<<if $seeImages && $seeReportImages>>

			<<SlaveArt $slaves[$i] 0 0>>

		<</if>>
		/* 000-250-006 */
		''__@@.pink;<<= SlaveFullName($slaves[$i])>>@@__''
		<<if $slaves[$i].choosesOwnAssignment == 2>>
			<<include "SA chooses own job">>
		<<else>>
			is resting in $spaName.
		<</if>>

    _He2 <<= saRest($slaves[$i])>>

		<<= saChoosesOwnClothes($slaves[$i])>>
		<<include "SA rules">>
		<<include "SA diet">>
		<<include "SA long term effects">>
		<<include "SA drugs">>
		<<include "SA relationships">>
		<<include "SA rivalries">>

<<include "SA devotion">>
	<<else>>
		<<silently>>
		<<include "SA chooses own job">>
		<<set _chosenClothes = saChoosesOwnClothes($slaves[$i])>>
		<<set _dump = saRest($slaves[$i])>>
		<<include "SA rules">>
		<<include "SA diet">>
		<<include "SA long term effects">>
		<<include "SA drugs">>
		<<include "SA relationships">>
		<<include "SA rivalries">>
		<<include "SA devotion">>
		<</silently>>
	<</if>>
<</for>>
<<if (_restedSlaves > 0)>>

	<<if (_restedSlaves == 1)>>
		One slave has rested until she reached a state of @@.hotpink;devotion@@ and @@.mediumaquamarine;trust@@ and will leave the spa before the end of the week.
	<<else>>
		_restedSlaves slaves have rested until they reached a state of @@.hotpink;devotion@@ and @@.mediumaquamarine;trust@@ and will leave the spa before the end of the week.
	<</if>>
	<<if $spaDecoration != "standard">>

    $spaNameCaps's $spaDecoration atmosphere @@.hotpink;had an impact on <<if _restedSlaves == 1>>her while she was<<else>>them while they were<</if>>@@ resting.
	<</if>>
<</if>>
<<if _DL > 0 || $Attendant != 0>>

<</if>>