1 #ifndef TURRET_WALKER_WEAPON_H
2 #define TURRET_WALKER_WEAPON_H
4 CLASS(WalkerTurretAttack, PortoLaunch)
5 /* flags */ ATTRIB(WalkerTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
6 /* impulse */ ATTRIB(WalkerTurretAttack, impulse, int, 5);
7 /* refname */ ATTRIB(WalkerTurretAttack, netname, string, "turret_walker");
8 /* wepname */ ATTRIB(WalkerTurretAttack, message, string, _("Walker"));
9 ENDCLASS(WalkerTurretAttack)
10 REGISTER_WEAPON(WALKER, NEW(WalkerTurretAttack));
18 METHOD(WalkerTurretAttack, wr_think, void(entity thiswep, entity actor, int slot, int fire)) {
19 bool isPlayer = IS_PLAYER(actor);
21 if (!isPlayer || weapon_prepareattack(thiswep, actor, 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, WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready);
30 sound (actor, CH_WEAPON_A, SND_UZI_FIRE, VOL_BASE, ATTEN_NORM);
31 fireBullet (actor.tur_shotorg, actor.tur_shotdir_updated, actor.shot_spread, 0, actor.shot_dmg, actor.shot_force, DEATH_TURRET_WALK_GUN.m_id, 0);
32 Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, actor.tur_shotorg, actor.tur_shotdir_updated * 1000, 1);