2 void W_Shotgun_Attack (void)
9 bullets = cvar("g_balance_shotgun_primary_bullets");
10 d = cvar("g_balance_shotgun_primary_damage");
11 spread = cvar("g_balance_shotgun_primary_spread");
13 W_SetupShot (self, '15 8 -8', TRUE, 5, "weapons/shotgun_fire.ogg");
14 for (sc = 0;sc < bullets;sc = sc + 1)
15 fireBullet (w_shotorg, w_shotdir, spread, d, IT_SHOTGUN, sc < 3);
16 if (cvar("g_use_ammunition"))
17 self.ammo_shells = self.ammo_shells - cvar("g_balance_shotgun_primary_ammo");
19 W_Smoke(w_shotorg, v_forward, 12);
20 //te_smallflash(w_shotorg);
23 if (cvar("g_casings") >= 1)
24 SpawnCasing (w_shotorg, ((random () * 50 + 50) * v_right) - ((random () * 25 + 25) * v_forward) - ((random () * 5 - 30) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 1);
27 void W_Shotgun_Attack2 (void)
34 bullets = cvar("g_balance_shotgun_secondary_bullets");
35 d = cvar("g_balance_shotgun_secondary_damage");
36 spread = cvar("g_balance_shotgun_secondary_spread");
38 W_SetupShot (self, '15 8 -8', TRUE, 5, "weapons/shotgun_fire.ogg");
39 for (sc = 0;sc < bullets;sc = sc + 1)
40 fireBullet (w_shotorg, w_shotdir, spread, d, IT_SHOTGUN, sc < 3);
41 if (cvar("g_use_ammunition"))
42 self.ammo_shells = self.ammo_shells - cvar("g_balance_shotgun_secondary_ammo");
44 W_Smoke(w_shotorg + v_forward * 8, v_forward, 12);
45 //te_smallflash(w_shotorg);
48 if (cvar("g_casings") >= 1)
49 SpawnCasing (w_shotorg, ((random () * 50 + 50) * v_right) - ((random () * 25 + 25) * v_forward) - ((random () * 5 - 30) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 1);
53 void() shotgun_fire2_03 =
56 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_shotgun_secondary_animtime"), w_ready);
58 void() shotgun_fire2_02 =
61 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_shotgun_secondary_animtime"), shotgun_fire2_03);
64 float(float req) w_shotgun =
67 self.button0 = bot_aim(1000000, 0, 0.001, FALSE);
68 else if (req == WR_THINK)
71 if (weapon_prepareattack(0, cvar("g_balance_shotgun_primary_refire")))
74 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_shotgun_primary_animtime"), w_ready);
77 if (weapon_prepareattack(1, cvar("g_balance_shotgun_secondary_refire")))
80 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_shotgun_secondary_animtime"), shotgun_fire2_02);
83 else if (req == WR_SETUP)
84 weapon_setup(WEP_SHOTGUN, "shotgun", IT_SHELLS);
85 else if (req == WR_CHECKAMMO1)
86 return self.ammo_shells >= cvar("g_balance_shotgun_primary_ammo");
87 else if (req == WR_CHECKAMMO2)
88 return self.ammo_shells >= cvar("g_balance_shotgun_secondary_ammo") * 3;