# journal

! 2021/05/02 Initial code
! Refactored 24 Aug 22
! Amended by Hooded Silence
! Game Character Journal - central core game data area for players.
! V .01 Refactored to enable menu bar navigation for UI consistency. 
! V .02 Redesign and integration of content areas.
! V .03 Bug fixes.
!
! Sections:
! 0 Magic (if enabled)
! 1 Housing
! 2 Work - calls in journal_work
! 3 Quests - calls in journal_quest section
! 4 Relations / Current Group - pulls in various elements refactored from other areas to make tracking relationships easier. To be expanded on.
! 5 General Information 
! 6 User Notes - custom function
!
! Menu Variables
! menutrack = tracks current menu position
! jumploc = call in the active menu section
! $tablebody = Container to create the menu body to work around QSP deadspace display issues.
! Section Variables
! employed[qw] = Work tracker if employed. To be set on starting or leaving a job.

! Header section start
if $ARGS[0] = 'records':
	*clr & cla
	gs 'housing', 'rent'
    gs 'journal', 'journalmenu'
! records
end

if $ARGS[0]='journalmenu':
	*clr & cla
	gs 'stat'
	if $start_type[1] ! 'nomagic':
        $tablebody = '<tr><th><a href="exec:menutrack = 0 & gs ''journal'', ''magictab''">Magic</a></th><th><a href="exec:menutrack = 1 & gs ''Journal'', ''housingtab''">Housing</a></th><th><a href="exec:menutrack = 2 & gs ''journal_work'', ''start''">Work</a></th><th><a href="exec:menutrack = 2 & gs ''journal_quests'', ''start''">Quests</a></th><th><a href="exec:menutrack = 4 & gs ''journal'', ''relationstab''">Relations</a></th><th><a href="exec:menutrack = 5 & gs ''journal'', ''generaltab''">Game Information</a></th><th><a href="exec:menutrack = 6 & gs ''journal'', ''notestab''">Notes</a></th></tr>'
    
    else
        $tablebody ='<tr><th><a href="exec:menutrack = 1 & gs ''Journal'', ''housingtab''">Housing</a></th><th><a href="exec:menutrack = 2 & gs ''journal_work'', ''start''">Work</a></th><th><a href="exec:menutrack = 2 & gs ''journal_quests'', ''start''">Quests</a></th><th><a href="exec:menutrack = 4 & gs ''journal'', ''relationstab''">Relations</a></th><th><a href="exec:menutrack = 5 & gs ''journal'', ''generaltab''">Game Information</a></th><th><a href="exec:menutrack = 6 & gs ''journal'', ''notestab''">Notes</a></th></tr>'
    ! menu
    end
	!display the table here.
	
	'<center><table width="90%" align="center" width="90%" cellspacing="0" cellpadding="0" valign="top"><tr><<$tablebody>></tr></table></center>'
	
	if $jumploc = '' or jclose = 1: 
		if $start_type[1] ! 'nomagic': 
			menutrack = 0
			jclose = 0
			gt 'journal', 'magictab'
		else
			menutrack = 1
			jclose = 0
			gt 'journal', 'housingtab'  
		end
	end
	gs 'journal', 'leaveactions'


! Journal Menu
end

if $ARGS[0] = 'magictab':
	$jumploc = 'magictab'
	gs 'journal', 'journalmenu'
	
	'<center><h2>Spells</h2></center><br>'
	'<center><h2>Spells to Cast</h2></center><br>'
	func('spellBook','cast','$nonComSpells', 'gt ''journal'', ''magictab''', 'jclose = 1') 
	'<br><center><h2>Spell Learning</h2></center><br>'
	'<br><center><h3>Combat</h3></center><br>'
	func('spellBook','learn','$combatSpells') 
	'<br><center><h3>Non-Combat</h3></center><br>'
	func('spellBook','learn','$nonComSpells') 
	delact 'Never mind'
	
	
! magic
end

if $ARGS[0] = 'housingtab':
	$jumploc = 'housingtab'
	gs 'journal', 'journalmenu'

	'<center><h2>Housing</h2></center>'
	
	*nl
	if accessible_property['shared_apartment'] = 4:'You share an apartment with three others in Pavlovsk. Your bills are paid by the other tenants in exchange for your house services'
	if accessible_property['city_apartment'] = 1:'You rent a two room apartment in the city residential area. Your rent for the apartment is subtracted automatically in sum of <<accessible_property[''city_apartment-rent'']>> <b>₽</b> us electric bill on 25th of each month. You are currently paid up for <b><<accessible_property[''city_apartment-days-left'']>></b> days'
	if accessible_property['city_apartment'] = 2:'You own a two room apartment in the city residential area. Your utility bills are due on the 25th of each month.'
	if accessible_property['city_apartment'] = 3:'You own a two room apartment in the city residential area. It''s currently occupied by your tenants.'
	if accessible_property['parents_home'] = 4:'You live with your parents and siblings in a two room apartment in Pavlovsk.'
	if accessible_property['village_cottage']= 2 :'You own a small holiday cottage with an adjacent allotment in the communal village.'
	if accessible_property['old_town_apartment'] = 1:'You rent a two room apartment in Pushkin. Your rent for the apartment is subtracted automatically in the sum of <<accessible_property[''old_town_apartment-rent'']>> <b>₽</b> us electric bill on the 25th of each month. You are currently paid up for <b><<accessible_property[''old_town_apartment-days-left'']>></b> days'
	if accessible_property['matryona_mansion'] = 2 and constructionstatus = 0:'You own a vacant block in the city suburbs.'
	if accessible_property['matryona_mansion'] = 2 and constructionstatus = 1:'You own a plot of land in the city suburbs upon which you are building a house.' + iif(banaMansion = 1, 'Your utility bills are due on the 25th of each month.', '')
	if accessible_property['matryona_mansion'] = 2 and constructionstatus = 2:'You own an impressive mansion in the city suburbs. ' + iif(banaMansion = 1, 'Your utility bills are due on the 25th of each month.', '')
	if accessible_property['city_house'] = 2:'You own a nice house on the edge of the city residential district. Your utility bills are due on the 25th of each month.'
	if accessible_property['meynold_household'] = 4:'You live with Vicky, Katja and Tamara Meynold. You have your own room and get an allowance based on helping out around the house and/or studying with Tamara.'
	*nl
	if car > 0:
		'<center><h2>Car</h2></center>'
		*nl
		if cardrive = 1: 'Your car is parked in St. Petersburg''s residential area.'
		if cardrive = 2: 'Your car is parked in St. Petersburg''s city center.'
		if cardrive = 3: 'Your car is parked in St. Petersburg''s industrial region.'
		if cardrive = 4: 'Your car is parked at St. Petersburg''s Lake.'
		if cardrive = 5: 'Your car is parked at St. Petersburg''s Park.'
		if cardrive = 6: 'Your car is parked at the gas station in St. Petersburg''s industrial region.'
		if cardrive = 7: 'Your car is parked at the Car Repair Shop in St. Petersburg.'
		if cardrive = 8: 'Your car is parked at your house in St. Petersburg''s residential area.'
		if cardrive = 9: 'Your car is parked at the Car Dealership in St. Petersburg.'
		if cardrive = 10: 'Your car is parked at St. Petersburg''s Park.'
		if cardrive = 11: 'Your car is parked at St. Petersburg''s Sauna.'
		if cardrive = 12: 'Your car is parked at the construction site.'
		if cardrive = 13: 'Your car is parked in the Suburban Cooperative.'
		if cardrive = 14: 'Your car is parked in Old Town district of Pavlovsk.'
		if cardrive = 18: 'Your car is parked at Matryona Mansion.'
		if cardrive = 19: 'Your car is parked at St. Petersburg''s industrial train station.'
		if cardrive = 20: 'Your car is parked in Pavlovsk''s residential area.'
		if cardrive = 21: 'Your car is parked at the gas station near Pavlovsk.'
		if cardrive = 22: 'Your car is parked on the highway.'
		if cardrive = 23: 'Your car is parked in Gadukino.'
		if cardrive = 24: 'Your car is parked in Pavlovsk''s commercial region.'
		if cardrive = 25: 'Your car is parked in Vasilyevsky Island'
		if cardrive = 26: 'Your car is parked in Pavlovsk''s industrial region.'
		if cardrive = 27: 'Your car is parked in St. Petersburg''s red light district.'
		if cardrive = 28: 'Your car is parked in St. Petersburg''s suburbs.'
	end
! housing
end

if $ARGS[0] = 'relationstab':
    $jumploc = 'relationstab'
	gs 'journal', 'journalmenu'

	'<center><h2>Relationships</h2></center>'
	'<h2>Family</h2>'
		
	'Mother:'
		
	gs 'journal', 'relindex', 'A29'
	
	'Stepfather:'
	
	gs 'journal', 'relindex', 'A28'
	
	'Sister:'

	gs 'journal', 'relindex', 'A33'
	
	'Brother:'
	
	gs 'journal', 'relindex', 'A34'

	
	if mid($start_type,1,2) = 'sg' and SchoolAtestat = 0 and SchoolBlock = 0:
	
		'<center><h2>Standings by Social Group</h2></center>'

		if grupTipe < 5 and grupvalue[grupTipe] > 700:
			$journal_school_standing = ' You are well respected and liked within your clique.'
		elseif grupTipe < 5 and grupvalue[grupTipe] > 300:
			$journal_school_standing = ' You are in good standing with your clique.'
		elseif grupTipe < 5:
			$journal_school_standing = '<font color="red"> You have to work on your clique standing. You''re in danger of being cast out.</font>'
		end

		if grupTipe = 0:
			'You are not a member of any particular school social group.'+$journal_school_standing
		elseif grupTipe = 1:
			'Your school social group consists of the popular, cool and beautiful.'+$journal_school_standing
		elseif grupTipe = 2:
			'Your school social group consists of jocks and natural athletes.'+$journal_school_standing
		elseif grupTipe = 3:
			'Your school social group consists of nerds, geeks and good students.'+$journal_school_standing
			if nerd_game['game_day'] > daystart: 'You have been invited to a games night on <<$week[(week + (nerd_game[''game_day'']  - daystart))]>> at 20:00 in the community center library.'
			if nerd_game['game_day'] = daystart: 'You have been invited to a games night tonight at 20:00 in the community center library.'
		elseif grupTipe = 4:
			'Your school social group consists of gopniks, rebels, punks or troublemakers.'+$journal_school_standing
		elseif grupTipe = 5:
			'Your school social group consists of losers, teacher''s pets, sluts and the ugly.'
		end
		*nl
		
		'Cool Kids'

		gs 'indik', '4', grupvalue[1]/10, grupvalue[1], 1 & '<<$ind>>'

		'Jocks'
		gs 'indik', '4', grupvalue[2]/10, grupvalue[2], 2 & '<<$ind>>'

		'Nerds'
		gs 'indik', '4', grupvalue[3]/10, grupvalue[3], 3 & '<<$ind>>'

		'Gopnik'
		gs 'indik', '4', grupvalue[4]/10, grupvalue[4], 4 & '<<$ind>>'
		
		'<h2>Other Relations</h2>'
		
		if npc_QW['A192'] > 0: 'Friendship with Nastya:' & gs 'journal', 'relindex', 'A192' 
		if npc_rel['A218'] > 0: 'Friendship with Tanya:' & gs 'journal', 'relindex', 'A218'  
		if npc_rel['A219'] > 0: 'Friendship with Kat:' & gs 'journal', 'relindex', 'A219' 
		if npc_rel['A220'] > 0: 'Friendship with Vika:' & gs 'journal', 'relindex', 'A220' 
		if npc_rel['A93'] > 0: 'Friendship with Ira:'  & gs 'journal', 'relindex', 'A93' 
		if npc_rel['A43'] > 0: 'Friendship with Tamara:' & gs 'journal', 'relindex', 'A43' 
		if npc_rel['A169']> 0: 'Friendship with Dima:'  & gs 'journal', 'relindex', 'A169' 
		if npc_rel['A69'] > 0:'Friendship with Mikhail Nikolaevich (Volleyball Coach):' & gs 'journal', 'relindex', 'A69' 
		
		! Uncomment if re-introduced into the game ensure you use NPC ID to update them
		! if alla > 0: 'Friendship with Alla <<alla>>'
		! if masha > 0: 'Friendship with Masha <<masha>>'
		! if npc_rel['A41'] > 0: 'Friendship with Givi K. <<npc_rel[''A41'']>>'
		! if npc_rel['A42'] > 0: 'Friendship with Ashot <<npc_rel[''A42'']>>'
		

		!!!WD: Formatting
		if (npc_rel['A93'] + npc_rel['A41'] + npc_rel['A42'] + npc_rel['A43'] + gosh + npc_rel['A220'] + npc_rel['A219'] + npc_QW['A192'] + npc_rel['A218']) > 0:*nl
		*nl
		
	end

	if husband > 0:'You have been married for <<husbanday>> days. Your husband <<$husName>> <<$husBody>> <<$husFat>> <<$husHair>>. Member <<husDick>> Relationship <<husband>>.'
	if kid > 0:
		i = 0
		if kid = 1:
			'You have a child, a <<$polreb[0]>> named <<$kidname[0]>>. Born <<daykid[0]>>-<<monthkid[0]>>-<<yearkid[0]>>. Aged <<kidage[0]>>.'
		else
			'You have children:'
			:LoopKidCounter
			if i <= kid + 1:
				'<br> a <<$polreb[i]>> named <<$kidname[i]>>. Born <<daykid[i]>>-<<monthkid[i]>>-<<yearkid[i]>>. Aged <<kidage[i]>>.'
				i += 1
				jump 'LoopKidCounter'
			end
		end
		*nl
	end
	*nl
!! This has some sex info but also weirdness like npc number and smilie face is dick the right length. Its about first time with a random lover
!!	if $bfsex > 0:'<<$bfsex>>'
	*nl
	if loverGender[0] = 0:
		$obj_loverintro = 'Your boyfriend'
		$obj_loverpron = 'He'
	else
		$obj_loverintro = 'Your girlfriend'
		$obj_loverpron = 'She'
	end
	if pcs_lovers[0] = 1:'<<$obj_loverintro>> <<$loverdesc[0]>> is <<$loverbody[0]>> height and <<$loverbod[0]>> build with <<$loverface[0]>> hair. <<$loverdesc[0]>> is <<$loverClo[0]>>. Your relationship is <<loverrelation[0]>> after <<loverdays[0]>> days dating.'
	if haraklover[0] = 0 and loverrelation[0] > 1:'<<$obj_loverpron>>''s timid and lacks confidence.'
	if haraklover[0] = 1 and loverrelation[0] > 1:'<<$obj_loverpron>> has a cheerful and sociable personality.'
	if haraklover[0] = 2 and loverrelation[0] > 1:'<<$obj_loverpron>>''s short-tempered and strict.'
	if loverGender[1] = 0:
		$obj_loverintro = 'Your boyfriend'
		$obj_loverpron = 'He'
	else
		$obj_loverintro = 'Your girlfriend'
		$obj_loverpron = 'She'
	end
	if pcs_lovers[1] = 1:'<<$obj_loverintro>> <<$loverdesc[1]>> is <<$loverbody[1]>> height and <<$loverbod[1]>> build with <<$loverface[1]>> hair. <<$loverdesc[1]>> is <<$loverClo[1]>>. Your relationship is <<loverrelation[1]>> after <<loverdays[1]>> days dating.'
	if haraklover[1] = 0 and loverrelation[1] > 1:'<<$obj_loverpron>>''s timid and lacks confidence.'
	if haraklover[1] = 1 and loverrelation[1] > 1:'<<$obj_loverpron>> has a cheerful and sociable personality.'
	if haraklover[1] = 2 and loverrelation[1] > 1:'<<$obj_loverpron>>''s short-tempered and strict.'
	if loverGender[2] = 0:
		$obj_loverintro = 'Your boyfriend'
		$obj_loverpron = 'He'
	else
		$obj_loverintro = 'Your girlfriend'
		$obj_loverpron = 'She'
	end
	if pcs_lovers[2] = 1:'<<$obj_loverintro>> <<$loverdesc[2]>> is <<$loverbody[2]>> height and <<$loverbod[2]>> build with <<$loverface[2]>> hair. <<$loverdesc[2]>> is <<$loverClo[2]>>. Your relationship is <<loverrelation[2]>> after <<loverdays[2]>> days dating.'
	if haraklover[2] = 0 and loverrelation[2] > 1:'<<$obj_loverpron>>''s timid and lacks confidence.'
	if haraklover[2] = 1 and loverrelation[2] > 1:'<<$obj_loverpron>> has a cheerful and sociable personality.'
	if haraklover[2] = 2 and loverrelation[2] > 1:'<<$obj_loverpron>>''s short-tempered and strict.'
	*nl

! relations
end

if $ARGS[0] = 'generaltab':
	$jumploc = 'generaltab'
	gs 'journal', 'journalmenu'
	
! generaltab
	'<center><h2>General Information</h2></center>'
	
	if ARRSIZE('$portfolio_locations') > 0 or ARRSIZE('$portfolio_people') > 0:
		act 'View your photography portfolio': gt 'journal_portfolio'
	end
	'<br><center><a href="exec: gs ''journal'', ''locations''">Locations</a></center>'
	'<br><center><a href="exec: gs ''journal'', ''friends_family''">Friends & Family</a></center>'
	if SchoolAtestat = 0 and mid($start_type,1,2) = 'sg' and SchoolBlock = 0: '<br><center><a href="exec: gs ''journal_school'', ''school''">School</a></center><br><center><a href="exec: gs ''journal_school'', ''coursesinfo''">School Courses and Grades</a></center>'
	if university['student'] = 1: '<br><center><a href="exec: gs ''journal'', ''uni''">University</a></center>'
	'<br><center><a href="exec: gs ''journal'', ''clothing''">Clothing information</a></center>'
end

if $ARGS[0] = 'notestab':
	$jumploc = 'notestab'
	gs 'journal', 'journalmenu'
	'<center><h2>Notes</h2></center>'
	'Create notes to keep track of any information you need.'
	*nl

	'<a href="exec: $zapis[] = input(''What do you want to record?'') & gt ''journal'',''notestab'' ">Make a note</a>'

	jur_temp = 0
	:jur_loop
	if jur_temp < arrsize('$zapis'):
		'<<$zapis[jur_temp]>>  <a href="exec: dynamic ''killvar''''$zapis'''',<<jur_temp>> & gt ''''journal'''', ''''notestab'''''' ">Delete</a>'
		jur_temp += 1
		jump 'jur_loop'
	end
	killvar 'jur_temp'
	
! notes
end

! ---- Other Sections ---- 

if $ARGS[0] = 'clothing':
	$jumploc = 'generalsub'
	gs 'journal', 'journalmenu'
	'<center>Clothing information</center>'
	*nl
	'Clothing has a strength value, which decreases by 1 for every day you wear that outfit. At 0 it is ruined and you will have to throw it away.'
	'You can attempt to fix outfits when their strength is very low and you have a high enough sewing skill. Clothes you throw away will appear back in the shop.'
	*nl
	'Quality of clothing is ranked in this order:'
	'	Crappy quality outfit'
	'	Very low quality outfit'
	'	Low quality outfit'
	'	Average quality outfit'
	'	Reasonable quality outfit'
	'	Good quality outfit'
	'	Outstanding quality outfit'

	gs 'journal', 'leaveactions'
end

if $ARGS[0] = 'uni':
	$jumploc = 'generalsub'
	gs 'journal', 'journalmenu'
	'<center><h2>University</h2></center>'

	if university['diploma'] > 0:
		'You have graduated from the University of St. Petersburg with a degree in '+func('uni_programs', 'program_name')+'.'
	else
		'You have are enrolled in the '+trim(MID('first, second, third, fourth, fifth, sixth, seventh, eighth, ninth, tenth', university['enrolled_in_semester']*8-7,7))+' semester of the '+func('uni_programs', 'program_name')+' at the University of St. Petersburg.'
	end

	if $university['elective1'] ! '' or $university['elective2'] ! '' or $university['elective3'] ! '':
		*nl
		'This semester, you are taking the following elective classes: <<$university[''elective1'']>>, <<$university[''elective2'']>>, <<$university[''elective1'']>>.'
	end

	i = 1
	:semester_loop
	if university['semester_passed'] = i:
		*nl
		'You passed the'+trim(MID('first, second, third, fourth, fifth, sixth, seventh, eighth, ninth, tenth', i*8-7,7))+' semester with the following grades:'
		j = 0
		:class_loop
		if $class_list_institution[j] = 'uni_<<$university[''enrolled_in'']>>_semester_<<i>>':
			'<<$class_list_name[j]>>: <<$class[''<<$class_list_institution[j]>>_<<$class_list_name[j]>>_grade'']>>'
		end
		j += 1
		if ARRSIZE('class_list_institution') >= j: jump 'class_loop'
		killvar 'j'
	end
	i += 1
	if i < 8: jump 'semester_loop'
	killvar 'i'

	if university['semester_passed'] = university['enrolled_in_semester'] and university['diploma'] = 0:
		'You need to register for your next semester at the university administration'
	elseif university['semester_week'] <= 0 and university['exam_week'] = 0:
		'You currently have a break between semesters.'
		if university['semester_week'] = -1:
			'The next semester will start next week'
		end

		'<center><h2>Class schedule for Next Semester</h2></center>'

		'Monday: '+func('uni_programs', 'uni_period_first', 'monday')+' '+func('uni_programs', 'uni_period_second', 'monday')+' '+func('uni_programs', 'uni_period_third', 'monday')
		'Tuesday: '+func('uni_programs', 'uni_period_first', 'tuesday')+' '+func('uni_programs', 'uni_period_second', 'tuesday')+' '+func('uni_programs', 'uni_period_third', 'tuesday')
		'Wednesday: '+func('uni_programs', 'uni_period_first', 'wednesday')+' '+func('uni_programs', 'uni_period_second', 'wednesday')+' '+func('uni_programs', 'uni_period_third', 'wednesday')
		'Thursday: '+func('uni_programs', 'uni_period_first', 'thursday')+' '+func('uni_programs', 'uni_period_second', 'thursday')+' '+func('uni_programs', 'uni_period_third', 'thursday')

	elseif university['semester_week'] > 0:
		if university['semester_week'] < 11:
			'You are in the '+trim(MID('first, second, third, fourth, fifth, sixth, seventh, eighth, ninth, tenth', university['semester_week']*8-7,7))+' week of the semester, which last 15 weeks.'
		else
			'You are in the '+str(university['semester_week'])+'th week of the semester which last 15 weeks.'
		end

		'<center><h2>Class schedule</h2></center>'

		'Monday: '+func('uni_programs', 'uni_period_first', 'monday')+' '+func('uni_programs', 'uni_period_second', 'monday')+' '+func('uni_programs', 'uni_period_third', 'monday')
		'Tuesday: '+func('uni_programs', 'uni_period_first', 'tuesday')+' '+func('uni_programs', 'uni_period_second', 'tuesday')+' '+func('uni_programs', 'uni_period_third', 'tuesday')
		'Wednesday: '+func('uni_programs', 'uni_period_first', 'wednesday')+' '+func('uni_programs', 'uni_period_second', 'wednesday')+' '+func('uni_programs', 'uni_period_third', 'wednesday')
		'Thursday: '+func('uni_programs', 'uni_period_first', 'thursday')+' '+func('uni_programs', 'uni_period_second', 'thursday')+' '+func('uni_programs', 'uni_period_third', 'thursday')

		'<center><h2>Grades</h2></center>'

		gs 'grades', 'assing_grade_description', $university['enrolled_in']

		j = 0
		:grade_loop
		if $class_list_institution[j] = 'uni_<<$university[''enrolled_in'']>>_semester_<<university[''enrolled_in_semester'']>>':
			If dyneval( 'RESULT = class[''<<$class_list_institution[j]>>_<<$class_list_name[j]>>_grade'']') >= dyneval( 'RESULT = (4*<<university[''semester_week'']>> + 32)'):
				'You think you are doing great in <<$class_list_name[j]>> and will probably pass with a top grade if you keep this up.'
			elseIf dyneval( 'RESULT = class[''<<$class_list_institution[j]>>_<<$class_list_name[j]>>_grade'']') > dyneval( 'RESULT = (2*<<university[''semester_week'']>> + 32)'):
				'You are following the <<$class_list_name[j]>> class well and will probably pass with a good grade if you keep this up, but to get the top mark you need to put in some more effort.'
			elseIf dyneval( 'RESULT = class[''<<$class_list_institution[j]>>_<<$class_list_name[j]>>_grade'']') >= dyneval( 'RESULT = (1*<<university[''semester_week'']>> + 32)'):
				'You have trouble following the <<$class_list_name[j]>> class, but will probably still pass. If you want a good grade, then you''ll really need to do something about it.'
			elseIf dyneval( 'RESULT = class[''<<$class_list_institution[j]>>_<<$class_list_name[j]>>_grade'']') < 40:
				'You will fail your <<$class_list_name[j]>> class unless you do something about it right now. It might even be too late to catch up.'
			else
				'You are hopelessly behind in your <<$class_list_name[j]>> class, but can probably still pass. Any hope of getting a good grade will require that you start doing something about it right now.'
			end
		end
		j += 1
		if ARRSIZE('class_list_institution') >= j: jump 'grade_loop'
		killvar 'j'

	elseif university['exam_week'] > 0:
		'You are in the '+iif(university['exam_week'] = 1,'first','second')+' of the two weeks of exams. '+func('uni_programs', 'exam', 'schedule')
		*nl
		j = 0
		:exam_loop
		if $class_list_institution[j] = 'uni_<<$university[''enrolled_in'']>>_semester_<<university[''enrolled_in_semester'']>>':
			if dyneval( 'RESULT = class[''<<$class_list_institution[j]>>_<<$class_list_name[j]>>_exam_done'']') = 1:
				'You did your <<$class_list_name[j]>> exam and think you will get an <<$class[''<<$class_list_institution[j]>>_<<$class_list_name[j]>>_grade'']>>.'
			elseif func('uni_programs', 'exam', 'is_over', $class_list_name[j]) = 1:
				'Your exam <<$class_list_name[j]>> is over and you did not go. This means you will fail the class and thefore also the semester.'
			elseif dyneval( 'RESULT = class[''<<$class_list_institution[j]>>_<<$class_list_name[j]>>_grade'']') >= 100:
				'You think you are well prepared in your <<$class_list_name[j]>> exam and will probably pass with the highest mark possible.'
			elseif dyneval( 'RESULT = class[''<<$class_list_institution[j]>>_<<$class_list_name[j]>>_grade'']') >= 90:
				'You think you are well prepared in your <<$class_list_name[j]>> exam and will probably pass with a 5, but a little more studying never hurts.'
			elseif dyneval( 'RESULT = class[''<<$class_list_institution[j]>>_<<$class_list_name[j]>>_grade'']') >= 70:
				'You think that you are prepared pretty well for your <<$class_list_name[j]>> exam and will probably get a 4. With some more studying, you might get a 5.'
			elseif dyneval( 'RESULT = class[''<<$class_list_institution[j]>>_<<$class_list_name[j]>>_grade'']') >= 40:
				'You think you are prepared enough to pass your <<$class_list_name[j]>> exam, but if you want a good grade, then you need to do some serious studying.'
			else
				'If your <<$class_list_name[j]>> exam was today, then you would fail. Time to hit the books if you don''t want to fail the semester.'
			end
		end
		j += 1
		if ARRSIZE('class_list_institution') >= j: jump 'exam_loop'
		killvar 'j'
	end
	act 'Go back': gt 'journal', 'generaltab'
	gs 'journal', 'leaveactions'
end
if $ARGS[0] = 'locations':
	$jumploc = 'generalsub'
	gs 'journal', 'journalmenu'
	'<center><h2>Pavlovsk</h2></center>'
	'Pavlovsk is a small town. It is somewhat of a tourist trap thanks to the Catharina Palace and the former palace grounds, which have been converted into a large park centered around the train station. There is an open air market near the train station that is open year round where many bargains can be found. The cafe where your mother works can also be found near the train station. It caters to the visitors coming in by train. The downtown area contains businesses and some middle class housing, while the residential area is a mixture of houses and old Soviet era apartment blocks.'
	*nl
	'The wealthier families live in large houses near the park on the outskirts of town, while the poorest homes are found near the old industrial area where several factories have long since been abandoned. The only factory still open is the G&M clothing factory, which also has a local store front and a tailor that can adjust your clothing. The industrial area is now mostly home to prostitutes and drug dealers and is not considered a safe area to walk around at night. Despite being a tourist destination, the area is seen as fairly poor and without many jobs.'

	'<center><h2>Gadukino</h2></center>'
	'You''ve spent several summers at your grandparents'' village. It''s a small village where everyone is very tightly knit together. You remember spending your days playing with the local children at the river or visiting the little shop that had everything a kid needed. When your great grandparents were younger, they used to take you out into the woods where you picked mushrooms and berries. Your great grandfather also showed you around the hunting grounds and told you all kind of stories about the hunters that visit the area.'

	'<center><h2>St. Petersburg</h2></center>'
	'You''ve heard many rumors about the city from both family members and school friends. They all say it''s both a great and bad place. The few memories you have are connected to the big park that you and your family visited once, which had a large amusement park with lots of rides. You also know about the University because you''ve overheard Anya and your mother argue about it. Sometimes, your mother would drag you and Anya along to the city mall while she was visiting the beauty salon. You remember running through the stores asking your mother to buy you clothes.'

	act 'Go back': gt 'journal', 'generaltab'
	gs 'journal', 'leaveactions'
end

if $ARGS[0] = 'friends_family':
	$jumploc = 'generalsub'
	gs 'journal', 'journalmenu'
	'<center><img src="images/characters/shared/headshots_main/29.jpg"></center>'
	'Natasha (Mother) - Your mother was born in Gadukino. She is still quite young and attractive, but you have done the math and know she had Anya when she was only sixteen years old. Your grandmother died in child birth with your mother and your grandfather was killed a few years later in the Afghanistan war. She works at the cafe near the train station.'
	*nl
	'<center><img src="images/characters/shared/headshots_main/35.jpg"></center>'
	'Mikhail Kuznetsov (Father) - You''ve never seen your biological father since your parents divorced, so you have no real memory of him.'
	*nl
	'<center><img src="images/characters/shared/headshots_main/28.jpg"></center>'
	'Vladimir (Stepfather) - Your stepfather is a greying, slightly flabby man who works as a truck driver. Your mother divorced your biological father and married Vladimir when you were less than a year old. One year after being married, your parents welcomed your little brother Kolka, Vladimir''s first born child. Kolka is his only child that you know of. When not working, your stepfather can often be found working on his cars in the garage. He gets some time alone to watch TV on Monday evenings.'
	*nl
	'<center><img src="images/characters/shared/headshots_main/33.jpg"></center>'
	'Anya (Sister) - Anya is your older sister, two years your senior, but she still lives at home and shares a bedroom with you. She chose to work at the local supermarket instead of going to university like your mother wanted and spends most of her free time either partying, hanging out with her friends or with her boyfriend Roma.'
	*nl
	'<center><img src="images/characters/shared/headshots_main/34.jpg"></center>'
	'Kolka (Brother) - Kolka is your younger brother, born about a year after you. While you share the same mother, Kolka''s father is your stepfather. He is a student at the same school as you and enjoys football. When he is not playing football or doing homework, he spends much of his free time hanging out with his friends.'
	*nl
	'<center><img src="images/characters/shared/headshots_main/30.jpg"></center>'
	'Lyudmila Knavs (Aunt) - Your mother''s older sister, who works at the local pharmacy and has a live in boyfriend called Olu whom she met while traveling. He is an African man, which has caused more than a few rumors and sour looks at your aunt. Your aunt doesn''t seem to care though, and if anything, seems to enjoy flaunting her boyfriend in front of others.'
	*nl
	'<center><img src="images/characters/shared/headshots_main/55.jpg"></center>'
	'Oluuosegun "Olu" Maina - You don''t know much about your aunt''s live-in boyfriend, only that he is from Africa and doesn''t speak Russian very well. He''s a very large and muscular man and you know many people in the area that find it disgraceful that your aunt lives with him.'
	*nl
	'<center><img src="images/characters/shared/headshots_main/31.jpg"></center>'
	'Zlatek Knavs (Great Grandfather) - Your great grandfather is a grumpy old man who is always complaining about the village elders and how they have neglected the village to the point where it is now barely fit to live in. He can walk, but requires a cane, so doesn''t leave the house unless he has to. Your mother and aunt were raised by your great grandparents.'
	*nl
	'<center><img src="images/characters/shared/headshots_main/32.jpg"></center>'
	'Elena Knavs (Great Grandmother) - Your great grandma is extremely old and almost never leaves the house. Most of the time, she just sits on her bed watching TV or slowly cleans the house. Having raised your mother and aunt Luda, she is like a grandmother to you and a mother to your mother. She has raised two generations of children and is now content with the peace and quiet of the village.'
	*nl
	'<center><img src="images/characters/shared/headshots_main/54.jpg"></center>'
	'Mikhail "Misha" - Your neighbor''s name is Mikhail, but everyone calls him "Uncle Misha". He lives in the apartment across the hall from you, but your mother always forbade you from talking to him by warning you that he used to be a local crime lord and that you shouldn''t get involved with him. However, he has always been polite and nice to you. He is close friends with your stepfather, but both have been evasive about how they met and became friends.'
	*nl
	'<center><img src="images/characters/shared/headshots_main/112.jpg"></center>'
	'Sergey Shulgin - Sergey lives in the same building as you with his son, your childhood friend Vasily. He has gray hair and a small beer belly, but is still hearty looking. His wife, Vasily''s mother, left when Vasily was young. He has been close friends with your stepfather and mother for as long as you can remember. Oddly enough, he never re-married after being abandoned by his ex-wife.'

	act 'Go back': gt 'journal', 'generaltab'
	gs 'journal', 'leaveactions'
end

! Helper functions

if $ARGS[0] = 'relindex':

    *pl & gs 'indik', '1', npc_rel['<<$ARGS[1]>>'], npc_rel['<<$ARGS[1]>>'], 100 & '<<$ind>>'
end

if $ARGS[0] = 'leaveactions':
	act 'Put your notebook down': 		 
		killvar 'jumploc'
		jclose = 1
		gt $loc, $loc_arg
	end	
end
--- journal ---------------------------------