Xonotic
jumppads.qh
Go to the documentation of this file.
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 
8 STATIC_INIT(g_jumppads) { g_jumppads = IL_NEW(); }
9 
10 .float pushltime;
11 .bool istypefrag;
12 .float height;
13 
14 const int NUM_JUMPPADSUSED = 3;
15 .float jumppadcount;
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 bool trigger_push_testorigin_for_item(entity tracetest_ent, entity item, vector org);
23 #endif
24 
25 /*
26  trigger_push_calculatevelocity
27 
28  Arguments:
29  org - origin of the object which is to be pushed
30  tgt - target entity (can be either a point or a model entity; if it is
31  the latter, its midpoint is used)
32  ht - jump height, measured from the higher one of org and tgt's midpoint
33  pushed_entity - object that is to be pushed
34 
35  Returns: velocity for the jump
36  */
37 vector trigger_push_calculatevelocity(vector org, entity tgt, float ht, entity pushed_entity);
38 
39 void trigger_push_touch(entity this, entity toucher);
40 
41 .vector dest;
42 bool trigger_push_test(entity this, entity item);
44 
45 /*
46  * ENTITY PARAMETERS:
47  *
48  * target: target of jump
49  * height: the absolute value is the height of the highest point of the jump
50  * trajectory above the higher one of the player and the target.
51  * the sign indicates whether the highest point is INSIDE (positive)
52  * or OUTSIDE (negative) of the jump trajectory. General rule: use
53  * positive values for targets mounted on the floor, and use negative
54  * values to target a point on the ceiling.
55  * movedir: if target is not set, this * speed * 10 is the velocity to be reached.
56  */
57 #ifdef SVQC
58 spawnfunc(trigger_push);
59 
60 spawnfunc(target_push);
61 spawnfunc(info_notnull);
62 spawnfunc(target_position);
63 #endif
vector dest
Definition: jumppads.qh:41
const int PUSH_SILENT
Definition: jumppads.qh:5
#define IL_NEW()
entity() spawn
const int PUSH_ONCE
Definition: jumppads.qh:4
vector trigger_push_calculatevelocity(vector org, entity tgt, float ht, entity pushed_entity)
Definition: jumppads.qc:31
void SUB_UseTargets(entity this, entity actor, entity trigger)
Definition: triggers.qc:366
float pushltime
Definition: jumppads.qh:10
float jumppadcount
Definition: jumppads.qh:15
entity jumppadsused[NUM_JUMPPADSUSED]
Definition: jumppads.qh:16
limitations: NULL cannot be present elements can only be present once a maximum of IL_MAX lists can e...
spawnfunc(info_player_attacker)
Definition: sv_assault.qc:283
const int NUM_JUMPPADSUSED
Definition: jumppads.qh:14
IntrusiveList g_jumppads
Definition: jumppads.qh:7
void trigger_push_findtarget(entity this)
Definition: jumppads.qc:558
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition: bits.qh:8
float height
Definition: jumppads.qh:12
STATIC_INIT(g_jumppads)
Definition: jumppads.qh:8
vector(float skel, float bonenum) _skel_get_boneabs_hidden
bool istypefrag
Definition: jumppads.qh:11
bool trigger_push_test(entity this, entity item)
if (item != NULL) returns true if the item can be reached by using this jumppad, false otherwise if (...
Definition: jumppads.qc:387
void trigger_push_touch(entity this, entity toucher)
Definition: jumppads.qc:260