4 #include "mlrs_weapon.qh"
6 CLASS(MLRSTurret, Turret)
7 /* spawnflags */ ATTRIB(MLRSTurret, spawnflags, int, TUR_FLAG_SPLASH | TUR_FLAG_MEDPROJ | TUR_FLAG_PLAYER);
8 /* mins */ ATTRIB(MLRSTurret, mins, vector, '-32 -32 0');
9 /* maxs */ ATTRIB(MLRSTurret, maxs, vector, '32 32 64');
10 /* modelname */ ATTRIB(MLRSTurret, mdl, string, "base.md3");
11 /* model */ ATTRIB_STRZONE(MLRSTurret, model, string, strcat("models/turrets/", this.mdl));
12 /* head_model */ ATTRIB_STRZONE(MLRSTurret, head_model, string, strcat("models/turrets/", "mlrs.md3"));
13 /* netname */ ATTRIB(MLRSTurret, netname, string, "mlrs");
14 /* fullname */ ATTRIB(MLRSTurret, turret_name, string, _("MLRS Turret"));
15 ATTRIB(MLRSTurret, m_weapon, Weapon, WEP_TUR_MLRS);
17 REGISTER_TURRET(MLRS, NEW(MLRSTurret));
25 spawnfunc(turret_mlrs) { if (!turret_initialize(this, TUR_MLRS)) remove(this); }
27 METHOD(MLRSTurret, tr_think, void(MLRSTurret thistur, entity it))
29 // 0 = full, 6 = empty
30 it.tur_head.frame = bound(0, 6 - floor(0.1 + it.ammo / it.shot_dmg), 6);
31 if(it.tur_head.frame < 0)
33 LOG_TRACE("ammo:",ftos(it.ammo),"\n");
34 LOG_TRACE("shot_dmg:",ftos(it.shot_dmg),"\n");
37 METHOD(MLRSTurret, tr_setup, void(MLRSTurret this, entity it))
39 it.ammo_flags = TFL_AMMO_ROCKETS | TFL_AMMO_RECHARGE;
40 it.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE;
42 it.damage_flags |= TFL_DMG_HEADSHAKE;
43 it.shoot_flags |= TFL_SHOOT_VOLLYALWAYS;
44 it.volly_counter = it.shot_volly;