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

Go to the source code of this file.

Functions

void beam_think (entity this)
 SOUND (PhaserTurretAttack_FIRE, W_Sound("electro_fire"))
 SOUND (PhaserTurretAttack_IMPACT, W_Sound("neximpact"))

Variables

int fireflag

Function Documentation

◆ beam_think()

void beam_think ( entity this)

Definition at line 56 of file phaser_weapon.qc.

57{
58 entity actor = this.owner;
59 if (time > this.cnt || IS_DEAD(actor))
60 {
61 actor.attack_finished_single[0] = time + actor.shot_refire;
62 actor.fireflag = 2;
63 actor.tur_head.frame = 10;
64 sound(this, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM);
65 delete(this);
66 return;
67 }
68
69 turret_do_updates(actor);
70
71 if (time - this.shot_spread > 0)
72 {
73 this.shot_spread = time + 2;
74 sound(this, CH_SHOTS_SINGLE, SND_TUR_PHASER, VOL_BASE, ATTEN_NORM);
75 }
76
77 this.nextthink = time;
78
79 actor.attack_finished_single[0] = time + frametime;
80 FireImoBeam(actor, actor.tur_shotorg,
81 actor.tur_shotorg + actor.tur_shotdir_updated * actor.target_range,
82 '-1 -1 -1' * actor.shot_radius,
83 '1 1 1' * actor.shot_radius,
84 actor.shot_force,
85 this.shot_dmg,
86 0.75,
87 DEATH_TURRET_PHASER.m_id
88 );
89 this.scale = vlen(actor.tur_shotorg - trace_endpos) / 256;
90}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float cnt
Definition powerups.qc:24
entity owner
Definition main.qh:87
#define IS_DEAD(s)
Definition player.qh:244
void FireImoBeam(entity this, vector start, vector end, vector smin, vector smax, float bforce, float f_dmg, float f_velfactor, int deathtype)
Railgun-like beam, but has thickness and suppots slowing of target.
Definition util.qc:25
float frametime
float time
vector trace_endpos
float nextthink
float vlen(vector v)
float scale
Definition projectile.qc:14
const float VOL_BASE
Definition sound.qh:36
const int CH_SHOTS_SINGLE
Definition sound.qh:15
const float ATTEN_NORM
Definition sound.qh:30
#define sound(e, c, s, v, a)
Definition sound.qh:52
void turret_do_updates(entity t_turret)
updates enemy distances, predicted impact point/time and updated aim<->predict impact distance.

References ATTEN_NORM, CH_SHOTS_SINGLE, cnt, entity(), FireImoBeam(), frametime, IS_DEAD, nextthink, owner, scale, sound, time, trace_endpos, turret_do_updates(), vlen(), and VOL_BASE.

◆ SOUND() [1/2]

SOUND ( PhaserTurretAttack_FIRE ,
W_Sound("electro_fire")  )

◆ SOUND() [2/2]

SOUND ( PhaserTurretAttack_IMPACT ,
W_Sound("neximpact")  )

Variable Documentation

◆ fireflag

int fireflag

Definition at line 7 of file phaser_weapon.qc.