]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/triggers/teleporters.qh
Merge branch 'master' into Mario/qc_physics_prehax
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / teleporters.qh
1 #ifndef T_TELEPORTERS_H
2 #define T_TELEPORTERS_H
3
4 #ifdef SVQC
5
6 void trigger_teleport_use();
7
8 #define TDEATHLOOP(o) \
9         entity head; \
10         vector deathmin; \
11         vector deathmax; \
12         float deathradius; \
13         deathmin = (o) + player.mins; \
14         deathmax = (o) + player.maxs; \
15         if(telefragmin != telefragmax) \
16         { \
17                 if(deathmin.x > telefragmin.x) deathmin.x = telefragmin.x; \
18                 if(deathmin.y > telefragmin.y) deathmin.y = telefragmin.y; \
19                 if(deathmin.z > telefragmin.z) deathmin.z = telefragmin.z; \
20                 if(deathmax.x < telefragmax.x) deathmax.x = telefragmax.x; \
21                 if(deathmax.y < telefragmax.y) deathmax.y = telefragmax.y; \
22                 if(deathmax.z < telefragmax.z) deathmax.z = telefragmax.z; \
23         } \
24         deathradius = max(vlen(deathmin), vlen(deathmax)); \
25         for(head = findradius(o, deathradius); head; head = head.chain) \
26                 if(head != player) \
27                         if(head.takedamage) \
28                                 if(boxesoverlap(deathmin, deathmax, head.absmin, head.absmax))
29
30
31 float check_tdeath(entity player, vector org, vector telefragmin, vector telefragmax);
32 float tdeath_hit;
33 void tdeath(entity player, entity teleporter, entity telefragger, vector telefragmin, vector telefragmax);
34
35 void spawn_tdeath(vector v0, entity e, vector v);
36
37 .entity pusher;
38 const float TELEPORT_FLAG_SOUND = 1;
39 const float TELEPORT_FLAG_PARTICLES = 2;
40 const float TELEPORT_FLAG_TDEATH = 4;
41 const float TELEPORT_FLAG_FORCE_TDEATH = 8;
42
43 #define TELEPORT_FLAGS_WARPZONE   0
44 #define TELEPORT_FLAGS_PORTAL     (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH | TELEPORT_FLAG_FORCE_TDEATH)
45 #define TELEPORT_FLAGS_TELEPORTER (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH)
46
47 // types for .teleportable entity setting
48 const float TELEPORT_NORMAL = 1; // play sounds/effects etc
49 const float TELEPORT_SIMPLE = 2; // only do teleport, nothing special
50
51 void Reset_ArcBeam(entity player, vector forward);
52 void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity, vector telefragmin, vector telefragmax, float tflags);
53
54 entity Simple_TeleportPlayer(entity teleporter, entity player);
55
56 void Teleport_Touch (void);
57
58 void teleport_findtarget (void);
59
60 entity Teleport_Find(vector mi, vector ma);
61
62 entity teleport_first;
63 .entity teleport_next;
64
65 void WarpZone_PostTeleportPlayer_Callback(entity pl);
66 #endif
67
68 #endif