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

Go to the source code of this file.

Functions

 SOUND (HellionAttack_FIRE, W_Sound("rocket_fire"))
void turret_hellion_missile_think (entity this)

Variables

float autocvar_g_turrets_unit_hellion_shot_speed_gain
float autocvar_g_turrets_unit_hellion_shot_speed_max

Function Documentation

◆ SOUND()

SOUND ( HellionAttack_FIRE ,
W_Sound("rocket_fire")  )

◆ turret_hellion_missile_think()

void turret_hellion_missile_think ( entity this)

Definition at line 41 of file hellion_weapon.qc.

42{
43 vector olddir,newdir;
44 vector pre_pos;
45 float itime;
46
47 this.nextthink = time + 0.05;
48
49 olddir = normalize(this.velocity);
50
51 if(this.max_health < time)
53
54 // Enemy dead? just keep on the current heading then.
55 if ((this.enemy == NULL) || (IS_DEAD(this.enemy)))
56 {
57
58 // Make sure we dont return to tracking a respawned player
59 this.enemy = NULL;
60
61 // Turn model
62 this.angles = vectoangles(this.velocity);
63
64 if(vdist(this.origin - this.owner.origin, >, (this.owner.shot_radius * 5)))
66
67 // Accelerate
69
71
72 return;
73 }
74
75 // Enemy in range?
76 if(vdist(this.origin - this.enemy.origin, <, this.owner.shot_radius * 0.2))
78
79 // Predict enemy position
80 itime = vlen(this.enemy.origin - this.origin) / vlen(this.velocity);
81 pre_pos = this.enemy.origin + this.enemy.velocity * itime;
82
83 pre_pos = (pre_pos + this.enemy.origin) * 0.5;
84
85 // Find out the direction to that place
86 newdir = normalize(pre_pos - this.origin);
87
88 // Turn
89 newdir = normalize(olddir + newdir * 0.35);
90
91 // Turn model
92 this.angles = vectoangles(this.velocity);
93
94 // Accelerate
96
97 if (itime < 0.05)
99
101}
float max_health
entity owner
Definition main.qh:87
#define IS_DEAD(s)
Definition player.qh:245
vector velocity
float time
float nextthink
vector origin
void UpdateCSQCProjectile(entity e)
ent angles
Definition ent_cs.qc:121
float autocvar_g_turrets_unit_hellion_shot_speed_gain
float autocvar_g_turrets_unit_hellion_shot_speed_max
float vlen(vector v)
vector vectoangles(vector v)
float min(float f,...)
vector normalize(vector v)
#define NULL
Definition post.qh:14
#define setthink(e, f)
vector
Definition self.qh:92
entity enemy
Definition sv_ctf.qh:153
void turret_projectile_explode(entity this)
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
Definition vector.qh:8

References angles, autocvar_g_turrets_unit_hellion_shot_speed_gain, autocvar_g_turrets_unit_hellion_shot_speed_max, enemy, entity(), IS_DEAD, max_health, min(), nextthink, normalize(), NULL, origin, owner, setthink, time, turret_projectile_explode(), UpdateCSQCProjectile(), vdist, vectoangles(), vector, velocity, and vlen().

Variable Documentation

◆ autocvar_g_turrets_unit_hellion_shot_speed_gain

float autocvar_g_turrets_unit_hellion_shot_speed_gain

Definition at line 5 of file hellion_weapon.qc.

Referenced by turret_hellion_missile_think().

◆ autocvar_g_turrets_unit_hellion_shot_speed_max

float autocvar_g_turrets_unit_hellion_shot_speed_max

Definition at line 6 of file hellion_weapon.qc.

Referenced by turret_hellion_missile_think().