:: uni_lessons
<<set $here = 'uni_lessons'>>
<<set $ARGS = $location_var[$here]>>
<!-- !2021/22/12-->
<!-- !! This file includes the code to make sure that the player characters can go to class and exams when they are enrolled in the university.-->
<!-- !! The file does not include the selection of classes depending upon which program they are enrolled in only the part of the code that don't depend on the program.-->
<!-- !! The code for the individual programs is in uni_programs-->
<<if $location_var[$here][0] == 'cikl'>>
	<!-- !! Setting the weeks in the university semester and making sure that the grades are calculated at the right times-->
	<<if getvar("$university['semester_week']") == 0 and ($time.month == 8 or $time.month == 1) and ($time.day - $time.weekday) >= 20>>
		<<setinit $university['semester_week'] = -1>>
	<<else>>
		<<if $time.weekday == 1>>
			<<if getvar("$university['semester_week']") == -1>>
				<<setinit $university['semester_week'] = 1>>
			<<elseif getvar("$university['semester_week']") > 0 and getvar("$university['semester_week']") < 15>>
				<<setinit $university['semester_week'] += 1>>
				<<if $university['enrolled_in_semester'] > $university['semester_passed']>>
					<<gs 'grades' 'calculate_grade' 'uni_$university['enrolled_in']_semester_university['enrolled_in_semester']'>>
					<<gs 'grades' 'assing_grade_description' 'uni_$university['enrolled_in']_semester_university['enrolled_in_semester']'>>
				<</if>>
			<<elseif getvar("$university['semester_week']") == 15>>
				<<setinit $university['semester_week'] = 0>>
				<<setinit $university['exam_week'] = 1>>
				<<if $university['enrolled_in_semester'] > $university['semester_passed']>>
					<<gs 'grades' 'calculate_grade' 'uni_$university['enrolled_in']_semester_university['enrolled_in_semester']'>>
					<<gs 'grades' 'assing_grade_description' 'uni_$university['enrolled_in']_semester_university['enrolled_in_semester']'>>
				<</if>>
			<<elseif getvar("$university['exam_week']") == 1>>
				<<setinit $university['exam_week'] = 2>>
			<<elseif getvar("$university['exam_week']") == 2>>
				<<setinit $university['exam_week'] = 0>>
				<<if $university['enrolled_in_semester'] > $university['semester_passed']>>
					<<set $i = 0>>
					<<set $passed_count = 0>>
					<<set $class_count = 0>>
					<<warn 'JUMP MARKER ENCOUNTERED: :passed_exams_loop'>>
					<<if $class_list_institution[$i] == 'uni_>>
						<<set $class_count += 1>>
						<<if $class['+$class_list_institution[$i]+'_'+$class_list_name[$i]+'_grade'] > 40 and $class['+$class_list_institution[$i]+'_'+$class_list_name[$i]+'_exam_done'] == 1>>
							<<set $passed_count += 1>>
						<<elseif $class['+$class_list_institution[$i]+'_'+$class_list_name[$i]+'_exam_done'] == 0>>
							<<setinit $class[''+$class_list_institution[$i]+'_'+$class_list_name[$i]+'_grade'] = 0>>
							<<setinit $university['expelled_for_missing_exam'] = 1>>
						<</if>>
					<</if>>
					<<set $i += 1>>
					<<if ARRSIZE('class_list_institution') >= $i>>
						<<warn 'JUMP COMMAND ENCOUNTERED: jump passed_exams_loop'>>

					<</if>>
					<<set $i to null>>
					<<if $passed_count == $class_count>>
						<<setinit $university['semester_passed'] = $university['enrolled_in_semester']>>
					<<else>>
						<<setinit $university['expelled'] = 1>>
						<<setinit $university['student'] = 0>>
					<</if>>
					<<if getvar("$university['semester_passed']") == 8>>
						<<setinit $university['diploma'] = 1>>
						<<setinit $university['student'] = 0>>
					<</if>>
					<<set $class_count to null>>
					<<set $passed_count to null>>
				<</if>>
			<</if>>
		<</if>>
	<</if>>
<</if>>
<<if $location_var[$here][0] == 'short_break'>>
	<<set $location_type = 'public_indoors'>>
	<<set $menu_off = 1>>
	<<if $time.hour == 9>>
		<<set $time.minutes += 90 - $time.minutes>>

	<</if>>
	<<if $time.hour == 10 and $time.minutes < 30>>
		<<set $time.minutes += 30 - $time.minutes>>

	<</if>>
	<<if $time.hour == 11>>
		<<set $time.minutes += 90 - $time.minutes>>

	<</if>>
	<<if $time.hour == 12 and $time.minutes < 30>>
		<<set $time.minutes += 30 - $time.minutes>>

	<</if>>
	<<if $time.hour == 13>>
		<<set $time.minutes += 105 - $time.minutes>>

	<</if>>
	<<if $time.hour == 14 and $time.minutes < 45>>
		<<set $time.minutes += 45 - $time.minutes>>

	<</if>>
	<<if getvar("$katjaQW['QWstage']") < 2 and $time.hour >= 14 and $npc('A14').rel >= 70 and $pc.fame('city_slut') < 150 and $pc.skillLevel("makeup") >= 40 and $pc.hotcat >= 6>>
		<<gt 'katja_uni' 'dorm_room_invite'>>

	<</if>>
	<<if $time.weekday == 4 and $time.hour > 14 and getvar("$nerd_game['fixed_uni_day']") == 0 and ($npc('A153').rel >= 50 or getvar("$nerd_game['stage']") > 0) and getvar("$nerd_game['invite_day']") != 2147483647>>
		<<gt 'nerd_game_night' 'invite_uni'>>

	<</if>>
	<<if rand(0,19) == 0>>
		<<gt 'uni_events' 'lecture_hall_events'>>

	<</if>>
	<h2>Lecture Building Hallway</h2>
	<<image "locations/city/island/university/lecture_hall/lecture_hall.jpg">>
	Walking down the halls, you are still amazed at how well maintained the buildings are compared to your old school.
	<<gs 'uni_lessons' 'schedule'>>
	<<act 'Go to the university plaza'>>
		<<gt 'uni_grounds' 'main'>>
	<</act>>
<</if>>
<<if $location_var[$here][0] == 'schedule'>>
	<<if $uni_period['first'] != $time.daystart and $time.hour > 6 and $time.hour < 9>>
		<<gs 'uni_programs' 'uni_period_first'>>
	<<elseif $uni_period['second'] != $time.daystart and $time.hour == 10>>
		<<gs 'uni_programs' 'uni_period_second'>>
	<<elseif $uni_period['third'] != $time.daystart and ($time.hour == 12 or ($time.hour == 13 and $time.minutes < 15))>>
		<<gs 'uni_programs' 'uni_period_third'>>
	<</if>>
<</if>>
<<if $location_var[$here][0] == 'exam_schedule'>>
	<<if $uni_period['exam'] != $time.daystart and $time.hour > 6 and $time.hour < 9>>
		<<gs 'uni_programs' 'exam'>>
	<</if>>
<</if>>
