Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
jumppads.qh
Go to the documentation of this file.
1#pragma once
2
3
4const int PUSH_ONCE = BIT(0); // legacy, deactivate with relay instead
5const int PUSH_SILENT = BIT(1); // not used?
6const int PUSH_STATIC = BIT(12); // xonotic-only, Q3 already behaves like this by default
7
8#define PUSH_VELOCITY_PLAYERDIR_XY BIT(0)
9#define PUSH_VELOCITY_ADD_XY BIT(1)
10#define PUSH_VELOCITY_PLAYERDIR_Z BIT(2)
11#define PUSH_VELOCITY_ADD_Z BIT(3)
12#define PUSH_VELOCITY_BIDIRECTIONAL_XY BIT(4)
13#define PUSH_VELOCITY_BIDIRECTIONAL_Z BIT(5)
14#define PUSH_VELOCITY_CLAMP_NEGATIVE_ADDS BIT(6)
15
16#define Q3_TARGET_PUSH_JUMPPAD BIT(0) // target_push defaults to "wind tunnel" mode in Q3
17
20
21.float pushltime;
23.float height;
24
26
27const int NUM_JUMPPADSUSED = 3;
30
31#ifdef SVQC
32void SUB_UseTargets(entity this, entity actor, entity trigger);
33void trigger_push_use(entity this, entity actor, entity trigger);
34bool trigger_push_testorigin(entity tracetest_ent, entity targ, entity jp, vector org);
36#endif
37
38/*
39 trigger_push_calculatevelocity
40
41 Arguments:
42 org - origin of the object which is to be pushed
43 tgt - target entity (can be either a point or a model entity; if it is
44 the latter, its midpoint is used)
45 ht - jump height, measured from the higher one of org and tgt's midpoint
46 pushed_entity - object that is to be pushed
47
48 Returns: velocity for the jump
49 */
50vector trigger_push_calculatevelocity(vector org, entity tgt, float ht, entity pushed_entity);
51
53
54.vector dest;
55bool trigger_push_test(entity this, entity item);
57
58/*
59 * ENTITY PARAMETERS trigger_push:
60 *
61 * target: target of jump
62 * height: the absolute value is the height of the highest point of the jump
63 * trajectory above the higher one of the player and the target.
64 * the sign indicates whether the highest point is INSIDE (positive)
65 * or OUTSIDE (negative) of the jump trajectory. General rule: use
66 * positive values for targets mounted on the floor, and use negative
67 * values to target a point on the ceiling.
68 * movedir: if target is not set, this * speed * 10 is the velocity to be reached.
69 */
70
71/*
72 * ENTITY PARAMETERS trigger_push_velocity:
73 *
74 * target: this points to the target_position to which the player will jump.
75 * speed: XY speed for player-directional velocity pads - either sets or adds to the player's horizontal velocity.
76 * count: Z speed for player-directional velocity pads - either sets or adds to the player's vertical velocity.
77 */
78#ifdef SVQC
79spawnfunc(trigger_push);
80spawnfunc(trigger_push_velocity);
81
82spawnfunc(target_push);
83spawnfunc(info_notnull);
84spawnfunc(target_position);
85#endif
#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 bobbing.qc:3
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
limitations: NULL cannot be present elements can only be present once a maximum of IL_MAX lists can e...
#define IL_NEW()
const int PUSH_ONCE
Definition jumppads.qh:4
bool trigger_push_testorigin(entity tracetest_ent, entity targ, entity jp, vector org)
Definition jumppads.qc:477
bool trigger_push_testorigin_for_item(entity tracetest_ent, entity item, vector org)
Definition jumppads.qc:513
void SUB_UseTargets(entity this, entity actor, entity trigger)
Definition triggers.qc:344
void trigger_push_use(entity this, entity actor, entity trigger)
Definition jumppads.qc:6
entity last_pushed
Definition jumppads.qh:25
void trigger_push_findtarget(entity this)
Definition jumppads.qc:753
entity jumppadsused[NUM_JUMPPADSUSED]
Definition jumppads.qh:29
const int NUM_JUMPPADSUSED
Definition jumppads.qh:27
bool trigger_push_test(entity this, entity item)
Definition jumppads.qc:579
IntrusiveList g_jumppads
Definition jumppads.qh:18
vector trigger_push_calculatevelocity(vector org, entity tgt, float ht, entity pushed_entity)
Definition jumppads.qc:32
vector dest
Definition jumppads.qh:54
float pushltime
Definition jumppads.qh:21
float jumppadcount
Definition jumppads.qh:28
bool istypefrag
Definition jumppads.qh:22
const int PUSH_STATIC
Definition jumppads.qh:6
const int PUSH_SILENT
Definition jumppads.qh:5
void trigger_push_touch(entity this, entity toucher)
Definition jumppads.qc:438
vector
Definition self.qh:92
vector org
Definition self.qh:92
entity entity toucher
Definition self.qh:72
#define spawnfunc(id)
Definition spawnfunc.qh:96
#define STATIC_INIT(func)
during worldspawn
Definition static.qh:32