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 46 of file hellion_weapon.qc.

47{
48 this.nextthink = time + 0.05;
49
50 vector newdir, olddir = normalize(this.velocity);
51
52 if (this.max_health < time)
54
55 // Enemy dead? just keep on the current heading then.
56 if (this.enemy == NULL || IS_DEAD(this.enemy))
57 {
58
59 // Make sure we dont return to tracking a respawned player
60 this.enemy = NULL;
61
62 // Turn model
63 this.angles = vectoangles(this.velocity);
64
65 if (vdist(this.origin - this.owner.origin, >, (this.owner.shot_radius * 5)))
67
68 // Accelerate
70
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 float itime = vlen(this.enemy.origin - this.origin) / vlen(this.velocity);
81 vector 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 // Turn
88 newdir = normalize(olddir + newdir * 0.35);
89 // Turn model
90 this.angles = vectoangles(this.velocity);
91
92 // Accelerate
94
95 if (itime < 0.05)
97
99}
float max_health
entity owner
Definition main.qh:87
#define IS_DEAD(s)
Definition player.qh:244
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().