1 #ifndef TURRET_EWHEEL_WEAPON_H
2 #define TURRET_EWHEEL_WEAPON_H
4 CLASS(EWheelAttack, PortoLaunch)
5 /* flags */ ATTRIB(EWheelAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
6 /* impulse */ ATTRIB(EWheelAttack, impulse, int, 5);
7 /* refname */ ATTRIB(EWheelAttack, netname, string, "turret_ewheel");
8 /* wepname */ ATTRIB(EWheelAttack, m_name, string, _("eWheel"));
10 REGISTER_WEAPON(EWHEEL, NEW(EWheelAttack));
18 void turret_initparams(entity);
19 SOUND(EWheelAttack_FIRE, W_Sound("electro_fire"));
20 METHOD(EWheelAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
21 bool isPlayer = IS_PLAYER(actor);
23 if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(electro, refire))) {
25 turret_initparams(actor);
26 W_SetupShot_Dir(actor, v_forward, false, 0, SND_EWheelAttack_FIRE, CH_WEAPON_B, 0);
27 actor.tur_shotdir_updated = w_shotdir;
28 actor.tur_shotorg = w_shotorg;
29 actor.tur_head = actor;
30 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready);
33 turret_do_updates(actor);
35 entity missile = turret_projectile(SND_LASERGUN_FIRE, 1, 0, DEATH_TURRET_EWHEEL.m_id, PROJECTILE_BLASTER, true, true);
36 missile.missile_flags = MIF_SPLASH;
38 Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, actor.tur_shotorg, actor.tur_shotdir_updated * 1000, 1);
41 actor.tur_head.frame += 2;
43 if (actor.tur_head.frame > 3)
44 actor.tur_head.frame = 0;