Browse Source

[changed] centralized the code for doing university coursework in one file instead of having it largely copy-pasted all places it can be done. this will also make adding this option in other locations easier

Spackled Lanturn 4 years ago
parent
commit
96a1dee0b7

+ 1 - 0
glife-notepad++

@@ -746,6 +746,7 @@
 			<File name="locations\ugel" />
 			<File name="locations\ugol" />
 			<File name="locations\ugol1" />
+			<File name="locations\unicoursework" />
 			<File name="locations\univer" />
 			<File name="locations\univer_din" />
 			<File name="locations\vann" />

+ 1 - 0
glife.qproj

@@ -913,6 +913,7 @@
 		<Location name="obroom"/>
 		<Location name="Vika"/>
 		<Location name="univer_din"/>
+		<Location name="unicoursework"/>
 	</Folder>
 	<Folder name="Game 1">
 		<Location name="KGstart"/>

+ 2 - 17
locations/Komp.qsrc

@@ -15,7 +15,7 @@ if $ARGS[0] = 'start':
 
 	!!act 'SunReview of the Dead':gt 'KGZstart'
 
-	if student > 0 and kursovik < 100:'You should probably do some of your <a href="exec:gt ''komp'',''kursak''">coursework</a>.'
+	gs 'unicoursework', 'start', 'komp', 'brows'
 
 	if $loc = 'shulga_room' or $loc = 'anushapt' or $loc = 'artemhome':
 		internet_store = internet
@@ -37,6 +37,7 @@ end
 if $ARGS[0] = 'brows':
 	*clr & cla
 	gs 'stat'
+	menu_off = 0
 	
 	act 'Close the browser':
 		if $loc = 'shulga_room' or $loc = 'anushapt' or $loc = 'artemhome' or $loc = 'dachain':
@@ -511,22 +512,6 @@ if $ARGS[0] = 'study':
 	act 'Leave this website':gt'komp','brows'
 end
 
-if $ARGS[0] = 'kursak':
-	*clr & cla
-	minut += 60
-	elektro += 3
-	internet -= 1
-	pcs_mood -= 10
-	compskl_exp += 1
-	kursovik = kursovik + rand(pcs_intel/20,pcs_intel/10)
-	if kursovik > 100:kursovik = 100
-	'<center><b>Coursework</b></center>'
-	'<center><img <<$set_imgh>> src="images/shared/accessories/computer/kursak.jpg"></center>'
-	'It may be boring, but it still needs doing! You spend an hour doing coursework, and <<kursovik>>% of it is now finished.'
-
-	act 'Leave this website':gt 'komp','brows'
-end
-
 if $ARGS[0] = 'agent':
 	*clr & cla
 	minut += 60

+ 1 - 16
locations/bedrPar.qsrc

@@ -174,22 +174,7 @@ act 'Exit the room':
 	gt'korrPar'
 end
 
-if student > 0 and kursovik < 100:
-	act 'Do coursework (1:00)':
-		*clr & cla
-		menu_off = 1
-		minut += 60
-		kursovik += rand(pcs_intel / 20, pcs_intel / 10)
-
-		if kursovik > 100:kursovik = 100
-
-		pcs_mood -= 10
-		'<center><img <<$set_imgh>> src="images/pc/activities/study.jpg"></center>'
-		'You sit down at the desk and do your coursework. You''ve finished <<kursovik>> percent of it.'
-
-		act 'Leave your desk':gt $curloc
-	end
-end
+gs 'unicoursework', 'start', $curloc
 
 if pornMagazine > 0:'You have hidden your porn magazines under the mattress of your bed.'
 !!Masturbation, allowed after sister threesome (when sis_watch is used for a message) or sister not here.

+ 1 - 16
locations/nichBedroomServant.qsrc

@@ -82,22 +82,7 @@ if $ARGS[0] = '' or $ARGS[0] = 'start' or $ARGS[0] = 'return':
 		act 'Finish':gt $loc
 	end
 
-	if student > 0 and kursovik < 100:
-		act 'Write course work (1:00)':
-			*clr & cla
-			menu_off = 1
-			minut += 60
-			kursovik += rand(pcs_intel / 20, pcs_intel / 10)
-
-			if kursovik > 100:kursovik = 100
-
-			pcs_mood -= 10
-			'<center><img <<$set_imgh>> src="images/pc/activities/study.jpg"></center>'
-			'You work on your course work and have now completed <<kursovik>> percent.'
-
-			act 'Finish':gt $loc
-		end
-	end
+	gs 'unicoursework', 'start', $loc
 
 	gs 'events', 'read'
 

+ 1 - 18
locations/obroom.qsrc

@@ -64,24 +64,7 @@ if $ARGS[0] = 'start' or $ARGS[0] = '':
 		act 'Finish':gt 'obroom', 'start'
 	end
 
-	if student > 0 and kursovik < 100:
-		act 'Do some coursework (1:00)':
-			cla
-			*clr
-			menu_off = 1
-			minut += 60
-			pcs_mood -= 10
-			kursovik += rand(pcs_intel / 20, pcs_intel / 10)
-
-			if kursovik > 100:kursovik = 100
-			gs 'stat'
-
-			'<center><img <<$set_imgh>> src="images/pc/activities/study.jpg"></center>'
-			'You sit for an hour and prepare your work for the class. You''ve finish <<kursovik>> percent of the work.'
-
-			act 'Finish':gt 'obroom', 'start'
-		end
-	end
+	gs 'unicoursework', 'start', $loc, $loc_arg
 
 dynamic $wearpan
 dynamic $removepan

+ 1 - 16
locations/pav_shared_apt.qsrc

@@ -724,22 +724,7 @@ if $ARGS[0] = 'pcsRoom':
 
 	if komp = 1:'Your <a href="exec:gorodokKomp = 1 & gt ''Komp'',''start''">laptop</a> is sitting on small table.'
 
-	if student > 0 and kursovik < 100:
-		act 'Do coursework (1:00)':
-			cla
-			*clr
-			minut += 60
-			kursovik += rand(pcs_intel / 20, pcs_intel / 10)
-
-			if kursovik > 100:kursovik = 100
-
-			pcs_mood -= 10
-			'<center><img <<$set_imgh>> src="images/pc/activities/study.jpg"></center>'
-			'You sit down on the sofa bed and do your coursework, you''ve finished <<kursovik>> percent of it.'
-
-			act 'Stand up':gt 'pav_shared_apt', 'pcsRoom'
-		end
-	end
+	gs 'unicoursework', 'start', $loc, $loc_arg
 
 	if vcard > 0: act 'View your vintage porn cards':card_deck = 0 & gt 'card'
 	if card > 0: act 'View your new porn cards':card_deck = 1 & gt 'card'

+ 1 - 16
locations/sitr.qsrc

@@ -72,22 +72,7 @@ if husband > 0 and husbandrink ! 10 and husbandrinkday ! daystart:
 	end
 end
 
-if student > 0 and kursovik < 100:
-	act 'Do some coursework (1:00)':
-		cla
-		*clr
-		minut += 60
-		kursovik += rand(pcs_intel / 20, pcs_intel / 10)
-
-		if kursovik > 100:kursovik = 100
-
-		pcs_mood -= 10
-		'<center><img <<$set_imgh>> src="images/pc/activities/study.jpg"></center>'
-		'You work on your courses homework and are about <<kursovik>> percent done.'
-
-		act 'Exit':gt 'sitr'
-	end
-end
+gs 'unicoursework', 'start', $loc
 
 if ml_guitar['carried'] = 1:
 	act 'Place the guitar next to your desk': 

+ 1 - 15
locations/sitr2x.qsrc

@@ -61,21 +61,7 @@ end
 
 gs'subkid'
 
-if student > 0 and kursovik < 100:
-	act 'Write kursovik 1 h':
-		cla
-		*clr
-		minut = minut + 60
-		kursovik = kursovik + rand(pcs_intel/20,pcs_intel/10)
-		if kursovik > 100:kursovik = 100
-		pcs_mood -= 10
-
-		'<center><img <<$set_imgh>> src="images/pc/activities/study.jpg"></center>'
-		'You sat and studied, you managed to complete more of your coursework. You are now <<kursovik>> percent done.'
-
-		act 'Logout':gt'sitr2x'
-	end
-end
+gs 'unicoursework', 'start', $loc
 
 act 'Go out on the balcony': gt 'balkon','start'
 

+ 69 - 0
locations/unicoursework.qsrc

@@ -0,0 +1,69 @@
+# unicoursework
+
+$unicourseworkloc[0] = $ARGS[1]
+$unicourseworkloc[1] = $ARGS[2]
+
+if $ARGS[0] = 'start':
+	if student > 0 and kursovik < 100:
+		if $unicourseworkloc[0] = 'komp':
+			'You should probably do some of your <a href="exec:gt ''unicoursework'',$unicourseworkloc[0],$unicourseworkloc[1],1">coursework</a>.'
+		else:
+			act 'Do some coursework (1:00)':
+				gt 'unicoursework', 'do_coursework', $unicourseworkloc[0], $unicourseworkloc[1]
+			end
+		end
+	end
+end
+
+if $ARGS[0] = 'do_coursework':
+    *clr & cla
+    menu_off = 1
+    minut += 60
+
+    if $ARGS[1] = 'komp':
+    	elektro += 3
+    	internet -= 1
+    	compskl_exp += 1
+    end
+
+    kursovik += rand(pcs_intel / 20, pcs_intel / 10)
+    if kursovik > 100:kursovik = 100
+
+    pcs_mood -= 10
+    gs 'stat'
+
+    if $ARGS[1] = 'komp':
+    	'<center><b>Coursework</b></center>'
+    	'<center><img <<$set_imgh>> src="images/shared/accessories/computer/kursak.jpg"></center>'
+    else:
+    	'<center><img <<$set_imgh>> src="images/pc/activities/study.jpg"></center>'
+    end
+
+    if $ARGS[1] = 'komp':
+    	'It may be boring, but it still needs doing! You spend an hour doing coursework, and '+kursovik+'% of it is now finished.'
+    elseif $ARGS[1] = 'sitr2x':
+    	'You sat and studied, and you managed to complete some of your coursework. You are now '+kursovik+' percent done.'
+    elseif $ARGS[1] = 'sitr':
+    	'You work on your course''s homework and are about '+kursovik+' percent done.'
+    elseif $ARGS[1] = 'pav_shared_apt':
+    	'You sit down on the sofa bed and do some of your coursework. You''ve finished '+kursovik+' percent of it.'
+    elseif $ARGS[1] = 'nichBedroomServant':
+    	'You work on your coursework and have now completed '+kursovik+' percent.'
+    elseif $ARGS[1] = 'bedrPar':
+    	'You sit down at your desk and do some of your coursework. You''ve finished '+kursovik+' percent of it.'
+    else:
+    	'You sit for an hour and do some of your work for class. You''ve finished '+kursovik+' percent of the work.'
+    end
+
+    if kursovik < 100:
+    	act 'Do some more coursework (1:00)':
+    		gt 'unicoursework', 'do_coursework', $unicourseworkloc[0], $unicourseworkloc[1]
+    	end
+    end
+
+    act 'Stop':
+    	gt $unicourseworkloc[0], $unicourseworkloc[1]
+    end
+end
+
+--- unicoursework ---------------------------------