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(this, TUR_PHASER)) remove(this); }
29 METHOD(PhaserTurret, tr_think, void(PhaserTurret thistur, entity it))
31 if (it.tur_head.frame != 0)
35 if (it.tur_head.frame == 10)
36 it.tur_head.frame = 1;
38 it.tur_head.frame = it.tur_head.frame +1;
40 else if (it.fireflag == 2 )
42 it.tur_head.frame = it.tur_head.frame +1;
43 if (it.tur_head.frame == 15)
45 it.tur_head.frame = 0;
51 bool turret_phaser_firecheck(entity this);
52 METHOD(PhaserTurret, tr_setup, void(PhaserTurret this, entity it))
54 it.ammo_flags = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE | TFL_AMMO_RECIEVE;
55 it.aim_flags = TFL_AIM_LEAD;
57 it.turret_firecheckfunc = turret_phaser_firecheck;
59 bool turret_phaser_firecheck(entity this)
61 if (this.fireflag != 0) return false;
62 return turret_firecheck(this);