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