Xonotic
teleporters.qh
Go to the documentation of this file.
1 #pragma once
2 #include "defs.qh"
3 
4 #ifdef SVQC
5 bool autocvar_g_telefrags;
6 bool autocvar_g_telefrags_avoid;
7 bool autocvar_g_telefrags_teamplay;
8 #endif
9 
11 STATIC_INIT(g_teleporters) { g_teleporters = IL_NEW(); }
12 
13 .entity pusher;
14 
15 const int TELEPORT_FLAG_SOUND = BIT(0);
17 const int TELEPORT_FLAG_TDEATH = BIT(2);
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 
24 .float teleportable;
25 // types for .teleportable entity setting
26 const int TELEPORT_NORMAL = 1; // play sounds/effects etc
27 const int TELEPORT_SIMPLE = 2; // only do teleport, nothing special
28 
29 entity Simple_TeleportPlayer(entity teleporter, entity player);
30 
31 void Teleport_Touch(entity this, entity toucher);
32 
33 void teleport_findtarget(entity this);
34 
36 
37 void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity, vector telefragmin, vector telefragmax, float tflags);
38 
39 #ifdef SVQC
40 
41 void 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 
59 float check_tdeath(entity player, vector org, vector telefragmin, vector telefragmax);
60 float tdeath_hit;
61 void tdeath(entity player, entity teleporter, entity telefragger, vector telefragmin, vector telefragmax);
62 
63 void spawn_tdeath(vector v0, entity e, vector v);
64 
65 void Reset_ArcBeam(entity player, vector forward);
66 
67 #endif
68 
70 
71 #ifdef CSQC
72 .entity realowner;
73 #endif
entity Simple_TeleportPlayer(entity teleporter, entity player)
Definition: teleporters.qc:180
const int TELEPORT_FLAG_TDEATH
Definition: teleporters.qh:17
const int TELEPORT_SIMPLE
Definition: teleporters.qh:27
STATIC_INIT(g_teleporters)
Definition: teleporters.qh:11
const int TELEPORT_NORMAL
Definition: teleporters.qh:26
void WarpZone_PostTeleportPlayer_Callback(entity pl)
Definition: teleporters.qc:294
IntrusiveList g_teleporters
Definition: teleporters.qh:10
#define IL_NEW()
entity() spawn
entity to
Definition: self.qh:96
limitations: NULL cannot be present elements can only be present once a maximum of IL_MAX lists can e...
entity pusher
Definition: teleporters.qh:13
void Reset_ArcBeam()
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition: bits.qh:8
void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity, vector telefragmin, vector telefragmax, float tflags)
Definition: teleporters.qc:67
void teleport_findtarget(entity this)
Definition: teleporters.qc:237
entity Teleport_Find(vector mi, vector ma)
Definition: teleporters.qc:285
vector(float skel, float bonenum) _skel_get_boneabs_hidden
vector v
Definition: ent_cs.qc:116
const int TELEPORT_FLAG_SOUND
Definition: teleporters.qh:15
entity realowner
Definition: common.qh:25
float teleportable
Definition: teleporters.qh:24
const int TELEPORT_FLAG_PARTICLES
Definition: teleporters.qh:16
const int TELEPORT_FLAG_FORCE_TDEATH
Definition: teleporters.qh:18
void Teleport_Touch(entity this, entity toucher)
Definition: teleport.qc:45