X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Fteleporters.qh;h=c0f45f263d588087d724d1e52a59e590275f6b38;hp=01e738e43de17e3be53160ea1b91866c5cfb14cb;hb=678388b78fdaad89fc8218dadf7007432b4153c3;hpb=317ec3eb27ada1c4668876e9499136125acb7984 diff --git a/qcsrc/common/triggers/teleporters.qh b/qcsrc/common/triggers/teleporters.qh index 01e738e43..c0f45f263 100644 --- a/qcsrc/common/triggers/teleporters.qh +++ b/qcsrc/common/triggers/teleporters.qh @@ -1,9 +1,36 @@ #ifndef T_TELEPORTERS_H #define T_TELEPORTERS_H +.entity pusher; +const float TELEPORT_FLAG_SOUND = 1; +const float TELEPORT_FLAG_PARTICLES = 2; +const float TELEPORT_FLAG_TDEATH = 4; +const float TELEPORT_FLAG_FORCE_TDEATH = 8; + +#define TELEPORT_FLAGS_WARPZONE 0 +#define TELEPORT_FLAGS_PORTAL (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH | TELEPORT_FLAG_FORCE_TDEATH) +#define TELEPORT_FLAGS_TELEPORTER (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH) + +// types for .teleportable entity setting +const float TELEPORT_NORMAL = 1; // play sounds/effects etc +const float TELEPORT_SIMPLE = 2; // only do teleport, nothing special + +entity Simple_TeleportPlayer(entity teleporter, entity player); + +void Teleport_Touch(entity this, entity toucher); + +void teleport_findtarget(entity this); + +entity Teleport_Find(vector mi, vector ma); + +void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity, vector telefragmin, vector telefragmax, float tflags); + +entity teleport_first; +.entity teleport_next; + #ifdef SVQC -void trigger_teleport_use(); +void trigger_teleport_use(entity this, entity actor, entity trigger); #define TDEATHLOOP(o) \ entity head; \ @@ -27,42 +54,43 @@ void trigger_teleport_use(); if(head.takedamage) \ if(boxesoverlap(deathmin, deathmax, head.absmin, head.absmax)) - float check_tdeath(entity player, vector org, vector telefragmin, vector telefragmax); float tdeath_hit; void tdeath(entity player, entity teleporter, entity telefragger, vector telefragmin, vector telefragmax); void spawn_tdeath(vector v0, entity e, vector v); -.entity pusher; -const float TELEPORT_FLAG_SOUND = 1; -const float TELEPORT_FLAG_PARTICLES = 2; -const float TELEPORT_FLAG_TDEATH = 4; -const float TELEPORT_FLAG_FORCE_TDEATH = 8; - -#define TELEPORT_FLAGS_WARPZONE 0 -#define TELEPORT_FLAGS_PORTAL (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH | TELEPORT_FLAG_FORCE_TDEATH) -#define TELEPORT_FLAGS_TELEPORTER (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH) - -// types for .teleportable entity setting -const float TELEPORT_NORMAL = 1; // play sounds/effects etc -const float TELEPORT_SIMPLE = 2; // only do teleport, nothing special - void Reset_ArcBeam(entity player, vector forward); -void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity, vector telefragmin, vector telefragmax, float tflags); - -entity Simple_TeleportPlayer(entity teleporter, entity player); - -void Teleport_Touch (); -void teleport_findtarget (); +#endif -entity Teleport_Find(vector mi, vector ma); +void WarpZone_PostTeleportPlayer_Callback(entity pl); -entity teleport_first; -.entity teleport_next; +#ifdef CSQC +.entity realowner; +.float lastteleporttime; -void WarpZone_PostTeleportPlayer_Callback(entity pl); +#define TDEATHLOOP(o) \ + entity head; \ + vector deathmin; \ + vector deathmax; \ + float deathradius; \ + deathmin = (o) + player.mins; \ + deathmax = (o) + player.maxs; \ + if(telefragmin != telefragmax) \ + { \ + if(deathmin.x > telefragmin.x) deathmin.x = telefragmin.x; \ + if(deathmin.y > telefragmin.y) deathmin.y = telefragmin.y; \ + if(deathmin.z > telefragmin.z) deathmin.z = telefragmin.z; \ + if(deathmax.x < telefragmax.x) deathmax.x = telefragmax.x; \ + if(deathmax.y < telefragmax.y) deathmax.y = telefragmax.y; \ + if(deathmax.z < telefragmax.z) deathmax.z = telefragmax.z; \ + } \ + deathradius = max(vlen(deathmin), vlen(deathmax)); \ + for(head = findradius(o, deathradius); head; head = head.chain) \ + if(head != player) \ + if(head.isplayermodel) \ + if(boxesoverlap(deathmin, deathmax, head.absmin, head.absmax)) #endif #endif