]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/triggers/trigger/jumppads.qh
#pragma once
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / trigger / jumppads.qh
1 #pragma once
2
3 const float PUSH_ONCE           = 1;
4 const float PUSH_SILENT         = 2;
5
6 .float pushltime;
7 .float istypefrag;
8 .float height;
9
10 const int NUM_JUMPPADSUSED = 3;
11 .float jumppadcount;
12 .entity jumppadsused[NUM_JUMPPADSUSED];
13
14 float trigger_push_calculatevelocity_flighttime;
15
16 #ifdef SVQC
17 void SUB_UseTargets(entity this, entity actor, entity trigger);
18 void trigger_push_use(entity this, entity actor, entity trigger);
19 #endif
20
21 /*
22         trigger_push_calculatevelocity
23
24         Arguments:
25           org - origin of the object which is to be pushed
26           tgt - target entity (can be either a point or a model entity; if it is
27                 the latter, its midpoint is used)
28           ht  - jump height, measured from the higher one of org and tgt's midpoint
29
30         Returns: velocity for the jump
31         the global trigger_push_calculatevelocity_flighttime is set to the total
32         jump time
33  */
34
35 vector trigger_push_calculatevelocity(vector org, entity tgt, float ht);
36
37 void trigger_push_touch(entity this, entity toucher);
38
39 .vector dest;
40 void trigger_push_findtarget(entity this);
41
42 /*
43  * ENTITY PARAMETERS:
44  *
45  *   target:  target of jump
46  *   height:  the absolute value is the height of the highest point of the jump
47  *            trajectory above the higher one of the player and the target.
48  *            the sign indicates whether the highest point is INSIDE (positive)
49  *            or OUTSIDE (negative) of the jump trajectory. General rule: use
50  *            positive values for targets mounted on the floor, and use negative
51  *            values to target a point on the ceiling.
52  *   movedir: if target is not set, this * speed * 10 is the velocity to be reached.
53  */
54 #ifdef SVQC
55 spawnfunc(trigger_push);
56
57 spawnfunc(target_push);
58 spawnfunc(info_notnull);
59 spawnfunc(target_position);
60 #endif