Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
translocate.qc File Reference
#include "translocate.qh"
Include dependency graph for translocate.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void nade_translocate_boom (entity this)
bool nade_translocate_DestroyDamage (entity this, entity attacker)

Function Documentation

◆ nade_translocate_boom()

void nade_translocate_boom ( entity this)

Definition at line 4 of file translocate.qc.

5{
6 if (this.realowner.vehicle)
7 return;
8
9 setsize(this, PL_MIN_CONST - '16 16 16', PL_MAX_CONST + '16 16 16');
10
11 if (!move_out_of_solid(this))
12 {
13 sprint(this.realowner, "^1Couldn't move the translocator out of solid! origin: ", vtos(this.origin), "\n");
14 return;
15 }
16
17 vector locout = this.origin + '0 0 1' * (1 - this.realowner.mins.z - 24);
18 tracebox(locout, this.realowner.mins, this.realowner.maxs, locout, MOVE_NOMONSTERS, this.realowner);
19 locout = trace_endpos;
20
21 makevectors(this.realowner.angles);
22
23 MUTATOR_CALLHOOK(PortalTeleport, this.realowner);
24
25 TeleportPlayer(this, this.realowner, locout, this.realowner.angles, v_forward * vlen(this.realowner.velocity), '0 0 0', '0 0 0', TELEPORT_FLAGS_TELEPORTER);
26}
#define MUTATOR_CALLHOOK(id,...)
Definition base.qh:143
const vector PL_MIN_CONST
Definition constants.qh:56
const vector PL_MAX_CONST
Definition constants.qh:55
const float MOVE_NOMONSTERS
vector trace_endpos
vector v_forward
vector origin
#define move_out_of_solid(e)
Definition common.qh:110
void sprint(float clientnum, string text,...)
float vlen(vector v)
string vtos(vector v)
#define makevectors
Definition post.qh:21
vector
Definition self.qh:92
void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity, vector telefragmin, vector telefragmax, float tflags)
#define TELEPORT_FLAGS_TELEPORTER
entity realowner

References entity(), makevectors, MOVE_NOMONSTERS, move_out_of_solid, MUTATOR_CALLHOOK, origin, PL_MAX_CONST, PL_MIN_CONST, realowner, sprint(), TELEPORT_FLAGS_TELEPORTER, TeleportPlayer(), trace_endpos, v_forward, vector, vlen(), and vtos().

Referenced by nade_boom().

◆ nade_translocate_DestroyDamage()

bool nade_translocate_DestroyDamage ( entity this,
entity attacker )

Definition at line 28 of file translocate.qc.

29{
30 if (STAT(NADE_BONUS_TYPE, this) == NADE_TYPE_TRANSLOCATE.m_id && autocvar_g_nades_translocate_destroy_damage > 0)
31 {
32 Damage(this.realowner, attacker, attacker,
34 DEATH_TOUCHEXPLODE.m_id,
36 this.realowner.origin,
37 '0 0 0'
38 );
39 W_PrepareExplosionByDamage(this, this.realowner, nade_boom); // Don't change the owner
40
41 return true;
42 }
43 return false;
44}
void Damage(entity targ, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
Definition damage.qc:493
#define DMG_NOWEP
Definition damage.qh:104
#define STAT(...)
Definition stats.qh:82
void W_PrepareExplosionByDamage(entity this, entity attacker, void(entity this) explode)
Definition common.qc:87
void nade_boom(entity this)
Definition sv_nades.qc:114
float autocvar_g_nades_translocate_destroy_damage
Definition translocate.qh:7

References autocvar_g_nades_translocate_destroy_damage, Damage(), DMG_NOWEP, entity(), nade_boom(), realowner, STAT, and W_PrepareExplosionByDamage().

Referenced by nade_damage().