Browse Source

[fixed/added] Extracted repeated library code to a `library_functions` location. Fixed an issue with the loaned books

anjuna krokus 5 months ago
parent
commit
b6bdb6efa7

+ 1 - 0
glife.qproj

@@ -81,6 +81,7 @@
 		<Location name="pcs_has_attr"/>
 		<Location name="grades"/>
 		<Location name="internet_mobile"/>
+		<Location name="library_functions"/>
 	</Folder>
 	<Folder name="Sleep">
 		<Location name="pre_sleep"/>

+ 44 - 240
locations/city_library.qsrc

@@ -1,287 +1,91 @@
 # city_library
 
-$loc_arg = $ARGS[0]
-$loc = 'city_library'
-$menu_loc = 'city_library'
-$menu_arg = ''
 menu_off = 0
-$location_type = 'public_indoors'
-frost = 0
-gs 'stat'
-gs 'themes', 'indoors'
 
-! Stuff to do on Studying a Book
-!	$ARGS[0] = Skill to Check
-killvar '$downlibrary'
-$downlibrary['BookStudy'] = {
-	$downlibrary['Skill'] = $ARGS[0]
-	*clr & cla
-	menu_off = 1
-	if blizoruk = 500 or glassqw = 1:
-		glassqw = 1
-		msg '	The text blurs across the page. It seems you have poor eyesight. Maybe you should visit an ophthalmologist?'
-		gt 'city_library'
-	end
-	if pcs_nerd > 0:
-		lastread = totminut
-		lastreadday = daystart
-		pcs_nerd += 1
-	end
-	minut += 60
-	if $downlibrary['Skill'] ! '':
-		dynamic "
-			if pcs_<<$downlibrary['Skill']>> >= 50:
-				<<$downlibrary['Skill']>>_exp += rand(0,1)
-			elseif pcs_<<$downlibrary['Skill']>> >= 25:
-				<<$downlibrary['Skill']>>_exp += rand(1,2)
-			else
-				<<$downlibrary['Skill']>>_exp += rand(1,3)
-			end"
-	end
+if $ARGS[0] = '':
+	gs 'shortgs', 'setloc', 'city_library', $ARGS[0]
+	$location_type = 'public_indoors'
+	frost = 0
+	gs 'stat'
+	gs 'themes', 'indoors'
 
-	blizoruk += 1
-}
+	'<center><b><font color="maroon">National Library of Russia</font></b></center>'
+	'<center><img <<$set_imgh>> src="images/locations/city/citycenter/library/downlibint.jpg"></center>'
+	'A huge library with thousands upon thousands of books. You could spend years in here and probably still wouldn''t be able to read it all.'
 
-'<center><b><font color="maroon">National Library of Russia</font></b></center>'
-'<center><img <<$set_imgh>> src="images/locations/city/citycenter/library/downlibint.jpg"></center>'
-'A huge library with thousands upon thousands of books. You could spend years in here and probably still wouldn''t be able to read it all.'
-
-act 'Leave': minut += 5 & gt 'city_center'
+	if hour <= 7 or hour >= 19:
+		'The library is closed.'
+		act 'Leave': minut += 5 & gt 'city_center'
+		exit
+	end
 
-if hour >= 8 and hour <= 18:
 	'There is a large IT section with <a href="exec: gs ''internet_mobile'', ''get_access'', ''free'', ''noporn'',''nocamshow'' & gs ''internet_mobile'', ''add_limitation'', ''general-text'', ''On this public computer all adult content sites are blocked'' & gt ''Komp'',''start''">computers</a> available for public use.'
-	act 'Read a book':
-		gt 'city_library', 'read'
-	end
-	
-	act 'Borrow a book':
-		gt 'city_library', 'loan'
-	end
+
+	act 'Read a book': gt 'city_library', 'read'
+	act 'Borrow a book': gt 'city_library', 'loan'
 
 	if MagicLibrary = 1:
 		act 'Read magic books':
-			dynamic $downlibrary['BookStudy'], 'splcstng'
+			*clr & cla
+			menu_off = 1
+			gs 'library_functions', 'read_book', 'splcstng'
 			gs 'stat'
+
 			'You pick out one of the magic books you can actually read and sit down with it.'
 			'You discover that not only is the subject matter complex and mostly a mystery to you, but the descriptions and explanations are unnecessarily wordy, as if the writer had something to prove.'
 			'After about an hour, you decide to take a break from it and instead test your memory. You don''t remember much, but you understand magic a little better than before.'
 
 			! Find Researchable Spells
-			if func('spellList','numAvailableSpells','librarySpells') > 0:
-				if rand(1,10) = 10:
+			if func('spellList','numAvailableSpells','librarySpells') <= 0:
+				'There doesn''t seem to be any more spells to learn here, but you can still improve your skills in the ones that you''ve already found.'
+			else
+				if rand(0, 9) = 0:
 					gs 'spellList','addAvailableSpells','librarySpells'
 					*nl
 					*pl 'You have come across a lead on a new spell.'
 				end
-			else
-				'There doesn''t seem to be any more spells to learn here, but you can still improve your skills in the ones that you''ve already found.'
 			end
 
 			!!Adding to the Actions opportunity to practice spells MC found
 			gs 'spellList', 'teacherActions', '$librarySpells', 'city_library', ''
 
-			act 'Put the book down': gt $curloc
+			act 'Put the book down': gt $loc, $loc_arg
 		end
 		!!Adding to the Actions opportunity to practice spells MC found
 		gs 'spellList', 'teacherActions', '$librarySpells', 'city_library', ''
 	end
-else
-	'The library is closed.'
-end
-
-gs 'camera', 'check_location'
-
-if $ARGS[0] = 'read':
-	cla
-	act 'Read a book on science (1:00)':
-		dynamic $downlibrary['BookStudy'], ''
-		gs 'exp_gain', 'intel', rand(3,6) + rand(0, drugVars['mentats_dose'])
-		grupvalue[3] += 1
-		gs 'stat'
-		'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/science1.jpg"></center>'
-		'You spend an hour reading, trying to make sense of all the clever propositions written inside and understand the subject it describes.'
-		act 'Put the book back': gt 'city_library', 'read'
-	end
 
-	act 'Read an adventure novel (1:00)':
-		dynamic $downlibrary['BookStudy'], ''
-		pcs_mood = 100
-		grupvalue[3] += 1
-		gs 'stat'
-		'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/fiction' + rand(1,2) + '.jpg"></center>'
-		'You spend an hour reading an adventure novel, immersing yourself in daring deeds and awesome twists.'
-		act 'Put the book back': gt 'city_library', 'read'
-	end
+	gs 'camera', 'check_location'
 
-	act 'Read a fantasy novel (1:00)':
-		dynamic $downlibrary['BookStudy'], ''
-		pcs_mood = 100
-		grupvalue[3] += 1
-		gs 'stat'
-		'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/fantasy' + rand(1,9) + '.jpg"></center>'
-		'You spend an hour reading a fantasy novel, rescuing damsels from dragons, digging for jewels with dwarves and performing world changing magic alongside elves and druids.'
-		act 'Put the book back': gt 'city_library', 'read'
-	end
+	act 'Leave': minut += 5 & gt 'city_center'
+end
 
-	act 'Read a science fiction novel (1:00)':
-		dynamic $downlibrary['BookStudy'], ''
-		pcs_mood = 100
-		grupvalue[3] += 1
-		gs 'stat'
-		'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/scifi' + rand(1,6) + '.jpg"></center>'
-		'You spend an hour reading a science fiction novel - flying off into space, traveling through time, running from rogue AI and creating monsters with your hunchbacked assistant.'
-		act 'Put the book back': gt 'city_library', 'read'
-	end
+if $ARGS[0] = 'read':
+	gs 'shortgs', 'setloc', 'city_library', 'read'
 
-	act 'Read a romance novel (1:00)':
-		dynamic $downlibrary['BookStudy'], ''
-		pcs_mood = 100
-		pcs_horny += 20
-		gs 'stat'
-		'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/romance' + rand(1,20) + '.jpg"></center>'
-		'You spend a very short hour reading a romance novel - choosing between a vampire or a werewolf, falling in love with an obscenely wealthy Grey... Several of the scenes are very steamy and you find yourself getting quite aroused.'
-		act 'Put the book back': gt 'city_library', 'read'
-	end
-	
-	temp = pcs_intel * 2 + pcs_sprt
-	if temp < 100:
-		$diff = 'hard'
-	elseif temp < 150:
-		$diff = 'medium'
-	else
-		$diff = 'easy'
+	if hour <= 7 or hour >= 19:
+		'The library is closed.'
+		act 'Leave': minut += 5 & gt 'city_center'
+		exit
 	end
-	gs 'willpower', 'misc', 'self', $diff
-	if will_cost <= pcs_willpwr:
-		act 'Read from the collected works of Leo Tolstoy (1:00) (<<will_cost>> Willpower)':
-			gs 'willpower', 'pay', 'self'
-			killvar 'will_cost'
 
-			dynamic $downlibrary['BookStudy'], ''
-			gs 'exp_gain', 'sprt', rand(3,6)
-			grupvalue[3] += 2
-			gs 'stat'
-			'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/tolstoy.jpg"></center>'
-			'You read the book for an hour. Tolstoy is certainly a classic writer, but he used a <i>lot</i> of words.'
-			act 'Put the book back': gt 'city_library', 'read'
-		end
-	else
-		act 'Read from the collected works of Leo Tolstoy (1:00) (<font color="red"><<will_cost>> Willpower</font>)': '<br><font color="red">You don''t have enough willpower to use this action.</font>'
-	end
-	
+	gs 'library_functions', 'set_read_acts'
 	act 'Go back': gt 'city_library'
+	act 'Leave': minut += 5 & gt 'city_center'
 end
 
 if $ARGS[0] = 'loan':
-	cla
-	if $lib_book_loaned ! '':
-		'You''ve currently borrowed a <<$lib_book_loaned>>.'
-		if lib_debt <= 0:
-			temp_loan_days_left = lib_debt / -50
-			'You have <<temp_loan_days_left>> days left before you need to return it.'
-		else
-			'<font color="red">Your book is overdue!</font>'
-		end
-
-		act 'Return your loaned book':
-			if lib_book_read = 0:
-				if $lib_book_loaned = 'fantasy': f_book -= 1
-			elseif lib_book_read = 1:
-				if $lib_book_loaned = 'fantasy': fantasybook = 0
-			end
-			$lib_book_loaned = ''
-			if lib_debt <= 0: lib_debt = 0
-			gt 'city_library'
-		end
-	end
-
-	if lib_debt > 0:
-		'You owe an outstanding debt of <<lib_debt>> <b>₽</b> to the library.'
-		if money < lib_debt and karta < lib_debt:
-			'You don''t have enough money to pay your debt!'
-		else
-			if money >= lib_debt:
-				act 'Pay your debt (cash)':
-					money -= lib_debt
-					lib_debt = 0
-					gt 'city_library', 'loan'
-				end
-			end
-			if karta >= lib_debt:
-				act 'Pay your debt (card)':
-					karta -= lib_debt
-					lib_debt = 0
-					gt 'city_library', 'loan'
-				end
-			end
-		end
-	end
+	gs 'shortgs', 'setloc', 'city_library', 'loan'
 
-	if $lib_book_loaned = '' and lib_debt = 0:
-		!!There''s currently only code for fantasy novels
-		!{act 'Borrow a book on science':
-			*clr & cla
-			menu_off = 1
-			s_book += 1
-			$lib_book_loaned = 'a science book'
-			lib_debt = -700
-			!!Picture here
-			'You find a science book that catches your interest and bring it to the librarian, who notes your name and the title of the book down before handing it to you.'
-			'"You need to return it within 2 weeks. Every day that you''re late incurs a 50 <b>₽</b> fine."'
-			act 'Continue': gt 'city_library'
-		end
-		
-		act 'Borrow an adventure novel':
-			*clr & cla
-			menu_off = 1
-			a_book += 1
-			$lib_book_loaned = 'an adventure novel'
-			lib_debt = -700
-			!!Picture here
-			'You find an adventure novel that catches your interest and bring it to the librarian, who notes your name and the title of the book down before handing it to you.'
-			'"You need to return it within 2 weeks. Every day that you''re late incurs a 50 <b>₽</b> fine."'
-			act 'Continue': gt 'city_library'
-		end}
-		
-		act 'Borrow a fantasy novel':
-			*clr & cla
-			menu_off = 1
-			f_book += 1
-			$lib_book_loaned = 'a fantasy novel'
-			lib_debt = -700
-			!!Picture here
-			'You find a fantasy novel that catches your interest and bring it to the librarian, who notes your name and the title of the book down before handing it to you.'
-			'"You need to return it within 2 weeks. Every day that you''re late incurs a 50 <b>₽</b> fine."'
-			act 'Continue': gt 'city_library'
-		end
-		
-		!{act 'Borrow a science fiction novel':
-			*clr & cla
-			menu_off = 1
-			sf_book += 1
-			$lib_book_loaned = 'a science fiction novel'
-			lib_debt = -700
-			!!Picture here
-			'You find a fantasy novel that catches your interest and bring it to the librarian, who notes your name and the title of the book down before handing it to you.'
-			'"You need to return it within 2 weeks. Every day that you''re late incurs a 50 <b>₽</b> fine."'
-			act 'Continue': gt 'city_library'
-		end
-		
-		act 'Borrow a romance novel':
-			*clr & cla
-			menu_off = 1
-			r_book += 1
-			$lib_book_loaned = 'a romance novel'
-			lib_debt = -700
-			!!Picture here
-			'You find a romance novel that catches your interest and bring it to the librarian, who notes your name and the title of the book down before handing it to you.'
-			'"You need to return it within 2 weeks. Every day that you''re late incurs a 50 <b>₽</b> fine."'
-			act 'Continue': gt 'city_library'
-		end}
+	if hour <= 7 or hour >= 19:
+		'The library is closed.'
+		act 'Leave': minut += 5 & gt 'city_center'
+		exit
 	end
 
+	gs 'library_functions', 'set_loan_acts'
 	act 'Go back': gt 'city_library'
+	act 'Leave': minut += 5 & gt 'city_center'
 end
 
 --- city_library ---------------------------------
-

+ 16 - 124
locations/city_mansion_residence_2.qsrc

@@ -7,12 +7,12 @@ if $ARGS[0] = 'yliving':
 	$menu_arg = 'yliving'
 	$location_type = 'private'
 	$locclass = 'livingr'
-	
+
 	menu_off = 0
 	minut += 1
 	gs 'stat'
 	gs 'music_actions', 'clear_restrictions'
-	
+
 	*clr & cla
 	'<center><b><font color="maroon">Living Room</font></b></center>'
 	if ymanrem[7] = 2:
@@ -38,11 +38,11 @@ if $ARGS[0] = 'ylounge':
 	$menu_loc = 'city_mansion_residence_2'
 	$menu_arg = 'ylounge'
 	$location_type = 'private'
-	
+
 	menu_off = 0
 	minut += 1
 	gs 'stat'
-	
+
 	*clr & cla
 	'<center><b><font color="maroon">Lounge</font></b></center>'
 	if ymanrem[8] = 2:
@@ -52,7 +52,7 @@ if $ARGS[0] = 'ylounge':
 	else
 		'<center><img <<$set_imgh>> src="images/locations/city/suburb/mansion/i_unfinished.jpg"></center>'
 	end
-	
+
 	act 'Leave the room': gt 'city_mansion_residence_1', 'yfoyer'
 
 	if ymanrem[8] = 2:
@@ -64,7 +64,7 @@ if $ARGS[0] = 'ylounge':
 			if mc_inventory['sewing_fabric'] <= 0:'You do not have any fabric.'
 			*nl
 			if pcs_sewng >= 80:
-				if newgobelen = 0 and mc_inventory['sewing_fabric'] > 0: 
+				if newgobelen = 0 and mc_inventory['sewing_fabric'] > 0:
 					act 'Start a new tapestry': gt 'sewing', 'tapestry'
 				elseif newgobelen >= 1:
 					'Your tapestry is <<newgobelen/10>> percent finished.'
@@ -77,17 +77,12 @@ if $ARGS[0] = 'ylounge':
 end
 
 if $ARGS[0] = 'ylibrary':
-	$loc = 'city_mansion_residence_2'
-	$loc_arg = 'ylibrary'
-	$menu_loc = 'city_mansion_residence_2'
-	$menu_arg = 'ylibrary'
-	$location_type = 'private'
-	
 	menu_off = 0
+	gs 'shortgs', 'setloc', 'city_mansion_residence_2', 'ylibrary'
+	$location_type = 'private'
 	minut += 1
 	gs 'stat'
-	
-	*clr & cla
+
 	'<center><b><font color="maroon">Library</font></b></center>'
 	if ymanrem[10] = 2:
 		'<center><img <<$set_imgh>> src="images/locations/city/suburb/mansion/y_library.jpg"></center>'
@@ -98,114 +93,11 @@ if $ARGS[0] = 'ylibrary':
 	end
 
 	act 'Leave the room': gt 'city_mansion_residence_1', 'yfoyer'
-	
-	if ymanrem[10] = 2:
-		killvar '$downlibrary'
-		$downlibrary['read'] = {
-			*clr & cla
-			menu_off = 1
-			if blizoruk = 500 or glassqw = 1:
-				glassqw = 1
-				msg '	The text blurs across the page. It seems you have poor eyesight. Maybe you should visit an ophthalmologist?'
-				gt 'city_mansion_residence_2', 'ylibrary'
-			end
-			if pcs_nerd > 0:
-				lastread = totminut
-				lastreadday = daystart
-				pcs_nerd += 1
-			end
-			minut += 60
-			blizoruk += 1
-		}
 
+	if ymanrem[10] = 2:
 		'A huge collection of books are neatly placed on the bookshelves.'
-		act 'Read a book on science (1:00)':
-			dynamic $downlibrary['read']
-			gs 'exp_gain', 'intel', rand(3,6) + rand(0, drugVars['mentats_dose'])
-			grupvalue[3] +=1
-			gs 'stat'
-
-			'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/science1.jpg"></center>'
-			'You spend an hour reading, trying to make sense of all the clever propositions writen inside and to finally understand the subject it describes.'
-			
-			act 'Put the book back': gt 'city_mansion_residence_2', 'ylibrary'
-		end
-
-		act 'Read an adventure novel (1:00)':
-			dynamic $downlibrary['read']
-			pcs_mood = 100
-			grupvalue[3] +=1
-			gs 'stat'
-
-			'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/fiction' + rand(1,2) + '.jpg"></center>'
-			'You spend an hour reading an adventure novel, immersing yourself in daring deeds and awesome twists.'
-			
-			act 'Put the book back': gt 'city_mansion_residence_2', 'ylibrary'
-		end
-
-		act 'Read a fantasy novel (1:00)':
-			dynamic $downlibrary['read']
-			pcs_mood = 100
-			grupvalue[3] +=1
-			gs 'stat'
-
-			'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/fantasy' + rand(1,9) + '.jpg"></center>'
-			'You spend an hour reading a fantasy novel, rescuing damsels from dragons, digging for jewels with dwarves and performing word changing magic alongside elves and druids.'
 
-			act 'Put the book back': gt 'city_mansion_residence_2', 'ylibrary'
-		end
-
-		act 'Read a science fiction novel (1:00)':
-			dynamic $downlibrary['read']
-			pcs_mood = 100
-			grupvalue[3] += 1
-			gs 'stat'
-
-			'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/scifi' + rand(1,6) + '.jpg"></center>'
-			'You spend an hour reading a science fiction novel - flying off into space, travelling though time, running from rogue AI''s and creating monsters with your hunchbacked assistant.'
-
-			act 'Put the book back': gt 'city_mansion_residence_2', 'ylibrary'
-		end
-
-		act 'Read a romance novel (1:00)':
-			dynamic $downlibrary['read']
-			pcs_mood = 100
-			pcs_horny += 20
-			gs 'stat'
-
-			'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/romance' + rand(1,20) + '.jpg"></center>'
-			'You spend a very short hour reading a romance novel - choosing between a vampire or a werewolf, falling in love with an obscenely wealthy Grey... several of the scenes are very steamy and you find yourself getting quite aroused.'
-
-			act 'Put the book back': gt 'city_mansion_residence_2', 'ylibrary'
-		end
-
-		temp = pcs_intel * 2 + pcs_sprt
-		if temp < 100:
-			$diff = 'hard'
-		elseif temp < 150:
-			$diff = 'medium'
-		else
-			$diff = 'easy'
-		end
-		gs 'willpower', 'misc', 'self', $diff
-		if will_cost <= pcs_willpwr:
-			act 'Read from the collected works of Leo Tolstoy (1:00) (<<will_cost>> Willpower)':
-				gs 'willpower', 'pay', 'self'
-				killvar 'will_cost'
-
-				dynamic $downlibrary['read']
-				gs 'exp_gain', 'sprt', rand(3,6)
-				grupvalue[3] += 2
-				gs 'stat'
-
-				'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/tolstoy.jpg"></center>'
-				'You read the book for an hour. Tolstoy is certainly a classic writer, no one denies this, but he used a shit-load of words.'
-
-				act 'Put the book back': gt 'city_mansion_residence_2', 'ylibrary'
-			end
-		else
-			act 'Read from the collected works of Leo Tolstoy (1:00) (<font color="red"><<will_cost>> Willpower</font>)': '<br><font color="red">You don''t have enough willpower to use this action.</font>'
-		end
+		gs 'library_functions', 'set_read_acts'
 	end
 end
 
@@ -217,12 +109,12 @@ if $ARGS[0] = 'yoffice':
 	$locM = 'city_mansion_residence_2'
 	$locM_arg = 'yoffice'
 	$location_type = 'private'
-	
+
 	menu_off = 0
 	minut += 1
 	gs 'stat'
 	gs 'music_actions', 'clear_restrictions'
-	
+
 	*clr & cla
 	'<center><b><font color="maroon">Office</font></b></center>'
 	if ymanrem[12] = 2:
@@ -243,7 +135,7 @@ if $ARGS[0] = 'yoffice':
 
 	!! IMPORTANT: if there is anything added later that could mean that others are in the room, gs 'music_actions', 'not_alone' should be added with the correct conditions.
 	gs 'music_actions', 'start'
-		
+
 	end
 end
 
@@ -253,11 +145,11 @@ if $ARGS[0] = 'ynursery':
 	$menu_loc = 'city_mansion_residence_2'
 	$menu_arg = 'ynursery'
 	$location_type = 'private'
-	
+
 	menu_off = 0
 	minut += 1
 	gs 'stat'
-	
+
 	*clr & cla
 	'<center><b><font color="maroon">Nursery</font></b></center>'
 	if ymanrem[9] = 2:

+ 23 - 102
locations/events.qsrc

@@ -19,24 +19,6 @@ end
 
 if $ARGS[0] = 'read':
 	act 'Read a book':
-		killvar '$downlibrary'
-		$downlibrary['read'] = {
-			*clr & cla
-			menu_off = 1
-			if blizoruk = 500 or glassqw = 1:
-				glassqw = 1
-				msg '	The text blurs across the page. It seems you have poor eyesight. Maybe you should visit an ophthalmologist?'
-				gt $loc, $loc_arg
-			end
-			if pcs_nerd > 0:
-				lastread = totminut
-				lastreadday = daystart
-				pcs_nerd += 1
-			end
-			minut += 60
-			blizoruk += 1
-		}
-
 		*clr & cla
 		gs 'stat'
 		if $clothingworntype = 'nude' and $braworntype = 'none' and $pantyworntype = 'none':
@@ -51,7 +33,7 @@ if $ARGS[0] = 'read':
 
 		if f_book > 0:
 			if fantasybook <= 0:
-				if $lib_book_loaned = 'fantasy' and lib_book_read = 0:
+				if $lib_book_loaned = 'a fantasy novel' and lib_book_read = 0:
 					lib_book_read = 1
 				end
 				fantasybook = 5
@@ -63,13 +45,15 @@ if $ARGS[0] = 'read':
 
 		if fantasybook > 0:
 			act 'Read fantasy book. There are <<fantasybook * 100>> pages left (1:00)':
+				*clr & cla
+				menu_off = 1
 				fantasybook -= 1
 				if fantasybook = 0:
 					totalbook += 1
-					if lib_book_read = 1 and $lib_book_loaned = 'fantasy': lib_book_read = 2
+					if lib_book_read = 1 and $lib_book_loaned = 'a fantasy novel': lib_book_read = 2
 				end
 
-				dynamic $downlibrary['read']
+				gs 'library_functions', 'read_book'
 				gs 'stat'
 
 				if $clothingworntype = 'nude' and $braworntype = 'none' and $pantyworntype = 'none':
@@ -79,7 +63,7 @@ if $ARGS[0] = 'read':
 				else
 					'<center><img <<$set_imgh>> src="images/pc/activities/reading/bed_book_dressed.jpg"></center>'
 				end
-				
+
 				if pcs_nerd > 0:
 					pcs_mood = 100
 
@@ -103,10 +87,12 @@ if $ARGS[0] = 'read':
 
 		if womanbook > 0:
 			act 'Read Women''s Novel. There are <<womanbook * 100>> pages left (1:00)':
+				*clr & cla
+				menu_off = 1
 				womanbook -= 1
 				if womanbook = 0: totalbook += 1
 
-				dynamic $downlibrary['read']
+				gs 'library_functions', 'read_book'
 				gs 'stat'
 
 				if $clothingworntype = 'nude' and $braworntype = 'none' and $pantyworntype = 'none':
@@ -135,12 +121,14 @@ if $ARGS[0] = 'read':
 			end
 		end
 
-        if artembook > 0:
+		if artembook > 0:
 			act 'Read the book your borrowed from Artem. There are <<artembook * 100>> pages left (1:00) ':
+				*clr & cla
+				menu_off = 1
 				artembook -= 1
 				if artembook = 0:totalbook += 1
 
-				dynamic $downlibrary['read']
+				gs 'library_functions', 'read_book'
 				gs 'stat'
 
 				if $clothingworntype = 'nude' and $braworntype = 'none' and $pantyworntype = 'none':
@@ -166,7 +154,7 @@ if $ARGS[0] = 'read':
 			end
 
 		end
-		
+
 		if tractatus > 0:
 			act 'Study Aleksei''s magical discourse on unarmed combat. You feel that there are <<tractatus>> uses left (0:15) ':
 				if pcs_mana <= 400:
@@ -191,7 +179,7 @@ if $ARGS[0] = 'read':
 				else
 					'<center><img <<$set_imgh>> src="images/pc/activities/reading/bed_book_dressed.jpg"></center>'
 				end
-				
+
 				'As you read the strange text, the words blur and suddenly you are <i>inspired</i>. Your mind fill with new ideas and revelations, the defects in your combat form polished and the knows at how inflict the maximum level of pain at the minimal cost... sharpened.'
 
 				act 'Close the book':gt $loc, $loc_arg
@@ -206,18 +194,6 @@ if $ARGS[0] = 'read':
 		'You have no magazines to read.'
 	else
 		act 'Read a magazine':
-			killvar '$downlibrary'
-			$downlibrary['magazine'] = {
-				cla & *nl
-				if blizoruk = 500 or glassqw = 1:
-					glassqw = 1
-					msg '	The text blurs across the page. It seems you have poor eyesight. Maybe you should visit an ophthalmologist?'
-					gt $loc, $loc_arg
-				end
-				pcs_mood += 5
-				minut += 30
-			}
-			
 			*clr & cla
 			gs 'stat'
 			if $clothingworntype = 'nude' and $braworntype = 'none' and $pantyworntype = 'none':
@@ -229,65 +205,10 @@ if $ARGS[0] = 'read':
 			else
 				'<center><img <<$set_imgh>> src="images/pc/activities/reading/bed_magazine_dressed.jpg"></center>'
 			end
-			
-			if mc_inventory['mag_cooking'] = 1:
-				act 'Read your cooking magazine':
-					dynamic $downlibrary['magazine']
-					mc_inventory['mag_cooking'] = 0
-					'You relax for half an hour reading your cooking magazine.'
-					act 'Return':gt $loc, $loc_arg
-				end
-			end
 
-			if mc_inventory['mag_fashion'] = 1:
-				act 'Read your fashion magazine':
-					dynamic $downlibrary['magazine']
-					mc_inventory['mag_fashion'] = 0
-					gs 'exp_gain', 'makupskl', 1
-					'You relax for half an hour reading your fashion magazine.'
-					act 'Return':gt $loc, $loc_arg
-				end
-			end
+			gs 'library_functions', 'set_magazine_acts'
 
-			if mc_inventory['mag_computer'] = 1:
-				act 'Read your computing magazine':
-					dynamic $downlibrary['magazine']
-					mc_inventory['mag_computer'] = 0
-					gs 'exp_gain', 'compskl', 1 
-					'You relax for half an hour reading your computing magazine.'
-					act 'Return':gt $loc, $loc_arg
-				end
-			end
-
-			if mc_inventory['mag_biography'] = 1:
-				act 'Read your biographical magazine':
-					dynamic $downlibrary['magazine']
-					mc_inventory['mag_biography'] = 0
-					'You relax for half an hour reading your biographical magazine.'
-					act 'Return':gt $loc, $loc_arg
-				end
-			end
-
-			if mc_inventory['mag_knitting'] = 1:
-				act 'Read your knitting magazine':
-					dynamic $downlibrary['magazine']
-					mc_inventory['mag_knitting'] = 0
-					if pcs_sewng <= 100: gs 'exp_gain', 'sewng', rand(1,3)
-					'You relax for half an hour reading your knitting magazine.'
-					act 'Return':gt $loc, $loc_arg
-				end
-			end
-
-			if mc_inventory['mag_fitness'] = 1:
-				act 'Read your fitness magazine':
-					dynamic $downlibrary['magazine']
-					mc_inventory['mag_fitness'] = 0
-					'You relax for half an hour reading your fitness magazine.'
-					act 'Return':gt $loc, $loc_arg
-				end
-			end
-
-			act 'Return':gt $loc, $loc_arg
+			act 'Return': gt $loc, $loc_arg
 		end
 	end
 end
@@ -300,7 +221,7 @@ if $ARGS[0] = 'read_porn':
 			gt $loc, $loc_arg
 		end
 		*clr & cla
-		
+
 		'<center><img <<$set_imgh>> src="images/pc/items/accessories/magazines/porn.jpg"></center>'
 
 		if mc_inventory['mag_porn'] = 1:
@@ -383,9 +304,9 @@ if $ARGS[0] = 'pav_drug_dropoff':
 	'Cocaine: 2100 <b>₽</b>'
 	'Amphetamine: 600 <b>₽</b>'
 	'Weed: 300 <b>₽</b>'
-	
+
 	act 'Leave': gt 'pav_train_hall'
-	
+
 	if money >= 560:
 		act 'Buy and use heroin (560 <b>₽</b>)':
 			money -= 560
@@ -416,7 +337,7 @@ if $ARGS[0] = 'pav_drug_dropoff':
 	else
 		'You don''t have enough money to buy heroin.'
 	end
-	
+
 	if money >= 2100:
 		act 'Buy enough cocaine for 5 lines (1800 <b>₽</b>)':
 			money -= 2100
@@ -427,7 +348,7 @@ if $ARGS[0] = 'pav_drug_dropoff':
 	else
 		'You don''t have enough money to buy cocaine.'
 	end
-	
+
 	if money >= 600:
 		act 'Buy 5 Amphetamine (600 <b>₽</b>)':
 			money -= 600
@@ -437,7 +358,7 @@ if $ARGS[0] = 'pav_drug_dropoff':
 	else
 		'You don''t have enough money to buy amphetamine.'
 	end
-	
+
 	if money >= 300:
 		act 'Buy enough weed for 5 joints (300 <b>₽</b>)':
 			money -= 300

+ 6 - 21
locations/gad_field.qsrc

@@ -38,7 +38,7 @@ if $ARGS[0] = 'field':
 	if hour >= 7 and hour <= 20 and grandpaQW['chore_bale_hay'] = 1:'You see a crowd of people working on the field.'
 
 	act 'Head back to the road (0:10)':minut += 10 & gt 'gad_road', 'start'
-	
+
 	if hour >= 7 and hour <= 13 and grandpaQW['chore_bale_hay'] = 1:
 		act 'Spend the day helping to bale hay (6:00)':
 			gs 'food', 'm_meal'
@@ -97,24 +97,6 @@ if $ARGS[0] = 'horse':
 	end
 end
 
-killvar '$downlibrary'
-$downlibrary['read'] = {
-	*clr & cla
-	menu_off = 1
-	if blizoruk = 500 or glassqw = 1:
-		glassqw = 1
-		msg '	The text blurs across the page. It seems you have poor eyesight. Maybe you should visit an ophthalmologist?'
-		gt $loc, $loc_arg
-	end
-	if pcs_nerd > 0:
-		lastread = totminut
-		lastreadday = daystart
-		pcs_nerd += 1
-	end
-	minut += 60
-	blizoruk += 1
-}
-
 if $ARGS[0] = 'cow':
 	gs 'shortgs', 'setloc', 'gad_field', 'cow'
 	$location_type = 'secluded'
@@ -284,7 +266,7 @@ if $ARGS[0] = 'cow2':
 			menu_off = 1
 			'<center><img <<$set_imgh>> src="images/locations/gadukino/village/cow_go.jpg"></center>'
 			'Grandpa looks at his watch and says it''s time to drive the herd near the forest. So the two of you begin to gather the herd and guide them toward the woods.'
-			
+
 			minut += 60
 			if temper >= 25 and sunWeather = 1:
 				pcs_hydra -= 12
@@ -477,7 +459,10 @@ if $ARGS[0] = 'set_nomira_acts':
 		end
 
 		act 'Read a book (1:00)':
-			dynamic $downlibrary['read']
+			*clr & cla
+			menu_off = 1
+			gs 'library_functions', 'read_book'
+
 			'<center><img <<$set_imgh>> src="images/locations/gadukino/village/graze_cow_book'+rand(1,2)+'.jpg"></center>'
 			if temper >= 25: pcs_hydra -= 12
 			if pcs_nerd > 0:

+ 22 - 33
locations/gad_swamphouse.qsrc

@@ -583,26 +583,7 @@ if $ARGS[0] = 'clothes_read_magazines':
 end
 
 if $ARGS[0] = 'stackmagazines':
-	killvar '$downlibrary'
-	$downlibrary['read'] = {
-		*clr & cla
-		menu_off = 1
-		if blizoruk = 500 or glassqw = 1:
-			glassqw = 1
-			msg '	The text blurs across the page. It seems you have poor eyesight. Maybe you should visit an ophthalmologist?'
-			gt 'gad_swamphouse', 'stackmagazines'
-		end
-		if pcs_nerd > 0:
-			lastread = totminut
-			lastreadday = daystart
-			pcs_nerd += 1
-		end
-		minut += 60
-		blizoruk += 1
-	}
-
-	cla
-	*clr
+	*clr & cla
 	menu_off = 1
 	minut += 1
 	gs 'stat'
@@ -612,7 +593,9 @@ if $ARGS[0] = 'stackmagazines':
 	'A stack of all kinds of magazines, there''s even one with "interesting" pictures.'
 
 	act 'Read the scientific journal (1:00)':
-		dynamic $downlibrary['read']
+		*clr & cla
+		menu_off = 1
+		gs 'library_functions', 'read_book'
 		gs 'exp_gain', 'intel', 4
 		pcs_mood += 10
 		gs 'stat'
@@ -623,7 +606,9 @@ if $ARGS[0] = 'stackmagazines':
 		act 'Continue': gs 'gad_swamphouse', 'stackmagazines'
 	end
 	act 'Read the literary magazine (1:00)':
-		dynamic $downlibrary['read']
+		*clr & cla
+		menu_off = 1
+		gs 'library_functions', 'read_book'
 		gs 'exp_gain', 'intel', 4
 		pcs_mood += 10
 		gs 'stat'
@@ -634,7 +619,9 @@ if $ARGS[0] = 'stackmagazines':
 		act 'Continue': gs 'gad_swamphouse', 'stackmagazines'
 	end
 	act 'Read the entertainment magazine (1:00)':
-		dynamic $downlibrary['read']
+		*clr & cla
+		menu_off = 1
+		gs 'library_functions', 'read_book'
 		gs 'exp_gain', 'sprt', 4
 		pcs_mood += 10
 		gs 'stat'
@@ -647,23 +634,25 @@ if $ARGS[0] = 'stackmagazines':
 	act 'Read the porn magazine (1:00)':
 		*clr & cla
 		menu_off = 1
-		if blizoruk = 500 or glassqw = 1:
-			glassqw = 1
-			msg '	The text blurs across the page, it seems you have poor eyesight. Probably from all the porn. Maybe you should visit an ophthalmologist?'
-			gt 'gad_swamphouse', 'stackmagazines'
-		end
-		blizoruk += 1
+		gs 'library_functions', 'read_book', 'porn'
 		pcs_mood += 10
 		gs 'stat'
 
-		if $clothingworntype ! 'nude':'<center><img <<$set_imgh>> src="images/locations/gadukino/hunters/readpornomag.jpg"></center>'
-		if $clothingworntype = 'nude' and $pantyworntype ! 'none':'<center><img <<$set_imgh>> src="images/locations/gadukino/hunters/readpornomag_tanga.jpg"></center>'
-		if $clothingworntype = 'nude' and $pantyworntype = 'none':'<center><img <<$set_imgh>> src="images/locations/gadukino/hunters/readpornomag_nude.jpg"></center>'
+		if $clothingworntype ! 'nude':
+			'<center><img <<$set_imgh>> src="images/locations/gadukino/hunters/readpornomag.jpg"></center>'
+		elseif $pantyworntype ! 'none':
+			'<center><img <<$set_imgh>> src="images/locations/gadukino/hunters/readpornomag_tanga.jpg"></center>'
+		else
+			'<center><img <<$set_imgh>> src="images/locations/gadukino/hunters/readpornomag_nude.jpg"></center>'
+		end
+
 		*nl
 		'You flip through the porn magazine, reading the stories and looking at pictures, when suddenly you realize you''ve started touching yourself.'
-		gs 'arousal', 'porn', 60
+
+		gs 'arousal', 'porn', -60
 		gs 'arousal', 'end'
 		gs 'stat'
+
 		act 'Continue': gs 'gad_swamphouse', 'stackmagazines'
 	end
 	act 'Move away': gt 'gad_swamphouse', 'start'

+ 333 - 0
locations/library_functions.qsrc

@@ -0,0 +1,333 @@
+# library_functions
+
+
+if $ARGS[0] = 'read_book':
+	if blizoruk = 500 or glassqw = 1:
+		glassqw = 1
+		msg '	The text blurs across the page. It seems you have poor eyesight. Maybe you should visit an ophthalmologist?'
+		gt $loc, $loc_arg
+	end
+	blizoruk += 1
+	minut += 60
+
+	if $ARGS[1] ! 'porn':
+		if pcs_nerd > 0:
+			lastread = totminut
+			lastreadday = daystart
+			pcs_nerd += 1
+		end
+		if $ARGS[1] ! '':
+			dynamic "
+				if pcs_<<$ARGS[1]>> >= 50:
+					<<$ARGS[1]>>_exp += rand(0, 1)
+				elseif pcs_<<$ARGS[1]>> >= 25:
+					<<$ARGS[1]>>_exp += rand(1, 2)
+				else
+					<<$ARGS[1]>>_exp += rand(1, 3)
+				end"
+		end
+	end
+
+elseif $ARGS[0] = 'read_magazine':
+	if blizoruk = 500 or glassqw = 1:
+		glassqw = 1
+		msg '	The text blurs across the page. It seems you have poor eyesight. Maybe you should visit an ophthalmologist?'
+		gt $loc, $loc_arg
+	end
+	pcs_mood += 5
+	minut += 30
+end
+
+
+if $ARGS[0] = 'set_read_acts':
+	act 'Read a book on science (1:00)':
+		*clr & cla
+		menu_off = 1
+		gs 'library_functions', 'read_book'
+		gs 'exp_gain', 'intel', rand(3,6) + rand(0, drugVars['mentats_dose'])
+		grupvalue[3] += 1
+		gs 'stat'
+		'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/science1.jpg"></center>'
+		'You spend an hour reading, trying to make sense of all the clever propositions written inside and understand the subject it describes.'
+		act 'Put the book back': gt $loc, $loc_arg
+	end
+
+	act 'Read an adventure novel (1:00)':
+		*clr & cla
+		menu_off = 1
+		gs 'library_functions', 'read_book'
+		pcs_mood = 100
+		grupvalue[3] += 1
+		gs 'stat'
+		'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/fiction' + rand(1,2) + '.jpg"></center>'
+		'You spend an hour reading an adventure novel, immersing yourself in daring deeds and awesome twists.'
+		act 'Put the book back': gt $loc, $loc_arg
+	end
+
+	act 'Read a fantasy novel (1:00)':
+		*clr & cla
+		menu_off = 1
+		gs 'library_functions', 'read_book'
+		pcs_mood = 100
+		grupvalue[3] += 1
+		gs 'stat'
+		'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/fantasy' + rand(1,9) + '.jpg"></center>'
+		'You spend an hour reading a fantasy novel, rescuing damsels from dragons, digging for jewels with dwarves and performing word changing magic alongside elves and druids.'
+		act 'Put the book back': gt $loc, $loc_arg
+	end
+
+	act 'Read a science fiction novel (1:00)':
+		*clr & cla
+		menu_off = 1
+		gs 'library_functions', 'read_book'
+		pcs_mood = 100
+		grupvalue[3] += 1
+		gs 'stat'
+		'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/scifi' + rand(1,6) + '.jpg"></center>'
+		'You spend an hour reading a science fiction novel - flying off into space, travelling though time, running from rogue AI and creating monsters with your hunchbacked assistant.'
+		act 'Put the book back': gt $loc, $loc_arg
+	end
+
+	act 'Read a romance novel (1:00)':
+		*clr & cla
+		menu_off = 1
+		gs 'library_functions', 'read_book'
+		pcs_mood = 100
+		pcs_horny += 20
+		gs 'stat'
+		'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/romance' + rand(1,20) + '.jpg"></center>'
+		'You spend a very short hour reading a romance novel - choosing between a vampire or a werewolf, falling in love with an obscenely wealthy Grey... Several of the scenes are very steamy and you find yourself getting quite aroused.'
+		act 'Put the book back': gt $loc, $loc_arg
+	end
+
+	temp = pcs_intel * 2 + pcs_sprt
+	if temp < 100:
+		$diff = 'hard'
+	elseif temp < 150:
+		$diff = 'medium'
+	else
+		$diff = 'easy'
+	end
+	gs 'willpower', 'misc', 'self', $diff
+	if will_cost <= pcs_willpwr:
+		act 'Read from the collected works of Leo Tolstoy (1:00) (<<will_cost>> Willpower)':
+			*clr & cla
+			menu_off = 1
+			gs 'willpower', 'pay', 'self'
+			killvar 'will_cost'
+
+			gs 'library_functions', 'read_book'
+			gs 'exp_gain', 'sprt', rand(3,6)
+			grupvalue[3] += 2
+			gs 'stat'
+			'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/tolstoy.jpg"></center>'
+			'You read the book for an hour. Tolstoy is certainly a classic writer, but he used a <i>lot</i> of words.'
+			act 'Put the book back': gt $loc, $loc_arg
+		end
+	else
+		act 'Read from the collected works of Leo Tolstoy (1:00) (<font color="red"><<will_cost>> Willpower</font>)': '<br><font color="red">You don''t have enough willpower to use this action.</font>'
+	end
+end
+
+
+if $ARGS[0] = 'set_magazine_acts':
+	if mc_inventory['mag_cooking'] = 1:
+		act 'Read your cooking magazine':
+			cla & *nl
+			gs 'library_functions', 'read_magazine'
+			mc_inventory['mag_cooking'] = 0
+			'You relax for half an hour reading your cooking magazine.'
+			act 'Return':gt $loc, $loc_arg
+		end
+	end
+
+	if mc_inventory['mag_fashion'] = 1:
+		act 'Read your fashion magazine':
+			cla & *nl
+			gs 'library_functions', 'read_magazine'
+			mc_inventory['mag_fashion'] = 0
+			gs 'exp_gain', 'makupskl', 1
+			'You relax for half an hour reading your fashion magazine.'
+			act 'Return':gt $loc, $loc_arg
+		end
+	end
+
+	if mc_inventory['mag_computer'] = 1:
+		act 'Read your computing magazine':
+			cla & *nl
+			gs 'library_functions', 'read_magazine'
+			mc_inventory['mag_computer'] = 0
+			gs 'exp_gain', 'compskl', 1
+			'You relax for half an hour reading your computing magazine.'
+			act 'Return':gt $loc, $loc_arg
+		end
+	end
+
+	if mc_inventory['mag_biography'] = 1:
+		act 'Read your biographical magazine':
+			cla & *nl
+			gs 'library_functions', 'read_magazine'
+			mc_inventory['mag_biography'] = 0
+			'You relax for half an hour reading your biographical magazine.'
+			act 'Return':gt $loc, $loc_arg
+		end
+	end
+
+	if mc_inventory['mag_knitting'] = 1:
+		act 'Read your knitting magazine':
+			cla & *nl
+			gs 'library_functions', 'read_magazine'
+			mc_inventory['mag_knitting'] = 0
+			if pcs_sewng <= 100: gs 'exp_gain', 'sewng', rand(1,3)
+			'You relax for half an hour reading your knitting magazine.'
+			act 'Return':gt $loc, $loc_arg
+		end
+	end
+
+	if mc_inventory['mag_fitness'] = 1:
+		act 'Read your fitness magazine':
+			cla & *nl
+			gs 'library_functions', 'read_magazine'
+			mc_inventory['mag_fitness'] = 0
+			'You relax for half an hour reading your fitness magazine.'
+			act 'Return':gt $loc, $loc_arg
+		end
+	end
+end
+
+
+
+
+	!!=================================================!!
+	!!                                                 !!
+	!!                    LOAN ACTS                    !!
+	!!                                                 !!
+	!!=================================================!!
+
+
+if $ARGS[0] = 'set_loan_acts':
+	gs 'library_functions', 'return_book_act'
+	gs 'library_functions', 'pay_debt_act'
+	gs 'library_functions', 'loan_book_act'
+end
+
+if $ARGS[0] = 'return_book_act':
+	if $lib_book_loaned ! '':
+		'You''ve currently borrowed <<$lib_book_loaned>>.'
+		if lib_debt <= 0:
+			temp_loan_days_left = lib_debt / -50
+			'You have <<temp_loan_days_left>> days left before you need to return it.'
+		else
+			'<font color="red">Your book is overdue!</font>'
+		end
+
+		act 'Return your loaned book':
+			if lib_book_read = 0:
+				if $lib_book_loaned = 'a fantasy novel':
+					f_book -= 1
+				end
+			elseif lib_book_read = 1:
+				if $lib_book_loaned = 'a fantasy novel':
+					fantasybook = 0
+				end
+			end
+			$lib_book_loaned = ''
+			if lib_debt <= 0: lib_debt = 0
+			gt $loc, $loc_arg
+		end
+	end
+end
+
+
+if $ARGS[0] = 'pay_debt_act':
+	if lib_debt > 0:
+		'You owe an outstanding debt of <<lib_debt>> <b>₽</b> to the library.'
+		if money < lib_debt and karta < lib_debt:
+			'You don''t have enough money to pay your debt!'
+		else
+			if money >= lib_debt:
+				act 'Pay your debt (cash)':
+					money -= lib_debt
+					lib_debt = 0
+					gt 'uni_library', 'loan'
+				end
+			end
+			if karta >= lib_debt:
+				act 'Pay your debt (card)':
+					karta -= lib_debt
+					lib_debt = 0
+					gt 'uni_library', 'loan'
+				end
+			end
+		end
+	end
+end
+
+
+if $ARGS[0] = 'loan_book_act':
+	if $lib_book_loaned = '' and lib_debt = 0:
+		!!There''s currently only code for fantasy novels (Is this still true? I''ve left everything but the fantasy novel out until confirmed)
+		!{act 'Borrow a science book':
+			*clr & cla
+			menu_off = 1
+			s_book += 1
+			$lib_book_loaned = 'a science book'
+			lib_debt = -700
+			!!Picture here
+			'You find a science book that catches your interest and bring it to the librarian, who notes your name and the title of the book down before handing it to you.'
+			'"You need to return it within 2 weeks. Every day that you''re late incurs a 50 <b>₽</b> fine."'
+			act 'Continue': gt $loc, $loc_arg
+		end
+
+		act 'Borrow an adventure novel':
+			*clr & cla
+			menu_off = 1
+			a_book += 1
+			$lib_book_loaned = 'an adventure novel'
+			lib_debt = -700
+			!!Picture here
+			'You find an adventure novel that catches your interest and bring it to the librarian, who notes your name and the title of the book down before handing it to you.'
+			'"You need to return it within 2 weeks. Every day that you''re late incurs a 50 <b>₽</b> fine."'
+			act 'Continue': gt $loc, $loc_arg
+		end}
+
+		act 'Borrow a fantasy novel':
+			*clr & cla
+			menu_off = 1
+			f_book += 1
+			$lib_book_loaned = 'a fantasy novel'
+			lib_debt = -700
+			!!Picture here
+			'You find a fantasy novel that catches your interest and bring it to the librarian, who notes your name and the title of the book down before handing it to you.'
+			'"You need to return it within 2 weeks. Every day that you''re late incurs a 50 <b>₽</b> fine."'
+			act 'Continue': gt $loc, $loc_arg
+		end
+
+		!{act 'Borrow a science fiction novel':
+			*clr & cla
+			menu_off = 1
+			sf_book += 1
+			$lib_book_loaned = 'a science fiction novel'
+			lib_debt = -700
+			!!Picture here
+			'You find a science fiction novel that catches your interest and bring it to the librarian, who notes your name and the title of the book down before handing it to you.'
+			'"You need to return it within 2 weeks. Every day that you''re late incurs a 50 <b>₽</b> fine."'
+			act 'Continue': gt $loc, $loc_arg
+		end
+
+		act 'Borrow a romance novel':
+			*clr & cla
+			menu_off = 1
+			r_book += 1
+			$lib_book_loaned = 'a romance novel'
+			lib_debt = -700
+			!!Picture here
+			'You find a fantasy novel that catches your interest and bring it to the librarian, who notes your name and the title of the book down before handing it to you.'
+			'"You need to return it within 2 weeks. Every day that you''re late incurs a 50 <b>₽</b> fine."'
+			act 'Continue': gt $loc, $loc_arg
+		end}
+	end
+end
+
+
+--- library_functions ---------------------------------

+ 81 - 251
locations/pav_library.qsrc

@@ -3,66 +3,55 @@
 !2021/10/05
 !2023/09/11 Loan update by Anjuna
 
-$loc_arg = ''
-$loc = 'pav_library'
-$location_type = 'public_indoors'
-$menu_loc = 'pav_library'
-$menu_arg = ''
 menu_off = 0
-frost = 0
-gs 'stat'
-gs 'themes', 'indoors'
-'<center><b><font color="maroon">Community center library</font></b></center>'
-'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/library/gdkbibl.jpg"></center>'
-'For such a small town, the library is surprisingly large, containing many interesting books on a wide variety of subjects.'
 
-if mid($start_type,1,2) = 'sg' and kanikuli = 0 and week < 6 and nerdstudynight['day'] ! daystart and hour > 14 and SchoolAtestat = 0:
-	'The nerds are sitting at a table studying together.'
-end
+if $ARGS[0] = '':
+	gs 'shortgs', 'setloc', 'pav_library', ''
+	$location_type = 'public_indoors'
+	frost = 0
+	gs 'stat'
+
+	gs 'themes', 'indoors'
 
-if mid($start_type,1,2) = 'sg' and kanikuli = 0 and week > 5 and hour >= 12 and hour < 14:
-	if nataliaQW['library_day_check'] ! daystart:
-		nataliaQW['library_day_check'] = daystart
-		if rand(0,3) = 0: nataliaQW['library_day'] = daystart
+	'<center><b><font color="maroon">Community center library</font></b></center>'
+	'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/library/gdkbibl.jpg"></center>'
+	'For such a small town, the library is surprisingly large, containing many interesting books on a wide variety of subjects.'
+
+	if mid($start_type,1,2) = 'sg' and kanikuli = 0 and week < 6 and nerdstudynight['day'] ! daystart and hour > 14 and SchoolAtestat = 0:
+		'The nerds are sitting at a table studying together.'
 	end
-	if nataliaQW['library_day'] = daystart:
-		'You see your classmate <a href="exec: gt ''natalia_pavlova'',''library''">Natalia Pavlova</a> sitting alone at one of the tables.'
+
+	if mid($start_type,1,2) = 'sg' and kanikuli = 0 and week > 5 and hour >= 12 and hour < 14:
+		if nataliaQW['library_day_check'] ! daystart:
+			nataliaQW['library_day_check'] = daystart
+			if rand(0,3) = 0: nataliaQW['library_day'] = daystart
+		end
+		if nataliaQW['library_day'] = daystart:
+			'You see your classmate <a href="exec: gt ''natalia_pavlova'',''library''">Natalia Pavlova</a> sitting alone at one of the tables.'
+		end
 	end
-end
 
-act 'Leave': gt 'pav_commcenter'
-act 'Go to the toilets': gt 'gdktoilet', 'start'
-if nerd_game['game_day'] = daystart and hour = 19: act 'Wait for game night to start': minut += 60-minut & gt 'pav_library'
-if nerd_game['game_day'] = daystart and hour = 20: act 'Join the nerds': gt 'nerd_game_night', 'game'
+	if nerd_game['game_day'] = daystart and hour = 19: act 'Wait for game night to start': minut = 60 & gt 'pav_library'
+	if nerd_game['game_day'] = daystart and hour = 20: act 'Join the nerds': gt 'nerd_game_night', 'game'
 
-killvar '$downlibrary'
-$downlibrary['read'] = {
-	*clr & cla
-	menu_off = 1
-	if blizoruk = 500 or glassqw = 1:
-		glassqw = 1
-		msg '	The text blurs across the page. It seems you have poor eyesight. Maybe you should visit an ophthalmologist?'
-		gt 'pav_library'
-	end
-	if pcs_nerd > 0:
-		lastread = totminut
-		lastreadday = daystart
-		pcs_nerd += 1
+	if hour <= 7 or hour >= 18:
+		'The library is closed.'
+		act 'Go to the toilets': gt 'gdktoilet', 'start'
+		act 'Leave': gt 'pav_commcenter'
+		exit
 	end
-	minut += 60
-	blizoruk += 1
-}
 
-if hour >= 8 and hour < 18:
 	'Between the bookshelves are some tables which can be used for studying. Some of them have <a href="exec: gs ''internet_mobile'', ''get_access'', ''free'', ''noporn'',''nocamshow'' & gs ''internet_mobile'', ''add_limitation'', ''general-text'', ''On this public computer all adult content sites are blocked'' & gt ''Komp'',''start''">computers</a> for public use.'
 	if lernHome > 0: 'You could do your homework with the help of one of the computers.'
 
-	act 'Read a book': gt 'pav_library', 'read'	
+	act 'Read a book': gt 'pav_library', 'read'
 	act 'Borrow a book': gt 'pav_library', 'loan'
 
 	act 'Study for an hour':
-		dynamic $downlibrary['read']
-		lern += rand(1,3)
+		*clr & cla
+		menu_off = 1
+		gs 'library_functions', 'read_book'
+		lern += rand(1, 3)
 		grupvalue[3] += 2
 		gs 'stat'
 		'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/learning' + rand(1,3) + '.jpg"></center>'
@@ -70,234 +59,75 @@ if hour >= 8 and hour < 18:
 		act 'Put the book back': gt 'pav_library'
 	end
 
-	gs 'willpower', 'chore', 'self', iif(grupTipe = 4 and pcs_traits['nerd_status'] = 0, 'hard', iif(pcs_traits['nerd_status'] > 0, 'easy', 'medium'))
-	if pcs_traits['nerd_status'] = 2: will_cost = will_cost / 2
-	if lernHome > 0 and (will_cost <= pcs_willpwr or pcs_traits['nerd_status'] = 3):
-		act 'Do your homework (1:00'+iif(pcs_traits['nerd_status'] = 3, '', ' and <<will_cost>> Willpower')+')':
-			cla & *clr
-			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/library/homework.jpg"></center>'
-			minut += 60
-			pcs_mood += 5 * pcs_traits['nerd_status']
-			lern += 1
-			gs 'willpower', 'chore', 'self', iif(grupTipe = 4, 'hard', iif(pcs_traits['nerd_status'] > 0, 'easy', 'medium'))
-			if pcs_traits['nerd_status'] = 2: will_cost = will_cost / 2
-			if pcs_traits['nerd_status'] < 3: gs 'willpower', 'pay', 'self'
-			gs 'stat'
-			gs 'grades', 'homework', 'school', 'yes', 1, 0, 0
-			'You sit down at one of the tables with a computer and use it to help you do your homework.'
-			'After an hour, you''ve '+iif(lernHome = 0, 'completed', 'done a part of')+' your homework.'
-			act 'Get up from the table': gt 'pav_library'
+	if lernhome > 0:
+		gs 'willpower', 'chore', 'self', iif(grupTipe = 4 and pcs_traits['nerd_status'] = 0, 'hard', iif(pcs_traits['nerd_status'] > 0, 'easy', 'medium'))
+		if pcs_traits['nerd_status'] = 2: will_cost = will_cost / 2
+		if pcs_willpwr < will_cost and pcs_traits['nerd_status'] < 3:
+			act 'Do your homework (<font color="red"><<will_cost>> Willpower</font>)': '<br><font color="red">You don''t have enough willpower to use this action.</font>'
+		else
+			act 'Do your homework (1:00' + iif(pcs_traits['nerd_status'] = 3, '', ' and <<will_cost>> Willpower')+')':
+				*clr & cla
+				minut += 60
+				pcs_mood += 5 * pcs_traits['nerd_status']
+				lern += 1
+
+				gs 'willpower', 'chore', 'self', iif(grupTipe = 4, 'hard', iif(pcs_traits['nerd_status'] > 0, 'easy', 'medium'))
+				if pcs_traits['nerd_status'] = 2: will_cost = will_cost / 2
+				if pcs_traits['nerd_status'] < 3: gs 'willpower', 'pay', 'self'
+				gs 'stat'
+				gs 'grades', 'homework', 'school', 'yes', 1, 0, 0
+
+				'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/library/homework.jpg"></center>'
+				'You sit down at one of the tables with a computer and use it to help you do your homework.'
+				'After an hour, you''ve '+iif(lernHome = 0, 'completed', 'done a part of')+' your homework.'
+
+				act 'Get up from the table': gt 'pav_library'
+			end
 		end
-	elseif lernHome > 0 and will_cost > pcs_willpwr:
-		act 'Do your homework (<font color="red"><<will_cost>> Willpower</font>)': '<br><font color="red">You don''t have enough willpower to use this action.</font>'
 	end
-	
-	if mid($start_type,1,2) = 'sg' and kanikuli = 0 and week < 6 and nerdstudynight['day'] ! daystart and hour > 14 and SchoolAtestat = 0 and SchoolBlock = 0 _ 
+
+	if mid($start_type,1,2) = 'sg' and kanikuli = 0 and week < 6 and nerdstudynight['day'] ! daystart and hour > 14 and SchoolAtestat = 0 and SchoolBlock = 0 _
 	and (class['school_grades_above_40'] + class['school_grades_above_70'] + class['school_grades_above_90'] <= 20 or grupTipe = 3):
 		act 'Join the nerd''s study group': gt 'pav_library_nerdstudy', 'nerd_study_night'
 	end
-else
-	'The library is closed.'
+
+	act 'Go to the toilets': gt 'gdktoilet', 'start'
+	act 'Leave': gt 'pav_commcenter'
 end
 
 if $ARGS[0] = 'read':
-	cla
-	if hour < 18:
-		act 'Go back': gt 'pav_library'
-
-		act 'Read a book on science (1:00)':
-			dynamic $downlibrary['read']
-			gs 'exp_gain', 'intel', rand(3,6) + rand(0, drugVars['mentats_dose'])
-			grupvalue[3] +=1
-			gs 'stat'
-			'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/science1.jpg"></center>'
-			'You spend an hour reading, trying to make sense of all the clever propositions written inside and understand the subject it describes.'
-			act 'Put the book back': gt 'pav_library', 'read'
-		end
-
-		act 'Read an adventure novel (1:00)':
-			dynamic $downlibrary['read']
-			pcs_mood = 100
-			grupvalue[3] +=1
-			gs 'stat'
-			'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/fiction' + rand(1,2) + '.jpg"></center>'
-			'You spend an hour reading an adventure novel, immersing yourself in daring deeds and awesome twists.'
-			act 'Put the book back': gt 'pav_library', 'read'
-		end
-
-		act 'Read a fantasy novel (1:00)':
-			dynamic $downlibrary['read']
-			pcs_mood = 100
-			grupvalue[3] += 1
-			gs 'stat'
-			'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/fantasy' + rand(1,9) + '.jpg"></center>'
-			'You spend an hour reading a fantasy novel, rescuing damsels from dragons, digging for jewels with dwarves and performing word changing magic alongside elves and druids.'
-			act 'Put the book back': gt 'pav_library', 'read'
-		end
+	gs 'shortgs', 'setloc', 'pav_library', 'read'
 
-		act 'Read a science fiction novel (1:00)':
-			dynamic $downlibrary['read']
-			pcs_mood = 100
-			grupvalue[3] += 1
-			gs 'stat'
-			'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/scifi' + rand(1,6) + '.jpg"></center>'
-			'You spend an hour reading a science fiction novel - flying off into space, travelling though time, running from rogue AI and creating monsters with your hunchbacked assistant.'
-			act 'Put the book back': gt 'pav_library', 'read'
-		end
+	'<center><b><font color="maroon">Community center library</font></b></center>'
+	'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/library/gdkbibl.jpg"></center>'
 
-		act 'Read a romance novel (1:00)':
-			dynamic $downlibrary['read']
-			pcs_mood = 100
-			pcs_horny += 20
-			gs 'stat'
-			'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/romance' + rand(1,20) + '.jpg"></center>'
-			'You spend a very short hour reading a romance novel - choosing between a vampire or a werewolf, falling in love with an obscenely wealthy Grey... Several of the scenes are very steamy and you find yourself getting quite aroused.'
-			act 'Put the book back': gt 'pav_library', 'read'
-		end
-		
-		temp = pcs_intel * 2 + pcs_sprt
-		if temp < 100:
-			$diff = 'hard'
-		elseif temp < 150:
-			$diff = 'medium'
-		else
-			$diff = 'easy'
-		end
-		gs 'willpower', 'misc', 'self', $diff
-		if will_cost <= pcs_willpwr:
-			act 'Read from the collected works of Leo Tolstoy (1:00) (<<will_cost>> Willpower)':
-				gs 'willpower', 'pay', 'self'
-				killvar 'will_cost'
-
-				dynamic $downlibrary['read']
-				gs 'exp_gain', 'sprt', rand(3,6)
-				grupvalue[3] += 2
-				gs 'stat'
-				'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/tolstoy.jpg"></center>'
-				'You read the book for an hour. Tolstoy is certainly a classic writer, but he used a <i>lot</i> of words.'
-				act 'Put the book back': gt 'pav_library', 'read'
-			end
-		else
-			act 'Read from the collected works of Leo Tolstoy (1:00) (<font color="red"><<will_cost>> Willpower</font>)': '<br><font color="red">You don''t have enough willpower to use this action.</font>'
-		end
-	else
+	if hour >= 18:
 		!! Note find stern librarian image
 		'The librarian finds you still reading and shooshes you out of the library'
 		act 'Leave': gt 'pav_commcenter'
+		exit
 	end
+
+	gs 'library_functions', 'set_read_acts'
+	act 'Go back': gt 'pav_library'
+	act 'Leave': gt 'pav_commcenter'
 end
 
 if $ARGS[0] = 'loan':
-	cla
-	if $lib_book_loaned ! '':
-		'You''ve currently borrowed a <<$lib_book_loaned>>.'
-		if lib_debt <= 0:
-			temp_loan_days_left = lib_debt / -50
-			'You have <<temp_loan_days_left>> days left before you need to return it.'
-		else
-			'<font color="red">Your book is overdue!</font>'
-		end
-
-		act 'Return your loaned book':
-			if lib_book_read = 0:
-				if $lib_book_loaned = 'fantasy': f_book -= 1
-			elseif lib_book_read = 1:
-				if $lib_book_loaned = 'fantasy': fantasybook = 0
-			end
-			$lib_book_loaned = ''
-			if lib_debt <= 0: lib_debt = 0
-			lib_book_read = 0
-			gt 'pav_library'
-		end
-	end
+	gs 'shortgs', 'setloc', 'pav_library', 'loan'
 
-	if lib_debt > 0:
-		'You owe an outstanding debt of <<lib_debt>> <b>₽</b> to the library.'
-		if money < lib_debt and karta < lib_debt:
-			'You don''t have enough money to pay your debt!'
-		else
-			if money >= lib_debt:
-				act 'Pay your debt (cash)':
-					money -= lib_debt
-					lib_debt = 0
-					gt 'pav_library', 'loan'
-				end
-			end
-			if karta >= lib_debt:
-				act 'Pay your debt (card)':
-					karta -= lib_debt
-					lib_debt = 0
-					gt 'pav_library', 'loan'
-				end
-			end
-		end
-	end
+	'<center><b><font color="maroon">Community center library</font></b></center>'
+	'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/library/gdkbibl.jpg"></center>'
 
-	if $lib_book_loaned = '' and lib_debt = 0:
-		!!There''s currently only code for fantasy novels
-		!{act 'Borrow a science book':
-			*clr & cla
-			menu_off = 1
-			s_book += 1
-			$lib_book_loaned = 'a science book'
-			lib_debt = -700
-			!!Picture here
-			'You find a science book that catches your interest and bring it to the librarian, who notes your name and the title of the book down before handing it to you.'
-			'"You need to return it within 2 weeks. Every day that you''re late incurs a 50 <b>₽</b> fine."' 
-			act 'Continue': gt 'pav_library'
-		end
-		
-		act 'Borrow an adventure novel':
-			*clr & cla
-			menu_off = 1
-			a_book += 1
-			$lib_book_loaned = 'an adventure novel'
-			lib_debt = -700
-			!!Picture here
-			'You find an adventure novel that catches your interest and bring it to the librarian, who notes your name and the title of the book down before handing it to you.'
-			'"You need to return it within 2 weeks. Every day that you''re late incurs a 50 <b>₽</b> fine."'
-			act 'Continue': gt 'pav_library'
-		end}
-		
-		act 'Borrow a fantasy novel':
-			*clr & cla
-			menu_off = 1
-			f_book += 1
-			$lib_book_loaned = 'a fantasy novel'
-			lib_debt = -700
-			!!Picture here
-			'You find a fantasy novel that catches your interest and bring it to the librarian, who notes your name and the title of the book down before handing it to you.'
-			'"You need to return it within 2 weeks. Every day that you''re late incurs a 50 <b>₽</b> fine."'
-			act 'Continue': gt 'pav_library'
-		end
-		
-		!{act 'Borrow a science fiction novel':
-			*clr & cla
-			menu_off = 1
-			sf_book += 1
-			$lib_book_loaned = 'a science fiction novel'
-			lib_debt = -700
-			!!Picture here
-			'You find a science fiction novel that catches your interest and bring it to the librarian, who notes your name and the title of the book down before handing it to you.'
-			'"You need to return it within 2 weeks. Every day that you''re late incurs a 50 <b>₽</b> fine."'
-			act 'Continue': gt 'pav_library'
-		end
-		
-		act 'Borrow a romance novel':
-			*clr & cla
-			menu_off = 1
-			r_book += 1
-			$lib_book_loaned = 'a romance novel'
-			lib_debt = -700
-			!!Picture here
-			'You find a romance novel that catches your interest and bring it to the librarian, who notes your name and the title of the book down before handing it to you.'
-			'"You need to return it within 2 weeks. Every day that you''re late incurs a 50 <b>₽</b> fine."'
-			act 'Continue': gt 'pav_library'
-		end}
+	if hour >= 18:
+		'The library is closing for the night.'
+		act 'Leave': gt 'pav_commcenter'
+		exit
 	end
 
+	gs 'library_functions', 'set_loan_acts'
 	act 'Go back': gt 'pav_library'
+	act 'Leave': gt 'pav_commcenter'
 end
 
 --- pav_library ---------------------------------
-

+ 3 - 0
locations/saveupdater.qsrc

@@ -3241,6 +3241,9 @@ if temp_current_save_version < 00090302:
 	end
 
 	$npc_notes['A26'] = 'Anatoly Tsarev is the school''s math teacher. He''s a stern teacher, who always demands the best out of his students. His daughter Lera is in your class. He''s married to Vera, who works at the train station as a ticket saleswoman and as a cleaner in the garment factory. There are rumors that since Lesco came to live with them, his marriage has been on the rocks.'
+
+	if $lib_book_loaned = 'fantasy': $lib_book_loaned = 'a fantasy novel'
+	killvar '$downlibrary'
 end
 
 

+ 118 - 325
locations/uni_library.qsrc

@@ -2,50 +2,31 @@
 !!march 18 2024
 !!This is the file containing the university library
 
-killvar '$downlibrary'
-$downlibrary['read'] = {
-	*clr & cla
-	menu_off = 1
-	if blizoruk = 500 or glassqw = 1:
-		glassqw = 1
-		msg '	The text blurs across the page. It seems you have poor eyesight. Maybe you should visit an ophthalmologist?'
-		gt 'uni_library', 'start'
-	end
-	if pcs_nerd > 0:
-		lastread = totminut
-		lastreadday = daystart
-		pcs_nerd += 1
-	end
-	minut += 60
-	blizoruk += 1
-}
+menu_off = 0
 
 if $ARGS[0] = 'start' or $ARGS[0] = '':
-	$sexloc = 'uni_library'
-    $location_type = 'public_indoors'
-	cla & *clr
 	minut += 5
-	$loc = 'uni_library'
-	$loc_arg = 'start'
-	$menu_loc = 'uni_library'
-	$menu_arg = 'start'
-	menu_off = 0
+	gs 'shortgs', 'setloc', 'uni_library', 'start'
+	$sexloc = 'uni_library'
+	$location_type = 'public_indoors'
 	gs 'katja_meynold_schedule'
 	!!gs 'albina_uni_schedule'
 	gs 'stat'
+
 	gs 'themes', 'indoors'
+
 	'<center><b><font color="maroon">The University Library</font></b></center>'
 	'<center><img <<$set_imgh>> src="images/locations/city/island/university/library/library.jpg"></center>'
 	'One of the medium sized buildings is the university''s library. It is three stories tall and filled with books, sections with tables scattered around to study or relax at and computer stations to help students with their studying.'
-	
+
 	if locat['katja'] = 29:
 		'You see '+iif(katjaQW['know_katja_uni'] = 0 and ($start_type['loc'] ! 'sg' and $start_type['magic'] = 'tg'), 'a cute redheaded girl', '<a href="exec:gt ''katja_uni'', ''library''">Katja</a>')+' sitting at one of the desks with a laptop and a pile of books.'
 	end
-	
+
 	if locat['A144'] = 12:
 		'You see your former classmate <a href="exec:gt ''uni_library'', ''anushka''">Anushka</a> sitting at one of the tables studying some books.'
 	end
-	
+
 	!!if locat['albina'] = 6:
 		!!'You see '+iif(AlbinaQW['know_albina_uni'] = 0 and ($start_type['loc'] ! 'sg' and $start_type['magic'] = 'tg'), 'an attractive looking brunette', '<a href="exec:gt ''albina_uni'', ''library''">Albina</a>')+' searching the shelves for books.'
 	!!end
@@ -57,11 +38,11 @@ if $ARGS[0] = 'start' or $ARGS[0] = '':
 			'You see a pretty ebony <a href="exec:gt ''uni_library'', ''kendra''">girl</a> sitting at one of the tables studying some books.'
 		end
 	end
-	
+
 	if yearstart > 1 and week <= 5 and hour >= 15 and hour < 17:
 		'You see your former classmate <a href="exec:gt ''uni_library'', ''artem''">Artem</a> sitting at one of the tables studying some books.'
 	end
-	
+
 	if $start_type['loc'] = 'sg' and yearstart > 1 and week > 5 and hour >= 12 and hour < 14:
 		if nataliaQW['library_day_check'] ! daystart:
 			nataliaQW['library_day_check'] = daystart
@@ -71,38 +52,34 @@ if $ARGS[0] = 'start' or $ARGS[0] = '':
 			'You see your former classmate <a href="exec: gt ''natalia_pavlova'',''library''">Natalia Pavlova</a>.'
 		end
 	end
-	
-	if (week < 6 or hour < 23) and hour > 7:
-		act 'Read a book':
-			gt 'uni_library', 'read'	
-		end
-		
-		act 'Borrow a book':
-			gt 'uni_library', 'loan'
-		end
-
-		if university['enrolled_in_semester'] > university['semester_passed']:
-			act 'Study': gt 'uni_library', 'study'
-		end
 
-		act 'Wander around': gt 'uni_library', 'wander'
-	else
+	if (week >= 6 and hour = 23) or hour < 8:
 		'The library is closing for the night.'
+		act 'Leave': minut += 5 & gt 'uni_grounds', 'main'
+		exit
 	end
-	act 'Leave':
-		minut += 2
-		gt 'uni_grounds', 'main'
+
+
+	act 'Read a book': gt 'uni_library', 'read'
+	act 'Borrow a book': gt 'uni_library', 'loan'
+
+	if university['enrolled_in_semester'] > university['semester_passed']:
+		act 'Study': gt 'uni_library', 'study'
 	end
+
+	act 'Wander around': gt 'uni_library', 'wander'
+	act 'Leave': minut += 2 & gt 'uni_grounds', 'main'
 end
 
 if $ARGS[0] = 'study':
-	$sexloc = 'uni_library'
-	cla & *clr
 	minut += 5
+	$sexloc = 'uni_library'
 	gs 'stat'
+
 	'<center><b><font color="maroon">The University Library</font></b></center>'
 	'<center><img <<$set_imgh>> src="images/locations/city/island/university/library/study' + rand(1,7) + '.jpg"></center>'
-	'You spend some time collecting some books on your subjects and grab one of the library''s laptops before finding a quiet place to sit.' 
+	'You spend some time collecting some books on your subjects and grab one of the library''s laptops before finding a quiet place to sit.'
+
 	if university['semester_week'] > 0:
 		i = 0
 		:study_loop
@@ -114,7 +91,7 @@ if $ARGS[0] = 'study':
 				'You don''t need to study any more this week for your <<$class_list_name[i]>> class.'
 			end
 		end
-		
+
 		i += 1
 		if ARRSIZE('class_list_institution') >= i: jump 'study_loop'
 		killvar 'i'
@@ -124,29 +101,31 @@ if $ARGS[0] = 'study':
 		if $class_list_institution[i] = 'uni_<<$university[''enrolled_in'']>>_semester_<<university[''enrolled_in_semester'']>>' and func('uni_programs', 'exam', 'is_over', $class_list_name[i]) = 0:
 			dynamic '	act ''Study intensely for your <<$class_list_name[i]>> exam (30 minuts)'': gt ''uni_library'', ''studying_exam'', ''<<$class_list_institution[i]>>'', ''<<$class_list_name[i]>>'' '
 		end
-		
+
 		i += 1
 		if ARRSIZE('class_list_institution') >= i: jump 'exam_loop'
 		killvar 'i'
-	end	
-	act 'Leave':
-		minut += 5
-		gt 'uni_grounds', 'main'
 	end
-	act 'Return to the entrance':
-		minut += 2
-		gt 'uni_library', 'start'
+
+	if (week >= 6 and hour = 23) or hour < 8:
+		'The library is closing for the night.'
+		act 'Leave': minut += 5 & gt 'uni_grounds', 'main'
+		exit
 	end
+
 	act 'Wander around': gt 'uni_library', 'wander'
+	act 'Return to the entrance': minut += 2 & gt 'uni_library', 'start'
+	act 'Leave': minut += 5 & gt 'uni_grounds', 'main'
 end
 
 if $ARGS[0] = 'studying':
-	cla & *clr
-	'<center><b><font color="maroon">The University Library</font></b></center>'
-	'<center><img <<$set_imgh>> src="images/locations/city/island/university/library/study' + rand(1,7) + '.jpg"></center>'
 	minut += 30
 	gs 'grades', 'optional_activity_attribute', '<<$ARGS[1]>>', '<<$ARGS[2]>>', 'yes', min(pcs_intel+10,100)
 	gs 'stat'
+
+	'<center><b><font color="maroon">The University Library</font></b></center>'
+	'<center><img <<$set_imgh>> src="images/locations/city/island/university/library/study' + rand(1,7) + '.jpg"></center>'
+
 	'You open the books and start studying for your <<$ARGS[2]>> class. The library is mostly quiet, but you hear occasional noises, some of them hard to make out and some of them fairly suspicious. Despite this, it is a good environment to study in and you can see a number of other students studying as well.'
 	*nl
 	if dyneval ('RESULT = class[''<<$ARGS[1]>>_<<$ARGS[2]>>_optional_weekly_grade_gain'']') < dyneval ('RESULT = class[''<<$ARGS[1]>>_<<$ARGS[2]>>_optional_weekly_max'']'):
@@ -154,24 +133,20 @@ if $ARGS[0] = 'studying':
 	else
 		'You study for half an hour and believe you now understand everything that is being covered this week.'
 	end
-	act 'Leave':
-		minut += 5
-		gt 'uni_grounds', 'main'
-	end
-	if (week < 6 or hour < 23) and hour > 7:
-		act 'Return to entrance':
-			minut += 2
-			gt 'uni_library', 'start'
-		end
-		act 'Keep studying': gt 'uni_library', 'study'
-		act 'Wander around': gt 'uni_library', 'wander'
-	else
+
+	if (week >= 6 and hour = 23) or hour < 8:
 		'The library is closing for the night.'
+		act 'Leave': minut += 5 & gt 'uni_grounds', 'main'
+		exit
 	end
+
+	act 'Keep studying': gt 'uni_library', 'study'
+	act 'Wander around': gt 'uni_library', 'wander'
+	act 'Return to entrance': minut += 2 & gt 'uni_library', 'start'
+	act 'Leave': minut += 5 & gt 'uni_grounds', 'main'
 end
 
 if $ARGS[0] = 'studying_exam':
-	cla & *clr
 	'<center><b><font color="maroon">The University Library</font></b></center>'
 	'<center><img <<$set_imgh>> src="images/locations/city/island/university/library/study' + rand(1,7) + '.jpg"></center>'
 	!!Nerds like studying and so their mood improves a little. Everybody else gets in a worse mood by studying.
@@ -243,35 +218,30 @@ if $ARGS[0] = 'studying_exam':
 			'You study for half an hour and believe that you''re making good progress in getting ready for the exam.'
 		else
 			'You study for half an hour and believe that you''re improving a lot.'
-		end		
+		end
 		gs 'grades', 'grade_award', '<<$ARGS[1]>>', '<<$ARGS[2]>>', study_mod
 	end
-	
+
 	gs 'stat'
-	
+
 	killvar 'study_mod'
 	killvar 'nod_study'
-	
-	act 'Leave':
-		minut += 5
-		gt 'uni_grounds', 'main'
-	end
-	if (week < 6 or hour < 23) and hour > 7:
-		act 'Return to the entrance':
-			minut += 2
-			gt 'uni_library', 'start'
-		end
-		act 'Keep studying': gt 'uni_library', 'study'
-		act 'Wander around': gt 'uni_library', 'wander'
-	else
+
+	if (week >= 6 and hour = 23) or hour < 8:
 		'The library is closing for the night.'
+		act 'Leave': minut += 5 & gt 'uni_grounds', 'main'
+		exit
 	end
+
+	act 'Keep studying': gt 'uni_library', 'study'
+	act 'Wander around': gt 'uni_library', 'wander'
+	act 'Return to the entrance': minut += 2 & gt 'uni_library', 'start'
+	act 'Leave': minut += 5 & gt 'uni_grounds', 'main'
 end
 
 if $ARGS[0] = 'wander':
-	$sexloc = 'uni_library'
-	cla & *clr
 	minut += 15
+	$sexloc = 'uni_library'
 	gs 'stat'
 	'<center><b><font color="maroon">The University Library</font></b></center>'
 	temp = rand(1,20)
@@ -330,217 +300,53 @@ if $ARGS[0] = 'wander':
 		'<center><img <<$set_imgh>> src="images/locations/city/island/university/library/library.jpg"></center>'
 		'You wander around the library for a while, looking at all the books. You pass by several of your fellow students, some quietly studying, reading or just looking through the bookshelves. You don''t come across anything of interest.'
 	end
-	act 'Leave':
-		minut += 5
-		gt 'uni_grounds', 'main'
-	end
-	if (week < 6 or hour < 23) and hour > 7:
-		act 'Return to the entrance':
-			minut += 2
-			gt 'uni_library', 'start'
-		end
-		act 'Wander around':
-			gt 'uni_library', 'wander'
-		end 
-	else
+
+	if (week >= 6 and hour = 23) or hour < 8:
 		'The library is closing for the night.'
+		act 'Leave': minut += 5 & gt 'uni_grounds', 'main'
+		exit
 	end
+
+	act 'Wander around': gt 'uni_library', 'wander'
+	act 'Return to the entrance': minut += 2 & gt 'uni_library', 'start'
+	act 'Leave': minut += 5 & gt 'uni_grounds', 'main'
 end
 
 if $ARGS[0] = 'read':
-	cla
-	act 'Read a book on science (1:00)':
-		dynamic $downlibrary['read']
-		gs 'exp_gain', 'intel', rand(3,6) + rand(0, drugVars['mentats_dose'])
-		grupvalue[3] += 1
-		gs 'stat'
-		'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/science1.jpg"></center>'
-		'You spend an hour reading, trying to make sense of all the clever propositions written inside and understand the subject it describes.'
-		act 'Put the book back': gt 'uni_library', 'read'
-	end
+	gs 'shortgs', 'setloc', 'uni_library', 'read'
 
-	act 'Read an adventure novel (1:00)':
-		dynamic $downlibrary['read']
-		pcs_mood = 100
-		grupvalue[3] += 1
-		gs 'stat'
-		'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/fiction' + rand(1,2) + '.jpg"></center>'
-		'You spend an hour reading an adventure novel, immersing yourself in daring deeds and awesome twists.'
-		act 'Put the book back': gt 'uni_library', 'read'
-	end
-
-	act 'Read a fantasy novel (1:00)':
-		dynamic $downlibrary['read']
-		pcs_mood = 100
-		grupvalue[3] += 1
-		gs 'stat'
-		'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/fantasy' + rand(1,9) + '.jpg"></center>'
-		'You spend an hour reading a fantasy novel, rescuing damsels from dragons, digging for jewels with dwarves and performing word changing magic alongside elves and druids.'
-		act 'Put the book back': gt 'uni_library', 'read'
-	end
+	'<center><b><font color="maroon">The University Library</font></b></center>'
+	'<center><img <<$set_imgh>> src="images/locations/city/island/university/library/library.jpg"></center>'
 
-	act 'Read a science fiction novel (1:00)':
-		dynamic $downlibrary['read']
-		pcs_mood = 100
-		grupvalue[3] += 1
-		gs 'stat'
-		'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/scifi' + rand(1,6) + '.jpg"></center>'
-		'You spend an hour reading a science fiction novel - flying off into space, travelling though time, running from rogue AI and creating monsters with your hunchbacked assistant.'
-		act 'Put the book back': gt 'uni_library', 'read'
+	if (week >= 6 and hour = 23) or hour < 8:
+		'The library is closing for the night.'
+		act 'Leave': minut += 5 & gt 'uni_grounds', 'main'
+		exit
 	end
 
-	act 'Read a romance novel (1:00)':
-		dynamic $downlibrary['read']
-		pcs_mood = 100
-		pcs_horny += 20
-		gs 'stat'
-		'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/romance' + rand(1,20) + '.jpg"></center>'
-		'You spend a very short hour reading a romance novel - choosing between a vampire or a werewolf, falling in love with an obscenely wealthy Grey... Several of the scenes are very steamy and you find yourself getting quite aroused.'
-		act 'Put the book back': gt 'uni_library', 'read'
-	end
-	
-	temp = pcs_intel * 2 + pcs_sprt
-	if temp < 100:
-		$diff = 'hard'
-	elseif temp < 150:
-		$diff = 'medium'
-	else
-		$diff = 'easy'
-	end
-	gs 'willpower', 'misc', 'self', $diff
-	if will_cost <= pcs_willpwr:
-		act 'Read from the collected works of Leo Tolstoy (1:00) (<<will_cost>> Willpower)':
-			gs 'willpower', 'pay', 'self'
-			killvar 'will_cost'
-
-			dynamic $downlibrary['read']
-			gs 'exp_gain', 'sprt', rand(3,6)
-			grupvalue[3] += 2
-			gs 'stat'
-			'<center><img <<$set_imgh>> src="images/pc/items/accessories/books/tolstoy.jpg"></center>'
-			'You read the book for an hour. Tolstoy is certainly a classic writer, but he used a <i>lot</i> of words.'
-			act 'Put the book back': gt 'uni_library', 'read'
-		end
-	else
-		act 'Read from the collected works of Leo Tolstoy (1:00) (<font color="red"><<will_cost>> Willpower</font>)': '<br><font color="red">You don''t have enough willpower to use this action.</font>'
-	end
-	
+	gs 'library_functions', 'set_read_acts'
 	act 'Go back': gt 'uni_library', 'start'
+	act 'Leave': minut += 5 & gt 'uni_grounds', 'main'
 end
 
 if $ARGS[0] = 'loan':
-	cla
-	if $lib_book_loaned ! '':
-		'You''ve currently borrowed <<$lib_book_loaned>>.'
-		if lib_debt <= 0:
-			temp_loan_days_left = lib_debt / -50
-			'You have <<temp_loan_days_left>> days left before you need to return it.'
-		else
-			'<font color="red">Your book is overdue!</font>'
-		end
-
-		act 'Return your loaned book':
-			if lib_book_read = 0:
-				if $lib_book_loaned = 'fantasy': f_book -= 1
-			elseif lib_book_read = 1:
-				if $lib_book_loaned = 'fantasy': fantasybook = 0
-			end
-			$lib_book_loaned = ''
-			if lib_debt <= 0: lib_debt = 0
-			gt 'uni_library', 'start'
-		end
-	end
+	gs 'shortgs', 'setloc', 'uni_library', 'loan'
 
-	if lib_debt > 0:
-		'You owe an outstanding debt of <<lib_debt>> <b>₽</b> to the library.'
-		if money < lib_debt and karta < lib_debt:
-			'You don''t have enough money to pay your debt!'
-		else
-			if money >= lib_debt:
-				act 'Pay your debt (cash)':
-					money -= lib_debt
-					lib_debt = 0
-					gt 'uni_library', 'loan'
-				end
-			end
-			if karta >= lib_debt:
-				act 'Pay your debt (card)':
-					karta -= lib_debt
-					lib_debt = 0
-					gt 'uni_library', 'loan'
-				end
-			end
-		end
-	end
+	'<center><b><font color="maroon">The University Library</font></b></center>'
+	'<center><img <<$set_imgh>> src="images/locations/city/island/university/library/library.jpg"></center>'
 
-	if $lib_book_loaned = '' and lib_debt = 0:
-		!!There''s currently only code for fantasy novels (Is this still true? I''ve left everything but the fantasy novel out until confirmed)
-		!{act 'Borrow a science book':
-			*clr & cla
-			menu_off = 1
-			s_book += 1
-			$lib_book_loaned = 'a science book'
-			lib_debt = -700
-			!!Picture here
-			'You find a science book that catches your interest and bring it to the librarian, who notes your name and the title of the book down before handing it to you.'
-			'"You need to return it within 2 weeks. Every day that you''re late incurs a 50 <b>₽</b> fine."'
-			act 'Continue': gt 'uni_library'
-		end
-		
-		act 'Borrow an adventure novel':
-			*clr & cla
-			menu_off = 1
-			a_book += 1
-			$lib_book_loaned = 'an adventure novel'
-			lib_debt = -700
-			!!Picture here
-			'You find an adventure novel that catches your interest and bring it to the librarian, who notes your name and the title of the book down before handing it to you.'
-			'"You need to return it within 2 weeks. Every day that you''re late incurs a 50 <b>₽</b> fine."'
-			act 'Continue': gt 'uni_library'
-		end}
-		
-		act 'Borrow a fantasy novel':
-			*clr & cla
-			menu_off = 1
-			f_book += 1
-			$lib_book_loaned = 'a fantasy novel'
-			lib_debt = -700
-			!!Picture here
-			'You find a fantasy novel that catches your interest and bring it to the librarian, who notes your name and the title of the book down before handing it to you.'
-			'"You need to return it within 2 weeks. Every day that you''re late incurs a 50 <b>₽</b> fine."'
-			act 'Continue': gt 'uni_library'
-		end
-		
-		!{act 'Borrow a science fiction novel':
-			*clr & cla
-			menu_off = 1
-			sf_book += 1
-			$lib_book_loaned = 'a science fiction novel'
-			lib_debt = -700
-			!!Picture here
-			'You find a science fiction novel that catches your interest and bring it to the librarian, who notes your name and the title of the book down before handing it to you.'
-			'"You need to return it within 2 weeks. Every day that you''re late incurs a 50 <b>₽</b> fine."'
-			act 'Continue': gt 'uni_library'
-		end
-		
-		act 'Borrow a romance novel':
-			*clr & cla
-			menu_off = 1
-			r_book += 1
-			$lib_book_loaned = 'a romance novel'
-			lib_debt = -700
-			!!Picture here
-			'You find a fantasy novel that catches your interest and bring it to the librarian, who notes your name and the title of the book down before handing it to you.'
-			'"You need to return it within 2 weeks. Every day that you''re late incurs a 50 <b>₽</b> fine."'
-			act 'Continue': gt 'uni_library'
-		end}
+	if (week >= 6 and hour = 23) or hour < 8:
+		'The library is closing for the night.'
+		act 'Leave': minut += 5 & gt 'uni_grounds', 'main'
+		exit
 	end
 
+	gs 'library_functions', 'set_loan_acts'
 	act 'Go back': gt 'uni_library', 'start'
+	act 'Leave': minut += 5 & gt 'uni_grounds', 'main'
 end
 
 if $ARGS[0] = 'kendra':
-	*clr & cla
 	menu_off = 1
 	gs 'npc_relationship', 'modify', 'A82', 'like'
 	gs 'exp_gain', 'chrsm', rand(1,2)
@@ -548,36 +354,33 @@ if $ARGS[0] = 'kendra':
 	'<center><img <<$set_imgh>> src="images/locations/city/island/university/classroom/ebony_girl_talk.jpg"></center>'
 	'You walk over to her table.'
 	if meet_kendra = 1:
-		if kendraQW['sub'] < 0:
+		if kendraQW['sub'] <= 0:
 			'You''re about to take a seat when Kendra glares at you. "I don''t think so, Princess. We''re not friends and I want nothing to do with you. Go sit somewhere else."'
-			'You glance around and notice a few other students staring at you, so you move away from her and find a seat by yourself.' 
-		elseif kendraQW['sub'] >= 10:
+			'You glance around and notice a few other students staring at you, so you move away from her and find a seat by yourself.'
+		elseif kendraQW['sub'] <= 10:
 			if npc_rel['A82'] >= 60:
 				minut += 10
 				'You sit next to Kendra. You talk to her and she even lets you get a few words in, but she mostly treats you like a pet or someone simple, often making condescending comments towards you.'
-			elseif npc_rel['A82'] <= 20:
-				'You''re about to sit next to Kendra when she glares at you. "We''re not friends. You''re nothing more than my white slave bitch to use and abuse as I see fit. You don''t come over to me in public, <i>ever</i>. Go sit somewhere else."'
-				'You glance around and notice a few other students staring at you, so you move away from her and find a seat by yourself.' 
-			else
+			elseif npc_rel['A82'] >= 20:
 				minut += 10
-				'You sit next to Kendra and try to have a conversation with her, but anytime you try and get a word in, she gives you a dirty look until you shut up and let her keep talking.'
+				'You sit next to Kendra. You try and have a conversation with her, but mostly she talks and you listen. Any time you try and get a word in edgewise she just gives you a dirty look until you shut up and let her keep talking.'
+			else
+				'You''re about to sit next to Kendra when she looks over at you. "I don''t think so, Princess. We''re not friends. You''re nothing more than my toy to be used when and where I want, and now is not the time, so go sit somewhere else."'
+				'You glance around and notice a few other students staring at you, so you move away from her.'
 			end
 		else
 			if npc_rel['A82'] >= 60:
 				minut += 10
 				'You sit next to Kendra. You talk to her and she even lets you get a few words in, but she mostly treats you like a pet or someone simple, often making condescending comments towards you.'
-			elseif npc_rel['A82'] <= 20:
-				'You''re about to sit next to Kendra when she looks over at you. "I don''t think so, Princess. We''re not friends. You''re nothing more than my toy to be used when and where I want, and now is not the time, so go sit somewhere else."'
-				'You glance around and notice a few other students staring at you, so you move away from her.' 
-			else
+			elseif npc_rel['A82'] >= 20:
 				minut += 10
-				'You sit next to Kendra. You try and have a conversation with her, but mostly she talks and you listen. Any time you try and get a word in edgewise she just gives you a dirty look until you shut up and let her keep talking.'
+				'You sit next to Kendra and try to have a conversation with her, but anytime you try and get a word in, she gives you a dirty look until you shut up and let her keep talking.'
+			else
+				'You''re about to sit next to Kendra when she glares at you. "We''re not friends. You''re nothing more than my white slave bitch to use and abuse as I see fit. You don''t come over to me in public, <i>ever</i>. Go sit somewhere else."'
+				'You glance around and notice a few other students staring at you, so you move away from her and find a seat by yourself.'
 			end
 		end
-		act 'Leave Kendra be':
-			minut += 2
-			gt 'uni_library', 'start'
-		end
+		act 'Leave Kendra be': minut += 2 & gt 'uni_library', 'start'
 	else
 		if hotcat >= 5:
 			meet_kendra = 1
@@ -586,20 +389,15 @@ if $ARGS[0] = 'kendra':
 			'You''re taken aback by her comment. "Slaves?"'
 			'She smiles. "Yes, I have many sex slaves here, and I can train you to serve me well. If you''re interested, come to my dorm room. It''s on the eighth floor of the east dorm, room 808."'
 			'She then ignores you, leaving you to wonder if you should visit her dorm room and see what she was talking about...'
-			act 'Leave Kendra be':
-				minut += 2
-				gt 'uni_library', 'start'
-			end
+
+			act 'Leave Kendra be': minut += 2 & gt 'uni_library', 'start'
 		else
 			'There''s something about this ebony girl that intrigues you, so you decide to sit next to her. "Hi, I''m <<$pcs_nickname>>."'
 			'"No. Not interested. Maybe if you do something about all of... ''this'', you can try again." Her hand indicates your entire person with languid disinterest.'
 			'You''re taken aback by her comment. "What?"'
 			'She rolls her eyes, believing your shocked silence to be stupidity. "Just go away."'
 			'She then ignores you, leaving you to wonder if she doesn''t find you attractive enough to get her attention. Maybe if you were better looking she would talk to you?'
-			act 'Leave her be':
-				minut += 2
-				gt 'uni_library', 'start'
-			end
+			act 'Leave her be': minut += 2 & gt 'uni_library', 'start'
 		end
 	end
 end
@@ -616,43 +414,38 @@ if $ARGS[0] = 'artem':
 		artemQW['knows_dorm_room_number'] = 1
 		minut += 10
 		'You sit next to Artem. The two of you talk about your classes, fellow students, roommates, and just life in general for awhile. Finally he says. "I don''t mean to be rude but I really need to finish this, but why don''t you come to my dorm room sometime and we can hangout then. I am on the second floor in room 209." You tell him you will, then say your goodbyes and leave him to study.'
-	elseif npc_rel['A2'] <= 20:
-		'You sit next to Artem when he looks over at you. "I''m busy and need to study, so please go sit somewhere else." You sigh and get up and move away.'
-	else
+	elseif npc_rel['A2'] >= 20:
 		minut += 5
 		'You sit next to Artem. You try and have a conversation with him, but mostly you talk as he tries to study. Finally after a bit he says. "Look sorry but I really need to study this, maybe we can talk at the cafe sometime or something. But if you don''t mind." He indicates his book, you get the hint and leave him alone.'
+	else
+		'You sit next to Artem when he looks over at you. "I''m busy and need to study, so please go sit somewhere else." You sigh and get up and move away.'
 	end
-	act 'Leave Artem be':
-		minut += 2
-		gt 'uni_library', 'start'
-	end
+
+	act 'Leave Artem be': minut += 2 & gt 'uni_library', 'start'
 end
 
 if $ARGS[0] = 'anushka':
-	*clr & cla
 	menu_off = 1
 	gs 'npc_relationship', 'modify', 'A144', 'like'
 	gs 'exp_gain', 'chrsm', rand(1,2)
 	minut += 5
 	'<center><img <<$set_imgh>> src="images/characters/shared/headshots_main/big144.jpg"></center>'
 	'You walk over to her table.'
+
 	if npc_rel['A144'] >= 60:
 		anushkaCityQW['first_visit'] = 1
 		minut += 5
 		gs 'stat'
 		'<center><img <<$set_imgh>> src="images/characters/shared/headshots_main/big144.jpg"></center>'
 		'You exchange greetings as you sit. Anushka seems really intent on her studies, at first she is polite and tries to respond but after a few minutes she mostly stops responding and just listening until she finally says. "I don''t mean to be rude but can you politely fuck off." She says in a teasing tone and a smile on her face. "But in all seriousness I really do need to get this done, this is one of the few times I have to be in the library. If you want to hang out, you can stop by the Coffee Hole sometimes or come by the boys'' and my apartment if you want." She tells you where the apartment she shares with the boys from the band is. With that, you get the hint and leave her alone.'
-	elseif npc_rel['A144'] <= 20:
-		'You sit next to Anushka when she looks over at you. "Go the fuck away, can''t you see I''m busy." You sigh and get up and move away.'
-	else
+	elseif npc_rel['A144'] >= 20:
 		minut += 5
 		'You sit next to Anushka. You try and have a conversation with her, but mostly you talk as she tries to study. Finally after a bit he says. "Look I don''t have time to hang out, I got to get this studying done now while I have some free time, why don''t you stop by the Coffee Hole sometime if you want to talk, I sometimes have free time then." You get the hint and leave her alone.'
+	else
+		'You sit next to Anushka when she looks over at you. "Go the fuck away, can''t you see I''m busy." You sigh and get up and move away.'
 	end
-	act 'Leave Anushka be':
-		minut += 2
-		gt 'uni_library', 'start'
-	end
+
+	act 'Leave Anushka be': minut += 2 & gt 'uni_library', 'start'
 end
 
 --- uni_library ---------------------------------
-