1 #ifndef TURRET_MACHINEGUN_WEAPON_H
2 #define TURRET_MACHINEGUN_WEAPON_H
4 CLASS(MachineGunTurretAttack, PortoLaunch)
5 /* flags */ ATTRIB(MachineGunTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN);
6 /* impulse */ ATTRIB(MachineGunTurretAttack, impulse, int, 9);
7 /* refname */ ATTRIB(MachineGunTurretAttack, netname, string, "turret_machinegun");
8 /* wepname */ ATTRIB(MachineGunTurretAttack, message, string, _("Machinegun"));
9 ENDCLASS(MachineGunTurretAttack)
10 REGISTER_WEAPON(TUR_MACHINEGUN, NEW(MachineGunTurretAttack));
18 void W_MachineGun_MuzzleFlash();
20 METHOD(MachineGunTurretAttack, wr_think, void(entity thiswep, bool fire1, bool fire2))
23 bool isPlayer = IS_PLAYER(self);
25 if (!isPlayer || weapon_prepareattack(false, WEP_CVAR(machinegun, sustained_refire))) {
27 turret_initparams(self);
28 W_SetupShot_Dir(self, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
29 self.tur_shotdir_updated = w_shotdir;
30 self.tur_shotorg = w_shotorg;
32 weapon_thinkf(WFRAME_FIRE1, 0, w_ready);
34 fireBullet (self.tur_shotorg, self.tur_shotdir_updated, self.shot_spread, 0, self.shot_dmg, self.shot_force, DEATH_TURRET_MACHINEGUN, 0);
35 W_MachineGun_MuzzleFlash();
36 setattachment(self.muzzle_flash, self.tur_head, "tag_fire");