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

61{
62 entity actor = this.realowner;
63 if (time > this.cnt || IS_DEAD(actor))
64 {
65 actor.attack_finished_single[0] = time + actor.shot_refire;
66 actor.fireflag = 2;
67 actor.tur_head.frame = 10;
68 sound(this, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM);
69 delete(this);
70 return;
71 }
72
73 turret_do_updates(actor);
74
75 if (time - this.shot_spread > 0)
76 {
77 this.shot_spread = time + 2;
78 sound(this, CH_SHOTS_SINGLE, SND_TUR_PHASER, VOL_BASE, ATTEN_NORM);
79 }
80
81 this.nextthink = time;
82
83 actor.attack_finished_single[0] = time + frametime;
84 FireImoBeam(actor, actor.tur_shotorg,
85 actor.tur_shotorg + actor.tur_shotdir_updated * actor.target_range,
86 '-1 -1 -1' * actor.shot_radius,
87 '1 1 1' * actor.shot_radius,
88 actor.shot_force,
89 this.shot_dmg,
90 0.75,
91 DEATH_TURRET_PHASER.m_id
92 );
94}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float cnt
Definition powerups.qc:24
#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
vector WarpZone_UnTransformOrigin(entity wz, vector org)
Transforms origin org backwards through warpzone wz, as the inverse of WarpZone_TransformOrigin.
Definition common.qc:526
entity WarpZone_trace_transform
Transform accumulator during a trace.
Definition common.qh:40
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.
entity realowner

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

◆ 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.