Ver código fonte

[changed] grouped together related functions in uniutil into pseudo-objects ($ARGS[0] is object and $ARGS[1] is method) and changed all func('uniutil', 'foo') ! 0 calls to func('uniutil', 'foo') to make meaning clearer. added some additional methods like func('uniutil', 'student', 'enrolled') and func('uniutil', 'student', 'not_enrolled'). added a missing case for transferring from legacy vars to new vars

Spackled Lanturn 3 anos atrás
pai
commit
2276a15754

+ 1 - 1
locations/Komp.qsrc

@@ -82,7 +82,7 @@ if $ARGS[0] = 'brows':
 		if shantfoto > 0:act 'Find the girl you took photos of in the park on "Assbook"':gt 'komp', 'foto'
 		if gor_dorm = 7:act 'Read letter from Eugene':gt 'etoexhib', 'pos91'
 		if camwhore = 1 and $loc ! 'shulga_room' and $loc ! 'anushapt':act 'Go to MyFreeCams.org':gt 'komp', 'mfc'
-		if (storyline = 1 and SchoolAtestat = 0) or func('uniutil', 'student_status') > 0:act 'Spend time studying':gt 'komp', 'study'
+		if (storyline = 1 and SchoolAtestat = 0) or func('uniutil', 'student', 'enrolled'):act 'Spend time studying':gt 'komp', 'study'
 		if sucpcinfo = 0 and succubxp > 0: act 'Research the strange feelings you''ve been having': gt 'succubus', 'kompresearch'
 	end
 end

+ 2 - 2
locations/MartinTalk.qsrc

@@ -539,7 +539,7 @@ if $ARGS[0] = '':
 			end
 		end
 		
-		if func('uniutil', 'student_status') > 0: 
+		if func('uniutil', 'student', 'enrolled'): 
 			act '"I''m a university student"':
 				cla
 				'"I''m going to university," you say, your voice somewhere between pride and shame: Pride over the privilege of receiving a higher education, and shame in the face of thinking of yourself as ''privileged'' while talking to Martin, who you think didn''t have that option... or did he?'
@@ -927,7 +927,7 @@ if $ARGS[0] = 'MartinTalkApartment':
 		'Martin laughs. "Well, you definitely make it sound complicated. Good for you. But," he turns serious once more, "nothing like that is ever truly ''free'', so... be careful."'
 		$OpenInnerThought+'He wouldn''t be Martin if he didn''t tell me to "watch out" at least once a day,'+$CloseInnerThought+' you think and roll your eyes, but still nod yes at him before he has to get back to work.'
 	
-	elseif func('uniutil', 'student_status') > 0:
+	elseif func('uniutil', 'student', 'enrolled'):
 		'"I have a room in one of the university dormitories, actually. I wouldn''t call it ''living'', though."'
 		*nl
 		'"Oh, so you''re a student, too?"'

+ 3 - 3
locations/cikl.qsrc

@@ -1196,10 +1196,10 @@ if day = 25:
 		'<b><font color="green">Your husband has paid <<huspay>> <b>₽</b> into your bank account.</font></b>'
 	end
 
-	if func('uniutil', 'scholarship_active') ! 0 and scholarshipday = 0:
+	if func('uniutil', 'scholarship' , 'is_active') and scholarshipday = 0:
 		scholarshipday = 1
-		karta += func('uniutil', 'scholarship_value')
-		'<b><font color="green">You have received '+func('uniutil', 'scholarship_value')+' <b>₽</b> from your scholarship.</font></b>'
+		karta += func('uniutil', 'scholarship', 'get')
+		'<b><font color="green">You have received '+func('uniutil', 'scholarship', 'get')+' <b>₽</b> from your scholarship.</font></b>'
 	end
 
 	! Utilities for all apartments.

+ 2 - 2
locations/city_island.qsrc

@@ -38,7 +38,7 @@ end
 
 !call random events from [street_events], and display them before show location.
 gs'street_event','city_island' & if streetrand = -1:exit
-if func('uniutil', 'student_status') > 0:act '<b>GO HOME</b> (University dorm)':gt 'dorm', 'start'
+if func('uniutil', 'student', 'enrolled'):act '<b>GO HOME</b> (University dorm)':gt 'dorm', 'start'
 
 if car > 0 and cardrive = 25:'In the parking stands your <a href="exec:GS ''carF'', ''start''"><<$car>></a>.'
 
@@ -67,7 +67,7 @@ if week < 6 and hour >= 7:
 else
 	'The University is closed. It''s open during the week from 07:00.'
 end
-if func('uniutil', 'student_status') > 0 or hour >= 6:'The <a href="exec:gt ''dorm'', ''start''">University dorms</a> offers small, but cheap, living space, for university students.'
+if func('uniutil', 'student', 'enrolled') or hour >= 6:'The <a href="exec:gt ''dorm'', ''start''">University dorms</a> offers small, but cheap, living space, for university students.'
 
 
 

+ 1 - 1
locations/city_park.qsrc

@@ -78,7 +78,7 @@ if $ARGS[0] = 'start':
 	end
 
 	if hour >= 20 or hour < 6 :
-		if home_owned[1] = 0 and tanwork = 0 and func('uniutil', 'student_status') <= 0:
+		if home_owned[1] = 0 and tanwork = 0 and func('uniutil', 'student', 'not_enrolled'):
 			!nowhere to live in city
 			'It''s quite dark now, and you have nowhere to stay nearby. Maybe you should try to sleep on a bench?'
 		else

+ 3 - 3
locations/dorm.qsrc

@@ -18,7 +18,7 @@ if $ARGS[0] = 'start':
 		gt 'city_island'
 	end
 	
-	if func('uniutil', 'student_status') <= 0:
+	if func('uniutil', 'student', 'not_enrolled'):
 		menu_off = 1
 		'Since you''re not attending the University, you''re not allowed to enter unless you''re visiting someone you know.'
 		act 'Leave': minut += 5 & gt 'city_island'
@@ -32,7 +32,7 @@ if $ARGS[0] = 'start':
 		if gosh > 0 and hour >= 8 and hour < 22:
 			act 'I''m here to visit Gosha':
 				*clr & cla
-				'You say that you''re here to visit Gosha. The janitor chuckles and says "Gosha''s new bitch? What you sluts see in that scrawny bastard, I''ll never understand. He''s already been through half of the dorm already. Heh, go to your stud, bitch."'
+				'You say that you''re here to visit Gosha. The janitor chuckles and says "Gosha''s new bitch? What you sluts see in that scrawny bastard, I''ll never understand. He''s been through half of the dorm already. Heh, go to your stud, bitch."'
 				reccoldorm = 1
 				goshiflag = 1
 				act 'Enter':gt 'dorm', 'korr'
@@ -79,7 +79,7 @@ if $ARGS[0] = 'korr':
 		gt 'vann', 'start'
 	end
 
-	if func('uniutil', 'student_status') > 0:
+	if func('uniutil', 'student', 'enrolled'):
 		if courtletter_date <= daystart and courtletter_date ! 0:
 			gt 'sentence', 'letter'
 		end

+ 1 - 1
locations/korr.qsrc

@@ -168,7 +168,7 @@ if BurgerQW['IvanQW']  = 3 and hour >= 9 and hour <= 20:
 			workSec =0
 			preg = 0
 			young_shop_work = 0
-			gs 'uniutil', 'unenroll'
+			gs 'uniutil', 'student', 'unenroll'
 			gs 'stat'
 
 			'Time drags on slowly. Your life and work are tedious and monotonous. You''ve been sewing for five years, having meals in the dining room and going to sleep in the barracks surrounded by other female inmates. 1,000 <b>₽</b> of your 2,000 <b>₽</b> per month salary goes towards your debt repayment. As slow as it seems, time does not stand still and your torment finally comes to an end. You are released and given 2,000 <b>₽</b>. You board the train and come back to the city.'

+ 1 - 1
locations/korr2x.qsrc

@@ -137,7 +137,7 @@ if BurgerQW['IvanQW']  = 3 and hour >= 9 and hour <= 20:
 			workSec = 0
 			preg = 0
 			young_shop_work = 0
-			gs 'uniutil', 'unenroll'
+			gs 'uniutil', 'student', 'unenroll'
 			gs'stat'
 			'Time dragged on for a long time. Your life and work in prison was tedious and monotonous. You sewed quilted jackets, had dinner in the cafeteria and went to sleep in the barracks surrounded by other women inmates. With your salary 2000 <b>₽</b> a month listed 1000 debt repayment. Eventually you payed off your debt and your torment came to an end. With your time served you were released with 2000 <b>₽</b>. You were taken to the train station and given a ticket back to the city.'
 			act 'Exit the train': gt 'city_industrial_train', 'outside'

+ 1 - 1
locations/love.qsrc

@@ -30,7 +30,7 @@ if $ARGS[0] = 'mother':
 	'<<$loverdesc[lover_number]>> pulls out a chair for you and you sit down. His mother places herself in front of the two of you. She looks at you with disgust in her eyes, looking like an overgrown insect, clearly thinking you are not a girl for her son. "So, darling, what do you do for a living?"'
 
 	if (work = 1 or cheatWork = 1) and workKafe = 1:'"I am a waitress in a cafe."'
-	if func('uniutil', 'student_status') > 0 and diplom = 0:'"I study at the university."'
+	if func('uniutil', 'student', 'enrolled') and diplom = 0:'"I study at the university."'
 	if diplom = 1:'"I graduated from university."'
 	if work = 0 and cheatWork = 0 and workKafe ! 1:'"I''m unemployed."'
 

+ 1 - 1
locations/nichTanya.qsrc

@@ -1226,7 +1226,7 @@ elseif $ARGS[0] = 'chat':
 							end
 						end
 					end
-					if  func('uniutil', 'student_status') > 0:
+					if  func('uniutil', 'student', 'enrolled'):
 						act 'I know what I am talking about (student)':
 							'"I know what I am talking about. I am a student myself."'
 							'She bites down on her lip and hesitates for a few seconds.'

+ 1 - 1
locations/park_walkevents.qsrc

@@ -474,7 +474,7 @@ if $ARGS[0] = '5':
 
 	act 'Finish your walk':gt 'city_park', 'start'
 
-	if yaq = 0 and func('uniutil', 'student_status') > 0:
+	if yaq = 0 and func('uniutil', 'student', 'enrolled'):
 		*clr & cla
 		minut += 20
 		gs 'stat'

+ 1 - 1
locations/stat_display.qsrc

@@ -1652,7 +1652,7 @@ if home_owned[1] > 0:
 	$streetev_home = 'your apartment'
 elseif tanwork = 1:
 	$streetev_home = 'Tanya''s apartment'
-elseif func('uniutil', 'student_status') > 0:
+elseif func('uniutil', 'student', 'enrolled'):
 	$streetev_home = 'your dorm'
 elseif home_owned[2] = 1:
 	$streetev_home = 'outside your apartment block'

+ 4 - 4
locations/street_event.qsrc

@@ -11,7 +11,7 @@
 		shantpopala: 100% if shantpopala>0
 2. home-related events: check if player live here (workDolgDay, vladimirday, pcs_magik >= 1 and mainQW = 0, hour = meethour).
 [street]: home_owned[1] > 0 for korr
-[down]:tanwork = 1 for house, func('uniutil', 'student_status') > 0 for dorm
+[down]:tanwork = 1 for house, func('uniutil', 'student', 'enrolled') for dorm
 [city_industrial]:none for now. use (train station) as position, if no home in city.
 Known issue: boyfriend/vladimir may wait you in both place, if you rent house in [street] and study in university/work in Tanya
 
@@ -49,7 +49,7 @@ elseif $ARGS[0] = 'city_industrial':
 	streetev_hijack = 0
 	streetev_bf = 30
 	streetev_mistmeet = 5
-	if home_owned[1] = 0 and tanwork = 0 and func('uniutil', 'student_status') <= 0:
+	if home_owned[1] = 0 and tanwork = 0 and func('uniutil', 'student', 'not_enrolled'):
 		streetev_home = 0
 		$streetev_home = 'by the train station'
 	end
@@ -69,7 +69,7 @@ elseif $ARGS[0] = 'pav_commercial':
 	streetev_hijack = 2
 	streetev_bf = 90
 	streetev_mistmeet = 20
-	if home_owned[1] = 0 and tanwork = 0 and func('uniutil', 'student_status') <= 0:
+	if home_owned[1] = 0 and tanwork = 0 and func('uniutil', 'student', 'not_enrolled'):
 		streetev_home = 0
 		$streetev_home = 'on the high street'
 	end
@@ -85,7 +85,7 @@ elseif $ARGS[0] = 'city_island':
 	streetev_hijack = 2
 	streetev_bf = 90
 	streetev_mistmeet = 20
-	if func('uniutil', 'student_status') > 0:
+	if func('uniutil', 'student', 'enrolled'):
 		streetev_home = 1
 		$streetev_home = 'near the entrance to your dorm'
 	end

+ 1 - 1
locations/unicoursework.qsrc

@@ -4,7 +4,7 @@ $unicourseworkloc[0] = $ARGS[1]
 $unicourseworkloc[1] = $ARGS[2]
 
 if $ARGS[0] = 'start':
-	if func('uniutil', 'student_status') > 0 and func('uniutil', 'finished_assignment') = 0:
+	if func('uniutil', 'student', 'enrolled') and func('uniutil', 'finished_assignment') = 0:
 		if $unicourseworkloc[0] = 'komp':
 			'You should probably do some of your <a href="exec:gt ''unicoursework'',$unicourseworkloc[0],$unicourseworkloc[1],1">coursework</a>.'
 		else:

+ 394 - 343
locations/uniutil.qsrc

@@ -1,117 +1,109 @@
 # uniutil
 
 if $ARGS[0] = 'eligible_for_university':
-	RESULT = func('uniutil', 'student_status') = 0 and diplom = 0 and (age >= 17 or fakepassport = 1)
+	RESULT = func('uniutil', 'student', 'status') = 0 and func('uniutil', 'student', 'graduated') = 0 and (age >= 17 or fakepassport = 1)
 end
 
-if $ARGS[0] = 'set_preclass_enrolled':
-	prepclassstats['enrolled'] = ARGS[1]
-end
-
-if $ARGS[0] = 'is_enrolled_prepclass':
-	RESULT = prepclassstats['enrolled'] = 1
-end
+if $ARGS[0] = 'prepclass':
+	if $ARGS[1] = 'cost':
+		RESULT = 15000
+	end
 
-if $ARGS[0] = 'prepclass_count':
-	RESULT = prepclassstats['count']
-end
+	if $ARGS[1] = 'closing_hour':
+		RESULT = 21
+	end
 
-if $ARGS[0] = 'prepclass_cost':
-	RESULT = 15000
-end
+	if $ARGS[1] = 'is_enrolled':
+		RESULT = prepclassstats['enrolled'] = 1
+	end
 
-if $ARGS[0] = 'prepclass_closing_hour':
-	RESULT = 21
-end
+	if $ARGS[1] = 'set_enrolled':
+		prepclassstats['enrolled'] = ARGS[2]
+	end
 
-if $ARGS[0] = 'is_prepclass_month':
-	RESULT = month <= func('uniutil', 'entrance_exam_month')
-end
+	if $ARGS[1] = 'count':
+		RESULT = prepclassstats['count']
+	end
 
-if $ARGS[0] = 'prepclass_in_session':
-	RESULT = hour < func('uniutil', 'prepclass_closing_hour') and week < 6
+	if $ARGS[1] = 'set_count':
+		prepclassstats['count'] = ARGS[2]
+	end
 
-if $ARGS[0] = 'set_prepclass_count':
-	prepclassstats['count'] = ARGS[1]
-end
+	if $ARGS[1] = 'update_count':
+		prepclassstats['count'] += 1
+	end
 
-if $ARGS[0] = 'update_prepclass_count':
-	prepclassstats['count'] += 1
-end
+	if $ARGS[1] = 'enroll':
+		money -= func('uniutil', 'prepclass', 'cost')
+		gs 'uniutil', 'prepclass', 'set_enrolled', 1
+		gs 'uniutil', 'prepclass', 'set_count', 0
+	end
 
-if $ARGS[0] = 'enroll_prepclass':
-	money -= func('uniutil', 'prepclass_cost')
-	gs 'uniutil', 'set_preclass_enrolled' 1
-	gs 'uniutil', 'set_prepclass_count', 0
-end
+	if $ARGS[1] = 'unenroll':
+		killvar 'prepclassstats'
+	end
 
-if $ARGS[0] = 'unenroll_prepclass':
-	killvar 'prepclassstats'
+	if $ARGS[1] = 'offered_this_month':
+		RESULT = month <= func('uniutil', 'entrance_exam', 'month')
+	end
 
-if $ARGS[0] = 'entrance_exam_month':
-	RESULT = 8
-end
+	if $ARGS[1] = 'offered_today':
+		RESULT = func('uniutil', 'entrance_exam', 'offered_this_month') and week < 6
+	end
 
-if $ARGS[0] = 'is_entrance_exam_month':
-	RESULT = month = func('uniutil', 'entrance_exam_month')
+	if $ARGS[1] = 'in_session':
+		RESULT = func('uniutil', 'prepclass', 'offered_today') and hour < func('uniutil', 'prepclass', 'closing_hour')
+	end
 end
 
-if $ARGS[0] = 'student_status':
-	if student >= 0:
-		gs 'uniutil', 'transfer_legacy_vars'
+if $ARGS[0] = 'entrance_exam':
+	if $ARGS[1] = 'month':
+		RESULT = 8
 	end
 
-	if student > 0:
-		uni_semvdateres = func('uniutil', 'check_semester_vs_date')
-
-		if uni_semvdateres < 0:
-			!! date indicates semester exam skipped
-			gs 'uniutil', 'expel'
-		elseif uni_semvdateres > 0:
-			!! date indicates semester exam passed and next semester started
-			gs 'uniutil', 'update_semester'
-			gs 'uniutil', 'update_semester_year'
-			gs 'uniutil', 'reset_semester_result'
-			gs 'uniutil', 'update_prev_passed_semesters'
-		else:
-			!! date indicates semester is still in progress
-			gs 'uniutil', 'update_semester_year'
-		end
-
-		killvar 'uni_semvdateres'
+	if $ARGS[1] = 'offered_today':
+		RESULT = month = func('uniutil', 'entrance_exam', 'month')
 	end
-
-	RESULT = student
 end
 
+!! The legacy vars are the vars used by the university before the vars were largely consolidated into
+!! arrays with string indices. This function exists to avoid breaking old save files with this change,
+!! which was made in September 2020. It can be removed whenever it is felt enough time has passed.
 if $ARGS[0] = 'transfer_legacy_vars':
 	if abiturient > 0:
-		gs 'uniutil', 'set_preclass_enrolled' 1
-		gs 'uniutil', 'set_prepclass_count', abiturient - 1
+		gs 'uniutil', 'prepclass', 'set_enrolled', 1
+		gs 'uniutil', 'prepclass', 'set_count', abiturient - 1
 	end
 
 	killvar 'abiturient'
 
 	if kurs > 0:
-		if func('uniutil', 'semester') = 2 and month = func('uniutil', 'exam_month', 1):
+		if (semestr = 1 and month < func('uniutil', 'entrance_exam', 'month')) or (semestr = 2 and month > func('uniutil', 'exam', 'month', 2)):
+			!! under the old system, the semestr variable was advanced when the exam was passed, so if the
+			!! variable is set to a value that does not match the current month, the player skipped the exam
+			!! and is expelled
+			gs 'student', 'set_status', -2
+			killvar 'unisemestrstats'
+		elseif semestr = 2 and month = func('uniutil', 'exam', 'month', 1):
 			!! semestr = 2 in first semester exam month in the old system indicates that its still the first
 			!! semester (time-wise) but the exam has been passed, so we set the new variables accordingly.
-			gs 'uniutil', 'set_semester_num', 1
-			gs 'uniutil', 'reset_lectures_attended'
-			gs 'uniutil', 'reset_assignments'
-			gs 'uniutil', 'set_semester_passed'
-			gs 'uniutil', 'set_prev_passed_semesters', 0
+			gs 'uniutil', 'semester', 'set', 1
+			gs 'uniutil', 'attendance', 'reset'
+			gs 'uniutil', 'assignment_progress', 'reset'
+			gs 'uniutil', 'assignments_done', 'reset'
+			gs 'uniutil', 'semester_result', 'set_passed'
+			gs 'uniutil', 'passed_semesters', 'set', 0
 		else:
-			gs 'uniutil', 'set_semester_num', semestr
-			gs 'uniutil', 'set_lectures_attended', lektor
-			gs 'uniutil', 'set_assignment_progress', kursovik
-			gs 'uniutil', 'set_assignments_done', kursovikD
-			gs 'uniutil', 'reset_semester_result'
-			gs 'uniutil', 'set_prev_passed_semesters', iif(semestr = 2, 1, 0)
+			gs 'uniutil', 'semester', 'set', semestr
+			gs 'uniutil', 'attendance', 'set', lektor
+			gs 'uniutil', 'assignment_progress', 'set', kursovik
+			gs 'uniutil', 'assignments_done', 'set', kursovikD
+			gs 'uniutil', 'semester_result', 'reset'
+			gs 'uniutil', 'passed_semesters', 'set', iif(semestr = 2, 1, 0)
 		end
 
-		gs 'uniutil', 'update_semester_year'
-		gs 'uniutil', 'set_scholarship', stipuha
+		gs 'uniutil', 'semester', 'update_year'
+		gs 'uniutil', 'scholarship', 'set', stipuha
 	end
 
 	killvar 'kurs'
@@ -123,362 +115,421 @@ if $ARGS[0] = 'transfer_legacy_vars':
 	killvar 'examen'
 end
 
-if $ARGS[0] = 'enroll_university':
-	gs 'uniutil', 'unenroll_prepclass'
-	student = 1
-	gs 'uniutil', 'set_semester_num', 1
-	gs 'uniutil', 'update_semester_year'
-	gs 'uniutil', 'reset_scholarship'
-	gs 'uniutil', 'reset_lectures_attended'
-	gs 'uniutil', 'reset_assignments'
-	gs 'uniutil', 'reset_semester_result'
-end
-
-if $ARGS[0] = 'unenroll_university':
-	if student > 0:
-		killvar 'student'
-		killvar 'unisemestrstats'
+if $ARGS[0] = 'check_semester_vs_date':
+	if year > func('uniutil', 'semester', 'get_year') + 1:
+		!! if year has advanced by more than one since a semester was finished, semesters were skipped.
+		RESULT = -1
+		exit
 	end
-end
 
-if $ARGS[0] = 'unenroll':
-	gs 'uniutil', 'unenroll_prepclass'
-	gs 'uniutil', 'unenroll_university'
-end
+	unilect_sm = func('uniutil', 'lecture', 'start_month', func('uniutil', 'semester', 'get'))
+	uniexam_m = func('uniutil', 'exam', 'month', func('uniutil', 'semester', 'get'))
+	uniexam_mns = func('uniutil', 'exam', 'month', func('uniutil','semester', 'next'))
 
-if $ARGS[0] = 'expel':
-	if func('uniutil', 'semester_failed') ! 0:
-		gs 'uniutil', 'unenroll'
-		student = -1
-	elseif func('uniutil', 'check_semester_vs_date') < 0:
-		gs 'uniutil', 'unenroll'
-		student = -2
+	if year = func('uniutil', 'semester', 'get_year') + 1:
+		if month > uniexam_m mod 12 and func('uniutil', 'semester_passed') and month <= uniexam_mns:
+			!! the semester was passed and the next one is not over
+			RESULT = 1
+		elseif month <= uniexam_m:
+			!! the semester is still in progress
+			RESULT = 0
+		else:
+			!! expelled
+			RESULT = -1
+		end
 	else:
-		gs 'uniutil', 'unenroll'
-		student = -3
+		if unilect_sm > uniexam_m or month <= uniexam_m:
+			!! The semester is still in progress
+			RESULT = 0
+		elseif func('uniutil', 'semester_result', 'is_passed') and (uniexam_m > uniexam_mns or month <= uniexam_mns):
+			!! the semester was passed and the next one is not over
+			RESULT = 1
+		else:
+			!! expelled
+			RESULT = -1
+		end
 	end
-end
 
-if $ARGS[0] = 'graduate':
-	gs 'uniutil', 'unenroll'
-	diplom = 1
+	killvar 'unilect_sm'
+	killvar 'uniexam_m'
+	killvar 'uniexam_mns'
 end
 
-if $ARGS[0] = 'graduated':
-	RESULT = diplom > 0
-end
+if $ARGS[0] = 'student':
+	if $ARGS[1] = 'status':
+		if student >= 0:
+			gs 'uniutil', 'transfer_legacy_vars'
+		end
 
-if $ARGS[0] = 'expelled_for_failing':
-	RESULT = func('uniutil', 'student_status') = -1
-end
+		if student > 0:
+			uni_semvdateres = func('uniutil', 'check_semester_vs_date')
+
+			if uni_semvdateres < 0:
+				!! date indicates semester exam skipped
+				gs 'uniutil', 'student', 'expel'
+			elseif uni_semvdateres > 0:
+				!! date indicates semester exam passed and next semester started
+				gs 'uniutil', 'semester', 'update'
+				gs 'uniutil', 'semester', 'update_year'
+				gs 'uniutil', 'semester_result', 'reset'
+				gs 'uniutil', 'passed_semesters', 'update'
+			else:
+				!! date indicates semester is still in progress
+				gs 'uniutil', 'semester', 'update_year'
+			end
+
+			killvar 'uni_semvdateres'
+		end
 
-if $ARGS[0] = 'expelled_for_skipping':
-	RESULT = func('uniutil', 'student_status') = -2
-end
+		RESULT = student
+	end
 
-if $ARGS[0] = 'expelled_for_other_reason':
-	RESULT = func('uniutil', 'student_status') = -3
-end
+	if $ARGS[1] = 'set_status':
+		student = ARGS[2]
+	end
 
-if $ARGS[0] = 'semesters_to_graduate':
-	RESULT = 2
-end
+	if $ARGS[1] = 'enroll':
+		gs 'uniutil', 'prepclass', 'unenroll'
+		gs 'uniutil', 'student', 'set_status', 1
+		gs 'uniutil', 'semester', 'set' 1
+		gs 'uniutil', 'semester', 'update_year'
+		gs 'uniutil', 'scholarship', 'reset'
+		gs 'uniutil', 'attendance', 'reset'
+		gs 'uniutil', 'assignment_progress', 'reset'
+		gs 'uniutil', 'assignments_done', 'reset'
+		gs 'uniutil', 'semester_result', 'reset'
+	end
 
-if $ARGS[0] = 'lecture_start_hour':
-	RESULT = 8
-end
+	if $ARGS[1] = 'unenroll':
+		gs 'uniutil', 'prepclass', 'unenroll'
+		if student > 0:
+			killvar 'student'
+			killvar 'unisemestrstats'
+		end
+	end
 
-if $ARGS[0] = 'lecture_length':
-	RESULT = 6
+	if $ARGS[1] = 'expel':
+		if func('uniutil', 'semester_result', 'is_failed'):
+			gs 'uniutil', 'student', 'unenroll'
+			gs 'uniutil', 'student', 'set_status', -1
+		elseif func('uniutil', 'check_semester_vs_date') < 0:
+			gs 'uniutil', 'student', 'unenroll'
+			sgs 'uniutil', 'student', 'set_status', -2
+		else:
+			gs 'uniutil', 'student', 'unenroll'
+			gs 'uniutil', 'student', 'set_status', -3
+		end
+	end
 
-if $ARGS[0] = 'lectures_attended':
-	RESULT = unisemestrstats['lectures_attended']
-end
+	if $ARGS[1] = 'graduate':
+		gs 'uniutil', 'student', 'unenroll'
+		diplom = 1
+	end
 
-if $ARGS[0] = 'set_lectures_attended':
-	unisemestrstats['lectures_attended'] = ARGS[1]
-end
+	if $ARGS[1] = 'graduated':
+		RESULT = diplom > 0
+	end
 
-if $ARGS[0] = 'update_lectures_attended':
-	gs 'uniutil', 'set_lectures_attended', func('uniutil', 'lectures_attended') + 1
-end
+	if $ARGS[1] = 'expelled_for_failing':
+		RESULT = func('uniutil', 'student', 'status') = -1
+	end
 
-if $ARGS[0] = 'reset_lectures_attended':
-	gs 'uniutil', 'set_lectures_attended', 0
-end
+	if $ARGS[1] = 'expelled_for_skipping':
+		RESULT = func('uniutil', 'student', 'status') = -2
+	end
+
+	if $ARGS[1] = 'expelled_for_other_reason':
+		RESULT = func('uniutil', 'student', 'status') = -3
+	end
+
+	if $ARGS[1] = 'enrolled':
+		RESULT = func('uniutil', 'student', 'status') > 0
+	end
+
+	if $ARGS[1] = 'not_enrolled':
+		RESULT = func('uniutil', 'student', 'status') <= 0
+	end
 
-if $ARGS[0] = 'have_great_attendence':
-	RESULT = func('uniutil', 'lectures_attended') > 55
+	if $ARGS[1] = 'semesters_to_graduate':
+		RESULT = 2
+	end
 end
 
-if $ARGS[0] = 'have_ok_attendence':
-	RESULT = func('uniutil', 'lectures_attended') > 40
+if $ARGS[0] = 'attendance'
+	if $ARGS[1] = 'get':
+		RESULT = unisemestrstats['lectures_attendad']
+	end
+
+	if $ARGS[1] = 'set':
+		unisemestrstats['lectures_attendad'] = ARGS[2]
+	end
+
+	if $ARGS[1] = 'update':
+		gs 'uniutil', 'attendance', 'set', func('uniutil', 'attendance', 'get') + 1
+	end
+
+	if $ARGS[1] = 'reset':
+		gs 'uniutil', 'attendance', 'set', 0
+	end
+
+	if $ARGS[1] = 'is_great':
+		RESULT = func('uniutil', 'attendance', 'get') > 55
+	end
+
+	if $ARGS[1] = 'is_ok':
+		RESULT = func('uniutil', 'attendance', 'get') > 40
+	end
+
+	if $ARGS[1] = 'is_bad':
+		RESULT = func('uniutil', 'attendance', 'get') <= 40
+	end
 end
 
 if $ARGS[0] = 'assignment_progress':
-	RESULT = unisemestrstats['assignment_progress']
-end
+	if $ARGS[1] = 'get'
+		RESULT = unisemestrstats['assignment_progress']
+	end
 
-if $ARGS[0] = 'set_assignment_progress':
-	unisemestrstats['assignment_progress'] = iif(ARGS[1] <= 100, ARGS[1], 100)
-end
+	if $ARGS[1] = 'set':
+		unisemestrstats['assignment_progress'] = iif(ARGS[2] <= 100, ARGS[2], 100)
+	end
 
-if $ARGS[0] = 'update_assignment_progress':
-	gs 'uniutil', 'set_assignment_progress', func('uniutil', 'assignment_progress') + rand(pcs_intel / 20, pcs_intel / 10)
-end
+	if $ARGS[1] = 'update':
+		gs 'uniutil', 'assignment_progress', 'set', func('uniutil', 'assignment_progress', 'get') + rand(pcs_intel / 20, pcs_intel / 10)
+	end
 
-if $ARGS[0] = 'reset_assignment_progress':
-	gs 'uniutil', 'set_assignment_progress', 0
-end
+	if $ARGS[1] = 'reset':
+		gs 'uniutil', 'assignment_progress', 'set', 0
+	end
 
-if $ARGS[0] = 'finished_assignment':
-	RESULT = func('uniutil', 'assignment_progress') >= 100
+	if $ARGS[1] = 'is_finished':
+		RESULT = func('uniutil', 'assignment_progress', 'get') >= 100
 end
 
 if $ARGS[0] = 'assignments_done':
-	RESULT = unisemestrstats['assignments_done']
-end
+	if $ARGS[1] = 'get':
+		RESULT = unisemestrstats['assignments_done']
+	end
 
-if $ARGS[0] = 'set_assignments_done':
-	unisemestrstats['assignments_done'] = ARGS[1]
-end
+	if $ARGS[1] = 'set':
+		unisemestrstats['assignments_done'] = ARGS[2]
+	end
 
-if $ARGS[0] = 'update_assignments_done':
-	gs 'uniutil', 'reset_assignment_progress'
-	gs 'uniutil', 'set_assignemnts_done', func('uniutil', 'assignments_done') + 1
-end
+	if $ARGS[1] = 'update':
+		gs 'uniutil', 'assignment_progress', 'reset'
+		gs 'uniutil', 'assignments_done', 'set', func('uniutil', 'assignments_done', 'get') + 1
+	end
 
-if $ARGS[0] = 'reset_assignments_done':
-	gs 'uniutil', 'set_assignments_done', 0
-end
+	if $ARGS[1] = 'reset':
+		gs 'uniutil', 'assignments_done', 'set', 0
+	end
 
-if $ARGS[0] = 'reset_assignments':
-	gs 'uniutil', 'reset_assignment_progress'
-	gs 'uniutil', 'reset_assignments_done'
-end
+	if $ARGS[1] = 'great_num':
+		RESULT = 11
+	end
 
-if $ARGS[0] = 'great_num_assignments':
-	RESULT = 11
-end
+	if $ARGS[1] = 'min_num':
+		RESULT = 1
+	end
 
-if $ARGS[0] = 'min_num_assignments':
-	RESULT = 1
-end
+	if $ARGS[1] = 'did_great_num':
+		RESULT = func('uniutil', 'assignments_done', 'get') >= func('uniutil', 'assignments_done', 'great_num')
+	end
 
-if $ARGS[0] = 'did_great_num_assignments':
-	RESULT = func('uniutil', 'assignments_done') >= func('uniutil', 'great_num_assignments')
+	if $ARGS[1] = 'did_min_num':
+		RESULT = func('uniutil', 'assignments_done', 'get') >= func('uniutil', 'assignments_done', 'min_num')
+	end
 end
 
-if $ARGS[0] = 'did_min_num_assignments':
-	RESULT = func('uniutil', 'assignments_done') >= func('uniutil', 'min_num_assignments')
-end
+if $ARGS[0] = 'scholarship':
+	if $ARGS[1] = 'get':
+		RESULT = 1200
+	end
 
-if $ARGS[0] = 'scholarship_active':
-	RESULT = unisemestrstats['scholarship'] = 1 and func('uniutil', 'is_semester_month') ! 0
-end
+	if $ARGS[1] = 'set':
+		unisemestrstats['scholarship'] = ARGS[2]
+	end
 
-if $ARGS[0] = 'scholarship_value':
-	RESULT = 1200
-end
+	if $ARGS[1] = 'enable'
+		gs 'uniutil', 'scholarship', 'set', 1
+	end
 
-if $ARGS[0] = 'set_scholarship':
-	unisemestrstats['scholarship'] = ARGS[1]
-end
+	if $ARGS[1] = 'reset':
+		gs 'uniutil', 'scholarship', 'set', 0
+	end
 
-if $ARGS[0] = 'enable_scholarship'
-	gs 'uniutil', 'set_scholarship', 1
+	if $ARGS[1] = 'is_active':
+		RESULT = unisemestrstats['scholarship'] = 1 and func('uniutil', 'semester', 'is_active')
+	end
 end
 
-if $ARGS[0] = 'reset_scholarship':
-	gs 'uniutil', 'set_scholarship', 0
-end
+if $ARGS[0] = 'lecture':
+	if $ARGS[1] = 'start_hour':
+		RESULT = 8
+	end
 
-if $ARGS[0] = 'semester':
-	RESULT = unisemestrstats['num']
-end
+	if $ARGS[1] = 'length':
+		RESULT = 6
 
-if $ARGS[0] = 'set_semester_num':
-	unisemestrstats['num'] = ARGS[1]
-end
+	if $ARGS[1] = 'start_month':
+		if ARGS[2] = 1:
+			RESULT = 9
+		elseif ARGS[2] = 2:
+			RESULT = 2
+		else:
+			!! Set to impossible month if it is not semester 1 or 2
+			RESULT = 13
+		end
+	end
 
-if $ARGS[0] = 'next_semester':
-	if func('uniutil', 'semester') = 1:
-		RESULT = 2
-	else:
-		RESULT = 1
+	if $ARGS[1] = 'end_month':
+		if ARGS[2] = 1:
+			RESULT = 11
+		elseif ARGS[2] = 2:
+			RESULT = 4
+		else:
+			!! Set to impossible month if it is not semester 1 or 2
+			RESULT = 0
+		end
 	end
-end
 
-if $ARGS[0] = 'update_semester':
-	gs 'uniutil', 'set_semester_num', func('uniutil', 'next_semester')
-end
+	if $ARGS[1] = 'offered_this_month':
+		unilect_sm = func('uniutil', 'lecture', 'start_month', func('uniutil', 'semester', 'get'))
+		unilect_em = func('uniutil', 'lecture', 'end_month', func('uniutil', 'semester', 'get'))
+		if unilect_sm <= unilect_em:
+			!! if semester is in one calendar year
+			RESULT = month >= unilect_sm and month <= unilect_em
+		else:
+			!! if semester continues through New Years
+			RESULT = month >= unilect_sm or month <= unilect_em
+		end
+		killvar 'unilect_sm'
+		killvar 'unilect_em'
+	end
 
-if $ARGS[0] = 'semester_year':
-	RESULT = unisemestrstats['year']
-end
+	if $ARGS[1] = 'offered_today':
+		RESULT = func('uniutil', 'lecture', 'offered_this_month') and week < 6
+	end
 
-if $ARGS[0] = 'update_semester_year':
-	unisemestrstats['year'] = year
+	if $ARGS[1] = 'in_session':
+		RESULT = func('uniutil', 'lecture', 'offered_today') and hour < func('uniutil', 'lecture', 'start_hour')
+	end
 end
 
-if $ARGS[0] = 'lecture_start_month':
-	if ARGS[1] = 1:
-		RESULT = 9
-	elseif ARGS[1] = 2:
-		RESULT = 2
-	else:
-		!! Set to impossible month if it is not semester 1 or 2
-		RESULT = 13
+if $ARGS[0] = 'exam':
+	if $ARGS[1] = 'month':
+		if ARGS[2] = 1:
+			RESULT = 12
+		elseif ARGS[2] = 2:
+			RESULT = 5
+		else:
+			!! Set to impossible month if it is not semester 1 or 2
+			RESULT = 0
+		end
 	end
-end
 
-if $ARGS[0] = 'lecture_end_month':
-	if ARGS[1] = 1:
-		RESULT = 11
-	elseif ARGS[1] = 2:
-		RESULT = 4
-	else:
-		!! Set to impossible month if it is not semester 1 or 2
-		RESULT = 0
+	if $ARGS[1] = 'offered_this_month':
+		RESULT = month = func('uniutil', 'exam', 'month', func('uniutil', 'semester', 'get'))
 	end
-end
 
-if $ARGS[0] = 'exam_month':
-	if ARGS[1] = 1:
-		RESULT = 12
-	elseif ARGS[1] = 2:
-		RESULT = 5
-	else:
-		!! Set to impossible month if it is not semester 1 or 2
-		RESULT = 0
+	if $ARGS[1] = 'offered_today':
+		RESULT = func('uniutil', 'exam', 'offered_this_month') and week < 6
 	end
 end
 
-if $ARGS[0] = 'is_lecture_month':
-	unilect_sm = func('uniutil', 'lecture_start_month', func('uniutil', 'semester'))
-	unilect_em = func('uniutil', 'lecture_end_month', func('uniutil', 'semester'))
-	if unilect_sm <= unilect_em:
-		!! if semester is in one calendar year
-		RESULT = month >= unilect_sm and month <= unilect_em
-	else:
-		!! if semester continues through New Years
-		RESULT = month >= unilect_sm or month <= unilect_em
+if $ARGS[0] = 'semester':
+	if $ARGS[1] = 'get':
+		RESULT = unisemestrstats['num']
 	end
-	killvar 'unilect_sm'
-	killvar 'unilect_em'
-end
 
-if $ARGS[0] = 'lecture_in_session':
-	RESULT = func('uniutil', 'is_lecture_month') ! 0 and week < 6
+	if $ARGS[1] = 'set':
+		unisemestrstats['num'] = ARGS[2]
+	end
 
-if $ARGS[0] = 'is_exam_month':
-	RESULT = month = func('uniutil', 'exam_month', func('uniutil', 'semester'))
-end
+	if $ARGS[1] = 'next':
+		if func('uniutil', 'semester', 'get') = 1:
+			RESULT = 2
+		else:
+			RESULT = 1
+		end
+	end
 
-if $ARGS[0] = 'exam_in_session':
-	RESULT = func('uniutil', 'is_exam_month') ! 0 and week < 6
+	if $ARGS[1] = 'update':
+		gs 'uniutil', 'semester', 'set', func('uniutil', 'semester', 'next')
+	end
 
-if $ARGS[0] = 'is_semester_month':
-	RESULT = func('uniutil', 'is_lecture_month') ! 0 or func('uniutil', 'is_exam_month') ! 0
+	if $ARGS[1] = 'get_year':
+		RESULT = unisemestrstats['year']
+	end
+
+	if $ARGS[1] = 'update_year':
+		unisemestrstats['year'] = year
+	end
+
+	if $ARGS[1] = 'is_active':
+		RESULT = func('uniutil', 'lecture', 'offered_this_month') or func('uniutil', 'exam' 'offered_this_month')
+	end
 end
 
 if $ARGS[0] = 'semester_result':
+	if $ARGS[1] = 'get':
 	RESULT = unisemestrstats['is_passed']
 end
 
-if $ARGS[0] = 'set_semester_result':
-	unisemestrstats['is_passed'] = ARGS[1]
-end
+	if $ARGS[1] = 'set':
+		unisemestrstats['is_passed'] = ARGS[2]
+	end
 
-if $ARGS[0] = 'set_semester_passed':
-	gs 'uniutil', 'set_semester_result', 1
-end
+	if $ARGS[1] = 'set_passed':
+		gs 'uniutil', 'semester_result', 'set', 1
+	end
 
-if $ARGS[0] = 'set_semester_failed':
-	gs 'uniutil', 'set_semester_result', -1
-end
+	if $ARGS[1] = 'set_failed':
+		gs 'uniutil', 'semester_result', 'set', -1
+	end
 
-if $ARGS[0] = 'reset_semester_result':
-	gs 'uniutil', 'set_semester_result', 0
-end
+	if $ARGS[1] = 'reset':
+		gs 'uniutil', 'semester_result', 'set', 0
+	end
 
-if $ARGS[0] = 'semester_passed':
-	RESULT = func('uniutil', 'semester_result') > 0
-end
+	if $ARGS[1] = 'is_passed':
+		RESULT = func('uniutil', 'semester_result', 'get') > 0
+	end
 
-if $ARGS[0] = 'semester_failed':
-	RESULT = func('uniutil', 'semester_result') < 0
+	if $ARGS[1] = 'is_failed':
+		RESULT = func('uniutil', 'semester_result', 'get') < 0
+	end
 end
 
 if $ARGS[0] =  'exam_outcome':
-	gs 'uniutil', 'reset_assignments'
-	gs 'uniutil', 'reset_lectures_attended'
+	gs 'uniutil', 'assignment_progress', 'reset'
+	gs 'uniutil', 'assignments_done', 'reset'
+	gs 'uniutil', 'attendance', 'reset'
 
 	if $ARGS[1] = 'passed_honors':
-		gs 'uniutil', 'set_semester_passed'
-		gs 'uniutil', 'enable_scholarship'
+		gs 'uniutil', 'semester_result', 'set_passed'
+		gs 'uniutil', 'scholarship', 'enable'
 	elseif $ARGS[1] = 'passed'
-		gs 'uniutil', 'set_semester_passed'
-		gs 'uniutil', 'reset_scholarship'
+		gs 'uniutil', 'semester_result', 'set_passed'
+		gs 'uniutil', 'scholarship', 'reset'
 	else:
-		gs 'uniutil', 'set_semester_failed'
-		gs 'uniutil', 'reset_scholarship'
+		gs 'uniutil', 'semester_result', 'set_failed'
+		gs 'uniutil', 'scholarship', 'reset'
 	end
 end
 
-if $ARGS[0] = 'check_semester_vs_date':
-	if year > func('uniutil', 'semester_year') + 1:
-		!! if year has advanced by more than one since a semester was finished, semesters were skipped.
-		RESULT = -1
-		exit
+if $ARGS[0] = 'passed_semesters':
+	if $ARGS[1] = 'get':
+		RESULT = unisemestrstats['prev_passed_count'] + iif(func('uniutil', 'semester_result', 'is_passed'), 1, 0)
 	end
 
-	unilect_sm = func('uniutil', 'lecture_start_month', func('uniutil', 'semester'))
-	uniexam_m = func('uniutil', 'exam_month', func('uniutil', 'semester'))
-	uniexam_mns = func('uniutil', 'exam_month', func('uniutil','next_semester'))
-
-	if year = func('uniutil', 'semester_year') + 1:
-		if month > uniexam_m mod 12 and func('uniutil', 'semester_passed') ! 0 and month <= uniexam_mns:
-			!! the semester was passed and the next one is not over
-			RESULT = 1
-		elseif month <= uniexam_m:
-			!! the semester is still in progress
-			RESULT = 0
-		else:
-			RESULT = -1
-		end
-	else:
-		if unilect_sm > uniexam_m or month <= uniexam_m:
-			!! The semester is still in progress
-			RESULT = 0
-		elseif func('uniutil', 'semester_passed') ! 0 and (uniexam_m > uniexam_mns or month <= uniexam_mns):
-			!! the semester was passed and the next one is not over
-			RESULT = 1
-		else:
-			!!expelled
-			RESULT = -1
-		end
+	if $ARGS[1] = 'set':
+		unisemestrstats['prev_passed_count'] = ARGS[2]
 	end
 
-	killvar 'unilect_sm'
-	killvar 'uniexam_m'
-	killvar 'uniexam_mns'
-end
-
-if $ARGS[0] = 'prev_passed_semesters':
-	RESULT = unisemestrstats['prev_passed_count']
-end
-
-if $ARGS[0] = 'set_prev_passed_semesters':
-	unisemestrstats['prev_passed_count'] = ARGS[1]
-end
-
-if $ARGS[0] = 'update_prev_passed_semesters':
-	gs 'uniutil', 'set_prev_passed_semesters', func('uniutil', 'prev_passed_semesters') + 1
-end
-
-if $ARGS[0] = 'passed_semester_count':
-	RESULT = func('uniutil', 'prev_passed_semesters') + iif(func('uniutil', 'semester_passed') ! 0, 1, 0)
+	if $ARGS[1] = 'update':
+		gs 'uniutil', 'passed_semesters', 'set', func('uniutil', 'passed_semesters', 'get')
+	end
 end
 
 --- uniutil ---------------------------------

+ 55 - 53
locations/univer.qsrc

@@ -12,33 +12,33 @@ if $ARGS[0] = 'start':
 	'<center><b><font color="maroon">The University</font></b></center>'
 	'<center><img <<$set_imgh>> src="images/locations/city/island/university/univer.jpg"></center>'
 
-	'University lectures begin at <b>'+func('uniutil', 'lecture_start_hour')+':00</b>. Students aren''t allowed to attend if late.'
+	'University lectures begin at <b>'+func('uniutil', 'lecture', 'start_hour')+':00</b>. Students aren''t allowed to attend if late.'
 	'First semester: September, October, November.'
 	'Second semester: February, March, April.'
 
-	if func('uniutil', 'graduated') ! 0:
+	if func('uniutil', 'student', 'graduated'):
 		'You have graduated from the University.'
-	elseif func('uniutil', 'expelled_for_failing') ! 0:
+	elseif func('uniutil', 'student', 'expelled_for_failing'):
 		'You have been expelled from the University for failing your exams.'
-	elseif func('uniutil', 'expelled_for_skipping') ! 0:
+	elseif func('uniutil', 'student', 'expelled_for_skipping'):
 		'You have been expelled from the University for skipping your exams.'
-	elseif func('uniutil', 'expelled_for_other_reason') ! 0:
+	elseif func('uniutil', 'student', 'expelled_for_other_reason'):
 		'You have been expelled from the University for reasons unrelated to your exam results.'
-	elseif func('uniutil', 'student_status') > 0:
-		if func('uniutil', 'passed_semester_count') = func('uniutil', 'semesters_to_graduate'):
-			gs 'uniutil', 'graduate'
+	elseif func('uniutil', 'student', 'enrolled'):
+		if func('uniutil', 'passed_semesters', 'get') = func('uniutil', 'student', 'semesters_to_graduate'):
+			gs 'uniutil', 'student', 'graduate'
 			'Congratulations, you''ve earned your degree!'
-		elseif func('uniutil', 'semester_failed') ! 0:
-			gs 'uniutil', 'expel'
+		elseif func('uniutil', 'semester_result', 'is_failed'):
+			gs 'uniutil', 'student', 'expel'
 			'You got expelled from the University.'
 		else:
 			'You are enrolled at the University.'
 		end
 	else:
-		if func('uniutil', 'is_enrolled_prepclass') ! 0:
+		if func('uniutil', 'prepclass', 'is_enrolled'):
 			'You''ve enrolled in the preparatory classes.'
 		else:
-			'You can take preparatory classes at the University for '+func('uniutil', 'prepclass_cost')' <b>₽</b>.'
+			'You can take preparatory classes at the University on weekdays for '+func('uniutil', 'prepclass', 'cost')' <b>₽</b>.'
 		end
 		'Admission examinations for the University are held in <b>August</b>.'
 	end
@@ -49,34 +49,38 @@ if $ARGS[0] = 'start':
 		gt 'city_island'
 	end
 
-	if func('uniutil', 'eligible_for_university') ! 0:
-		if func('uniutil', 'is_prepclass_month') ! 0:
-			if func('uniutil', 'is_enrolled_prepclass') = 0 and money >= func('uniutil', 'prepclass_cost'):
-				act 'Pay for the preparatory classes ('+func('uniutil', 'prepclass_cost')+' <b>₽</b>)':
-					cla
-					minut += 5
-					menu_off = 1
-					gs 'uniutil', 'enroll_prepclass'
-					'You paid '+func('uniutil', 'prepclass_cost')+' <b>₽</b> for the preparatory classes. They are held every weekday until <b>'+func('uniutil', 'prepclass_closing_hour')+':00</b>.'
+	if func('uniutil', 'eligible_for_university'):
+		if func('uniutil', 'prepclass', 'offered_this_month'):
+			if func('uniutil', 'prepclass', 'is_enrolled'):
+				if func('uniutil', 'prepclass', 'in_session'):
+					act 'Attend preparatory class (1:00)':
+						cla
+						*clr
+						minut += 60
+						gs 'uniutil', 'prepclass', 'update_count'
+						intel_exp += 1 + (mentats_dose - rand(0,mentats_dose))
+						'<center><img <<$set_imgh>> src="images/locations/city/island/university/classroom.jpg"></center>'
+						'You attend the preparatory class for an hour. You pay close attention to what is being said and take notes for the entrance examination later on.'
 
-					act 'Move away':gt 'univer', 'start'
+						act 'Leave class':gt 'univer', 'start'
+					end
 				end
-			elseif func('uniutil', 'is_enrolled_prepclass') ! 0 and func('uniutil', 'prepclass_in_session') ! 0:
-				act 'Attend preparatory class (1:00)':
-					cla
-					*clr
-					minut += 60
-					gs 'uniutil', 'update_prepclass_count'
-					intel_exp += 1 + (mentats_dose - rand(0,mentats_dose))
-					'<center><img <<$set_imgh>> src="images/locations/city/island/university/classroom.jpg"></center>'
-					'You attend the preparatory class for an hour. You pay close attention to what is being said and take notes for the entrance examination later on.'
+			else:
+				if money >= func('uniutil', 'prepclass', 'cost'):
+					act 'Pay for the preparatory classes ('+func('uniutil', 'prepclass', 'cost')+' <b>₽</b>)':
+						cla
+						minut += 5
+						menu_off = 1
+						gs 'uniutil', 'prepclass', 'enroll'
+						'You paid '+func('uniutil', 'prepclass', 'cost')+' <b>₽</b> for the preparatory classes. They are held every weekday until <b>'+func('uniutil', 'prepclass', 'closing_hour')+':00</b>.'
 
-					act 'Leave class':gt 'univer', 'start'
+						act 'Move away':gt 'univer', 'start'
+					end
 				end
 			end
 		end
 
-		if func('uniutil', 'is_entrance_exam_month') ! 0:
+		if func('uniutil', 'entrance_exam', 'offered_today'):
 			'You can try to take an entrance exam.'
 
 			act 'Take the entrance exam (1:00)':
@@ -85,8 +89,8 @@ if $ARGS[0] = 'start':
 				minut += 60
 				'<center><img <<$set_imgh>> src="images/locations/city/island/university/classroom.jpg"></center>'
 
-				if pcs_intel + func('uniutil', 'prepclass_count') >= 60:
-					gs 'uniutil', 'enroll_university'
+				if pcs_intel + func('uniutil', 'prepclass', 'count') >= 60:
+					gs 'uniutil', 'student', 'enroll'
 					'You have successfully passed the entrance exam and can attend the University in September.'
 				else
 					'You have failed the entrance exam. You need to study harder...'
@@ -97,14 +101,13 @@ if $ARGS[0] = 'start':
 		end
 	end
 
-	if func('uniutil', 'student_status') > 0:
-		if func('uniutil', 'lecture_in_session') ! 0:
+	if func('uniutil', 'student', 'enrolled'):
+		if func('uniutil', 'lecture', 'offered_today'):
 			act 'Visit the Dean':
 				cla
-				gs 'uniutil', 'check_semester_vs_date'
 				gt 'univer', 'dekanat'
 			end
-		elseif func('uniutil', 'exam_in_session') ! 0:
+		elseif func('uniutil', 'exam', 'offered_today'):
 			act 'Take the exam':gt 'univer', 'examen'
 		end
 	end
@@ -118,22 +121,21 @@ if $ARGS[0] = 'dekanat':
 	gs 'stat'
 	'<center><b><font color="maroon">Dean</font></b></center>'
 	'<center><img <<$set_imgh>> src="images/locations/city/island/university/dekanat.jpg"></center>'
-	'You are enrolled at the University for semester '+func('uniutil', 'semester')+'.'
+	'You are enrolled at the University for semester '+func('uniutil', 'semester', 'get')+'.'
 	'At the end of your semester, you must pass your exams. Attending lectures will help you prepare.'
-	'You must also pass at least '+func('uniutil', 'min_num_assignments')+' assignment'+iif(func('uniutil', 'min_num_assignments') = 1, '', 's')+'before the semester ends.'
+	'You must also pass at least '+func('uniutil', 'assignments_done', 'min_num')+' assignment'+iif(func('uniutil', 'assignments_done', 'min_num') = 1, '', 's')+'before the semester ends.'
 	'It is positively looked upon if you manage to complete more.'
-
-	if func('uniutil', 'assignments_done') > 0:'You''ve passed '+func('uniutil', 'assignments_done')+' assignment'+iif(func('uniutil', 'assignments_done') = 1, '', 's')+'.'
+	'You''ve passed '+func('uniutil', 'assignments_done', 'get')+' assignment'+iif(func('uniutil', 'assignments_done', 'get') = 1, '', 's')+' so far.'
 
 	act 'Leave the Dean''s office':gt 'univer', 'start'
 
-	if hour < func('uniutil', 'lecture_start_hour') and func('uniutil', 'student_status') > 0:
-		act 'Attend the lecture ('+func('uniutil', 'lecture_length')+':00)':
+	if func('uniutil', 'lecture', 'in_session') and func('uniutil', 'student', 'enrolled'):
+		act 'Attend the lecture ('+func('uniutil', 'lecture', 'length')+':00)':
 			cla 
 			*clr
-			hour = func('uniutil', 'lecture_start_hour') + func('uniutil', 'lecture_length')
+			hour = func('uniutil', 'lecture', 'start_hour') + func('uniutil', 'lecture', 'length')
 			minut = 0
-			gs 'uniutil', 'update_lectures_attended'
+			gs 'uniutil', 'attendance', 'update'
 			intel_exp += 1 + (mentats_dose - rand(0,mentats_dose))
 			menu_off = 1
 			gs 'stat'
@@ -276,12 +278,12 @@ if $ARGS[0] = 'dekanat':
 	end
 !!end of secent scene expansion.
 
-	if func('uniutil', 'finished_assignment') ! 0:
+	if func('uniutil', 'assignment_progress', 'is_finished'):
 		act 'Hand in your assignment':
 			cla
 			*clr
 			intel_exp += 1 + (mentats_dose - rand(0,mentats_dose))
-			gs 'uniutil', 'update_assignments_done'
+			gs 'uniutil', 'assignments_done', 'update'
 			'<center><img <<$set_imgh>> src="images/locations/city/island/university/classroom1.jpg"></center>'
 			'You hand in your completed assignment.'
 
@@ -299,19 +301,19 @@ if $ARGS[0] = 'examen':
 	'<center><b><font color="maroon">Exam</font></b></center>'
 	'<center><img <<$set_imgh>> src="images/locations/city/island/university/examen.jpg"></center>'
 
-	if func('uniutil', 'have_great_attendence') ! 0 and func('uniutil', 'did_min_num_assignments') ! 0:
+	if func('uniutil', 'attendance', 'is_great') and func('uniutil', 'assignments_done', 'did_min_num'):
 		gs 'uniutil', 'exam_outcome', 'passed_honors'
 		'You completed all your examinations, passing them with honors, and on top of that, you had outstanding attendance.'
 
-	elseif pcs_intel >= 100 and func('uniutil', 'have_ok_attendence') = 0 and func('uniutil', 'did_great_num_assignments') ! 0:
+	elseif pcs_intel >= 100 and func('uniutil', 'attendance', 'is_bad') and func('uniutil', 'assignments_done', 'did_great_num'):
 		gs 'uniutil', 'exam_outcome', 'passed_honors'
 		'Despite missing a lot of classes, you still managed to complete all the assignments and somehow still managed to pass with honors.'
 
-	else if pcs_intel >= 100 and func('uniutil', 'have_ok_attendence') ! 0 and func('uniutil', 'did_min_num_assignments') ! 0:
+	else if pcs_intel >= 100 and func('uniutil', 'attendance', 'is_ok') and func('uniutil', 'assignments_done', 'did_min_num'):
 		gs 'uniutil', 'exam_outcome', 'passed_honors'
 		'You completed all your examinations, passing them with honors.'
 
-	elseif (pcs_intel >= 80 or func('uniutil', 'have_ok_attendence') ! 0) and func('uniutil', 'did_min_num_assignments') ! 0:
+	elseif (pcs_intel >= 80 or func('uniutil', 'attendance', 'is_ok')) and func('uniutil', 'assignments_done', 'did_min_num'):
 		gs 'uniutil', 'exam_outcome', 'passed'
 		'You completed all your assignments and passed the exam.'