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