30 if (!(
teamplay && autocvar_g_telefrags_teamplay && head.team == player.team))
40 void trigger_teleport_link(
entity this);
44 TDEATHLOOP(player.origin)
48 if (!(
teamplay && autocvar_g_telefrags_teamplay && head.team == player.team))
53 Damage (head, teleporter, telefragger, 10000, DEATH_TELEFRAG.m_id,
DMG_NOWEP, head.origin,
'0 0 0');
57 Damage (telefragger, teleporter, telefragger, 10000, DEATH_TELEFRAG.m_id,
DMG_NOWEP, telefragger.origin,
'0 0 0');
63 tdeath(e, e, e,
'0 0 0',
'0 0 0');
73 telefragger = teleporter.owner;
82 if(teleporter.pushltime <
time)
86 string thesound =
SND(TELEPORT);
87 if(teleporter.noise !=
"")
92 RandomSelection_AddString(it, 1, 1);
100 Send_Effect(EFFECT_TELEPORT, player.origin,
'0 0 0', 1);
101 Send_Effect(EFFECT_TELEPORT, to +
v_forward * 32,
'0 0 0', 1);
103 teleporter.pushltime =
time + 0.2;
111 from = player.origin;
113 player.oldorigin =
to;
114 player.angles = to_angles;
117 player.v_angle = player.angles;
120 player.fixangle =
true;
121 player.velocity = to_velocity;
129 from = player.origin;
131 player.angles = to_angles;
132 player.velocity = to_velocity;
135 player.csqcmodel_teleported = 1;
136 player.v_angle = to_angles;
152 tdeath(player, teleporter, telefragger, telefragmin, telefragmax);
159 player.oldvelocity = player.velocity;
164 player.pusher = teleporter.owner;
170 player.pushltime = 0;
171 player.istypefrag = 0;
174 player.lastteleporttime =
time;
175 player.lastteleport_origin = from;
188 e = teleporter.enemy;
198 if(STAT(TELEPORT_TELEFRAG_AVOID, player))
201 locout = it.origin +
'0 0 1' * (1 - player.mins.z - 24);
203 locout = it.origin +
'0 0 1' * (1 - player.mins.z - 24);
205 if(check_tdeath(player, locout,
'0 0 0',
'0 0 0'))
215 if(!e) {
sprint(player,
"Teleport destination vanished. Sorry... please complain to the mapper.\n"); }
217 if(!e) {
LOG_INFO(
"Teleport destination could not be found from CSQC."); }
223 if(
vdist(player.velocity, >, e.speed))
224 player.velocity =
normalize(player.velocity) *
max(0, e.speed);
226 if(STAT(TELEPORT_MAXSPEED, player))
227 if(
vdist(player.velocity, >, STAT(TELEPORT_MAXSPEED, player)))
228 player.velocity =
normalize(player.velocity) *
max(0, STAT(TELEPORT_MAXSPEED, player));
230 locout = e.origin +
'0 0 1' * (1 - player.mins.z - 24);
249 setsize(tracetest_ent, PL_MIN_CONST, PL_MAX_CONST);
252 delete(tracetest_ent);
254 if(e.classname !=
"info_teleport_destination")
255 LOG_INFO(
"^3MAPPER ERROR: teleporter does target an invalid teleport destination entity. Angles will not work.");
262 objerror (
this,
"Teleporter with nonexistent target");
281 trigger_teleport_link(
this);
305 if(pl.owner == pl.realowner)
308 if(!(pl.flags & FL_PROJECTILE))
310 if(!(pl.flags &
BIT(15)))
312 LOG_INFO(
"A non-projectile got through a warpzone and its owner cleared. It's a ", pl.classname,
".");
319 pl.oldvelocity = pl.velocity;
#define round_handler_IsActive()
#define IL_EACH(this, cond, body)
#define PHYS_INPUT_BUTTON_CHAT(s)
const int TELEPORT_FLAG_TDEATH
string RandomSelection_chosen_string
void teleport_findtarget(entity this)
const float VF_CL_VIEWANGLES
const int TELEPORT_NORMAL
void bot_aim_reset(entity this)
ERASEABLE void RandomSelection_Init()
IntrusiveList g_teleporters
entity Teleport_Find(vector mi, vector ma)
float DPCONTENTS_PLAYERCLIP
#define round_handler_IsRoundStarted()
#define UNSET_ONGROUND(s)
float autocvar_g_maxpushtime
#define FOREACH_WORD(words, cond, body)
const int EF_TELEPORT_BIT
#define FOREACH_ENTITY_STRING(fld, match, body)
#define RandomSelection_AddEnt(e, weight, priority)
entity Simple_TeleportPlayer(entity teleporter, entity player)
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
void anticheat_fixangle(entity this)
float WarpZoneLib_BoxTouchesBrush(vector mi, vector ma, entity e, entity ig)
entity RandomSelection_chosen_ent
#define TELEPORT_FLAGS_TELEPORTER
void Damage(entity targ, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
void UpdateItemAfterTeleport(entity this)
void waypoint_spawnforteleporter(entity e, vector destination, float timetaken, entity tracetest_ent)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
const int IFLAG_TELEPORTED
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
void WarpZone_PostTeleportPlayer_Callback(entity pl)
#define _sound(e, c, s, v, a)
const float SOLID_TRIGGER
const int TELEPORT_FLAG_SOUND
#define IS_BOT_CLIENT(v)
want: (IS_CLIENT(v) && !IS_REAL_CLIENT(v))
void UpdateCSQCProjectileAfterTeleport(entity e)
#define BITXOR_ASSIGN(a, b)
const int TELEPORT_FLAG_PARTICLES
const int TELEPORT_FLAG_FORCE_TDEATH
void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity, vector telefragmin, vector telefragmax, float tflags)
void Teleport_Touch(entity this, entity toucher)