Browse Source

[added] alarm can now be set for weeks/weekends

julzor 4 years ago
parent
commit
2653bfbe49

+ 12 - 9
locations/bed2.qsrc

@@ -13,12 +13,9 @@ if $ARGS[0] = '':
 		'<center><img <<$set_imgh>> src="images/shared/home/bedroom/son.jpg"></center>'
 	end
 	*nl
-
-	if budilnikOn = 0:
-		'Your <a href="exec:gt ''budilnik'', ''start''">alarm clock</a> is set to <b>'+iif(timer < 10,'0<<timer>>','<<timer>>')+':'+iif(timerM < 10,'0<<timerM>>','<<timerM>>')+'</b> and is currently turned <a href="exec: budilnikOn = 1 & gt ''bed2''">OFF</a>.'
-	else
-		'Your <a href="exec:gt ''budilnik'', ''start''">alarm clock</a> is set to <b>'+iif(timer < 10,'0<<timer>>','<<timer>>')+':'+iif(timerM < 10,'0<<timerM>>','<<timerM>>')+'</b> and is currently turned <a href="exec: budilnikOn = 0 & gt ''bed2''">ON</a>.'
-	end
+	
+	'Your <a href="exec:gt ''budilnik'', ''start''">alarm clock</a> is set to <b>'+iif(timer < 10,'0<<timer>>','<<timer>>')+':'+iif(timerM < 10,'0<<timerM>>','<<timerM>>')+'</b> during the week and <b>'+iif(timerEnd < 10,'0<<timerEnd>>','<<timerEnd>>')+':'+iif(timerEndM < 10,'0<<timerEndM>>','<<timerEndM>>')+'</b> during the weekend. It is currently turned '+iif(budilnikOn = 0, '<a href="exec: budilnikOn = 1 & gt ''bed2''">OFF</a>.', '<a href="exec: budilnikOn = 0 & gt ''bed2''">ON</a>.')
+	
 	*nl
 
 	if bedPanty = 0:
@@ -136,8 +133,10 @@ if $ARGS[0] = 'sleep':
 	end
 	gs 'stat'
 	*nl
-	if budilnikOn = 1:
-		'You run through your regular nightly routine, seting your alarm for <b>'+iif(timer < 10,'0<<timer>>','<<timer>>')+':'+iif(timerM < 10,'0<<timerM>>','<<timerM>>')+'</b>, you undress, and prepare for sleep:'
+	if budilnikOn = 1 and week < 6:
+		'You run through your regular nightly routine, setting your alarm for <b>'+iif(timer < 10,'0<<timer>>','<<timer>>')+':'+iif(timerM < 10,'0<<timerM>>','<<timerM>>')+'</b>, you undress, and prepare for sleep:'
+	elseif budilnikOn = 1:
+		'You run through your regular nightly routine, setting your alarm for <b>'+iif(timerEnd < 10,'0<<timerEnd>>','<<timerEnd>>')+':'+iif(timerEndM < 10,'0<<timerEndM>>','<<timerEndM>>')+'</b>, you undress, and prepare for sleep:'
 	else
 		'You run through your regular nightly routine, not bothering to setting your alarm, you undress, and prepare for sleep:'
 	end
@@ -303,7 +302,11 @@ if $ARGS[0] = 'dream':
 	end
 
 	alarm_now = hour * 60 + minut
-	alarm_time = timer * 60 + timerM
+	if week < 6:
+		alarm_time = timer * 60 + timerM
+	else
+		alarm_time = timerEnd * 60 + timerEndM
+	end
 	alarm_set = alarm_time - rand(1,5)
 	if alarm_set <0:
 		alarm_set += 1440

+ 2 - 5
locations/bedr.qsrc

@@ -28,11 +28,8 @@ if rembedr = 0:
 	*nl
 	'A tight, little room with a <a href="exec:gt ''bed'', ''start''">double bed</a>.'
 	*nl
-	if budilnikOn = 0:
-		'There is an  <a href="exec:gt ''budilnik'', ''start''">alarm clock</a> on the bedside table, and it is set to '+iif(timer < 10,'0<<timer>>','<<timer>>')+':'+iif(timerM < 10,'0<<timerM>>','<<timerM>>')+' and is currently turned <a href="exec: budilnikOn = 1 & gt ''<<$loc>>''">off</a>.'
-	else
-		'There is an <a href="exec:gt ''budilnik'', ''start''">alarm clock</a> on the bedside table, and it is set to '+iif(timer < 10,'0<<timer>>','<<timer>>')+':'+iif(timerM < 10,'0<<timerM>>','<<timerM>>')+' and is currently turned <a href="exec: budilnikOn = 0 & gt ''<<$loc>>''">on</a>.'
-	end
+	
+	'Your <a href="exec:gt ''budilnik'', ''start''">alarm clock</a> is set to <b>'+iif(timer < 10,'0<<timer>>','<<timer>>')+':'+iif(timerM < 10,'0<<timerM>>','<<timerM>>')+'</b> during the week and <b>'+iif(timerEnd < 10,'0<<timerEnd>>','<<timerEnd>>')+':'+iif(timerEndM < 10,'0<<timerEndM>>','<<timerEndM>>')+'</b> during the weekend. It is currently turned '+iif(budilnikOn = 0, '<a href="exec: budilnikOn = 1 & gt $loc">OFF</a>.', '<a href="exec: budilnikOn = 0 & gt $loc">ON</a>.')
 	*nl
 	'An old wooden <a href="exec:gt ''wardrobe'', ''start''">wardrobe</a> stands near the door to the corridor.The windows are closed with faded, heavy curtains.'
 else

+ 1 - 5
locations/bedr2x.qsrc

@@ -25,11 +25,7 @@ if pcs_magik >= 6 and spellbefshild = 1 and tobiQW = 0:gt'tobiQW','start'
 'A bright and beautiful bedroom, with modern and stylish furniture.'
 *nl
 'The room is dominated by <a href="exec:gt ''bed'',''start''">full sized bed</a>'
-if budilnikOn = 0:
-	'There is an  <a href="exec:gt ''budilnik'', ''start''">alarm clock</a> on the bedside table, and it is set to '+iif(timer < 10,'0<<timer>>','<<timer>>')+':'+iif(timerM < 10,'0<<timerM>>','<<timerM>>')+' and is currently turned <a href="exec: budilnikOn = 1 & gt ''<<$loc>>''">off</a>.'
-else
-	'There is an <a href="exec:gt ''budilnik'', ''start''">alarm clock</a> on the bedside table, and it is set to '+iif(timer < 10,'0<<timer>>','<<timer>>')+':'+iif(timerM < 10,'0<<timerM>>','<<timerM>>')+' and is currently turned <a href="exec: budilnikOn = 0 & gt ''<<$loc>>''">on</a>.'
-end
+	'Your <a href="exec:gt ''budilnik'', ''start''">alarm clock</a> is set to <b>'+iif(timer < 10,'0<<timer>>','<<timer>>')+':'+iif(timerM < 10,'0<<timerM>>','<<timerM>>')+'</b> during the week and <b>'+iif(timerEnd < 10,'0<<timerEnd>>','<<timerEnd>>')+':'+iif(timerEndM < 10,'0<<timerEndM>>','<<timerEndM>>')+'</b> during the weekend. It is currently turned '+iif(budilnikOn = 0, '<a href="exec: budilnikOn = 1 & gt $loc">OFF</a>.', '<a href="exec: budilnikOn = 0 & gt $loc">ON</a>.')
 *nl
 'Near the entrance stands a modern <a href="exec:gt ''wardrobe'', ''start''">wardrobe</a>.'
 *nl

+ 1 - 5
locations/bedrPar.qsrc

@@ -96,11 +96,7 @@ if popugai2 = 1:
 	*nl
 end
 '<table><tr><td valign="top">'
-if budilnikOn = 0:
-	'Your <a href="exec:gt ''budilnik'', ''start''">alarm clock</a> is set to '+iif(timer < 10,'0<<timer>>','<<timer>>')+':'+iif(timerM < 10,'0<<timerM>>','<<timerM>>')+' and is currently turned <a href="exec: budilnikOn = 1 & gt ''<<$loc>>''">off</a>.'
-else
-	'Your <a href="exec:gt ''budilnik'', ''start''">alarm clock</a> is set to '+iif(timer < 10,'0<<timer>>','<<timer>>')+':'+iif(timerM < 10,'0<<timerM>>','<<timerM>>')+' and is currently turned <a href="exec: budilnikOn = 0 & gt ''<<$loc>>''">on</a>.'
-end
+'Your <a href="exec:gt ''budilnik'', ''start''">alarm clock</a> is set to <b>'+iif(timer < 10,'0<<timer>>','<<timer>>')+':'+iif(timerM < 10,'0<<timerM>>','<<timerM>>')+'</b> during the week and <b>'+iif(timerEnd < 10,'0<<timerEnd>>','<<timerEnd>>')+':'+iif(timerEndM < 10,'0<<timerEndM>>','<<timerEndM>>')+'</b> during the weekend. It is currently turned '+iif(budilnikOn = 0, '<a href="exec: budilnikOn = 1 & gt $loc">OFF</a>.', '<a href="exec: budilnikOn = 0 & gt $loc">ON</a>.')
 
 if tabletki > 0 and prezik + prezikcount + preziksabo > 0:
 	'Your <a href="exec:gt ''stol'', ''bc''">birth control</a> is hidden in one of your desk drawers, as are your <a href="exec:gt ''stol'', ''bc''">condoms</a>.'

+ 25 - 15
locations/budilnik.qsrc

@@ -3,8 +3,7 @@
 menu_off = 1
 
 if $ARGS[0] = 'start':
-	cla
-	clr
+	*clr & cla
 	gs 'stat'
 	'<center><img <<$set_imgh>> src="images/shared/home/bedroom/bed2.jpg"></center>'
 	*nl
@@ -21,13 +20,15 @@ if $ARGS[0] = 'start':
 	'<center><b><a href="exec:gt ''budilnik'', ''4''">4</a> <a href="exec:gt ''budilnik'', ''5''">5</a> <a href="exec:gt ''budilnik'', ''6''">6</a></b></center>'
 	'<center><b><a href="exec:gt ''budilnik'', ''7''">7</a> <a href="exec:gt ''budilnik'', ''8''">8</a> <a href="exec:gt ''budilnik'', ''9''">9</a></b></center>'
 	'<center><b><a href="exec:gt ''budilnik'', ''0''">0</a></b></center>'
-	'<center><b><a href="exec:gt ''budilnik'', ''Reset''">Reset</a> <a href="exec:gt ''budilnik'', ''Time''">Set Alarm</a></b></center>'
+	'<center><b><a href="exec: bud_weekend = 0 & gt ''budilnik'', ''Reset''">Reset (week)</a> <a href="exec: bud_weekend = 0 & gt ''budilnik'', ''Time''">Set this time for the week</a></b></center>' 
+	'<center><b><a href="exec:  bud_weekend = 1 & gt ''budilnik'', ''Reset''">Reset (weekend)</a> <a href="exec: bud_weekend = 1 & gt ''budilnik'', ''Time''">Set this time for the weekend</a></b></center>'
+	
 	*nl
 	if budilnikOn = 0:
 		'<center>Your alarm is currently turned <a href="exec: budilnikOn = 1 & gt ''budilnik'', ''start''"><b>off</a></b></center>'
 	else
 		'<center>Your alarm is currently turned <a href="exec: budilnikOn = 0 & gt ''budilnik'', ''start''"><b>on</b></a></center>'
-		'<center>The alarm is set to '+iif(timer < 10,'0<<timer>>','<<timer>>')+':'+iif(timerM < 10,'0<<timerM>>','<<timerM>>')+'.</center>'
+		'<center>The alarm is set to '+iif(timer < 10,'0<<timer>>','<<timer>>')+':'+iif(timerM < 10,'0<<timerM>>','<<timerM>>')+' during the week and to '+iif(timerEnd < 10,'0<<timerEnd>>','<<timerEnd>>')+':'+iif(timerEndM < 10,'0<<timerEndM>>','<<timerEndM>>')+' during the weekend.</center>'		
 	end
 	act 'Finish':
 		cla
@@ -44,11 +45,19 @@ if $ARGS[0] = 'Time':
 	cla
 	budilnikOn = 1
 
-	timer = bud1 * 10 + bud2
-	timerM = bud3 * 10 + bud4
+	if bud_weekend = 1:
+		timerEnd = bud1 * 10 + bud2
+		timerEndM = bud3 * 10 + bud4
+
+		if timerEnd > 23:timerEnd = 0
+		if timerEndM > 60:timerEndM = 0
+	else
+		timer = bud1 * 10 + bud2
+		timerM = bud3 * 10 + bud4
 
-	if timer > 23:timer = 0
-	if timerM > 60:timerM = 0
+		if timer > 23:timer = 0
+		if timerM > 60:timerM = 0
+	end
 
 	gt 'budilnik', 'start'
 end
@@ -174,9 +183,13 @@ end
 
 if $ARGS[0] = 'Reset':
 	cla
-	budilnikOn = 0
-	timer = 0
-	timerM = 0
+	if bud_weekend = 1:
+		timerEnd = 0
+		timerEndM = 0
+	else
+		timer = 0
+		timerM = 0
+	end
 	bud1 = 0
 	bud2 = 0
 	bud3 = 0
@@ -186,10 +199,7 @@ if $ARGS[0] = 'Reset':
 	gt 'budilnik', 'start'
 end
 
-if $ARGS[0] = 'fin':
-	cla
-	gt $loc, $metka
-end
+if $ARGS[0] = 'fin': gt $loc, $metka
 
 --- budilnik ---------------------------------
 

+ 3 - 5
locations/mey_home.qsrc

@@ -225,11 +225,9 @@ if $ARGS[0] = '3':
 	*nl
 	'It feels and looks like a standard room in a hotel.'
 	'There is a <a href="exec:gt ''bed'', ''start''">bed</a>, a small <a href="exec:gt ''wardrobe'', ''start''">wardrobe</a> (where you can choose outfits and organize your clothing), and a desk.'
-	if budilnikOn = 0:
-	'Your <a href="exec:gt ''budilnik'', ''start''">alarm clock</a> is set to '+iif(timer < 10,'0<<timer>>','<<timer>>')+':'+iif(timerM < 10,'0<<timerM>>','<<timerM>>')+' and is currently turned <a href="exec: budilnikOn = 1 & gt ''<<$loc>>''">off</a>.'
-else
-	'Your <a href="exec:gt ''budilnik'', ''start''">alarm clock</a> is set to '+iif(timer < 10,'0<<timer>>','<<timer>>')+':'+iif(timerM < 10,'0<<timerM>>','<<timerM>>')+' and is currently turned <a href="exec: budilnikOn = 0 & gt ''<<$loc>>''">on</a>.'
-end
+	*nl
+	'Your <a href="exec:gt ''budilnik'', ''start''">alarm clock</a> is set to <b>'+iif(timer < 10,'0<<timer>>','<<timer>>')+':'+iif(timerM < 10,'0<<timerM>>','<<timerM>>')+'</b> during the week and <b>'+iif(timerEnd < 10,'0<<timerEnd>>','<<timerEnd>>')+':'+iif(timerEndM < 10,'0<<timerEndM>>','<<timerEndM>>')+'</b> during the weekend. It is currently turned '+iif(budilnikOn = 0, '<a href="exec: budilnikOn = 1 & gt $loc, $metka">OFF</a>.', '<a href="exec: budilnikOn = 0 & gt $loc, $metka">ON</a>.')
+	*nl
 	'A <a href="exec:gt ''mirror'', ''start''">mirror</a> hangs on the wall near the front door.'
 	if komp = 1:'Your <a href="exec:gt ''Komp'',''start''">laptop</a> is on the desk.'
 

+ 3 - 0
locations/pavSharedApt.qsrc

@@ -695,6 +695,9 @@ if $ARGS[0] = 'pcsRoom':
 	'The living room wasn''t in use by the other apartment occupants, so it is now rented to use as a bedroom. It''s sparsly decorated, with, a <a href="exec:gt ''bed'', ''start''">sofa bed</a>, against the back wall.'
 	*nl
 	'Beside the sofa bed, is an old cabinet, with your <a href="exec:gt ''budilnik'', ''start''">alarm clock</a> on top.'
+	*nl
+	'Your <a href="exec:gt ''budilnik'', ''start''">alarm clock</a> is set to <b>'+iif(timer < 10,'0<<timer>>','<<timer>>')+':'+iif(timerM < 10,'0<<timerM>>','<<timerM>>')+'</b> during the week and <b>'+iif(timerEnd < 10,'0<<timerEnd>>','<<timerEnd>>')+':'+iif(timerEndM < 10,'0<<timerEndM>>','<<timerEndM>>')+'</b> during the weekend. It is currently turned '+iif(budilnikOn = 0, '<a href="exec: budilnikOn = 1 & gt $loc, $metka">OFF</a>.', '<a href="exec: budilnikOn = 0 & gt $loc, $metka">ON</a>.')
+	
 	if budilnikOn = 0:
 		'Your <a href="exec:gt ''budilnik'', ''start''">alarm clock</a> is set for <<timer>> hours <<timerM>> minutes and currently turned <a href="exec: budilnikOn = 1 & gt ''pavSharedApt'',''pcsRoom''">off</a>.'
 	else

+ 3 - 7
locations/sauna.qsrc

@@ -107,13 +107,9 @@ if $ARGS[0] = 'saunaroom':
 	'<br>Hanging on the wall is a dirty <a href="exec:gt ''mirror'', ''start''">mirror</a>. The floor is littered with dozens of porn magazines, and a selection of adult toys are scattered throughout the room. There''s so much crap laying around, there''s barely enough space to do some basic <a href="exec:gt ''sauna'', ''saunafitness''">exercise</a>.'
 	*nl
 
-	if budilnikOn = 0:
-		'<br>Your <a href="exec:gt ''budilnik'', ''start''">alarm clock</a> is set for <<timer>> hours <<timerM>> minutes and currently turned <a href="exec: budilnikOn = 1 & gt ''sauna'', ''saunaroom''">off</a>.'
-		*nl
-	else
-		'<br>Your <a href="exec:gt ''budilnik'', ''start''">alarm clock</a> is set for <<timer>> hours <<timerM>> minutes and currently turned <a href="exec: budilnikOn = 0 & gt ''sauna'', ''saunaroom''">on</a>.'
-		*nl
-	end
+	'Your <a href="exec:gt ''budilnik'', ''start''">alarm clock</a> is set to <b>'+iif(timer < 10,'0<<timer>>','<<timer>>')+':'+iif(timerM < 10,'0<<timerM>>','<<timerM>>')+'</b> during the week and <b>'+iif(timerEnd < 10,'0<<timerEnd>>','<<timerEnd>>')+':'+iif(timerEndM < 10,'0<<timerEndM>>','<<timerEndM>>')+'</b> during the weekend. It is currently turned '+iif(budilnikOn = 0, '<a href="exec: budilnikOn = 1 & gt ''sauna'', ''saunaroom''">OFF</a>.', '<a href="exec: budilnikOn = 0 & gt ''sauna'', ''saunaroom''">ON</a>.')
+	
+	*nl
 
 	'If you run out of personal hygeine or beauty products, you can ask for some more, but at a cost.'
 	*nl