1 #ifndef TURRET_PHASER_H
2 #define TURRET_PHASER_H
4 #include "phaser_weapon.qh"
6 CLASS(PhaserTurret, Turret)
7 /* spawnflags */ ATTRIB(PhaserTurret, spawnflags, int, TUR_FLAG_SNIPER | TUR_FLAG_HITSCAN | TUR_FLAG_PLAYER);
8 /* mins */ ATTRIB(PhaserTurret, mins, vector, '-32 -32 0');
9 /* maxs */ ATTRIB(PhaserTurret, maxs, vector, '32 32 64');
10 /* modelname */ ATTRIB(PhaserTurret, mdl, string, "base.md3");
11 /* model */ ATTRIB_STRZONE(PhaserTurret, model, string, strcat("models/turrets/", this.mdl));
12 /* head_model */ ATTRIB_STRZONE(PhaserTurret, head_model, string, strcat("models/turrets/", "phaser.md3"));
13 /* netname */ ATTRIB(PhaserTurret, netname, string, "phaser");
14 /* fullname */ ATTRIB(PhaserTurret, turret_name, string, _("Phaser Cannon"));
15 ATTRIB(PhaserTurret, m_weapon, Weapon, WEP_PHASER);
16 ENDCLASS(PhaserTurret)
17 REGISTER_TURRET(PHASER, NEW(PhaserTurret));
25 spawnfunc(turret_phaser) { if (!turret_initialize(TUR_PHASER)) remove(this); }
29 METHOD(PhaserTurret, tr_think, void(PhaserTurret thistur, entity it))
32 if (self.tur_head.frame != 0)
34 if (self.fireflag == 1)
36 if (self.tur_head.frame == 10)
37 self.tur_head.frame = 1;
39 self.tur_head.frame = self.tur_head.frame +1;
41 else if (self.fireflag == 2 )
43 self.tur_head.frame = self.tur_head.frame +1;
44 if (self.tur_head.frame == 15)
46 self.tur_head.frame = 0;
52 float turret_phaser_firecheck();
53 METHOD(PhaserTurret, tr_setup, void(PhaserTurret this, entity it))
55 it.ammo_flags = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE | TFL_AMMO_RECIEVE;
56 it.aim_flags = TFL_AIM_LEAD;
58 it.turret_firecheckfunc = turret_phaser_firecheck;
60 float turret_phaser_firecheck()
63 if (self.fireflag != 0) return 0;
64 return turret_firecheck();