W_DecreaseAmmo(WEP_CVAR_PRI(shotgun, ammo));
- W_SetupShot(self, true, 5, W_Sound("shotgun_fire"), ((isprimary) ? CH_WEAPON_A : CH_WEAPON_SINGLE), WEP_CVAR_PRI(shotgun, damage) * WEP_CVAR_PRI(shotgun, bullets));
+ W_SetupShot(self, true, 5, SND(SHOTGUN_FIRE), ((isprimary) ? CH_WEAPON_A : CH_WEAPON_SINGLE), WEP_CVAR_PRI(shotgun, damage) * WEP_CVAR_PRI(shotgun, bullets));
for(sc = 0;sc < WEP_CVAR_PRI(shotgun, bullets);sc = sc + 1)
fireBullet(w_shotorg, w_shotdir, WEP_CVAR_PRI(shotgun, spread), WEP_CVAR_PRI(shotgun, solidpenetration), WEP_CVAR_PRI(shotgun, damage), WEP_CVAR_PRI(shotgun, force), WEP_SHOTGUN.m_id, 0);
// muzzle flash for 1st person view
flash = spawn();
- setmodel(flash, "models/uziflash.md3"); // precision set below
+ setmodel(flash, MDL_SHOTGUN_MUZZLEFLASH); // precision set below
flash.think = SUB_Remove;
flash.nextthink = time + 0.06;
flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
void W_Shotgun_Attack2(void)
{SELFPARAM();
- sound(self, CH_WEAPON_A, W_Sound("shotgun_melee"), VOL_BASE, ATTEN_NORM);
+ sound(self, CH_WEAPON_A, SND_SHOTGUN_MELEE, VOL_BASE, ATTEN_NORM);
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(shotgun, animtime), w_ready);
entity meleetemp;
// alternate secondary weapon frames
void W_Shotgun_Attack3_Frame2()
{SELFPARAM();
- if (!WEP_ACTION(self.weapon, WR_CHECKAMMO2))
+ if (!_WEP_ACTION(self.weapon, WR_CHECKAMMO2))
if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
{
W_SwitchWeapon_Force(self, w_getbestweapon(self));
return;
}
- sound(self, CH_WEAPON_SINGLE, "misc/null.wav", VOL_BASE, ATTN_NORM); // kill previous sound
+ sound(self, CH_WEAPON_SINGLE, SND_Null, VOL_BASE, ATTN_NORM); // kill previous sound
W_Shotgun_Attack(true); // actually is secondary, but we trick the last shot into playing full reload sound
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_SEC(shotgun, alt_animtime), w_ready);
}
void W_Shotgun_Attack3_Frame1()
{SELFPARAM();
- if (!WEP_ACTION(self.weapon, WR_CHECKAMMO2))
+ if (!_WEP_ACTION(self.weapon, WR_CHECKAMMO2))
if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
{
W_SwitchWeapon_Force(self, w_getbestweapon(self));
.float shotgun_primarytime;
-float W_Shotgun(float req)
+float W_Shotgun(entity thiswep, float req)
{SELFPARAM();
float ammo_amount;
switch(req)
{
// don't force reload an empty shotgun if its melee attack is active
if(WEP_CVAR(shotgun, secondary) < 2)
- WEP_ACTION(self.weapon, WR_RELOAD);
+ _WEP_ACTION(self.weapon, WR_RELOAD);
}
else
{
}
case WR_INIT:
{
- precache_model("models/uziflash.md3");
- precache_model(W_Model("g_shotgun.md3"));
- precache_model(W_Model("v_shotgun.md3"));
- precache_model(W_Model("h_shotgun.iqm"));
- precache_sound("misc/itempickup.wav");
- precache_sound(W_Sound("shotgun_fire"));
- precache_sound(W_Sound("shotgun_melee"));
SHOTGUN_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
return true;
}
}
case WR_RELOAD:
{
- W_Reload(WEP_CVAR_PRI(shotgun, ammo), W_Sound("reload")); // WEAPONTODO
+ W_Reload(WEP_CVAR_PRI(shotgun, ammo), SND(RELOAD)); // WEAPONTODO
return true;
}
case WR_SUICIDEMESSAGE:
#endif
#ifdef CSQC
.float prevric;
-float W_Shotgun(float req)
+float W_Shotgun(entity thiswep, float req)
{SELFPARAM();
switch(req)
{
if(!w_issilent && time - self.prevric > 0.25)
{
if(w_random < 0.0165)
- sound(self, CH_SHOTS, W_Sound("ric1"), VOL_BASE, ATTEN_NORM);
+ sound(self, CH_SHOTS, SND_RIC1, VOL_BASE, ATTEN_NORM);
else if(w_random < 0.033)
- sound(self, CH_SHOTS, W_Sound("ric2"), VOL_BASE, ATTEN_NORM);
+ sound(self, CH_SHOTS, SND_RIC2, VOL_BASE, ATTEN_NORM);
else if(w_random < 0.05)
- sound(self, CH_SHOTS, W_Sound("ric3"), VOL_BASE, ATTEN_NORM);
+ sound(self, CH_SHOTS, SND_RIC3, VOL_BASE, ATTEN_NORM);
self.prevric = time;
}
}
case WR_INIT:
{
- precache_sound(W_Sound("ric1"));
- precache_sound(W_Sound("ric2"));
- precache_sound(W_Sound("ric3"));
return true;
}
case WR_ZOOMRETICLE: