Ver Fonte

Fixed the text to make clear guitar lesson is always the following week

Netuttki há 4 anos atrás
pai
commit
661eca5345
1 ficheiros alterados com 19 adições e 1 exclusões
  1. 19 1
      locations/music_guitarlesson.qsrc

+ 19 - 1
locations/music_guitarlesson.qsrc

@@ -99,7 +99,10 @@ if $ARGS[0] = 'goodbye':
 	ml_guitarlesson['lessonhour'] = 15
 
 	if ml_guitarlesson['lessonday'] < 8:
-		'You agree to meet for your next lesson on <<$ml_guitarlesson[''lessonday'']>> at <<ml_guitarlesson[''lessonhour'']>>:00. The teacher enters it in the diary and you say good bye before you leave.'
+		gs 'music_gutarlesson', 'getdate'
+		'You agree to meet for your next lesson on <<$ml_guitarlesson[''lessonday'']>> at <<ml_guitarlesson[''lessonhour'']>>:00 next week, on <<newday>>/<<newmonth>>. The teacher enters it in the diary and you say good bye before you leave.'
+		killvar 'newday'
+		killvar 'newmonth'
 	else
 		'You are not sure when it would be a good day right now, so you agree to decide on a day later, you say good bye and leave.'
 	end
@@ -119,4 +122,19 @@ if $ARGS[0] = 'advertisement':
 	
 end
 
+if $ARGS[0] = 'getdate':
+	newday = day + (ml_guitarlesson['lessonday'] + 7 - week)
+	newmonth = month + 1
+	if (month = 1 or month = 3 or month = 5 or month = 7 or month = 8 or month = 10 or month = 12) and newday > 31:
+		newday -= 31
+	elseif month = 2:
+		if (year mod 4 = 0) and newday > 29:
+			newday -= 29
+		else 
+			newday -= 28
+	elseif newday > 30:
+		newday -= 30
+	end	
+end
+
 --- music_guitarlesson ---------------------------------