3 IntrusiveList g_teleporters;
4 STATIC_INIT(g_teleporters) { g_teleporters = IL_NEW(); }
7 const float TELEPORT_FLAG_SOUND = 1;
8 const float TELEPORT_FLAG_PARTICLES = 2;
9 const float TELEPORT_FLAG_TDEATH = 4;
10 const float TELEPORT_FLAG_FORCE_TDEATH = 8;
12 #define TELEPORT_FLAGS_WARPZONE 0
13 #define TELEPORT_FLAGS_PORTAL (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH | TELEPORT_FLAG_FORCE_TDEATH)
14 #define TELEPORT_FLAGS_TELEPORTER (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH)
16 // types for .teleportable entity setting
17 const float TELEPORT_NORMAL = 1; // play sounds/effects etc
18 const float TELEPORT_SIMPLE = 2; // only do teleport, nothing special
20 entity Simple_TeleportPlayer(entity teleporter, entity player);
22 void Teleport_Touch(entity this, entity toucher);
24 void teleport_findtarget(entity this);
26 entity Teleport_Find(vector mi, vector ma);
28 void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity, vector telefragmin, vector telefragmax, float tflags);
30 entity teleport_first;
31 .entity teleport_next;
35 void trigger_teleport_use(entity this, entity actor, entity trigger);
37 #define TDEATHLOOP(o) \
42 deathmin = (o) + player.mins; \
43 deathmax = (o) + player.maxs; \
44 if(telefragmin != telefragmax) \
46 if(deathmin.x > telefragmin.x) deathmin.x = telefragmin.x; \
47 if(deathmin.y > telefragmin.y) deathmin.y = telefragmin.y; \
48 if(deathmin.z > telefragmin.z) deathmin.z = telefragmin.z; \
49 if(deathmax.x < telefragmax.x) deathmax.x = telefragmax.x; \
50 if(deathmax.y < telefragmax.y) deathmax.y = telefragmax.y; \
51 if(deathmax.z < telefragmax.z) deathmax.z = telefragmax.z; \
53 deathradius = max(vlen(deathmin), vlen(deathmax)); \
54 for(head = findradius(o, deathradius); head; head = head.chain) \
57 if(boxesoverlap(deathmin, deathmax, head.absmin, head.absmax))
59 float check_tdeath(entity player, vector org, vector telefragmin, vector telefragmax);
61 void tdeath(entity player, entity teleporter, entity telefragger, vector telefragmin, vector telefragmax);
63 void spawn_tdeath(vector v0, entity e, vector v);
65 void Reset_ArcBeam(entity player, vector forward);
69 void WarpZone_PostTeleportPlayer_Callback(entity pl);
73 .float lastteleporttime;
75 #define TDEATHLOOP(o) \
80 deathmin = (o) + player.mins; \
81 deathmax = (o) + player.maxs; \
82 if(telefragmin != telefragmax) \
84 if(deathmin.x > telefragmin.x) deathmin.x = telefragmin.x; \
85 if(deathmin.y > telefragmin.y) deathmin.y = telefragmin.y; \
86 if(deathmin.z > telefragmin.z) deathmin.z = telefragmin.z; \
87 if(deathmax.x < telefragmax.x) deathmax.x = telefragmax.x; \
88 if(deathmax.y < telefragmax.y) deathmax.y = telefragmax.y; \
89 if(deathmax.z < telefragmax.z) deathmax.z = telefragmax.z; \
91 deathradius = max(vlen(deathmin), vlen(deathmax)); \
92 for(head = findradius(o, deathradius); head; head = head.chain) \
94 if(head.isplayermodel) \
95 if(boxesoverlap(deathmin, deathmax, head.absmin, head.absmax))