Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
teleporters.qh
Go to the documentation of this file.
1#pragma once
2#include "defs.qh"
3
4#ifdef SVQC
8#endif
9
12
13.entity pusher;
14
15const int TELEPORT_FLAG_SOUND = BIT(0);
19
20#define TELEPORT_FLAGS_WARPZONE 0
21#define TELEPORT_FLAGS_PORTAL (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH | TELEPORT_FLAG_FORCE_TDEATH)
22#define TELEPORT_FLAGS_TELEPORTER (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH)
23
25// types for .teleportable entity setting
26const int TELEPORT_NORMAL = 1; // play sounds/effects etc
27const int TELEPORT_SIMPLE = 2; // only do teleport, nothing special
28
29entity Simple_TeleportPlayer(entity teleporter, entity player);
30
32
34
36
37void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity, vector telefragmin, vector telefragmax, float tflags);
38
39#ifdef SVQC
40
41void trigger_teleport_use(entity this, entity actor, entity trigger);
42
43#define TDEATHLOOP(o) \
44 vector deathmin = (o) + player.mins; \
45 vector deathmax = (o) + player.maxs; \
46 if(telefragmin != telefragmax) \
47 { \
48 if(deathmin.x > telefragmin.x) deathmin.x = telefragmin.x; \
49 if(deathmin.y > telefragmin.y) deathmin.y = telefragmin.y; \
50 if(deathmin.z > telefragmin.z) deathmin.z = telefragmin.z; \
51 if(deathmax.x < telefragmax.x) deathmax.x = telefragmax.x; \
52 if(deathmax.y < telefragmax.y) deathmax.y = telefragmax.y; \
53 if(deathmax.z < telefragmax.z) deathmax.z = telefragmax.z; \
54 } \
55 float deathradius = max(vlen(deathmin), vlen(deathmax)); \
56 for (entity head = findradius(o, deathradius); head; head = head.chain) \
57 if (head != player && head.takedamage && boxesoverlap(deathmin, deathmax, head.absmin, head.absmax))
58
59float check_tdeath(entity player, vector org, vector telefragmin, vector telefragmax);
61void tdeath(entity player, entity teleporter, entity telefragger, vector telefragmin, vector telefragmax);
62
63void spawn_tdeath(vector v0, entity e, vector v);
64
65void Reset_ArcBeam(entity player, vector forward);
66
67#endif
68
70
71#ifdef CSQC
72.entity realowner;
73#endif
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition bits.qh:8
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...
void Reset_ArcBeam()
Definition arc.qc:852
#define IL_NEW()
entity pusher
Definition laser.qc:57
vector
Definition self.qh:92
vector org
Definition self.qh:92
entity entity toucher
Definition self.qh:72
#define STATIC_INIT(func)
during worldspawn
Definition static.qh:32
const int TELEPORT_FLAG_SOUND
void tdeath(entity player, entity teleporter, entity telefragger, vector telefragmin, vector telefragmax)
const int TELEPORT_FLAG_PARTICLES
void spawn_tdeath(vector v0, entity e, vector v)
const int TELEPORT_FLAG_TDEATH
const int TELEPORT_NORMAL
void trigger_teleport_use(entity this, entity actor, entity trigger)
Definition teleport.qc:5
float teleportable
entity realowner
float check_tdeath(entity player, vector org, vector telefragmin, vector telefragmax)
void teleport_findtarget(entity this)
entity Simple_TeleportPlayer(entity teleporter, entity player)
void Teleport_Touch(entity this, entity toucher)
Definition teleport.qc:49
void WarpZone_PostTeleportPlayer_Callback(entity pl)
bool autocvar_g_telefrags_avoid
Definition teleporters.qh:6
const int TELEPORT_FLAG_FORCE_TDEATH
void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity, vector telefragmin, vector telefragmax, float tflags)
float tdeath_hit
IntrusiveList g_teleporters
bool autocvar_g_telefrags
Definition teleporters.qh:5
entity Teleport_Find(vector mi, vector ma)
const int TELEPORT_SIMPLE
bool autocvar_g_telefrags_teamplay
Definition teleporters.qh:7