2 void W_Shotgun_Attack (void)
11 bullets = cvar("g_balance_shotgun_primary_bullets");
12 d = cvar("g_balance_shotgun_primary_damage");
13 f = cvar("g_balance_shotgun_primary_force");
14 spread = cvar("g_balance_shotgun_primary_spread");
16 W_SetupShot (self, '11 8 -8', TRUE, 5, "weapons/shotgun_fire.wav");
17 for (sc = 0;sc < bullets;sc = sc + 1)
18 fireBullet (w_shotorg, w_shotdir, spread, d, f, IT_SHOTGUN, sc < 3);
19 if (cvar("g_use_ammunition"))
20 self.ammo_shells = self.ammo_shells - cvar("g_balance_shotgun_primary_ammo");
22 pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg + v_forward * 6, v_forward * 1000, cvar("g_balance_shotgun_primary_ammo"));
23 //W_Smoke(w_shotorg + v_forward * 8, v_forward, 12);
24 //te_smallflash(w_shotorg);
27 if (cvar("g_casings") >= 1)
28 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);
30 // muzzle flash for 1st person view
32 setorigin(flash, '53 5 0');
33 setmodel(flash, "models/uziflash.md3"); // precision set below
34 setattachment(flash, self.weaponentity, "bone01");
36 flash.viewmodelforclient = self;
37 flash.customizeentityforclient = CL_Weaponentity_CustomizeEntityForClient;
39 flash.think = SUB_Remove;
40 flash.nextthink = time + 0.06;
41 flash.angles_z = flash.v_angle_z + random() * 180;
43 flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
47 void W_Shotgun_Attack2 (void)
56 bullets = cvar("g_balance_shotgun_secondary_bullets");
57 d = cvar("g_balance_shotgun_secondary_damage");
58 f = cvar("g_balance_shotgun_secondary_force");
59 spread = cvar("g_balance_shotgun_secondary_spread");
61 W_SetupShot (self, '11 8 -8', TRUE, 5, "weapons/shotgun_fire.wav");
62 for (sc = 0;sc < bullets;sc = sc + 1)
63 fireBullet (w_shotorg, w_shotdir, spread, d, f, IT_SHOTGUN, sc < 3);
64 if (cvar("g_use_ammunition"))
65 self.ammo_shells = self.ammo_shells - cvar("g_balance_shotgun_secondary_ammo");
67 pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg + v_forward * 6, v_forward * 1000, cvar("g_balance_shotgun_secondary_ammo"));
68 //W_Smoke(w_shotorg + v_forward * 8, v_forward, 12);
69 //te_smallflash(w_shotorg);
72 if (cvar("g_casings") >= 1)
73 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);
76 setorigin(flash, '53 5 0');
77 setmodel(flash, "models/uziflash.md3"); // precision set below
78 setattachment(flash, self.weaponentity, "bone01");
80 flash.viewmodelforclient = self;
81 flash.customizeentityforclient = CL_Weaponentity_CustomizeEntityForClient;
83 flash.think = SUB_Remove;
84 flash.nextthink = time + 0.06;
85 flash.angles_z = flash.v_angle_z + random() * 180;
87 flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
91 void() shotgun_fire2_03 =
94 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_shotgun_secondary_animtime"), w_ready);
96 void() shotgun_fire2_02 =
99 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_shotgun_secondary_animtime"), shotgun_fire2_03);
102 float(float req) w_shotgun =
105 if(vlen(self.origin-self.enemy.origin)>200)
106 self.button0 = bot_aim(1000000, 0, 0.001, FALSE);
108 self.button3 = bot_aim(1000000, 0, 0.001, FALSE);
109 else if (req == WR_THINK)
112 if (weapon_prepareattack(0, cvar("g_balance_shotgun_primary_refire")))
115 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_shotgun_primary_animtime"), w_ready);
118 if (weapon_prepareattack(1, cvar("g_balance_shotgun_secondary_refire")))
121 weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_shotgun_secondary_animtime"), shotgun_fire2_02);
124 else if (req == WR_PRECACHE)
126 precache_model ("models/uziflash.md3");
127 precache_model ("models/tracer.mdl");
128 precache_model ("models/weapons/g_shotgun.md3");
129 precache_model ("models/weapons/v_shotgun.md3");
130 precache_model ("models/weapons/w_shotgun.zym");
131 precache_sound ("misc/itempickup.wav");
132 precache_sound ("weapons/ric1.wav");
133 precache_sound ("weapons/ric2.wav");
134 precache_sound ("weapons/ric3.wav");
135 precache_sound ("weapons/shotgun_fire.wav");
136 precache_sound ("weapons/tink1.wav");
137 if (cvar("g_casings") >= 1)
138 precache_model ("models/casing_shell.mdl");
140 else if (req == WR_SETUP)
141 weapon_setup(WEP_SHOTGUN, "shotgun", IT_SHELLS);
142 else if (req == WR_CHECKAMMO1)
143 return self.ammo_shells >= cvar("g_balance_shotgun_primary_ammo");
144 else if (req == WR_CHECKAMMO2)
145 return self.ammo_shells >= cvar("g_balance_shotgun_secondary_ammo") * 3;
146 else if (req == WR_REGISTER)
147 weapon_register(WEP_SHOTGUN, min(cvar("g_balance_shotgun_primary_ammo"), cvar("g_balance_shotgun_secondary_ammo")));