Merge branch 'master' into Mario/turrets
[xonotic/xonotic-data.pk3dir.git] /
1 void spawnfunc_turret_machinegun();
2 void turret_machinegun_std_init();
3 void turret_machinegun_attack();
4
5 //.float bulletcounter;
6 void turret_machinegun_attack()
7 {
8     fireBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, 0, self.shot_dmg, self.shot_force, DEATH_TURRET_MACHINEGUN, 0);
9
10     W_MachineGun_MuzzleFlash(); // WEAPONTODO
11     setattachment(self.muzzle_flash, self.tur_head, "tag_fire");
12 }
13
14
15 void turret_machinegun_std_init()
16 {
17     if (self.netname == "")      self.netname     = "Machinegun Turret";
18
19     self.ammo_flags = TFL_AMMO_BULLETS | TFL_AMMO_RECHARGE | TFL_AMMO_RECIVE;
20     self.turrcaps_flags = TFL_TURRCAPS_PLAYERKILL;
21     self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE;
22
23     self.turrcaps_flags |= TFL_TURRCAPS_HITSCAN;
24
25     if (turret_stdproc_init("machinegun_std", "models/turrets/base.md3", "models/turrets/machinegun.md3", TID_MACHINEGUN) == 0)
26     {
27         remove(self);
28         return;
29     }
30
31     self.damage_flags |= TFL_DMG_HEADSHAKE;
32         self.target_select_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK;
33
34     // Our fire routine
35     self.turret_firefunc  = turret_machinegun_attack;
36
37 }
38
39
40 /*QUAKED turret_machinegun (0 .5 .8) ?
41 * machinegun turret. does what you'd expect
42 */
43 void spawnfunc_turret_machinegun()
44 {
45     precache_model ("models/turrets/machinegun.md3");
46     precache_model ("models/turrets/base.md3");
47     precache_sound ("weapons/uzi_fire.wav");
48
49     self.think = turret_machinegun_std_init;
50     self.nextthink = time + 0.5;
51 }
52