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 54 of file phaser_weapon.qc.

55{
56 entity actor = this.owner;
57 if ((time > this.cnt) || (IS_DEAD(actor)))
58 {
59 actor.attack_finished_single[0] = time + actor.shot_refire;
60 actor.fireflag = 2;
61 actor.tur_head.frame = 10;
62 sound (this, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM);
63 delete(this);
64 return;
65 }
66
67 turret_do_updates(actor);
68
69 if (time - this.shot_spread > 0)
70 {
71 this.shot_spread = time + 2;
72 sound (this, CH_SHOTS_SINGLE, SND_TUR_PHASER, VOL_BASE, ATTEN_NORM);
73 }
74
75 this.nextthink = time;
76
77 actor.attack_finished_single[0] = time + frametime;
78 FireImoBeam ( actor, actor.tur_shotorg,
79 actor.tur_shotorg + actor.tur_shotdir_updated * actor.target_range,
80 '-1 -1 -1' * actor.shot_radius,
81 '1 1 1' * actor.shot_radius,
82 actor.shot_force,
83 this.shot_dmg,
84 0.75,
85 DEATH_TURRET_PHASER.m_id);
86 this.scale = vlen(actor.tur_shotorg - trace_endpos) / 256;
87}
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:245
void FireImoBeam(entity this, vector start, vector end, vector smin, vector smax, float bforce, float f_dmg, float f_velfactor, int deathtype)
Definition util.qc:27
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 6 of file phaser_weapon.qc.