]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/tturrets/units/unit_machinegun.qc
Merge remote branch 'remotes/origin/terencehill/newpanelhud-dom_points' into terenceh...
[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, cvar("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 (cvar("g_antilag_bullets"))
29                 self.turrcaps_flags |= TFL_TURRCAPS_HITSCAN;
30
31     if (turret_stdproc_init("machinegun_std",0,"models/turrets/base.md3","models/turrets/machinegun.md3") == 0)
32     {
33         remove(self);
34         return;
35     }
36
37     self.damage_flags |= TFL_DMG_HEADSHAKE;
38
39     if (!turret_tag_fire_update())
40         dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
41
42     // Our fire routine
43     self.turret_firefunc  = turret_machinegun_attack;
44
45 }
46
47
48 /*QUAKED turret_machinegun (0 .5 .8) ?
49 * machinegun turret. does what you'd expect
50 */
51 void spawnfunc_turret_machinegun()
52 {
53     precache_model ("models/turrets/machinegun.md3");
54     precache_model ("models/turrets/base.md3");
55     precache_sound ("weapons/uzi_fire.wav");
56
57     self.think = turret_machinegun_std_init;
58     self.nextthink = time + 0.5;
59 }
60