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