:: characterOverview_soial_widgets[widget]
	
	<<widget 'socialGroupMemberList'>>
		<<set _groupMembersIds = $npcs.ids({group:_args[0]})>>
		<ul>
			<<for _groupMembersId range _groupMembersIds>>
				<li><<npc _groupMembersId>><</npc>></li>
			<</for>>
		</ul>
	<</widget>>

	<<widget 'socialGroupName'>>
		<<if _args[0] == 'cool'>>
			cool kids
		<<else>>
			<<=_args[0]>>
		<</if>>
	<</widget>>

	<<widget 'socialGroupOutfitRating'>>
		<<set _sGOR_groupName = _args[0]>>
		<<switch $quest('school').func('groupOutfitRating',_args[0])>>
			<<case -2>>
				<<negative 2>>The <<socialGroupName _sGOR_groupName>> would hate your current outfit.<</negative>>
			<<case -1>>
				<<negative>>The <<socialGroupName _sGOR_groupName>> would dislike your current outfit.<</negative>>
			<<case 0>>
				The <<socialGroupName _sGOR_groupName>> would tolerate your current outfit.
			<<case 1>>
				<<positive>>The <<socialGroupName _sGOR_groupName>> would like your current outfit.<</positive>>
			<<case 2>>
				<<positive 2>>The <<socialGroupName _sGOR_groupName>> would love your current outfit.<</positive>>
		<</switch>>
	<</widget>>

	<<widget 'socialGroupStanding'>>
		<<set _sGS_groupName = _args[0]>>
		<<set _sGS_rel = $quest('school').func('groupRel',_args[0])>>
		<<if _sGS_rel < setup.npcSettings.relationshipMargins[0]>>
			<<negative 2>>The <<socialGroupName _sGS_groupName>> hate you.<</negative>>
		<<elseif _sGS_rel < setup.npcSettings.relationshipMargins[1]>>
			<<negative>>The <<socialGroupName _sGS_groupName>> don't like you.<</negative>>
		<<elseif _sGS_rel < setup.npcSettings.relationshipMargins[2]>>
			The <<socialGroupName _sGS_groupName>> tolerate you.
		<<elseif _sGS_rel < setup.npcSettings.relationshipMargins[3]>>
			<<positive>>The <<socialGroupName _sGS_groupName>> like you.<</positive>>
		<<else>>
			<<positive 2>>The <<socialGroupName _sGS_groupName>> like you very much.<</positive>>
		<</if>>
	<</widget>>

:: characterOverview_soial[menu]
	<<gs 'characterOverviewNavigation' 'social'>>
	<h2>Social</h2>
	<<if $pc.isSchoolStudent>>
		<h3>School</h3>
		<p>
			The students are split into several social groups.
			You can become member of a group by improving your group standing.
			Likewise, you can get kicked out of a group if your group standing drops too far.
		</p>
		<p>
			Your group standing is calcuated by taking the middle 60% of relationships with group members into account.
			This means, that, in a group of at least 5 other members, the opinion of those who hate and love you the most, are not taken into account.
			You need to mind the opinion of the majority of group members.
			<<linkreplace "Calculation Details">>
				<<notice>>
					<b>Calculation Details:</b>
					<p>Each realtionship value of the members of a group is placed in an array. This array is sorted.</p>
					<p><i>
						Anja (80), Bernd (10), Christian (50), Danielle (70), Erwin (100) and Frank (60) are members of the group Example.
						Their relationship values form the sorted array [10,50,60,70,80,100].
					</i></p>
					<p>
						Next, it is calcuated how many members of the group should be ignored. It's 20% on either end.
						This number is rounded to the next integer value.
					</p>
					<p><i>
						The group size in the example above is 6. 20% of six is 1.2, which is rounded to 1.
						We get a new set of relationship values: [<s>10</s>,50,60,70,80,<s>100</s>] = [50,60,70,80].
					</i></p>
					<p>
						Of these resulting values, the average is taken. This is the final result.
					</p>
					<p><i>
						avg([50,60,70,80]) = (50 + 60 + 70 + 80) / 4 = <b><u>65</u></b>.
					</i></p>
					<p>
						For performance reasons, this number is only updated once each day.
					</p>

				<</notice>>
			<</linkreplace>>
		</p>
		<p>
			A way to increase your standing with several members of a group at once is to spend time with them during breaks and attend their social events.
			You can further increase your relationship with single members of a group by talking to them.
			This is always possible at school, but some of the characters might invite you to their homes under individual conditions.
		</p>
		<p>
			You should also mind your outfit choice. Even though characters have their own outfit choices, there exists a consensus in each group of which outfits are acceptable.
			Not meeting the criteria of a group will reduce your standing with all their members and vice versa.
			This effect is doubled for groups you are a member of.
			It will get applied when you meet enough members of the relevant group. This is always the case at the beginning of each school day and for the respective group events.
		</p>
			
		<h4>Cool kids</h4>
		The cool kids approve of wearing attractive and sexy outfits to school.
		They deem conservative clothes as too prudish and slutty outfits as too slutty.
		Also, they expect an at least average outfit quality.
		<p><<socialGroupOutfitRating 'cool'>></p>
		<p>
			<<socialGroupStanding 'cool'>>
			<<if $quest('school').func('isGroupMember','cool')>>
				<<positive>>You are a member of this group.<</positive>>
			<</if>>
		</p>
		<p>
			<<linkreplace 'List of the group members'>>
				<b>List of the group members:</b>
				<<socialGroupMemberList 'cool'>>
			<</linkreplace>>
		</p>

		<h4>Jocks</h4>
		The jocks approve of wearing attractive and sexy outfits to school.
		They deem conservative clothes as too prudish and slutty outfits as too slutty.
		They don't mind the quality of your outfit.
		<p><<socialGroupOutfitRating 'jocks'>></p>
		<p>
			<<socialGroupStanding 'jocks'>>
			<<if $quest('school').func('isGroupMember','jocks')>>
				<<positive>>You are a member of this group.<</positive>>
			<</if>>
		</p>
		<p>
			<<linkreplace 'List of the group members'>>
				<b>List of the group members:</b>
				<<socialGroupMemberList 'jocks'>>
			<</linkreplace>>
		</p>

		<h4>Nerds</h4>
		The nerds approve of wearing a conservative outfit to school.
		They tolerate attractive outfits. Sexy outfits are deemed too slutty by them.
		They don't mind the quality of your outfit.
		<p><<socialGroupOutfitRating 'nerds'>></p>
		<p>
			<<socialGroupStanding 'nerds'>>
			<<if $quest('school').func('isGroupMember','nerds')>>
				<<positive>>You are a member of this group.<</positive>>
			<</if>>
		</p>
		<p>
			<<linkreplace 'List of the group members'>>
				<b>List of the group members:</b>
				<<socialGroupMemberList 'nerds'>>
			<</linkreplace>>
		</p>

		<h4>Gopniks</h4>
		Gopniks tolerate conservative, attractive and sexy outfits.
		Breaking the school rules by wearing a slutty outfit would earn you their respect, but a whorish outfit would be too daring even for them. 
		They don't mind the quality of your outfit.
		<p><<socialGroupOutfitRating 'gopniks'>></p>
		<p>
			<<socialGroupStanding 'gopniks'>>
			<<if $quest('school').func('isGroupMember','gopniks')>>
				<<positive>>You are a member of this group.<</positive>>
			<</if>>
		</p>
		<p>
			<<linkreplace 'List of the group members'>>
				<b>List of the group members:</b>
				<<socialGroupMemberList 'gopniks'>>
			<</linkreplace>>
		</p>

		<h4>Outcasts</h4>
		Outcasts are not a coherent group and have therefore no outfit preference.
		<p><<socialGroupOutfitRating 'outcasts'>></p>
		<p>
			<<socialGroupStanding 'outcasts'>>
			<<if $quest('school').func('isGroupMember','outcasts')>>
				<<positive>>You are a member of this group.<</positive>>
			<</if>>
		</p>
		<p>
			<<linkreplace 'List of the group members'>>
				<b>List of the group members:</b>
				<<socialGroupMemberList 'outcasts'>>
			<</linkreplace>>
		</p>

		<h4>Teacher</h4>
		Teachers will tolerate any outfit as long as it follows the school rules.
		This applies to every conservative, attractive and sexy school outfit of any quality.
		<p><<socialGroupOutfitRating 'teachers'>></p>
		<p>
			<<socialGroupStanding 'teachers'>>
			<<if $quest('school').func('isGroupMember','teachers')>>
				<<positive>>You are a member of this group.<</positive>>
			<</if>>
		</p>
		<p>
			<<linkreplace 'List of the group members'>>
				<b>List of the group members:</b>
				<<socialGroupMemberList 'teachers'>>
			<</linkreplace>>
		</p>
	<</if>>

