Xonotic
phaser.qc
Go to the documentation of this file.
1 #include "phaser.qh"
2 
3 #ifdef SVQC
4 
5 spawnfunc(turret_phaser) { if (!turret_initialize(this, TUR_PHASER)) delete(this); }
6 
7 .int fireflag;
8 
9 METHOD(PhaserTurret, tr_think, void(PhaserTurret thistur, entity it))
10 {
11  if (it.tur_head.frame != 0)
12  {
13  if (it.fireflag == 1)
14  {
15  if (it.tur_head.frame == 10)
16  it.tur_head.frame = 1;
17  else
18  it.tur_head.frame = it.tur_head.frame +1;
19  }
20  else if (it.fireflag == 2 )
21  {
22  it.tur_head.frame = it.tur_head.frame +1;
23  if (it.tur_head.frame == 15)
24  {
25  it.tur_head.frame = 0;
26  it.fireflag = 0;
27  }
28  }
29  }
30 }
31 bool turret_phaser_firecheck(entity this);
32 METHOD(PhaserTurret, tr_setup, void(PhaserTurret this, entity it))
33 {
35  it.aim_flags = TFL_AIM_LEAD;
36 
37  it.turret_firecheckfunc = turret_phaser_firecheck;
38 }
39 bool turret_phaser_firecheck(entity this)
40 {
41  if (this.fireflag != 0) return false;
42  return turret_firecheck(this);
43 }
44 
45 #endif
entity() spawn
bool turret_initialize(entity this, Turret tur)
spawnfunc(info_player_attacker)
Definition: sv_assault.qc:283
#define METHOD(cname, name, prototype)
Definition: oo.qh:257
const int TFL_AMMO_RECHARGE
Definition: turret.qh:143
const int TFL_AIM_LEAD
Definition: turret.qh:82
bool turret_firecheck(entity this)
const int TFL_AMMO_RECIEVE
Definition: turret.qh:144
const int TFL_AMMO_ENERGY
Definition: turret.qh:140