Переглянути джерело

[added] new 'sleep' file for when you sleep and you're not at home

hornguy6 3 роки тому
батько
коміт
6a381d4a39
2 змінених файлів з 49 додано та 0 видалено
  1. 1 0
      glife.qproj
  2. 48 0
      locations/sleep.qsrc

+ 1 - 0
glife.qproj

@@ -55,6 +55,7 @@
 		<Location name="food"/>
 		<Location name="beverage"/>
 		<Location name="food_menu"/>
+		<Location name="sleep"/>
 		<Location name="willpower"/>
 		<Location name="drugs"/>
 		<Location name="npc_relationship"/>

+ 48 - 0
locations/sleep.qsrc

@@ -0,0 +1,48 @@
+# sleep
+
+if $ARGS[0] = 'start':
+	InSleep = 1
+	:loopson
+	minut += 1
+	stime += 1
+	if recuperation = 0:pcs_health += 5
+	
+	if stime >= 60:
+		stime = 0
+		pcs_sleep += 15
+		gs 'stat'
+	end
+	
+	
+	alarm_now = hour * 60 + minut
+	if alarm_holiday = 1 and (kanikuli > 0 or week > 5):
+		alarm_time = timerEnd * 60 + timerEndM
+	elseif week > 5:
+		alarm_time = timerEnd * 60 + timerEndM
+	else
+		alarm_time = timer * 60 + timerM
+	end
+	alarm_set = alarm_time - rand(1,5)
+	if alarm_set <0:
+		alarm_set += 1440
+	elseif alarm_set >= 1440:
+		alarm_set -= 1440
+	end
+	
+	if slept_in = 1:
+		gs 'stat'
+	elseif pcs_sleep >= 100 and budilnikOn = 0:
+		gs 'stat'
+	elseif pcs_sleep >= 100 and budilnikOn = 1 and alarm_now >= alarm_set:
+		gs 'stat'
+	elseif budilnikOn = 1 and alarm_now = alarm_time:
+		pcs_mood -= 10
+		gs 'stat'
+	else
+		jump 'loopson'
+	end
+	InSleep = 0
+end
+
+
+--- sleep ---------------------------------