Browse Source

[added] environment and simple example for reflections (requested by Nutluck)

anjuna krokus 7 months ago
parent
commit
f57f5098ed
3 changed files with 41 additions and 0 deletions
  1. 1 0
      glife.qproj
  2. 2 0
      locations/pre_sleep_events.qsrc
  3. 38 0
      locations/sleep_reflections.qsrc

+ 1 - 0
glife.qproj

@@ -85,6 +85,7 @@
 	<Folder name="Sleep">
 		<Location name="pre_sleep"/>
 		<Location name="pre_sleep_events"/>
+		<Location name="sleep_reflections"/>
 		<Location name="dream_events"/>
 		<Location name="sleep"/>
 		<Location name="sleep_simple"/>

+ 2 - 0
locations/pre_sleep_events.qsrc

@@ -37,6 +37,8 @@ if $ARGS[0] = 'start' or $ARGS[0] = '':
 			$sleep_events_priority[] = 'gs ''pre_sleep_events'', ''nichServentSleepEvents_handler'', 1 '
 		end
 
+		gs 'sleep_reflections', 'event_check'
+
 		gt 'pre_sleep_events', 'mod_sleepevents'
 	end
 

+ 38 - 0
locations/sleep_reflections.qsrc

@@ -0,0 +1,38 @@
+# sleep_reflections
+
+if $ARGS[0] = 'event_check':
+	if test_var = 1: $sleep_events_priority[] = 'gs ''sleep_reflections'', ''test_reflection'' '
+
+end
+
+if $ARGS[0] = 'end':
+	gs 'pre_sleep_events', 'event_end'
+end
+
+if $ARGS[0] = 'test_reflection':
+	if ARGS[1] = 0: gt 'sleep_reflections', 'test_reflection', 1
+
+	'This is a test reflection!'
+	'Sveta is thinking deeply about "TEST_PERSON"'
+	'Wow, what interesting thoughts'
+
+	act 'positive':
+		*clr & cla
+		test_var = 2
+		'You think positive things about "TEST_PERSON"!'
+
+		act 'Go to sleep': killvar 'test_var' & gs 'sleep_reflections', 'end'
+	end
+	act 'negative':
+		*clr & cla
+		test_var = -1
+		'You think negative things about "TEST_PERSON"!'
+
+		act 'Go to sleep': killvar 'test_var' & gs 'sleep_reflections', 'end'
+	end
+	act 'ignore': killvar 'test_var' & gs 'sleep_reflections', 'end'
+
+end
+
+
+--- sleep_reflections ---------------------------------