:: extended family widgets [nobr widget]

<<widget "Family">>

/*testtest PC parent passage - determines if the current slave is your mother or father*/
<<if $activeSlave.ID == $PC.mother && $activeSlave.ID == $PC.father>>
	She @@.lightgreen;is both your mother and father, $pronoun impregnated <<print $object>>self with you.@@
<<elseif $activeSlave.ID == $PC.mother>>
	$pronounCap @@.lightgreen;is your mother.@@
<<elseif $activeSlave.ID == $PC.father>>
	$pronounCap @@.lightgreen;is your father.@@
<</if>>

<<if $activeSlave.father == -1 && $activeSlave.mother == -1>>
	$pronounCap's @@.lightgreen;your child;@@ you knocked yourself up and gave birth to $object.
<</if>>

<<if $activeSlave.father == -1 && $activeSlave.mother != -1>>
	$pronounCap's @@.lightgreen;your child;@@ you knocked $possessive mother up.
<<elseif $activeSlave.father > 0>>
	<<for $i = 0; $i < $slaves.length; $i++>>
		<<if $slaves[$i].ID == $activeSlave.father>>
			$pronounCap was @@.lightgreen;fathered by $slaves[$i].slaveName's@@ virile dick.
			<<break>>
		<</if>>
	<</for>>
<</if>>

<<if $activeSlave.father != -1 && $activeSlave.mother == -1>>
	$pronounCap's @@.lightgreen;your child;@@ you gave birth to $object.
<<elseif $activeSlave.mother > 0>>
	<<for $i = 0; $i < $slaves.length; $i++>>
		<<if $slaves[$i].ID == $activeSlave.mother>>
			$pronounCap was @@.lightgreen;born from $slaves[$i].slaveName's@@ fertile womb.
			<<break>>
		<</if>>
	<</for>>
<</if>>

<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $activeSlave.ID == $slaves[$i].father>>
		<<set $children.push($slaves[$i])>>
	<</if>>
<</for>>
<<if $children.length > 2>>
	$pronounCap @@.lightgreen;fathered
	<<for $j to 0; $j < $children.length; $j++>>
		<<if $j < $children.length-1>>
			$children[$j].slaveName,
		<<else>>
			and $children[$j].slaveName.@@
		<</if>>
	<</for>>
<<elseif $children.length > 1>>
	$pronounCap @@.lightgreen;fathered a pair of your slaves: $children[0].slaveName, and $children[1].slaveName.@@
<<elseif $children.length > 0>>
	$pronounCap @@.lightgreen;fathered a single slave of yours: $children[0].slaveName.@@
<</if>>
<<set $children = []>>

<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $activeSlave.ID == $slaves[$i].mother>>
		<<set $children.push($slaves[$i])>>
	<</if>>
<</for>>
<<if $children.length > 2>>
	$pronounCap @@.lightgreen;gave birth to
	<<for $j to 0; $j < $children.length; $j++>>
		<<if $j < $children.length-1>>
			$children[$j].slaveName,
		<<else>>
			and $children[$j].slaveName.@@
		<</if>>
	<</for>>
<<elseif $children.length > 1>>
	$pronounCap @@.lightgreen;gave birth to a pair of your slaves: $children[0].slaveName, and $children[1].slaveName.@@
<<elseif $children.length > 0>>
	$pronounCap @@.lightgreen;gave birth to a single of your slaves: $children[0].slaveName.@@
<</if>>
<<set $children = []>>


/*testtest maternal grandma passage - determines if the current slave has a maternal grandmother*/
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].ID != $activeSlave.ID && $slaves[$i].ID == $activeSlave.mother>>
		<<for $j to 0; $j < $slaves.length; $j++>>
			<<if $slaves[$j].ID != $activeSlave.ID && $slaves[$j].ID != $slaves[$i].ID && $slaves[$j].ID == $slaves[$i].mother>>
				$possessiveCap maternal @@.lightgreen;grandmother is $slaves[$j].slaveName.@@
			<</if>>
		<</for>>
	<<elseif $PC.ID == $activeSlave.mother && $slaves[$i].ID == $PC.mother>>
		$possessiveCap maternal @@.lightgreen;grandmother is $slaves[$i].slaveName.@@
	<</if>>
<</for>>

/*testtest maternal grandpa passage - determines if the current slave has a maternal grandfather*/
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].ID != $activeSlave.ID && $slaves[$i].ID == $activeSlave.mother>>
		<<for $j to 0; $j < $slaves.length; $j++>>
			<<if $slaves[$j].ID != $activeSlave.ID && $slaves[$j].ID != $slaves[$i].ID && $slaves[$j].ID == $slaves[$i].father>>
				$possessiveCap maternal @@.lightgreen;grandfather is $slaves[$j].slaveName.@@
			<</if>>
		<</for>>
	<<elseif $PC.ID == $activeSlave.mother && $slaves[$i].ID == $PC.father>>
		$possessiveCap maternal @@.lightgreen;grandfather is $slaves[$i].slaveName.@@
	<</if>>
<</for>>

/*testtest paternal grandma passage - determines if the current slave has a paternal grandmother*/
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].ID != $activeSlave.ID && $slaves[$i].ID == $activeSlave.father>>
		<<for $j to 0; $j < $slaves.length; $j++>>
			<<if $slaves[$j].ID != $activeSlave.ID && $slaves[$j].ID != $slaves[$i].ID && $slaves[$j].ID == $slaves[$i].mother>>
				$possessiveCap paternal @@.lightgreen;grandmother is $slaves[$j].slaveName.@@
			<</if>>
		<</for>>
	<<elseif $PC.ID == $activeSlave.father && $slaves[$i].ID == $PC.mother>>
		$possessiveCap paternal @@.lightgreen;grandmother is $slaves[$i].slaveName.@@
	<</if>>
<</for>>

/*testtest paternal grandpa passage - determines if the current slave has a paternal grandfather*/
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].ID != $activeSlave.ID && $slaves[$i].ID == $activeSlave.father>>
		<<for $j to 0; $j < $slaves.length; $j++>>
			<<if $slaves[$j].ID != $activeSlave.ID && $slaves[$j].ID != $slaves[$i].ID && $slaves[$j].ID == $slaves[$i].father>>
				$possessiveCap paternal @@.lightgreen;grandfather is $slaves[$j].slaveName.@@
			<</if>>
		<</for>>
	<<elseif $PC.ID == $activeSlave.father && $slaves[$i].ID == $PC.father>>
		$possessiveCap paternal @@.lightgreen;grandfather is $slaves[$i].slaveName.@@
	<</if>>
<</for>>

/*testtest PC grandparents passage - determines if the current slave is your grandparent*/
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].ID != $activeSlave.ID>>
	<<if $activeSlave.ID == $slaves[$i].mother && $slaves[$i].ID == $PC.mother && $activeSlave.ID == $slaves[$i].father && $slaves[$i].ID == $PC.father>>
		$pronounCap is @@.lightgreen;your grandparent.@@ $pronounCap impregnated <<print $object>>self with your mother/father who in turn impregnated themselves with you.
	<<elseif $activeSlave.ID == $slaves[$i].mother>>
		<<if $slaves[$i].ID == $PC.mother>>
			$pronounCap is @@.lightgreen;your maternal grandmother.@@
		<<elseif $slaves[$i].ID == $PC.father>>
			$pronounCap is @@.lightgreen;your paternal grandmother.@@
		<</if>>
	<<elseif $activeSlave.ID == $slaves[$i].father>>
		<<if $slaves[$i].ID == $PC.mother>>
			$pronounCap is @@.lightgreen;your maternal grandfather.@@
		<<elseif $slaves[$i].ID == $PC.father>>
			$pronounCap is @@.lightgreen;your paternal grandfather.@@
		<</if>>
	<</if>>
	<</if>>
<</for>>

/*testtest grandchild passage - determines how many grandchildren the current slave has*/
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].ID != $activeSlave.ID>>
	<<if $activeSlave.ID == $slaves[$i].mother or $activeSlave.ID == $slaves[$i].father>>
		<<for $j to 0; $j < $slaves.length; $j++>>
			<<if $slaves[$i].ID != $slaves[$j].ID>>
			<<if $slaves[$i].ID == $slaves[$j].mother or $slaves[$i].ID == $slaves[$j].father>>
				<<set $children.push($slaves[$j])>>
			<</if>>
			<</if>>
		<</for>>
	<</if>>
	<</if>>
<</for>>
<<if $children.length > 0>>
	$pronounCap
<<if $children.length > 2>>
	has @@.lightgreen;many grandchildren,
	<<for $j to 0; $j < $children.length; $j++>>
		<<if $j < $children.length-1>>
			$children[$j].slaveName,
		<<else>>
			and $children[$j].slaveName amongst your slaves.@@
		<</if>>
	<</for>>
<<elseif $children.length > 1>>
	has @@.lightgreen;two grandchildren, $children[0].slaveName, and $children[1].slaveName as your slaves.@@
<<elseif $children.length > 0>>
	has a @@.lightgreen;grandchild, $children[0].slaveName as your slave.@@
<</if>>
<</if>>
<<set $children = []>>

/*testtest PC aunt passage - determines how many aunts you have*/
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].ID != $activeSlave.ID>>
	<<if areSisters($slaves[$i], $activeSlave) == 1 ||  areSisters($slaves[$i], $activeSlave) == 2>>
	<<if $slaves[$i].ID == $PC.mother || $slaves[$i].ID == $PC.father>>
		<<for $j to 0; $j < $slaves.length; $j++>>
			<<if $slaves[$i].ID != $slaves[$j].ID >>
			<<if $slaves[$j].genes == "XX">>
			<<if areSisters($slaves[$j], $activeSlave) == 1 ||  areSisters($slaves[$j], $activeSlave) == 2>>
				<<set $children.push($slaves[$j])>>
			<</if>>
			<</if>>
			<</if>>
		<</for>>
	<</if>>
	<</if>>
	<</if>>
<</for>>
<<if $activeSlave.genes == "XX" && $children.length > 0>>
	$pronounCap
	<<if $children.length > 2>>
		is @@.lightgreen;your aunt along with
		<<for $j to 0; $j < $children.length; $j++>>
			<<if $j < $children.length-1>>
				$children[$j].slaveName,
			<<else>>
				and $children[$j].slaveName.@@
			<</if>>
		<</for>>
	<<elseif $children.length > 1>>
		is @@.lightgreen;your aunt along with $children[0].slaveName.@@
	<<elseif $children.length > 0>>
		<<for $i = 0; $i < $slaves.length; $i++>>
			<<if $slaves[$i].ID != $activeSlave.ID && $activeSlave.genes == "XX">>
			<<if areSisters($slaves[$i], $activeSlave) == 1 ||  areSisters($slaves[$i], $activeSlave) == 2>>
			<<if $slaves[$i].ID == $PC.mother || $slaves[$i].ID == $PC.father>>
				$pronounCap is @@.lightgreen;your aunt.@@
			<</if>>
			<</if>>
			<</if>>
		<</for>>
	<</if>>
<</if>>
<<set $children = []>>

/*testtest PC uncle passage - determines how many uncles you have*/
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].ID != $activeSlave.ID>>
	<<if areSisters($slaves[$i], $activeSlave) == 1 ||  areSisters($slaves[$i], $activeSlave) == 2>>
	<<if $slaves[$i].ID == $PC.mother || $slaves[$i].ID == $PC.father>>
		<<for $j to 0; $j < $slaves.length; $j++>>
			<<if $slaves[$i].ID != $slaves[$j].ID && $slaves[$j].dick > 0 && $slaves[$j].genes == "XY">>
			<<if areSisters($slaves[$j], $activeSlave) == 1 ||  areSisters($slaves[$j], $activeSlave) == 2>>
				<<set $children.push($slaves[$j])>>
			<</if>>
			<</if>>
		<</for>>
	<</if>>
	<</if>>
	<</if>>
<</for>>
<<if $activeSlave.genes == "XY" && $children.length > 0>>
	$pronounCap
	<<if $children.length > 2>>
		is @@.lightgreen;your uncle along with
		<<for $j to 0; $j < $children.length; $j++>>
			<<if $j < $children.length-1>>
				$children[$j].slaveName,
			<<else>>
				and $children[$j].slaveName.@@
			<</if>>
		<</for>>
	<<elseif $children.length > 1>>
		is @@.lightgreen;your uncle along with $children[0].slaveName.@@
	<<elseif $children.length > 0>>
		<<for $i = 0; $i < $slaves.length; $i++>>
			<<if $slaves[$i].ID != $activeSlave.ID && $activeSlave.genes == "XY">>
			<<if areSisters($slaves[$i], $activeSlave) == 1 ||  areSisters($slaves[$i], $activeSlave) == 2>>
			<<if $slaves[$i].ID == $PC.mother || $slaves[$i].ID == $PC.father>>
				$pronounCap is @@.lightgreen;your uncle.@@
			<</if>>
			<</if>>
			<</if>>
		<</for>>
	<</if>>
<</if>>
<<set $children = []>>

/*testtest aunt passage - determines how many aunts a slave has*/
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].ID != $activeSlave.ID>>
	<<if $slaves[$i].ID == $activeSlave.mother || $slaves[$i].ID == $activeSlave.father>>
		<<for $j to 0; $j < $slaves.length; $j++>>
			<<if $slaves[$j].genes == "XX">>
			<<if areSisters($slaves[$j], $slaves[$i]) == 1 || areSisters($slaves[$j], $slaves[$i]) == 2>>
				<<set $children.push($slaves[$j])>>
			<</if>>
			<</if>>
		<</for>>
	<</if>>
	<</if>>
<</for>>
<<if $children.length > 0>>
	$pronounCap
<<if $children.length > 2>>
	has @@.lightgreen;many aunts,
	<<for $j to 0; $j < $children.length; $j++>>
		<<if $j < $children.length-1>>
			$children[$j].slaveName,
		<<else>>
			and $children[$j].slaveName.@@
		<</if>>
	<</for>>
<<elseif $children.length > 1>>
	 has @@.lightgreen;two aunts, $children[0].slaveName, and $children[1].slaveName.@@
<<elseif $children.length > 0>>
	 has @@.lightgreen;an aunt, $children[0].slaveName.@@
<</if>>
<</if>>
<<set $children = []>>

/*testtest uncle passage - determines how many uncles a slave has*/
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].ID != $activeSlave.ID>>
	<<if $slaves[$i].ID == $activeSlave.mother || $slaves[$i].ID == $activeSlave.father>>
		<<for $j to 0; $j < $slaves.length; $j++>>
			<<if $slaves[$j].genes == "XY">>
			<<if areSisters($slaves[$j], $slaves[$i]) == 1 || areSisters($slaves[$j], $slaves[$i]) == 2>>
				<<set $children.push($slaves[$j])>>
			<</if>>
			<</if>>
		<</for>>
	<</if>>
	<</if>>
<</for>>
<<if $children.length > 0>>
	$pronounCap
<<if $children.length > 2>>
	has @@.lightgreen;many aunts,
	<<for $j to 0; $j < $children.length; $j++>>
		<<if $j < $children.length-1>>
			$children[$j].slaveName,
		<<else>>
			and $children[$j].slaveName.@@
		<</if>>
	<</for>>
<<elseif $children.length > 1>>
	 has @@.lightgreen;two aunts, $children[0].slaveName, and $children[1].slaveName.@@
<<elseif $children.length > 0>>
	 has @@.lightgreen;an aunt, $children[0].slaveName.@@
<</if>>
<</if>>
<<set $children = []>>

/*testtest PC niece passage - determines how many nieces you have*/
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].ID != $activeSlave.ID>>
	<<if areSisters($slaves[$i], $PC) == 1 || areSisters($slaves[$i], $PC) == 2>>
	<<if $slaves[$i].ID == $activeSlave.mother || $slaves[$i].ID == $activeSlave.father>>
		<<for $j to 0; $j < $slaves.length; $j++>>
			<<if $slaves[$i].ID != $slaves[$j].ID && $slaves[$j].ID != $activeSlave.ID && $slaves[$j].genes == "XX">>
			<<if $slaves[$i].ID == $slaves[$j].mother || $slaves[$i].ID == $slaves[$j].father>>
				<<set $children.push($slaves[$j])>>
			<</if>>
			<</if>>
		<</for>>
	<</if>>
	<</if>>
	<</if>>
<</for>>
<<if $activeSlave.genes == "XX" && $children.length > 0>>
	$pronounCap
<<if $children.length > 2>>
	is @@.lightgreen;your niece along with
	<<for $j = 0; $j < $children.length; $j++>>
		<<if $j < $children.length-1>>
			$children[$j].slaveName,
		<<else>>
			 and $children[$j].slaveName.@@
		<</if>>
	<</for>>
<<elseif $children.length > 1>>
	is @@.lightgreen;your niece along with $children[0].slaveName.@@
<<elseif $children.length > 0>>
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].ID != $activeSlave.ID && $activeSlave.genes == "XX">>
	<<if areSisters($slaves[$i], $PC) == 1 || areSisters($slaves[$i], $PC) == 2>>
	<<if $slaves[$i].ID == $activeSlave.mother || $slaves[$i].ID == $activeSlave.father>>
		$pronounCap is @@.lightgreen;your niece.@@
	<</if>>
	<</if>>
	<</if>>
<</for>>
<</if>>
<</if>>
<<set $children = []>>

/* testtest niece passage - determines how many nieces a slave has*/
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].ID != $activeSlave.ID>>
	<<if areSisters($slaves[$i], $activeSlave) == 1 || areSisters($slaves[$i], $activeSlave) == 2>>
		<<for $j = 0; $j < $slaves.length; $j++>>
			<<if $slaves[$i].ID != $slaves[$j].ID && $slaves[$j].ID != $activeSlave.ID && $slaves[$j].genes == "XX">>
			<<if $slaves[$i].ID == $slaves[$j].mother || $slaves[$i].ID == $slaves[$j].father>>
				<<set $children.push($slaves[$j])>>
			<</if>>
			<</if>>
		<</for>>
	<</if>>
	<</if>>
<</for>>
<<if $children.length > 0>>
	$pronounCap
<<if $children.length > 2>>
	has @@.lightgreen;many nieces,
	<<for $j = 0; $j < $children.length; $j++>>
		<<if $j < $children.length-1>>
			$children[$j].slaveName,
		<<else>>
			and $children[$j].slaveName, who are your slaves.@@
		<</if>>
	<</for>>
<<elseif $children.length > 1>>
	has @@.lightgreen;two nieces, $children[0].slaveName, and $children[1].slaveName, who are your slaves.@@
<<elseif $children.length > 0>>
	has @@.lightgreen;a niece, $children[0].slaveName, who is your slave.@@
<</if>>
<</if>>
<<set $children = []>>

/*testtest PC nephew passage - determines how many nephews you have*/
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].ID != $activeSlave.ID>>
	<<if areSisters($slaves[$i], $PC) == 1 || areSisters($slaves[$i], $PC) == 2>>
	<<if $slaves[$i].ID == $activeSlave.mother || $slaves[$i].ID == $activeSlave.father>>
		<<for $j = 0; $j < $slaves.length; $j++>>
			<<if $slaves[$i].ID != $slaves[$j].ID && $slaves[$j].ID != $activeSlave.ID && $slaves[$i].genes == "XY">>
			<<if $slaves[$i].ID == $slaves[$j].mother || $slaves[$i].ID == $slaves[$j].father>>
				<<set $children.push($slaves[$j])>>
			<</if>>
			<</if>>
		<</for>>
	<</if>>
	<</if>>
	<</if>>
<</for>>
<<if $activeSlave.genes == "XY" && $children.length > 0>>
	$pronounCap
<<if $children.length > 2>>
	is @@.lightgreen;your nephew along with
	<<for $j = 0; $j < $children.length; $j++>>
		<<if $j < $children.length-1>>
			$children[$j].slaveName,
		<<else>>
			 and $children[$j].slaveName.@@
		<</if>>
	<</for>>
<<elseif $children.length > 1>>
	is @@.lightgreen;your nephew along with $children[0].slaveName.@@
<<elseif $children.length > 0>>
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].ID != $activeSlave.ID && $activeSlave.genes == "XY">>
	<<if areSisters($slaves[$i], $PC) == 1 || areSisters($slaves[$i], $PC) == 2>>
	<<if $slaves[$i].ID == $activeSlave.mother || $slaves[$i].ID == $activeSlave.father>>
		$pronounCap is @@.lightgreen;your nephew.@@
	<</if>>
	<</if>>
	<</if>>
<</for>>
<</if>>
<</if>>
<<set $children = []>>

/* testtest nephew passage - determines how many nephews a slave has*/
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].ID != $activeSlave.ID>>
	<<if areSisters($slaves[$i], $activeSlave) == 1 || areSisters($slaves[$i], $activeSlave) == 2>>
		<<for $j = 0; $j < $slaves.length; $j++>>
			<<if $slaves[$i].ID != $slaves[$j].ID && $slaves[$j].ID != $activeSlave.ID && $slaves[$j].genes == "XY">>
			<<if $slaves[$i].ID == $slaves[$j].mother || $slaves[$i].ID == $slaves[$j].father>>
				<<set $children.push($slaves[$j])>>
			<</if>>
			<</if>>
		<</for>>
	<</if>>
	<</if>>
<</for>>
<<if $children.length > 0>>
	$pronounCap
<<if $children.length > 2>>
	has @@.lightgreen;many nephews,
	<<for $j = 0; $j < $children.length; $j++>>
		<<if $j < $children.length-1>>
			$children[$j].slaveName,
		<<else>>
			and $children[$j].slaveName, who are your slaves.@@
		<</if>>
	<</for>>
<<elseif $children.length > 1>>
	has @@.lightgreen;two nephews, $children[0].slaveName, and $children[1].slaveName, who are your slaves.@@
<<elseif $children.length > 0>>
	has @@.lightgreen;a nephew, $children[0].slaveName, who is your slave.@@
<</if>>
<</if>>
<<set $children = []>>

/*testtest PC sibling passages - determines how many siblings you have
<<set $children = []>>
<<set _rel_num = areSisters($activeSlave, $PC)>>
<<if(_rel_num > 0)>>
	<<if ($activeSlave.genes == "XX")>>
		<<set _rel_type = "sister">>
	<<else>>
		<<set _rel_type = "brother">>
	<</if>>
	<<if (_rel_num == 1)>>
		<<set _rel_desc = "your twin">>
	<<elseif _rel_num == 2>>
		<<set _rel_desc = "your ">>
	<<elseif _rel_num == 3>>
		<<set _rel_desc = "your half-">>
	<</if>>
	<<for $i = 0; $i < $slaves.length; $i++>>
		<<if $slaves[$i].ID != $activeSlave.ID>>
			<<if _rel_num == areSisters($activeSlave, $slaves[$i]) && ($activeSlave.vagina > -1) == ($slaves[$i].vagina > -1)>>
				<<set console.log('sisters', $slaves[$i].birthName)>>
				<<set $children.push($slaves[$i])>>
			<</if>>
		<</if>>
	<</for>>
	$pronounCap
<<if $children.length > 1>>
	@@.lightgreen;is _rel_desc _rel_type along with
	<<for $j = 0; $j < $children.length; $j++>>
		<<if $j < $children.length-1>>
			$children[$j].slaveName,
		<<else>>
			and $children[$j].slaveName.@@
		<</if>>
	<</for>>
<<elseif $children.length > 0>>
	is @@.lightgreen;_rel_desc _rel_type with $children[0].slaveName.@@
<<else>>
	is @@.lightgreen;_rel_desc _rel_type.@@
<</if>>
<</if>>
<<set $children = []>>
*/

<<set _twins = [], _sisters = [], _brothers = [], _halfsisters = [], _halfbrothers = []>>
<<for _i = 0; _i < $slaves.length; _i++>>
	<<set _sisterCheck = areSisters($slaves[_i], $activeSlave)>>
	<<if _sisterCheck == 1>>
		<<run _twins.push($slaves[_i])>>
	<</if>>
	<<if _sisterCheck == 2>>
		<<run ($slaves[_i].genes == 'XX' ? _sisters : _brothers).push($slaves[_i])>>
	<</if>>
	<<if _sisterCheck == 3>>
		<<run ($slaves[_i].genes == 'XX' ? _halfsisters : _halfbrothers).push($slaves[_i])>>
	<</if>>
<</for>>

/*testtest PC twin passages - determines how many twins you have but not implemented yet*/
<<if areSisters($activeSlave, $PC) == 1>>
	$pronounCap
	<<if _twins.length > 1>>
		@@.lightgreen;shared a cramped womb with you, <<print _twins.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>>.@@
	<<elseif _twins.length > 0>>
		is @@.lightgreen;your twin along with _twins[0].slaveName.@@
	<<else>>
		is @@.lightgreen;your twin <<if $activeSlave.genes == "XX">>sister<<else>>brother<</if>>.@@
	<</if>>
<</if>>

/*testtest PC sister passages - determines how many sisters you have*/
<<if areSisters($activeSlave, $PC) < 3 && areSisters($activeSlave, $PC) > 0 && $activeSlave.genes == "XX">>
	$pronounCap
	<<if _sisters.length > 1>>
		@@.lightgreen;is your sister along with <<print _sisters.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>>.@@
	<<elseif _sisters.length > 0>>
		is @@.lightgreen;your sister along with _sisters[0].slaveName.@@
	<<else>>
		is @@.lightgreen;your sister.@@
	<</if>>
<</if>>

/*testtest PC brother passages - determines how many brothers you have*/
<<if areSisters($activeSlave, $PC) < 3 && areSisters($activeSlave, $PC) > 0 && $activeSlave.genes == "XY">>
	$pronounCap
	<<if _brothers.length > 1>>
		@@.lightgreen;is your brother along with <<print _brothers.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>>.@@
	<<elseif _brothers.length > 0>>
		is @@.lightgreen;your brother along with _brothers[0].slaveName.@@
	<<else>>
		is @@.lightgreen;your brother.@@
	<</if>>
<</if>>

/*testtest PC half-sister passages - determines how many half-sisters you have*/
<<if areSisters($activeSlave, $PC) == 3 && $activeSlave.genes == "XX">>
	$pronounCap
	<<if _halfsisters.length > 1>>
		@@.lightgreen;is your half-sister along with <<print _halfsisters.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>>.@@
	<<elseif _halfsisters.length > 0>>
		is @@.lightgreen;your half-sister along with _halfsisters[0].slaveName.@@
	<<else>>
		is @@.lightgreen;your half-sister.@@
	<</if>>
<</if>>

/*testtest PC half-brother passages - determines how many half-brothers you have*/
<<if areSisters($activeSlave, $PC) == 3 && $activeSlave.genes == "XY">>
	$pronounCap
	<<if _halfbrothers.length > 1>>
		@@.lightgreen;is your half-brother along with <<print _halfbrothers.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>>.@@
	<<elseif _halfbrothers.length > 0>>
		is @@.lightgreen;your half-brother along with _halfbrothers[0].slaveName.@@
	<<else>>
		is @@.lightgreen;your half-brother.@@
	<</if>>
<</if>>

/*testtest twins? - determines how many twins a slave has*/
<<if _twins.length > 0>>
	$pronounCap
	<<if _twins.length > 2>>
		@@.lightgreen;shared a cramped womb with <<print _twins.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>>.@@
	<<elseif _twins.length > 1>>
		is a @@.lightgreen;one of a set of triplets; _twins[0].slaveName, and _twins[1].slaveName@@ complete the trio.
	<<else>>
		is @@.lightgreen;twins with _twins[0].slaveName.@@
	<</if>>
<</if>>

/*testtest sister - determines how many sisters a slave has*/
<<if _sisters.length > 0>>
	<<if _sisters.length > 1>>
		@@.lightgreen;<<print _sisters.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>> are $possessive sisters.@@
	<<else>>
		@@.lightgreen; _sisters[0].slaveName is $possessive sister.@@
	<</if>>
<</if>>

/*testtest brother - determines how many brothers a slave has*/
<<if _brothers.length > 0>>
	<<if _brothers.length > 1>>
		@@.lightgreen;_brothers.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>> are $possessive brothers.@@
	<<else>>
		@@.lightgreen;_brothers[0].slaveName is $possessive brother.@@
	<</if>>
<</if>>

/*testtest half-sister - determines how many half-sisters a slave has*/
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].ID != $activeSlave.ID>>
		<<if areSisters($activeSlave, $slaves[$i]) == 3 && $slaves[$i].genes == "XX">>
			<<set $children.push($slaves[$i])>>
		<</if>>
	<</if>>
<</for>>
<<if $children.length > 2>>
	@@.lightgreen;
	<<for $j = 0; $j < $children.length; $j++>>
		<<if $j < $children.length-1>>
			$children[$j].slaveName,
		<<else>>
			and $children[$j].slaveName
		<</if>>
	<</for>>
	are half-sisters to $object.@@
<<elseif $children.length > 1>>
	@@.lightgreen;$children[0].slaveName and $children[1].slaveName are half-sisters to $object.@@
<<elseif $children.length > 0>>
	@@.lightgreen;$children[0].slaveName is a half-sister to $object.@@
<</if>>
<<set $children = []>>

/*testtest half-brother - determines how many half-brothers a slave has*/
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].ID != $activeSlave.ID>>
		<<if areSisters($activeSlave, $slaves[$i]) == 3 && $slaves[$i].genes == "XY">>
			<<set $children.push($slaves[$i])>>
		<</if>>
	<</if>>
<</for>>
<<if $children.length > 2>>
	@@.lightgreen;
	<<for $j = 0; $j < $children.length; $j++>>
		<<if $j < $children.length-1>>
			$children[$j].slaveName,
		<<else>>
			and $children[$j].slaveName
		<</if>>
	<</for>>
	are half-brothers to $object.@@
<<elseif $children.length > 1>>
	@@.lightgreen;$children[0].slaveName and $children[1].slaveName are half-brothers to $object.@@
<<elseif $children.length > 0>>
	@@.lightgreen;$children[0].slaveName is a half-brother to $object.@@
<</if>>
<<set $children = []>>

<</widget>>

<<widget PlayerFamily>>

<br><br>Your present family includes:

/*Player parents, lists both your parents, or just one.*/
<<for $i = 0; $i < $slaves.length; $i++>>
<<if $slaves[$i].ID == $PC.father || $slaves[$i].ID == $PC.mother>>
			<<set $children.push($slaves[$i])>>
<</if>>
<</for>>
<<if $children.length > 1>>
	<br>Your parents are @@.lightgreen;$children[0].slaveName and $children[1].slaveName@@.
<<elseif $children.length > 0>>
	<br>You know one of your parents, @@.lightgreen;$children[0].slaveName@@.
<</if>>
<<set $children = []>>

/*Twins Test with aresisters*/
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].ID != $PC.ID>>
		<<if areSisters($activeSlave, $PC) == 1 && areSisters($slaves[$i], $activeSlave) == 1>>
			<<set $children.push($slaves[$i])>>
		<</if>>
	<</if>>
<</for>>
<<if $children.length > 2>>
	<br>You are @@.lightgreen;twins with
	<<for $j = 0; $j < $children.length; $j++>>
		<<if $j < $children.length-1>>
			$children[$j].slaveName,
		<<else>>
			and $children[$j].slaveName.@@
		<</if>>
	<</for>>
<<elseif $children.length > 1>>
	<br>You are twins with @@.lightgreen;$children[0].slaveName and $children[1].slaveName.@@
<<elseif $children.length > 0>>
	<br>Your twin is @@.lightgreen;$children[0].slaveName.@@
<</if>>
<<set $children = []>>

/*Sister Test with aresisters*/
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].ID != $PC.ID>>
		<<if areSisters($PC, $slaves[$i]) === 2 && areSisters($slaves[$i], $PC) === 2>>
			<<if $slaves[$i].genes == "XX">>
				<<set $children.push($slaves[$i])>>
			<</if>>
		<</if>>
	<</if>>
<</for>>
<<if $children.length > 2>>
	<br>You are @@.lightgreen;sisters with
	<<for $j = 0; $j < $children.length; $j++>>
		<<if $j < $children.length-1>>
			$children[$j].slaveName,
		<<else>>
			and $children[$j].slaveName.@@
		<</if>>
	<</for>>
<<elseif $children.length > 1>>
	<br>You are sisters with @@.lightgreen;$children[0].slaveName and $children[1].slaveName.@@
<<elseif $children.length > 0>>
	<br>Your sister is @@.lightgreen;$children[0].slaveName.@@
<</if>>
<<set $children = []>>

/*Brother Test with aresisters*/
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].ID != $PC.ID>>
		<<if areSisters($PC, $slaves[$i]) === 2 && areSisters($slaves[$i], $PC) === 2>>
			<<if $slaves[$i].genes == "XY">>
				<<set $children.push($slaves[$i])>>
			<</if>>
		<</if>>
	<</if>>
<</for>>
<<if $children.length > 2>>
	<br>You are @@.lightgreen;brothers with
	<<for $j = 0; $j < $children.length; $j++>>
		<<if $j < $children.length-1>>
			$children[$j].slaveName,
		<<else>>
			and $children[$j].slaveName.@@
		<</if>>
	<</for>>
<<elseif $children.length > 1>>
	<br>You are brothers with @@.lightgreen;$children[0].slaveName and $children[1].slaveName.@@
<<elseif $children.length > 0>>
	<br>Your brother is @@.lightgreen;$children[0].slaveName.@@
<</if>>
<<set $children = []>>

/*Half-Sister Test with aresisters */
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].ID != $PC.ID>>
	<<if areSisters($slaves[$i], $PC) == 3 && areSisters($PC, $slaves[$i]) == 3>>
		<<if $slaves[$i].genes == "XX">>
			<<set $children.push($slaves[$i])>>
		<</if>>
	<</if>>
<</if>>
<</for>>
<<if $children.length > 2>>
	<br>You are half-sisters with @@.lightgreen;
	<<for $j = 0; $j < $children.length; $j++>>
		<<if $j < $children.length-1>>
			$children[$j].slaveName,
		<<else>>
			and $children[$j].slaveName@@.
		<</if>>
	<</for>>
<<elseif $children.length > 1>>
	<br>You are half-sisters with @@.lightgreen;$children[0].slaveName and $children[1].slaveName@@.
<<elseif $children.length > 0>>
	<br>You have one half-sister, @@.lightgreen;$children[0].slaveName@@.
<</if>>
<<set $children = []>>

/*Half-Brother Test with aresisters */
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $slaves[$i].ID != $PC.ID>>
	<<if areSisters($slaves[$i], $PC) == 3 && areSisters($PC, $slaves[$i]) == 3>>
		<<if $slaves[$i].genes == "XY">>
			<<set $children.push($slaves[$i])>>
		<</if>>
	<</if>>
<</if>>
<</for>>
<<if $children.length > 2>>
	<br>You are half-brothers with @@.lightgreen;
	<<for $j = 0; $j < $children.length; $j++>>
		<<if $j < $children.length-1>>
			$children[$j].slaveName,
		<<else>>
			and $children[$j].slaveName@@.
		<</if>>
	<</for>>
<<elseif $children.length > 1>>
	<br>You are half-brothers with @@.lightgreen;$children[0].slaveName and $children[1].slaveName@@.
<<elseif $children.length > 0>>
	<br>You have one half-brother, @@.lightgreen;$children[0].slaveName@@.
<</if>>
<<set $children = []>>

/*Player is Father, lists children you fathered*/
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $PC.ID == $slaves[$i].father>>
		<<set $children.push($slaves[$i])>>
	<</if>>
<</for>>
<<if $children.length > 2>>
	<br>You are the father of @@.lightgreen;
	<<for $j = 0; $j < $children.length; $j++>>
		<<if $j < $children.length-1>>
			$children[$j].slaveName,
		<<else>>
			and $children[$j].slaveName@@.
		<</if>>
	<</for>>
<<elseif $children.length > 1>>
	<br>You are the father of two of your slaves, @@.lightgreen;$children[0].slaveName, and $children[1].slaveName@@.
<<elseif $children.length > 0>>
	<br>You are the father of one of your slaves, @@.lightgreen;$children[0].slaveName@@.
<</if>>
<<set $children = []>>

/*Player is Mother, lists birthed children*/
<<for $i = 0; $i < $slaves.length; $i++>>
	<<if $PC.ID == $slaves[$i].mother>>
		<<set $children.push($slaves[$i])>>
	<</if>>
<</for>>
<<if $children.length > 2>>
	<br>You are the mother of@@.lightgreen;
	<<for $j = 0; $j < $children.length; $j++>>
		<<if $j < $children.length-1>>
			$children[$j].slaveName,
		<<else>>
			and $children[$j].slaveName.@@
		<</if>>
	<</for>>
<<elseif $children.length > 1>>
	<br>You are the mother of two of your slaves, @@.lightgreen;$children[0].slaveName, and $children[1].slaveName@@.
<<elseif $children.length > 0>>
	<br>You are the mother of one of your slaves, @@.lightgreen;$children[0].slaveName@@.
<</if>>
<<set $children = []>>

<</widget>>

<<widget "parentName">>
<<if $activeSlave[$args[0]] == $PC.ID>>You<</if>><<for _j = 0; _j < $slaves.length; _j++>><<if $slaves[_j].ID == $activeSlave[$args[0]]>><<print $slaves[_j].slaveName>><</if>><</for>>
<</widget>>

<<widget "listOfSlavesWithSameParent">>
<<if $activeSlave[$args[0]] != 0>>
<<set _printSeperator = false>>
<<if $activeSlave[$args[0]] == $PC[$args[0]]>>You<<set _printSeperator = true>><</if>><<for _j = 0; _j < $slaves.length; _j++>><<if $slaves[_j][$args[0]] == $activeSlave[$args[0]]>><<if _printSeperator>> | <</if>><<set _printSeperator to true>><<print $slaves[_j].slaveName>><</if>><</for>>
<</if>>
<</widget>>

<<widget "editFamily">>
<br>''Mother:'' <span id="motherName"><<parentName "mother">></span>.
<<link "Reset">>
<<set $activeSlave.mother = 0>>
<<replace '#motherName'>><</replace>>
<<replace '#sameMotherNames'>><</replace>>
<<replace '#familySummary'>><<Family>><</replace>>
<</link>>
<<if $PC.vagina == 1>> | <<link "You">><<set $activeSlave.mother = $PC.ID>><<replace '#motherName'>>You<</replace>><<replace '#familySummary'>><<Family>><</replace>><</link>><</if>>
<<for _i = 0; _i < $slaves.length; _i++>>
<<if $slaves[_i].vagina > 0>>
 |
<<set _id = $slaves[_i].ID>>
<<set _slaveName = $slaves[_i].slaveName>>
<<print "
<<link _slaveName>>
<<set $activeSlave.mother = _id>>
<<replace '#motherName'>>_slaveName<</replace>>
<<replace '#sameMotherNames'>><<listOfSlavesWithSameParent 'mother'>><</replace>>
<<replace '#familySummary'>><<Family>><</replace>>
<</link>>
">>
<</if>>
<</for>>
<br>''Father:'' <span id="fatherName"><<parentName "father">></span>.
<<link "Reset">>
<<set $activeSlave.father = 0>>
<<replace '#fatherName'>><</replace>>
<<replace '#sameFatherNames'>><</replace>>
<<replace '#familySummary'>><<Family>><</replace>>
<</link>>
<<if ($PC.dick == 1) and (($PC.actualAge - $activeSlave.actualAge) >= $fertilityAge) >> | <<link "You">><<set $activeSlave.father = $PC.ID>><<replace '#fatherName'>>You<</replace>><<replace '#familySummary'>><<Family>><</replace>><</link>><</if>>
<<for _i = 0; _i < $slaves.length; _i++>>
<<if ($slaves[_i].dick > 0) and ((($slaves[_i].actualAge - $activeSlave.actualAge) >= $fertilityAge))>>
 |
<<set _id = $slaves[_i].ID>>
<<set _slaveName = $slaves[_i].slaveName>>
<<print "
<<link _slaveName>>
<<set $activeSlave.father = _id>>
<<replace '#fatherName'>>_slaveName<</replace>>
<<replace '#sameFatherNames'>><<listOfSlavesWithSameParent 'father'>><</replace>>
<<replace '#familySummary'>><<Family>><</replace>>
<</link>>
">>
<</if>>
<</for>>

<br>''Same mother as:'' <span id="sameMotherNames"><<listOfSlavesWithSameParent "mother">></span>.
<<link "Reset">>
<<set $activeSlave.mother = 0>>
<<replace '#motherName'>><</replace>>
<<replace '#sameMotherNames'>><</replace>>
<<replace '#familySummary'>><<Family>><</replace>>
<</link>>
 | <<link "You">>
<<if $PC.mother != 0>>
<<set $activeSlave.mother = $PC.mother>>
<<elseif $activeSlave.mother != 0>>
<<set $PC.mother = $activeSlave.mother>>
<<else>>
<<set $activeSlave.mother = -5 - 2*$activeSlave.ID >>
<<set $PC.mother = $activeSlave.mother>>
<</if>>
<<replace '#motherName'>><<parentName "mother">><</replace>>
<<replace '#sameMotherNames'>><<listOfSlavesWithSameParent "mother">><</replace>>
<<replace '#familySummary'>><<Family>><</replace>>
<</link>>
<<for _i = 0; _i < $slaves.length; _i++>>
 |
<<set _slaveName = $slaves[_i].slaveName>>
<<set _slave = $slaves[_i]>>

<<link _slaveName>>
<<if _slave.mother != 0>>
<<set $activeSlave.mother = _slave.mother>>
<<elseif $activeSlave.mother != 0>>
<<set _slave.mother = $activeSlave.mother>>
<<else>>
<<set $activeSlave.mother = -5 - 2*$activeSlave.ID >>
<<set _slave.mother = $activeSlave.mother>>
<</if>>
<<replace '#motherName'>><<parentName "mother">><</replace>>
<<replace '#sameMotherNames'>><<listOfSlavesWithSameParent 'mother'>><</replace>>
<<replace '#familySummary'>><<Family>><</replace>>
<</link>>

<</for>>

<br>''Same father as:'' <span id="sameFatherNames"><<listOfSlavesWithSameParent "father">></span>.
<<link "Reset">>
<<set $activeSlave.father = 0>>
<<replace '#fatherName'>><</replace>>
<<replace '#sameFatherNames'>><</replace>>
<<replace '#familySummary'>><<Family>><</replace>>
<</link>>
| <<link "You">>
<<if $PC.father != 0>>
<<set $activeSlave.father = $PC.father>>
<<elseif $activeSlave.father != 0>>
<<set $PC.father = $activeSlave.father>>
<<else>>
<<set $activeSlave.father = -5 - 2*$activeSlave.ID -1>>
<<set $PC.father = $activeSlave.father>>
<</if>>
<<replace '#fatherName'>><<parentName "father">><</replace>>
<<replace '#sameFatherNames'>><<listOfSlavesWithSameParent "father">><</replace>>
<<replace '#familySummary'>><<Family>><</replace>>
<</link>>

<<for _i = 0; _i < $slaves.length; _i++>>
 |
<<set _slaveName = $slaves[_i].slaveName>>
<<set _slave = $slaves[_i]>>

<<link _slaveName>>
<<if _slave.father != 0>>
<<set $activeSlave.father = _slave.father>>
<<elseif $activeSlave.father != 0>>
<<set _slave.father = $activeSlave.father>>
<<else>>
<<set $activeSlave.father = -5 - 2*$activeSlave.ID -1 >>
<<set _slave.father = $activeSlave.father>>
<</if>>
<<replace '#fatherName'>><<parentName "father">><</replace>>
<<replace '#sameFatherNames'>><<listOfSlavesWithSameParent 'father'>><</replace>>
<<replace '#familySummary'>><<Family>><</replace>>
<</link>>

<</for>>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;<span id="familySummary"><<Family>></span>
<br>

<</widget>>
