5 void() uzi_deselect_01;
10 if (self.ammo_nails > 0)
15 void(float req) w_uzi =
19 else if (req == WR_FIRE1)
20 weapon_prepareattack(uzi_check, uzi_check, uzi_fire1_01, 0.075);
21 else if (req == WR_FIRE2)
22 weapon_prepareattack(uzi_check, uzi_check, uzi_fire2_01, 0.4);
23 else if (req == WR_FIRE3)
24 weapon_prepareattack(uzi_check, uzi_check, uzi_fire3_01, 0.16);
25 else if (req == WR_RAISE)
27 else if (req == WR_UPDATECOUNTS)
28 self.currentammo = self.ammo_nails;
29 else if (req == WR_DROP)
31 else if (req == WR_SETUP)
32 weapon_setup(WEP_UZI, "w_uzi.zym", IT_SHELLS);
33 else if (req == WR_CHECKAMMO)
34 weapon_hasammo = uzi_check();
37 void W_Uzi_Attack (void)
39 makevectors(self.v_angle);
40 sound (self, CHAN_WEAPON, "weapons/uzi_fire.wav", 1, ATTN_NORM);
42 fireBullet (v_forward, 100, 5, IT_UZI);
44 self.punchangle_x = random () - 0.5;
45 self.punchangle_y = random () - 0.5;
46 self.punchangle_z = random () - 0.5;
48 self.attack_finished = time + 0.075;
49 self.ammo_nails = self.ammo_nails - 1;
51 vector org; // casing code
52 org = self.origin + self.view_ofs + (v_right * 6) - (v_up * 1) + (v_forward * 20);
53 SpawnCasing (org, ((random () * 50 + 50) * v_right) - ((random () * 25 + 25) * v_forward) - ((random () * 5 + 10) * v_up), 2, v_forward,'0 250 0', 100, 2);
54 //W_Smoke(org, v_forward, 12);
57 void W_Uzi_Attack2 (void)
62 makevectors(self.v_angle);
63 sound (self, CHAN_WEAPON, "weapons/shotgun_fire.wav", 1, ATTN_NORM);
66 if (bullets > self.ammo_nails)
67 bullets = self.ammo_nails;
69 sound (self, CHAN_WEAPON, "weapons/uzi_fire_secondary.wav", 1, ATTN_NORM);
71 for (sc = bullets; sc > 0; sc = sc - 1)
72 fireBullet (v_forward, 400, 10, IT_SHOTGUN);
74 self.punchangle_x = -1.5;
76 self.ammo_nails = self.ammo_nails - bullets;
77 self.attack_finished = time + 0.4;
79 vector org; // casing code
80 org = self.origin + self.view_ofs + (v_right * 6) - (v_up * 4) + (v_forward * 15);
81 SpawnCasing (org, ((random () * 50 + 50) * v_right) - ((random () * 25 + 25) * v_forward) - ((random () * 5 + 10) * v_up), 2, v_forward,'0 250 0', 100, 3);
84 void W_Uzi_Attack3 (void)
86 makevectors(self.v_angle);
87 sound (self, CHAN_WEAPON, "weapons/uzi_fire.wav", 1, ATTN_NORM);
89 fireBullet (v_forward, 0, 10, IT_UZI);
91 self.attack_finished = time + 0.16;
92 self.ammo_nails = self.ammo_nails - 1;
94 vector org; // casing code
95 org = self.origin + self.view_ofs + (v_right * 6) - (v_up * 1) + (v_forward * 20);
96 SpawnCasing (org, ((random () * 50 + 50) * v_right) - ((random () * 25 + 25) * v_forward) - ((random () * 5 + 10) * v_up), 2, v_forward,'0 250 0', 100, 2);
100 void() uzi_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, uzi_ready_01); self.weaponentity.state = WS_READY;};
101 void() uzi_select_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');};
102 void() uzi_deselect_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);};
103 void() uzi_fire1_01 =
105 weapon_doattack(uzi_check, uzi_check, W_Uzi_Attack);
107 weapon_thinkf(WFRAME_FIRE1, 0.075, uzi_fire1_01);
109 weapon_thinkf(WFRAME_FIRE1, 0.075, uzi_ready_01);
111 void() uzi_fire2_01 =
113 weapon_doattack(uzi_check, uzi_check, W_Uzi_Attack2);
114 weapon_thinkf(WFRAME_FIRE2, 0.4, uzi_ready_01);
116 void() uzi_fire3_01 =
118 weapon_doattack(uzi_check, uzi_check, W_Uzi_Attack3);
120 weapon_thinkf(WFRAME_FIRE2, 0.16, uzi_fire3_01);
122 weapon_thinkf(WFRAME_FIRE2, 0.1, uzi_ready_01);