4 IntrusiveList g_teleporters;
5 STATIC_INIT(g_teleporters) { g_teleporters = IL_NEW(); }
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);
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)
19 // types for .teleportable entity setting
20 const int TELEPORT_NORMAL = 1; // play sounds/effects etc
21 const int TELEPORT_SIMPLE = 2; // only do teleport, nothing special
23 entity Simple_TeleportPlayer(entity teleporter, entity player);
25 void Teleport_Touch(entity this, entity toucher);
27 void teleport_findtarget(entity this);
29 entity Teleport_Find(vector mi, vector ma);
31 void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity, vector telefragmin, vector telefragmax, float tflags);
35 void trigger_teleport_use(entity this, entity actor, entity trigger);
37 #define TDEATHLOOP(o) \
38 vector deathmin = (o) + player.mins; \
39 vector deathmax = (o) + player.maxs; \
40 if(telefragmin != telefragmax) \
42 if(deathmin.x > telefragmin.x) deathmin.x = telefragmin.x; \
43 if(deathmin.y > telefragmin.y) deathmin.y = telefragmin.y; \
44 if(deathmin.z > telefragmin.z) deathmin.z = telefragmin.z; \
45 if(deathmax.x < telefragmax.x) deathmax.x = telefragmax.x; \
46 if(deathmax.y < telefragmax.y) deathmax.y = telefragmax.y; \
47 if(deathmax.z < telefragmax.z) deathmax.z = telefragmax.z; \
49 float deathradius = max(vlen(deathmin), vlen(deathmax)); \
50 for (entity head = findradius(o, deathradius); head; head = head.chain) \
51 if (head != player && head.takedamage && boxesoverlap(deathmin, deathmax, head.absmin, head.absmax))
53 float check_tdeath(entity player, vector org, vector telefragmin, vector telefragmax);
55 void tdeath(entity player, entity teleporter, entity telefragger, vector telefragmin, vector telefragmax);
57 void spawn_tdeath(vector v0, entity e, vector v);
59 void Reset_ArcBeam(entity player, vector forward);
63 void WarpZone_PostTeleportPlayer_Callback(entity pl);