Przeglądaj źródła

[fixed] multiple bugs and the last forgotten variable migration for alarmVars

anjuna krokus 7 miesięcy temu
rodzic
commit
66aa047bd3

+ 48 - 47
locations/alarmclock.qsrc

@@ -19,16 +19,17 @@ if $ARGS[0] = 'start':
 	'<center><b><a href="exec:gt ''alarmclock'', ''4''">4</a> <a href="exec:gt ''alarmclock'', ''5''">5</a> <a href="exec:gt ''alarmclock'', ''6''">6</a></b></center>'
 	'<center><b><a href="exec:gt ''alarmclock'', ''7''">7</a> <a href="exec:gt ''alarmclock'', ''8''">8</a> <a href="exec:gt ''alarmclock'', ''9''">9</a></b></center>'
 	'<center><b><a href="exec:gt ''alarmclock'', ''0''">0</a></b></center>'
-	'<center><b><a href="exec: bud_weekend = 0 & gt ''alarmclock'', ''Reset''">Reset weekday alarm</a> <a href="exec: bud_weekend = 0 & gt ''alarmclock'', ''Time''">Set</a> weekday alarm to this time</b></center>'
 
+	'<center><b><a href="exec: bud_weekend = 0 & gt ''alarmclock'', ''Reset''">Reset weekday alarm</a> <a href="exec: bud_weekend = 0 & gt ''alarmclock'', ''Time''">Set</a> weekday alarm to this time</b></center>'
 	'<center><b>Currently set for <<func(''alarmclock'', ''alarm_display'', alarmVars[''timerH''], alarmVars[''timerM''])>></center>'
+
 	'<center><b><a href="exec: bud_weekend = 1 & gt ''alarmclock'', ''Reset''">Reset weekend alarm</a> <a href="exec: bud_weekend = 1 & gt ''alarmclock'', ''Time''">Set</a> weekend alarm to this time</b></center>'
 	'<center><b>Currently set for <<func(''alarmclock'', ''alarm_display'', alarmVars[''timerEndH''], alarmVars[''timerEndM''])>></center>'
 
-	if mid($start_type,1,2) = 'sg' and alarm_holiday = 0:
-		'<center><b>Use weekend alarm for holidays - <a href="exec:  alarm_holiday = 1 & gt ''alarmclock'', ''start''">OFF</a></b></center>'
-	elseif mid($start_type,1,2) = 'sg' and alarm_holiday = 1:
-		'<center><b>Use weekend alarm for holidays - <a href="exec:  alarm_holiday = 0 & gt ''alarmclock'', ''start''">ON</a></b></center>'
+	if mid($start_type,1,2) = 'sg' and alarmVars['alarm_holiday'] = 0:
+		'<center><b>Use weekend alarm for holidays - <a href="exec: alarmVars[''alarm_holiday''] = 1 & gt ''alarmclock'', ''start''">OFF</a></b></center>'
+	elseif mid($start_type,1,2) = 'sg' and alarmVars['alarm_holiday'] = 1:
+		'<center><b>Use weekend alarm for holidays - <a href="exec:  alarmVars[''alarm_holiday''] = 0 & gt ''alarmclock'', ''start''">ON</a></b></center>'
 	end
 
 	*nl
@@ -58,7 +59,7 @@ end
 
 if $ARGS[0] = 'alarm_display':
 	!! func('alarmclock', 'alarm_display', hour, minutes)
-	$result = '<b><<$mid(100 + hour, 2, 2)>>:<<$mid(100 + minut, 2, 2)>></b>'
+	$result = '<b><<$mid(100 + ARGS[1], 2, 2)>>:<<$mid(100 + ARGS[2], 2, 2)>></b>'
 end
 
 if $ARGS[0] = 'clear':
@@ -85,7 +86,7 @@ if $ARGS[0] = 'Time':
 		alarmVars['timerM'] = bud3 * 10 + bud4
 
 		if alarmVars['timerH'] > 23: alarmVars['timerH'] = 0
-		if alarmVars['timerM'] > 60:alarmVars['timerM'] = 0
+		if alarmVars['timerM'] > 60: alarmVars['timerM'] = 0
 	end
 
 	gt 'alarmclock', 'start'
@@ -93,100 +94,100 @@ end
 
 if $ARGS[0] = '1':
 	!!if numbud = 4:end
-	if numbud = 3:bud4 = 1 & numbud = 4
-	if numbud = 2:bud3 = 1 & numbud = 3
-	if numbud = 1:bud2 = 1 & numbud = 2
-	if numbud = 0:bud1 = 1 & numbud = 1
+	if numbud = 3: bud4 = 1 & numbud = 4
+	if numbud = 2: bud3 = 1 & numbud = 3
+	if numbud = 1: bud2 = 1 & numbud = 2
+	if numbud = 0: bud1 = 1 & numbud = 1
 
 	gt 'alarmclock', 'start'
 end
 
 if $ARGS[0] = '2':
 	!!if numbud = 4:end
-	if numbud = 3:bud4 = 2 & numbud = 4
-	if numbud = 2:bud3 = 2 & numbud = 3
-	if numbud = 1:bud2 = 2 & numbud = 2
-	if numbud = 0:bud1 = 2 & numbud = 1
+	if numbud = 3: bud4 = 2 & numbud = 4
+	if numbud = 2: bud3 = 2 & numbud = 3
+	if numbud = 1: bud2 = 2 & numbud = 2
+	if numbud = 0: bud1 = 2 & numbud = 1
 
 	gt 'alarmclock', 'start'
 end
 
 if $ARGS[0] = '3':
 	!!if numbud = 4:end
-	if numbud = 3:bud4 = 3 & numbud = 4
-	if numbud = 2:bud3 = 3 & numbud = 3
-	if numbud = 1:bud2 = 3 & numbud = 2
-	if numbud = 0:bud1 = 3 & numbud = 1
+	if numbud = 3: bud4 = 3 & numbud = 4
+	if numbud = 2: bud3 = 3 & numbud = 3
+	if numbud = 1: bud2 = 3 & numbud = 2
+	if numbud = 0: bud1 = 3 & numbud = 1
 
 	gt 'alarmclock', 'start'
 end
 
 if $ARGS[0] = '4':
 	!!if numbud = 4:end
-	if numbud = 3:bud4 = 4 & numbud = 4
-	if numbud = 2:bud3 = 4 & numbud = 3
-	if numbud = 1:bud2 = 4 & numbud = 2
-	if numbud = 0:bud1 = 4 & numbud = 1
+	if numbud = 3: bud4 = 4 & numbud = 4
+	if numbud = 2: bud3 = 4 & numbud = 3
+	if numbud = 1: bud2 = 4 & numbud = 2
+	if numbud = 0: bud1 = 4 & numbud = 1
 
 	gt 'alarmclock', 'start'
 end
 
 if $ARGS[0] = '5':
 	!!if numbud = 4:end
-	if numbud = 3:bud4 = 5 & numbud = 4
-	if numbud = 2:bud3 = 5 & numbud = 3
-	if numbud = 1:bud2 = 5 & numbud = 2
-	if numbud = 0:bud1 = 5 & numbud = 1
+	if numbud = 3: bud4 = 5 & numbud = 4
+	if numbud = 2: bud3 = 5 & numbud = 3
+	if numbud = 1: bud2 = 5 & numbud = 2
+	if numbud = 0: bud1 = 5 & numbud = 1
 
 	gt 'alarmclock', 'start'
 end
 
 if $ARGS[0] = '6':
 	!!if numbud = 4:end
-	if numbud = 3:bud4 = 6 & numbud = 4
-	if numbud = 2:bud3 = 6 & numbud = 3
-	if numbud = 1:bud2 = 6 & numbud = 2
-	if numbud = 0:bud1 = 6 & numbud = 1
+	if numbud = 3: bud4 = 6 & numbud = 4
+	if numbud = 2: bud3 = 6 & numbud = 3
+	if numbud = 1: bud2 = 6 & numbud = 2
+	if numbud = 0: bud1 = 6 & numbud = 1
 
 	gt 'alarmclock', 'start'
 end
 
 if $ARGS[0] = '7':
 	!!if numbud = 4:end
-	if numbud = 3:bud4 = 7 & numbud = 4
-	if numbud = 2:bud3 = 7 & numbud = 3
-	if numbud = 1:bud2 = 7 & numbud = 2
-	if numbud = 0:bud1 = 7 & numbud = 1
+	if numbud = 3: bud4 = 7 & numbud = 4
+	if numbud = 2: bud3 = 7 & numbud = 3
+	if numbud = 1: bud2 = 7 & numbud = 2
+	if numbud = 0: bud1 = 7 & numbud = 1
 
 	gt 'alarmclock', 'start'
 end
 
 if $ARGS[0] = '8':
 	!!if numbud = 4:end
-	if numbud = 3:bud4 = 8 & numbud = 4
-	if numbud = 2:bud3 = 8 & numbud = 3
-	if numbud = 1:bud2 = 8 & numbud = 2
-	if numbud = 0:bud1 = 8 & numbud = 1
+	if numbud = 3: bud4 = 8 & numbud = 4
+	if numbud = 2: bud3 = 8 & numbud = 3
+	if numbud = 1: bud2 = 8 & numbud = 2
+	if numbud = 0: bud1 = 8 & numbud = 1
 
 	gt 'alarmclock', 'start'
 end
 
 if $ARGS[0] = '9':
 	!!if numbud = 4:end
-	if numbud = 3:bud4 = 9 & numbud = 4
-	if numbud = 2:bud3 = 9 & numbud = 3
-	if numbud = 1:bud2 = 9 & numbud = 2
-	if numbud = 0:bud1 = 9 & numbud = 1
+	if numbud = 3: bud4 = 9 & numbud = 4
+	if numbud = 2: bud3 = 9 & numbud = 3
+	if numbud = 1: bud2 = 9 & numbud = 2
+	if numbud = 0: bud1 = 9 & numbud = 1
 
 	gt 'alarmclock', 'start'
 end
 
 if $ARGS[0] = '0':
 	!!if numbud = 4:end
-	if numbud = 3:bud4 = 0 & numbud = 4
-	if numbud = 2:bud3 = 0 & numbud = 3
-	if numbud = 1:bud2 = 0 & numbud = 2
-	if numbud = 0:bud1 = 0 & numbud = 1
+	if numbud = 3: bud4 = 0 & numbud = 4
+	if numbud = 2: bud3 = 0 & numbud = 3
+	if numbud = 1: bud2 = 0 & numbud = 2
+	if numbud = 0: bud1 = 0 & numbud = 1
 
 	gt 'alarmclock', 'start'
 end

+ 1 - 1
locations/bed_events.qsrc

@@ -227,11 +227,11 @@ if $ARGS[0] = 'vor':
 	else
 		if dog_bravery = 0: 
 			dog_bravery = rand(1,100)
+		end
 
 		if dog_bravery < 50:
 			'You''re lying in bed when you hear sounds from the hallway. You decide to get up and as you get to the door you see two masked men. <<$rex[''name'']>> is shivering in the corner.'
 			act 'Scream': gt 'bed_events', 'vor2'
-
 		else
 			minut += 10
 			'You''re lying in bed when you suddenly hear a commotion out in the hallway. You get up to check it out and as you arrive, you see <<$rex[''name'']>> chase two masked men outside. You can hear loud swearing as they run down the stairs.'

+ 12 - 12
locations/dream_events.qsrc

@@ -257,40 +257,40 @@ end
 
 if $ARGS[0] = 'd_dreams':
 	!random dreams about nothing
-	if $ARGS[1] = 1:
+	if ARGS[1] = 1:
 		'<center><img <<$set_imgh>> src="images/shared/home/bedroom/dream/dream1.jpg"></center>'
 		'You dream about an old town, standing on the opposite shores of high falls. Between its steeples fly strange creatures.'
-	elseif $ARGS[1] = 2:
+	elseif ARGS[1] = 2:
 		'<center><img <<$set_imgh>> src="images/shared/home/bedroom/dream/dream2.jpg"></center>'
 		'You dream about a tower, standing on frozen rocks, covered in snow and ice.'
-	elseif $ARGS[1] = 3:
+	elseif ARGS[1] = 3:
 		'<center><img <<$set_imgh>> src="images/shared/home/bedroom/dream/dream3.jpg"></center>'
 		'You dream about an ice mountain, on top of which stands a strange building, almost like a monastery.'
-	elseif $ARGS[1] = 4:
+	elseif ARGS[1] = 4:
 		'<center><img <<$set_imgh>> src="images/shared/home/bedroom/dream/dream4.jpg"></center>'
 		'You dream about an unknown girl, running in the pouring rain on a dark and narrow street.'
-	elseif $ARGS[1] = 5:
+	elseif ARGS[1] = 5:
 		'<center><img <<$set_imgh>> src="images/shared/home/bedroom/dream/dream5.jpg"></center>'
 		'You dream about your smiling mother standing in a room full of old things from the past. Strange. What could it mean?'
-	elseif $ARGS[1] = 6:
+	elseif ARGS[1] = 6:
 		'<center><img <<$set_imgh>> src="images/shared/home/bedroom/dream/dream6.jpg"></center>'
 		'You dream about a rider, standing by the lake, surrounded by high and steep mountains.'
-	elseif $ARGS[1] = 7:
+	elseif ARGS[1] = 7:
 		'<center><img <<$set_imgh>> src="images/shared/home/bedroom/dream/dream7.jpg"></center>'
 		'You dream about a scary man with charred skin, holding a strange creature on a chain, ready to fight a white haired middle-aged guy with a sword in his hand. It''s probably time to stop watching TV before bed...'
-	elseif $ARGS[1] = 8:
+	elseif ARGS[1] = 8:
 		'<center><img <<$set_imgh>> src="images/shared/home/bedroom/dream/dream8.jpg"></center>'
 		'You dream about the white-haired guy again, but he''s noticeably aged and has a thick beard. Next to him stands a beautiful white haired girl. Maybe it''s his daughter?'
-	elseif $ARGS[1] = 9:
+	elseif ARGS[1] = 9:
 		'<center><img <<$set_imgh>> src="images/shared/home/bedroom/dream/dream9.jpg"></center>'
 		'You dream about standing in a street among other people, looking at a nuclear explosion. It''s really scary!'
-	elseif $ARGS[1] = 10:
+	elseif ARGS[1] = 10:
 		'<center><img <<$set_imgh>> src="images/shared/home/bedroom/dream/dream10.jpg"></center>'
 		'You dream about a futuristic looking street littered with garbage.'
-	elseif $ARGS[1] = 11:
+	elseif ARGS[1] = 11:
 		'<center><img <<$set_imgh>> src="images/shared/home/bedroom/dream/dream11.jpg"></center>'
 		'You dream about a beautiful and majestic cathedral on the banks of the river.'
-	elseif $ARGS[1] = 12:
+	elseif ARGS[1] = 12:
 		'<center><img <<$set_imgh>> src="images/shared/home/bedroom/dream/dream12.jpg"></center>'
 		'You dream about being at a lake in the winter watching a dark figure. He''s standing in a pavilion in the middle of the lake, the pale light of the moon giving the scene an eerie aura.'
 	else

+ 1 - 1
locations/pre_sleep.qsrc

@@ -56,7 +56,7 @@ if $ARGS[0] = 'prepare_sleep':
 	gs 'stat'
 	*nl
 	if alarmVars['alarmOn'] = 1:
-		if alarm_holiday = 1 and kanikuli ! 0 or ((hour => alarmVars['timerEndH'] and (week = 5 or week = 6)) or (hour < alarmVars['timerEndH'] and (week = 6 or week = 7))):
+		if alarmVars['alarm_holiday'] = 1 and kanikuli ! 0 or ((hour => alarmVars['timerEndH'] and (week = 5 or week = 6)) or (hour < alarmVars['timerEndH'] and (week = 6 or week = 7))):
 			'You run through your regular nightly routine, setting your alarm for <<func(''bed2'', ''alarm_display'', timerEnd, timerEndM)>>, you undress, and prepare for sleep:'
 		else
 			'You run through your regular nightly routine, setting your alarm for <<func(''bed2'', ''alarm_display'', timer, timerM)>>, you undress, and prepare for sleep:'

+ 1 - 1
locations/pre_sleep_events.qsrc

@@ -268,7 +268,7 @@ if $ARGS[0] = 'nichServentSleepEvents':
 	gt 'nichBedroomServant', 'sleepEvents', 100
 end
 
-if $ARGS[0] = 'nichServentSleepEvents2'
+if $ARGS[0] = 'nichServentSleepEvents2':
 	gs 'pre_sleep_events', 'exit'
 	gt 'nichBedroomServant', 'sleepEvents', 1000
 end

+ 6 - 6
locations/saveupdater.qsrc

@@ -2161,12 +2161,12 @@ if temp_current_save_version < 00090003:
 	sleepVars['events_active'] = 1
 	sleepVars['dreams_active'] = 1
 
-	if budilnikOn	> 0: alarmVars['alarmOn']	= budilnikOn	& killvar 'budilnikOn'
-	if timer		> 0: alarmVars['timerH']	= timer			& killvar 'timer'
-	if timerM		> 0: alarmVars['timerM']	= timerM		& killvar 'timerM'
-	if timerEnd		> 0: alarmVars['timerEndH']	= timerEnd		& killvar 'timerEnd'
-	if timerEndM	> 0: alarmVars['timerEndM']	= timerEndM		& killvar 'timerEndM'
-	
+	if budilnikOn		> 0: alarmVars['alarmOn']		= budilnikOn	& killvar 'budilnikOn'
+	if timer			> 0: alarmVars['timerH']		= timer			& killvar 'timer'
+	if timerM			> 0: alarmVars['timerM']		= timerM		& killvar 'timerM'
+	if timerEnd			> 0: alarmVars['timerEndH']		= timerEnd		& killvar 'timerEnd'
+	if timerEndM		> 0: alarmVars['timerEndM']		= timerEndM		& killvar 'timerEndM'
+	if alarm_holiday	> 0: alarmVars['alarm_holiday']	= alarm_holiday	& killvar 'alarm_holiday'
 end
 
 killvar 'temp_current_save_version'

+ 7 - 7
locations/sleep.qsrc

@@ -49,25 +49,25 @@ if $ARGS[0] = 'start' or $ARGS[0] = '':
 	sleepVars['time_now'] = daystart * 1440 + hour * 60 + minut
 
 	if alarmVars['alarmOn'] = 1:
-		if alarm_holiday = 1 and kanikuli ! 0 or ((hour < alarmVars['timerEndH'] and (week = 6 or week = 7)) or (hour => alarmVars['timerEndH'] and (week = 5 or week = 6))):
+		if alarmVars['alarm_holiday'] = 1 and kanikuli ! 0 or ((hour < alarmVars['timerEndH'] and (week = 6 or week = 7)) or (hour => alarmVars['timerEndH'] and (week = 5 or week = 6))):
 		!! use weekend time alarm
 			sleepVars['alarm_time'] = daystart * 1440 + alarmVars['timerEndH'] * 60 + alarmVars['timerEndM']
 			if sleepVars['time_now'] >= sleepVars['alarm_time']: sleepVars['alarm_time'] += 1440
-			sleepVars['minutes to wakeup'] = min(sleepVars['time_to_full'], sleepVars['alarm_time_end'] - sleepVars['time_now'])
+			sleepVars['minutes_to_wakeup'] = min(sleepVars['time_to_full'], sleepVars['alarm_time'] - sleepVars['time_now'])
 		else
 			sleepVars['alarm_time'] = daystart * 1440 + alarmVars['timerH'] * 60 + alarmVars['timerM']
 			if sleepVars['time_now'] >= sleepVars['alarm_time']: sleepVars['alarm_time'] += 1440
-			sleepVars['minutes to wakeup'] = min(sleepVars['time_to_full'], sleepVars['alarm_time'] - sleepVars['time_now'])
+			sleepVars['minutes_to_wakeup'] = min(sleepVars['time_to_full'], sleepVars['alarm_time'] - sleepVars['time_now'])
 		end
 	else
-		sleepVars['minutes to wakeup'] = sleepVars['time_to_full']
+		sleepVars['minutes_to_wakeup'] = sleepVars['time_to_full']
 	end
 
 	xgt 'sleep', 'sleep_loop'
 end
 
 if $ARGS[0] = 'sleep_handler':
-	if sleepVars['minutes to wakeup'] > 0:
+	if sleepVars['minutes_to_wakeup'] > 0:
 		xgt 'sleep', 'sleep_loop'
 	else
 		xgt 'sleep', 'post_sleep'
@@ -79,7 +79,7 @@ if $ARGS[0] = 'sleep_loop':
 	:sleep_loop_loop
 		minut += 1
 		sleepVars['stime'] += 1
-		sleepVars['minutes to wakeup'] -= 1
+		sleepVars['minutes_to_wakeup'] -= 1
 		sleepVars['time_to_full'] -= 1
 
 		if recuperation = 0: pcs_health += 5
@@ -113,7 +113,7 @@ if $ARGS[0] = 'sleep_loop':
 			gs 'sleep_events', 'start'
 		end
 
-	if sleepVars['minutes to wakeup'] > 0: jump 'sleep_loop_loop'
+	if sleepVars['minutes_to_wakeup'] > 0: jump 'sleep_loop_loop'
 
 	killvar 'sleep_loop_loop'
 	xgt 'sleep', 'post_sleep'

+ 2 - 2
locations/sleep_simple.qsrc

@@ -16,11 +16,11 @@ if $ARGS[0] = 'simple':
 	sleepVars['time_now'] = daystart * 1440 + hour * 60 + minut
 
 	if alarmVars['alarmOn'] = 1:
-		if alarm_holiday = 1 and kanikuli ! 0 or ((hour < alarmVars['timerEndH'] and (week = 6 or week = 7)) or (hour => alarmVars['timerEndH'] and (week = 5 or week = 6))):
+		if alarmVars['alarm_holiday'] = 1 and kanikuli ! 0 or ((hour < alarmVars['timerEndH'] and (week = 6 or week = 7)) or (hour => alarmVars['timerEndH'] and (week = 5 or week = 6))):
 		!! use weekend time alarm
 			sleepVars['alarm_time'] = daystart * 1440 + alarmVars['timerEndH'] * 60 + alarmVars['timerEndM']
 			if sleepVars['time_now'] >= sleepVars['alarm_time']: sleepVars['alarm_time'] += 1440
-			sleepVars['minutes_to_wakeup'] = min(sleepVars['time_to_full'], sleepVars['alarm_time_end'] - sleepVars['time_now'])
+			sleepVars['minutes_to_wakeup'] = min(sleepVars['time_to_full'], sleepVars['alarm_time'] - sleepVars['time_now'])
 		else
 			sleepVars['alarm_time'] = daystart * 1440 + alarmVars['timerH'] * 60 + alarmVars['timerM']
 			if sleepVars['time_now'] >= sleepVars['alarm_time']: sleepVars['alarm_time'] += 1440