3 void() uzi_deselect_01;
8 if (self.ammo_nails >= 1)
13 void(float req) w_uzi =
17 else if (req == WR_FIRE1 || req == WR_FIRE2)
18 weapon_prepareattack(uzi_check, uzi_check, uzi_fire1_01, cvar("g_balance_uzi_refire"));
19 else if (req == WR_RAISE)
21 else if (req == WR_UPDATECOUNTS)
22 self.currentammo = self.ammo_nails;
23 else if (req == WR_DROP)
25 else if (req == WR_SETUP)
26 weapon_setup(WEP_UZI, "w_uzi.zym", IT_NAILS);
27 else if (req == WR_CHECKAMMO)
28 weapon_hasammo = uzi_check();
31 .float uzi_bulletcounter;
32 void W_Uzi_Attack (void)
38 org = self.origin + self.view_ofs;
39 end = self.origin + self.view_ofs + v_forward * 4096;
40 traceline(org,end,TRUE,self);
42 trueaim = trace_endpos;
45 sound (self, CHAN_WEAPON, "weapons/uzi_fire.ogg", 1, ATTN_NORM);
46 if (self.items & IT_STRENGTH) {
47 sound (self, CHAN_AUTO, "weapons/strength_fire.ogg", 1, ATTN_NORM);
50 if (cvar("g_use_ammunition"))
51 self.ammo_nails = self.ammo_nails - 1;
52 self.punchangle_x = random () - 0.5;
53 self.punchangle_y = random () - 0.5;
54 org = self.origin + self.view_ofs + (v_right * 6) - (v_up * 8) + (v_forward * 15);
56 // this attack_finished just enforces a cooldown at the end of a burst
57 self.attack_finished = time + cvar("g_balance_uzi_refire2");
59 if (self.uzi_bulletcounter == 1)
60 fireBullet (org, normalize(trueaim - org), cvar("g_balance_uzi_spread2"), cvar("g_balance_uzi_damage2"), IT_UZI, (self.uzi_bulletcounter & 3) == 0);
62 fireBullet (org, normalize(trueaim - org), cvar("g_balance_uzi_spread"), cvar("g_balance_uzi_damage"), IT_UZI, (self.uzi_bulletcounter & 3) == 0);
65 if (cvar("g_casings") >= 2)
67 org = self.origin + self.view_ofs + (v_right * 6) - (v_up * 8) + (v_forward * 10);
68 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);
72 org = self.origin + self.view_ofs + (v_right * 6) - (v_up * 10) + (v_forward * 40);
73 setorigin (flash, org);
74 setmodel (flash, "models/uziflash.md3");
75 flash.velocity = v_forward * 20;
76 flash.angles = vectoangles (flash.velocity);
77 flash.angles_z=flash.v_angle_z + random () * 180;
80 SUB_SetFade (flash, time, 0.2);
81 flash.effects = flash.effects | EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
86 void() uzi_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, uzi_ready_01); self.weaponentity.state = WS_READY;};
87 void() uzi_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');};
88 void() uzi_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);};
93 self.uzi_bulletcounter = self.uzi_bulletcounter + 1;
94 weapon_doattack(uzi_check, uzi_check, W_Uzi_Attack);
95 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_uzi_refire"), uzi_fire1_02);
98 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_uzi_refire"), uzi_ready_01);
100 void() uzi_fire1_01 =
102 self.uzi_bulletcounter = 1;
103 weapon_doattack(uzi_check, uzi_check, W_Uzi_Attack);
104 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_uzi_refire"), uzi_fire1_02);