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