2 void W_Shotgun_Attack (void)
10 bullets = cvar("g_balance_shotgun_primary_bullets");
11 d = cvar("g_balance_shotgun_primary_damage");
12 f = cvar("g_balance_shotgun_primary_force");
13 spread = cvar("g_balance_shotgun_primary_spread");
15 W_SetupShot (self, '11 8 -8', TRUE, 5, "weapons/shotgun_fire.wav");
16 for (sc = 0;sc < bullets;sc = sc + 1)
17 fireBullet (w_shotorg, w_shotdir, spread, d, f, IT_SHOTGUN, sc < 3);
18 if (cvar("g_use_ammunition"))
19 self.ammo_shells = self.ammo_shells - cvar("g_balance_shotgun_primary_ammo");
21 W_Smoke(w_shotorg + v_forward * 8, v_forward, 12);
22 //te_smallflash(w_shotorg);
25 if (cvar("g_casings") >= 1)
26 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);
29 void W_Shotgun_Attack2 (void)
37 bullets = cvar("g_balance_shotgun_secondary_bullets");
38 d = cvar("g_balance_shotgun_secondary_damage");
39 f = cvar("g_balance_shotgun_secondary_force");
40 spread = cvar("g_balance_shotgun_secondary_spread");
42 W_SetupShot (self, '11 8 -8', TRUE, 5, "weapons/shotgun_fire.wav");
43 for (sc = 0;sc < bullets;sc = sc + 1)
44 fireBullet (w_shotorg, w_shotdir, spread, d, f, IT_SHOTGUN, sc < 3);
45 if (cvar("g_use_ammunition"))
46 self.ammo_shells = self.ammo_shells - cvar("g_balance_shotgun_secondary_ammo");
48 W_Smoke(w_shotorg + v_forward * 8, v_forward, 12);
49 //te_smallflash(w_shotorg);
52 if (cvar("g_casings") >= 1)
53 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);
57 void() shotgun_fire2_03 =
60 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_shotgun_secondary_animtime"), w_ready);
62 void() shotgun_fire2_02 =
65 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_shotgun_secondary_animtime"), shotgun_fire2_03);
68 float(float req) w_shotgun =
71 if(vlen(self.origin-self.enemy.origin)>200)
72 self.button0 = bot_aim(1000000, 0, 0.001, FALSE);
74 self.button3 = bot_aim(1000000, 0, 0.001, FALSE);
75 else if (req == WR_THINK)
78 if (weapon_prepareattack(0, cvar("g_balance_shotgun_primary_refire")))
81 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_shotgun_primary_animtime"), w_ready);
84 if (weapon_prepareattack(1, cvar("g_balance_shotgun_secondary_refire")))
87 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_shotgun_secondary_animtime"), shotgun_fire2_02);
90 else if (req == WR_PRECACHE)
92 precache_model ("models/tracer.mdl");
93 precache_model ("models/weapons/g_shotgun.md3");
94 precache_model ("models/weapons/v_shotgun.md3");
95 precache_model ("models/weapons/w_shotgun.zym");
96 precache_sound ("misc/itempickup.wav");
97 precache_sound ("weapons/ric1.wav");
98 precache_sound ("weapons/ric2.wav");
99 precache_sound ("weapons/ric3.wav");
100 precache_sound ("weapons/shotgun_fire.wav");
101 precache_sound ("weapons/tink1.wav");
102 if (cvar("g_casings") >= 1)
103 precache_model ("models/casing_shell.mdl");
105 else if (req == WR_SETUP)
106 weapon_setup(WEP_SHOTGUN, "shotgun", IT_SHELLS);
107 else if (req == WR_CHECKAMMO1)
108 return self.ammo_shells >= cvar("g_balance_shotgun_primary_ammo");
109 else if (req == WR_CHECKAMMO2)
110 return self.ammo_shells >= cvar("g_balance_shotgun_secondary_ammo") * 3;
111 else if (req == WR_REGISTER)
112 weapon_register(WEP_SHOTGUN, min(cvar("g_balance_shotgun_primary_ammo"), cvar("g_balance_shotgun_secondary_ammo")));