1 #ifndef T_TELEPORTERS_H
2 #define T_TELEPORTERS_H
5 const float TELEPORT_FLAG_SOUND = 1;
6 const float TELEPORT_FLAG_PARTICLES = 2;
7 const float TELEPORT_FLAG_TDEATH = 4;
8 const float TELEPORT_FLAG_FORCE_TDEATH = 8;
10 #define TELEPORT_FLAGS_WARPZONE 0
11 #define TELEPORT_FLAGS_PORTAL (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH | TELEPORT_FLAG_FORCE_TDEATH)
12 #define TELEPORT_FLAGS_TELEPORTER (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH)
14 // types for .teleportable entity setting
15 const float TELEPORT_NORMAL = 1; // play sounds/effects etc
16 const float TELEPORT_SIMPLE = 2; // only do teleport, nothing special
18 entity Simple_TeleportPlayer(entity teleporter, entity player);
20 void Teleport_Touch ();
22 void teleport_findtarget(entity this);
24 entity Teleport_Find(vector mi, vector ma);
26 void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity, vector telefragmin, vector telefragmax, float tflags);
28 entity teleport_first;
29 .entity teleport_next;
33 void trigger_teleport_use();
35 #define TDEATHLOOP(o) \
40 deathmin = (o) + player.mins; \
41 deathmax = (o) + player.maxs; \
42 if(telefragmin != telefragmax) \
44 if(deathmin.x > telefragmin.x) deathmin.x = telefragmin.x; \
45 if(deathmin.y > telefragmin.y) deathmin.y = telefragmin.y; \
46 if(deathmin.z > telefragmin.z) deathmin.z = telefragmin.z; \
47 if(deathmax.x < telefragmax.x) deathmax.x = telefragmax.x; \
48 if(deathmax.y < telefragmax.y) deathmax.y = telefragmax.y; \
49 if(deathmax.z < telefragmax.z) deathmax.z = telefragmax.z; \
51 deathradius = max(vlen(deathmin), vlen(deathmax)); \
52 for(head = findradius(o, deathradius); head; head = head.chain) \
55 if(boxesoverlap(deathmin, deathmax, head.absmin, head.absmax))
57 float check_tdeath(entity player, vector org, vector telefragmin, vector telefragmax);
59 void tdeath(entity player, entity teleporter, entity telefragger, vector telefragmin, vector telefragmax);
61 void spawn_tdeath(vector v0, entity e, vector v);
63 void Reset_ArcBeam(entity player, vector forward);
67 void WarpZone_PostTeleportPlayer_Callback(entity pl);
71 .float lastteleporttime;
73 #define TDEATHLOOP(o) \
78 deathmin = (o) + player.mins; \
79 deathmax = (o) + player.maxs; \
80 if(telefragmin != telefragmax) \
82 if(deathmin.x > telefragmin.x) deathmin.x = telefragmin.x; \
83 if(deathmin.y > telefragmin.y) deathmin.y = telefragmin.y; \
84 if(deathmin.z > telefragmin.z) deathmin.z = telefragmin.z; \
85 if(deathmax.x < telefragmax.x) deathmax.x = telefragmax.x; \
86 if(deathmax.y < telefragmax.y) deathmax.y = telefragmax.y; \
87 if(deathmax.z < telefragmax.z) deathmax.z = telefragmax.z; \
89 deathradius = max(vlen(deathmin), vlen(deathmax)); \
90 for(head = findradius(o, deathradius); head; head = head.chain) \
92 if(head.isplayermodel) \
93 if(boxesoverlap(deathmin, deathmax, head.absmin, head.absmax))