1 #ifndef TURRET_PLASMA_WEAPON_H
2 #define TURRET_PLASMA_WEAPON_H
4 CLASS(PlasmaAttack, PortoLaunch)
5 /* flags */ ATTRIB(PlasmaAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN);
6 /* impulse */ ATTRIB(PlasmaAttack, impulse, int, 5);
7 /* refname */ ATTRIB(PlasmaAttack, netname, string, "turret_plasma");
8 /* wepname */ ATTRIB(PlasmaAttack, message, string, _("Plasma"));
10 REGISTER_WEAPON(PLASMA, NEW(PlasmaAttack));
18 METHOD(PlasmaAttack, wr_think, void(entity thiswep, bool fire1, bool fire2)) {
20 bool isPlayer = IS_PLAYER(self);
22 if (!isPlayer || weapon_prepareattack(false, WEP_CVAR_PRI(electro, refire))) {
24 turret_initparams(self);
25 W_SetupShot_Dir(self, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
26 self.tur_shotdir_updated = w_shotdir;
27 self.tur_shotorg = w_shotorg;
29 weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready);
31 entity missile = turret_projectile(SND(HAGAR_FIRE), 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, true, true);
32 missile.missile_flags = MIF_SPLASH;
33 Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);