File: motion_lock.cfg

package info (click to toggle)
frogatto-data 1.2%2Bdfsg-1
  • links: PTS, VCS
  • area: non-free
  • in suites: wheezy
  • size: 201,844 kB
  • sloc: python: 302; xml: 223; perl: 139; sh: 48; makefile: 13; ruby: 4
file content (115 lines) | stat: -rw-r--r-- 2,810 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
[object_type]
always_active="no"
id="motion_lock"
next_animation="'normal'"
on_check_lit="[
		if(find(match_sensors, 'match', not match.vars.light),
			map(all_sensors, 'sensor', if(not sensor in match_sensors, fire_event(sensor, 'off'))),
			map(all_sensors, 'sensor', if(not sensor in match_sensors, fire_event(sensor, 'off'), fire_event(sensor, 'on')))
		) where match_sensors = filter(all_sensors, 'sensor', sensor.vars.red=red_value and sensor.vars.blue=blu_value and sensor.vars.green=gre_value)
		where all_sensors = filter(level.chars, 'char', char.type = 'motion_lock')
		where red_value = vars.red
		where blu_value = vars.blue
		where gre_value = vars.green]"
on_end_anim="animation('normal')"
on_off="if(vars.light.type = 'motion_lock.dim', [
		fire_event(vars.light, 'nix'),
		set(vars.light, null()),
		])"
on_on="if(vars.light.type = 'motion_lock.dim', [
		schedule(25, [
			fire_event(vars.light, 'nix'),
			add_object(obj)]),
		colour(obj),
		set(vars.light, obj),
		fire_event('unlocked'),
		] where obj = object('motion_lock.bright', midpoint_x, midpoint_y, facing))"
on_timer="if(length(midpoint_x, midpoint_y, level.player.midpoint_x, level.player.midpoint_y) < 35, fire_event('triggered'))"
on_triggered="if(not vars.light, [
		add_object(obj),
		colour(obj),
		set(vars.light, obj),
		fire_event('check_lit'),
		] where obj = object('motion_lock.dim', midpoint_x, midpoint_y, facing))"
on_unlocked="if(vars.linked_object, 
		fire_event(
			get_object(level, vars.linked_object), 
			'button_pressed'))"
timer_frequency="3"
zorder="-5"
	[editor_info]
	category="controllers"
	help="When all locks of this type in the level are
			active, trigger the linked_object."
		[var]
		name="linked_object"
		type="label"
		[/var]

	[/editor_info]

	[vars]
	blue="5"
	green="3"
	red="5"
	[/vars]

	[properties]
	colour="def(obj) [set(obj.red, vars.red*50), set(obj.green, vars.green*50), set(obj.blue, vars.blue*50)]"
	[/properties]

	[animation]
	collide="0,0,28,28"
	duration="1000"
	frame_info="0,0,0,0,994,733,14,14"
	frames="1"
	id="normal"
	image="compiled-2.png"
	rect="994,733,1007,746"
	[/animation]

	[object_type]
	always_active="no"
	id="dim"
	next_animation="'normal'"
	on_end_anim="animation('normal')"
	on_nix="die()"
	on_triggered="[]"
	zorder="-4"
		[animation]
		collide="0,0,28,28"
		duration="1000"
		frames="1"
		h="14"
		id="normal"
		image="experimental/wall_switch.png"
		w="14"
		x="7"
		y="5"
		[/animation]

	[/object_type]

	[object_type]
	always_active="no"
	id="bright"
	next_animation="'normal'"
	on_end_anim="animation('normal')"
	on_triggered="[]"
	zorder="-4"
		[animation]
		collide="0,0,28,28"
		duration="1000"
		frames="1"
		h="14"
		id="normal"
		image="experimental/wall_switch.png"
		w="14"
		x="7"
		y="22"
		[/animation]

	[/object_type]

[/object_type]