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 | WEP_FLAG_MUTATORBLOCKED);
6 /* impulse */ ATTRIB(PlasmaAttack, impulse, int, 5);
7 /* refname */ ATTRIB(PlasmaAttack, netname, string, "turret_plasma");
8 /* wepname */ ATTRIB(PlasmaAttack, m_name, string, _("Plasma"));
10 REGISTER_WEAPON(PLASMA, NEW(PlasmaAttack));
18 METHOD(PlasmaAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
19 bool isPlayer = IS_PLAYER(actor);
21 if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(electro, refire))) {
23 turret_initparams(actor);
24 W_SetupShot_Dir(actor, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
25 actor.tur_shotdir_updated = w_shotdir;
26 actor.tur_shotorg = w_shotorg;
27 actor.tur_head = actor;
28 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready);
30 entity missile = turret_projectile(SND(HAGAR_FIRE), 1, 0, DEATH_TURRET_PLASMA.m_id, PROJECTILE_ELECTRO_BEAM, true, true);
31 missile.missile_flags = MIF_SPLASH;
32 Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, actor.tur_shotorg, actor.tur_shotdir_updated * 1000, 1);