1 #ifndef TURRET_MLRS_WEAPON_H
2 #define TURRET_MLRS_WEAPON_H
4 CLASS(MLRSTurretAttack, PortoLaunch)
5 /* flags */ ATTRIB(MLRSTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN);
6 /* impulse */ ATTRIB(MLRSTurretAttack, impulse, int, 9);
7 /* refname */ ATTRIB(MLRSTurretAttack, netname, string, "turret_mlrs");
8 /* wepname */ ATTRIB(MLRSTurretAttack, message, string, _("MLRS"));
9 ENDCLASS(MLRSTurretAttack)
10 REGISTER_WEAPON(TUR_MLRS, NEW(MLRSTurretAttack));
18 METHOD(MLRSTurretAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2))
21 bool isPlayer = IS_PLAYER(self);
23 if (!isPlayer || weapon_prepareattack(false, WEP_CVAR(machinegun, sustained_refire))) {
25 turret_initparams(self);
26 W_SetupShot_Dir(self, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
27 self.tur_shotdir_updated = w_shotdir;
28 self.tur_shotorg = w_shotorg;
30 self.shot_radius = 500;
31 weapon_thinkf(WFRAME_FIRE1, 0, w_ready);
33 turret_tag_fire_update();
34 entity missile = turret_projectile(SND(ROCKET_FIRE), 6, 10, DEATH_TURRET_MLRS, PROJECTILE_ROCKET, TRUE, TRUE);
35 missile.nextthink = time + max(self.tur_impacttime,(self.shot_radius * 2) / self.shot_speed);
36 missile.missile_flags = MIF_SPLASH;
37 te_explosion (missile.origin);