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