]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/tturrets/units/unit_machinegun.qc
230dc76275f4903c2b8f0b4b8a8ba646f4b615bb
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / tturrets / units / unit_machinegun.qc
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     sound (self, CHAN_WEAPON, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
9     fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET, 0, 1, autocvar_g_balance_uzi_bulletconstant);
10     endFireBallisticBullet();
11
12     //w_deathtypestring = "had an alergic reaction due to 10 kilos of led";
13     te_smallflash(self.tur_shotorg);
14
15     UziFlash();
16     setattachment(self.muzzle_flash, self.tur_head, "tag_fire");
17 }
18
19
20 void turret_machinegun_std_init()
21 {
22     if (self.netname == "")      self.netname     = "Machinegun Turret";
23
24     self.ammo_flags = TFL_AMMO_BULLETS | TFL_AMMO_RECHARGE | TFL_AMMO_RECIVE;
25     self.turrcaps_flags = TFL_TURRCAPS_PLAYERKILL;
26     self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE;
27     
28         if not (autocvar_g_antilag_bullets)
29                 self.turrcaps_flags |= TFL_TURRCAPS_HITSCAN;
30
31     if (turret_stdproc_init("machinegun_std", "models/turrets/base.md3", "models/turrets/machinegun.md3", TID_MACHINEGUN) == 0)
32     {
33         remove(self);
34         return;
35     }
36
37     self.damage_flags |= TFL_DMG_HEADSHAKE;
38
39     // Our fire routine
40     self.turret_firefunc  = turret_machinegun_attack;
41
42 }
43
44
45 /*QUAKED turret_machinegun (0 .5 .8) ?
46 * machinegun turret. does what you'd expect
47 */
48 void spawnfunc_turret_machinegun()
49 {
50     precache_model ("models/turrets/machinegun.md3");
51     precache_model ("models/turrets/base.md3");
52     precache_sound ("weapons/uzi_fire.wav");
53
54     self.think = turret_machinegun_std_init;
55     self.nextthink = time + 0.5;
56 }
57