]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/g_triggers.qh
Fix whitespace for #include
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_triggers.qh
1 #ifndef G_TRIGGERS_H
2 #define G_TRIGGERS_H
3
4 void SUB_DontUseTargets();
5
6
7 void() SUB_UseTargets;
8
9 void DelayThink();
10
11 /*
12 ==============================
13 SUB_UseTargets
14
15 the global "activator" should be set to the entity that initiated the firing.
16
17 If self.delay is set, a DelayedUse entity will be created that will actually
18 do the SUB_UseTargets after that many seconds have passed.
19
20 Centerprints any self.message to the activator.
21
22 Removes all entities with a targetname that match self.killtarget,
23 and removes them, so some events can remove other triggers.
24
25 Search for (string)targetname in all entities that
26 match (string)self.target and call their .use function
27
28 ==============================
29 */
30 void SUB_UseTargets();
31
32
33 //=============================================================================
34
35 const float     SPAWNFLAG_NOMESSAGE = 1;
36 const float     SPAWNFLAG_NOTOUCH = 1;
37
38 // the wait time has passed, so set back up for another activation
39 void multi_wait();
40
41
42 // the trigger was just touched/killed/used
43 // self.enemy should be set to the activator so it can be held through a delay
44 // so wait for the delay time before firing
45 void multi_trigger();
46
47 void multi_use();
48
49 void multi_touch();
50
51 void multi_eventdamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
52
53 void multi_reset();
54
55 /*QUAKED spawnfunc_trigger_multiple (.5 .5 .5) ? notouch
56 Variable sized repeatable trigger.  Must be targeted at one or more entities.  If "health" is set, the trigger must be killed to activate each time.
57 If "delay" is set, the trigger waits some time after activating before firing.
58 "wait" : Seconds between triggerings. (.2 default)
59 If notouch is set, the trigger is only fired by other entities, not by touching.
60 NOTOUCH has been obsoleted by spawnfunc_trigger_relay!
61 sounds
62 1)      secret
63 2)      beep beep
64 3)      large switch
65 4)
66 set "message" to text string
67 */
68 void spawnfunc_trigger_multiple();
69
70
71 /*QUAKED spawnfunc_trigger_once (.5 .5 .5) ? notouch
72 Variable sized trigger. Triggers once, then removes itself.  You must set the key "target" to the name of another object in the level that has a matching
73 "targetname".  If "health" is set, the trigger must be killed to activate.
74 If notouch is set, the trigger is only fired by other entities, not by touching.
75 if "killtarget" is set, any objects that have a matching "target" will be removed when the trigger is fired.
76 if "angle" is set, the trigger will only fire when someone is facing the direction of the angle.  Use "360" for an angle of 0.
77 sounds
78 1)      secret
79 2)      beep beep
80 3)      large switch
81 4)
82 set "message" to text string
83 */
84 void spawnfunc_trigger_once();
85
86 //=============================================================================
87
88 /*QUAKED spawnfunc_trigger_relay (.5 .5 .5) (-8 -8 -8) (8 8 8)
89 This fixed size trigger cannot be touched, it can only be fired by other events.  It can contain killtargets, targets, delays, and messages.
90 */
91 void spawnfunc_trigger_relay();
92
93 void delay_use();
94
95 void delay_reset();
96
97 void spawnfunc_trigger_delay();
98
99 //=============================================================================
100
101
102 void counter_use();
103
104 void counter_reset();
105
106 /*QUAKED spawnfunc_trigger_counter (.5 .5 .5) ? nomessage
107 Acts as an intermediary for an action that takes multiple inputs.
108
109 If nomessage is not set, t will print "1 more.. " etc when triggered and "sequence complete" when finished.
110
111 After the counter has been triggered "count" times (default 2), it will fire all of it's targets and remove itself.
112 */
113 void spawnfunc_trigger_counter();
114
115 void trigger_hurt_use();
116
117 .float triggerhurttime;
118 void trigger_hurt_touch();
119
120 /*QUAKED spawnfunc_trigger_hurt (.5 .5 .5) ?
121 Any object touching this will be hurt
122 set dmg to damage amount
123 defalt dmg = 5
124 */
125 .entity trigger_hurt_next;
126 entity trigger_hurt_last;
127 entity trigger_hurt_first;
128 void spawnfunc_trigger_hurt();
129
130 float tracebox_hits_trigger_hurt(vector start, vector mi, vector ma, vector end);
131
132 //////////////////////////////////////////////////////////////
133 //
134 //
135 //
136 //Trigger heal --a04191b92fbd93aa67214ef7e72d6d2e
137 //
138 //////////////////////////////////////////////////////////////
139
140 .float triggerhealtime;
141 void trigger_heal_touch();
142
143 void spawnfunc_trigger_heal();
144
145
146 //////////////////////////////////////////////////////////////
147 //
148 //
149 //
150 //End trigger_heal
151 //
152 //////////////////////////////////////////////////////////////
153
154 .entity trigger_gravity_check;
155 void trigger_gravity_remove(entity own);
156 void trigger_gravity_check_think();
157
158 void trigger_gravity_use();
159
160 void trigger_gravity_touch();
161
162 void spawnfunc_trigger_gravity();
163
164 //=============================================================================
165
166 // TODO add a way to do looped sounds with sound(); then complete this entity
167 .float volume, atten;
168 void target_speaker_use_off();
169 void target_speaker_use_activator();
170 void target_speaker_use_on();
171 void target_speaker_use_off();
172 void target_speaker_reset();
173
174 void spawnfunc_target_speaker();
175
176
177 void spawnfunc_func_stardust();
178
179 .string bgmscript;
180 .float bgmscriptattack;
181 .float bgmscriptdecay;
182 .float bgmscriptsustain;
183 .float bgmscriptrelease;
184 float pointparticles_SendEntity(entity to, float fl);
185
186 void pointparticles_use();
187
188 void pointparticles_think();
189
190 void pointparticles_reset();
191
192 void spawnfunc_func_pointparticles();
193
194 void spawnfunc_func_sparks();
195
196 float rainsnow_SendEntity(entity to, float sf);
197
198 /*QUAKED spawnfunc_func_rain (0 .5 .8) ?
199 This is an invisible area like a trigger, which rain falls inside of.
200
201 Keys:
202 "velocity"
203  falling direction (should be something like '0 0 -700', use the X and Y velocity for wind)
204 "cnt"
205  sets color of rain (default 12 - white)
206 "count"
207  adjusts density, this many particles fall every second for a 1024x1024 area, default is 2000
208 */
209 void spawnfunc_func_rain();
210
211
212 /*QUAKED spawnfunc_func_snow (0 .5 .8) ?
213 This is an invisible area like a trigger, which snow falls inside of.
214
215 Keys:
216 "velocity"
217  falling direction (should be something like '0 0 -300', use the X and Y velocity for wind)
218 "cnt"
219  sets color of rain (default 12 - white)
220 "count"
221  adjusts density, this many particles fall every second for a 1024x1024 area, default is 2000
222 */
223 void spawnfunc_func_snow();
224
225 .float modelscale;
226 void misc_laser_aim();
227
228 void misc_laser_init();
229
230 .entity pusher;
231 void misc_laser_think();
232
233 float laser_SendEntity(entity to, float fl);
234
235 /*QUAKED spawnfunc_misc_laser (.5 .5 .5) ? START_ON DEST_IS_FIXED
236 Any object touching the beam will be hurt
237 Keys:
238 "target"
239  spawnfunc_target_position where the laser ends
240 "mdl"
241  name of beam end effect to use
242 "colormod"
243  color of the beam (default: red)
244 "dmg"
245  damage per second (-1 for a laser that kills immediately)
246 */
247 void laser_use();
248
249 void laser_reset();
250
251 void spawnfunc_misc_laser();
252
253 // tZorks trigger impulse / gravity
254 .float radius;
255 .float falloff;
256 .float strength;
257 .float lastpushtime;
258
259 // targeted (directional) mode
260 void trigger_impulse_touch1();
261
262 // Directionless (accelerator/decelerator) mode
263 void trigger_impulse_touch2();
264
265 // Spherical (gravity/repulsor) mode
266 void trigger_impulse_touch3();
267
268 /*QUAKED spawnfunc_trigger_impulse (.5 .5 .5) ?
269 -------- KEYS --------
270 target : If this is set, this points to the spawnfunc_target_position to which the player will get pushed.
271          If not, this trigger acts like a damper/accelerator field.
272
273 strength : This is how mutch force to add in the direction of .target each second
274            when .target is set. If not, this is hoe mutch to slow down/accelerate
275            someting cought inside this trigger. (1=no change, 0,5 half speed rougthly each tic, 2 = doubble)
276
277 radius   : If set, act as a spherical device rather then a liniar one.
278
279 falloff : 0 = none, 1 = liniar, 2 = inverted liniar
280
281 -------- NOTES --------
282 Use a brush textured with common/origin in the trigger entity to determine the origin of the force
283 in directional and sperical mode. For damper/accelerator mode this is not nessesary (and has no effect).
284 */
285
286 void spawnfunc_trigger_impulse();
287
288 /*QUAKED spawnfunc_trigger_flipflop (.5 .5 .5) (-8 -8 -8) (8 8 8) START_ENABLED
289 "Flip-flop" trigger gate... lets only every second trigger event through
290 */
291 void flipflop_use();
292
293 void spawnfunc_trigger_flipflop();
294
295 /*QUAKED spawnfunc_trigger_monoflop (.5 .5 .5) (-8 -8 -8) (8 8 8)
296 "Mono-flop" trigger gate... turns one trigger event into one "on" and one "off" event, separated by a delay of "wait"
297 */
298 void monoflop_use();
299 void monoflop_fixed_use();
300
301 void monoflop_think();
302
303 void monoflop_reset();
304
305 void spawnfunc_trigger_monoflop();
306
307 void multivibrator_send();
308
309 void multivibrator_toggle();
310
311 void multivibrator_reset();
312
313 /*QUAKED trigger_multivibrator (.5 .5 .5) (-8 -8 -8) (8 8 8) START_ON
314 "Multivibrator" trigger gate... repeatedly sends trigger events. When triggered, turns on or off.
315 -------- KEYS --------
316 target: trigger all entities with this targetname when it goes off
317 targetname: name that identifies this entity so it can be triggered; when off, it always uses the OFF state
318 phase: offset of the timing
319 wait: "on" cycle time (default: 1)
320 respawntime: "off" cycle time (default: same as wait)
321 -------- SPAWNFLAGS --------
322 START_ON: assume it is already turned on (when targeted)
323 */
324 void spawnfunc_trigger_multivibrator();
325
326
327 void follow_init();
328
329 void spawnfunc_misc_follow();
330
331
332
333 void gamestart_use();
334
335 void spawnfunc_trigger_gamestart();
336
337
338
339
340 .entity voicescript; // attached voice script
341 .float voicescript_index; // index of next voice, or -1 to use the randomized ones
342 .float voicescript_nextthink; // time to play next voice
343 .float voicescript_voiceend; // time when this voice ends
344
345 void target_voicescript_clear(entity pl);
346
347 void target_voicescript_use();
348
349 void target_voicescript_next(entity pl);
350
351 void spawnfunc_target_voicescript();
352
353
354
355 void trigger_relay_teamcheck_use();
356
357 void trigger_relay_teamcheck_reset();
358
359 void spawnfunc_trigger_relay_teamcheck();
360
361
362
363 void trigger_disablerelay_use();
364
365 void spawnfunc_trigger_disablerelay();
366
367 float magicear_matched;
368 float W_Tuba_HasPlayed(entity pl, string melody, float instrument, float ignorepitch, float mintempo, float maxtempo);
369 string trigger_magicear_processmessage(entity ear, entity source, float teamsay, entity privatesay, string msgin);
370
371 entity magicears;
372 string trigger_magicear_processmessage_forallears(entity source, float teamsay, entity privatesay, string msgin);
373
374 void spawnfunc_trigger_magicear();
375
376 void relay_activators_use();
377
378 void spawnfunc_relay_activate();
379
380 void spawnfunc_relay_deactivate();
381
382 void spawnfunc_relay_activatetoggle();
383
384 .string chmap, gametype;
385 void spawnfunc_target_changelevel_use();
386
387 void spawnfunc_target_changelevel();
388 #endif