Xonotic
mlrs.qc
Go to the documentation of this file.
1 #include "mlrs.qh"
2 
3 #ifdef SVQC
4 
5 spawnfunc(turret_mlrs) { if (!turret_initialize(this, TUR_MLRS)) delete(this); }
6 
7 METHOD(MLRSTurret, tr_think, void(MLRSTurret thistur, entity it))
8 {
9  // 0 = full, 6 = empty
10  it.tur_head.frame = bound(0, 6 - floor(0.1 + it.ammo / it.shot_dmg), 6);
11  if(it.tur_head.frame < 0)
12  {
13  LOG_TRACE("ammo:",ftos(it.ammo));
14  LOG_TRACE("shot_dmg:",ftos(it.shot_dmg));
15  }
16 }
17 METHOD(MLRSTurret, tr_setup, void(MLRSTurret this, entity it))
18 {
19  it.ammo_flags = TFL_AMMO_ROCKETS | TFL_AMMO_RECHARGE;
21 
22  it.damage_flags |= TFL_DMG_HEADSHAKE;
23  it.shoot_flags |= TFL_SHOOT_VOLLYALWAYS;
24  it.volly_counter = it.shot_volly;
25 }
26 
27 #endif // SVQC
const int TFL_DMG_HEADSHAKE
Definition: turret.qh:155
const int TFL_AMMO_ROCKETS
Definition: turret.qh:142
entity() spawn
bool turret_initialize(entity this, Turret tur)
const int TFL_SHOOT_VOLLYALWAYS
Definition: turret.qh:112
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
#define LOG_TRACE(...)
Definition: log.qh:81
const int TFL_AIM_SHOTTIMECOMPENSATE
Definition: turret.qh:83