]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/triggers/trigger/jumppads.qh
Move entity spawnflags to a common file
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / trigger / jumppads.qh
1 #pragma once
2 #include "../spawnflags.qh"
3
4 IntrusiveList g_jumppads;
5 STATIC_INIT(g_jumppads) { g_jumppads = IL_NEW(); }
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 #ifdef SVQC
16 void SUB_UseTargets(entity this, entity actor, entity trigger);
17 void trigger_push_use(entity this, entity actor, entity trigger);
18 bool trigger_push_testorigin(entity tracetest_ent, entity targ, entity jp, vector org);
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           pushed_entity - object that is to be pushed
30
31         Returns: velocity for the jump
32  */
33 vector trigger_push_calculatevelocity(vector org, entity tgt, float ht, entity pushed_entity);
34
35 void trigger_push_touch(entity this, entity toucher);
36
37 .vector dest;
38 bool trigger_push_test(entity this, entity item);
39 void trigger_push_findtarget(entity this);
40
41 /*
42  * ENTITY PARAMETERS:
43  *
44  *   target:  target of jump
45  *   height:  the absolute value is the height of the highest point of the jump
46  *            trajectory above the higher one of the player and the target.
47  *            the sign indicates whether the highest point is INSIDE (positive)
48  *            or OUTSIDE (negative) of the jump trajectory. General rule: use
49  *            positive values for targets mounted on the floor, and use negative
50  *            values to target a point on the ceiling.
51  *   movedir: if target is not set, this * speed * 10 is the velocity to be reached.
52  */
53 #ifdef SVQC
54 spawnfunc(trigger_push);
55
56 spawnfunc(target_push);
57 spawnfunc(info_notnull);
58 spawnfunc(target_position);
59 #endif