4 void() uzi_deselect_01;
9 if (self.ammo_nails >= 1)
14 void(float req) w_uzi =
18 else if (req == WR_FIRE1)
19 weapon_prepareattack(uzi_check, uzi_check, uzi_fire1_01, cvar("g_balance_uzi_refire"));
20 else if (req == WR_FIRE2)
21 weapon_prepareattack(uzi_check, uzi_check, uzi_fire2_01, 0.4);
22 else if (req == WR_RAISE)
24 else if (req == WR_UPDATECOUNTS)
25 self.currentammo = self.ammo_nails;
26 else if (req == WR_DROP)
28 else if (req == WR_SETUP)
29 weapon_setup(WEP_UZI, "w_uzi.zym", IT_NAILS);
30 else if (req == WR_CHECKAMMO)
31 weapon_hasammo = uzi_check();
34 .float uzi_bulletcounter;
35 void W_Uzi_Attack (void)
38 makevectors(self.v_angle);
39 sound (self, CHAN_WEAPON, "weapons/uzi_fire.wav", 1, ATTN_NORM);
41 org = self.origin + self.view_ofs + (v_right * 6) - (v_up * 8) + (v_forward * 15);
42 self.uzi_bulletcounter = self.uzi_bulletcounter + 1;
43 if (self.uzi_bulletcounter >= 4)
44 self.uzi_bulletcounter = 0;
45 fireBullet (org, v_forward, cvar("g_balance_uzi_spread"), cvar("g_balance_uzi_damage"), IT_UZI, self.uzi_bulletcounter == 0);
47 self.punchangle_x = random () - 0.5;
48 self.punchangle_y = random () - 0.5;
49 self.punchangle_z = random () - 0.5;
51 //self.attack_finished = time + 0.2;
52 self.ammo_nails = self.ammo_nails - 0.25;
55 org = self.origin + self.view_ofs + (v_right * 6) - (v_up * 8) + (v_forward * 10);
56 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);
59 void W_Uzi_Attack2 (void)
66 void() uzi_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, uzi_ready_01); self.weaponentity.state = WS_READY;};
67 void() uzi_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');};
68 void() uzi_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);};
71 weapon_doattack(uzi_check, uzi_check, W_Uzi_Attack);
73 weapon_thinkf(WFRAME_FIRE1, 0.05, uzi_fire1_01);
75 weapon_thinkf(WFRAME_FIRE1, 0.05, uzi_ready_01);
79 weapon_doattack(uzi_check, uzi_check, W_Uzi_Attack2);
80 weapon_thinkf(WFRAME_FIRE2, 0.05, uzi_ready_01);