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