]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/turrets/turret/mlrs.qc
Monsters, turrets, vehicles: move definitions to headers
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / turret / mlrs.qc
1 #include "mlrs.qh"
2
3 #ifdef IMPLEMENTATION
4
5 #ifdef SVQC
6
7 spawnfunc(turret_mlrs) { if (!turret_initialize(this, TUR_MLRS)) delete(this); }
8
9 METHOD(MLRSTurret, tr_think, void(MLRSTurret thistur, entity it))
10 {
11     // 0 = full, 6 = empty
12     it.tur_head.frame = bound(0, 6 - floor(0.1 + it.ammo / it.shot_dmg), 6);
13     if(it.tur_head.frame < 0)
14     {
15         LOG_TRACE("ammo:",ftos(it.ammo));
16         LOG_TRACE("shot_dmg:",ftos(it.shot_dmg));
17     }
18 }
19 METHOD(MLRSTurret, tr_setup, void(MLRSTurret this, entity it))
20 {
21     it.ammo_flags = TFL_AMMO_ROCKETS | TFL_AMMO_RECHARGE;
22     it.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE;
23
24     it.damage_flags |= TFL_DMG_HEADSHAKE;
25     it.shoot_flags  |= TFL_SHOOT_VOLLYALWAYS;
26     it.volly_counter = it.shot_volly;
27 }
28
29 #endif // SVQC
30 #endif