#ifdef IMPLEMENTATION
#ifdef SVQC
-void spawnfunc_weapon_mortar(void) { weapon_defaultspawnfunc(WEP_MORTAR.m_id); }
-void spawnfunc_weapon_grenadelauncher(void) { spawnfunc_weapon_mortar(); }
+spawnfunc(weapon_mortar) { weapon_defaultspawnfunc(WEP_MORTAR.m_id); }
+spawnfunc(weapon_grenadelauncher) { spawnfunc_weapon_mortar(this); }
void W_Mortar_Grenade_Explode(void)
{SELFPARAM();
}
else if(WEP_CVAR_PRI(mortar, type) == 1) // bounce
{
- float r;
- r = random() * 6;
- if(r < 1)
- spamsound(self, CH_SHOTS, W_Sound("grenade_bounce1"), VOL_BASE, ATTN_NORM);
- else if(r < 2)
- spamsound(self, CH_SHOTS, W_Sound("grenade_bounce2"), VOL_BASE, ATTN_NORM);
- else if(r < 3)
- spamsound(self, CH_SHOTS, W_Sound("grenade_bounce3"), VOL_BASE, ATTN_NORM);
- else if(r < 4)
- spamsound(self, CH_SHOTS, W_Sound("grenade_bounce4"), VOL_BASE, ATTN_NORM);
- else if(r < 5)
- spamsound(self, CH_SHOTS, W_Sound("grenade_bounce5"), VOL_BASE, ATTN_NORM);
- else
- spamsound(self, CH_SHOTS, W_Sound("grenade_bounce6"), VOL_BASE, ATTN_NORM);
+ spamsound(self, CH_SHOTS, SND(GRENADE_BOUNCE_RANDOM()), VOL_BASE, ATTN_NORM);
Send_Effect(EFFECT_HAGAR_BOUNCE, self.origin, self.velocity, 1);
self.projectiledeathtype |= HITTYPE_BOUNCE;
self.gl_bouncecnt += 1;
}
else if(WEP_CVAR_PRI(mortar, type) == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
{
- spamsound(self, CH_SHOTS, W_Sound("grenade_stick"), VOL_BASE, ATTN_NORM);
+ spamsound(self, CH_SHOTS, SND(GRENADE_STICK), VOL_BASE, ATTN_NORM);
// let it stick whereever it is
self.oldvelocity = self.velocity;
}
else if(WEP_CVAR_SEC(mortar, type) == 1) // bounce
{
- float r;
- r = random() * 6;
- if(r < 1)
- spamsound(self, CH_SHOTS, W_Sound("grenade_bounce1"), VOL_BASE, ATTN_NORM);
- else if(r < 2)
- spamsound(self, CH_SHOTS, W_Sound("grenade_bounce2"), VOL_BASE, ATTN_NORM);
- else if(r < 3)
- spamsound(self, CH_SHOTS, W_Sound("grenade_bounce3"), VOL_BASE, ATTN_NORM);
- else if(r < 4)
- spamsound(self, CH_SHOTS, W_Sound("grenade_bounce4"), VOL_BASE, ATTN_NORM);
- else if(r < 5)
- spamsound(self, CH_SHOTS, W_Sound("grenade_bounce5"), VOL_BASE, ATTN_NORM);
- else
- spamsound(self, CH_SHOTS, W_Sound("grenade_bounce6"), VOL_BASE, ATTN_NORM);
+ spamsound(self, CH_SHOTS, SND(GRENADE_BOUNCE_RANDOM()), VOL_BASE, ATTN_NORM);
Send_Effect(EFFECT_HAGAR_BOUNCE, self.origin, self.velocity, 1);
self.projectiledeathtype |= HITTYPE_BOUNCE;
self.gl_bouncecnt += 1;
}
else if(WEP_CVAR_SEC(mortar, type) == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
{
- spamsound(self, CH_SHOTS, W_Sound("grenade_stick"), VOL_BASE, ATTN_NORM);
+ spamsound(self, CH_SHOTS, SND(GRENADE_STICK), VOL_BASE, ATTN_NORM);
// let it stick whereever it is
self.oldvelocity = self.velocity;
W_DecreaseAmmo(WEP_CVAR_PRI(mortar, ammo));
- W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', false, 4, W_Sound("grenade_fire"), CH_WEAPON_A, WEP_CVAR_PRI(mortar, damage));
+ W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', false, 4, SND(GRENADE_FIRE), CH_WEAPON_A, WEP_CVAR_PRI(mortar, damage));
w_shotdir = v_forward; // no TrueAim for grenades please
Send_Effect(EFFECT_GRENADE_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
W_DecreaseAmmo(WEP_CVAR_SEC(mortar, ammo));
- W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', false, 4, W_Sound("grenade_fire"), CH_WEAPON_A, WEP_CVAR_SEC(mortar, damage));
+ W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', false, 4, SND(GRENADE_FIRE), CH_WEAPON_A, WEP_CVAR_SEC(mortar, damage));
w_shotdir = v_forward; // no TrueAim for grenades please
Send_Effect(EFFECT_GRENADE_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
}
}
if(nadefound)
- sound(self, CH_WEAPON_B, W_Sound("rocket_det"), VOL_BASE, ATTN_NORM);
+ sound(self, CH_WEAPON_B, SND_ROCKET_DET, VOL_BASE, ATTN_NORM);
}
else if(weapon_prepareattack(1, WEP_CVAR_SEC(mortar, refire)))
{
}
case WR_INIT:
{
- precache_model(W_Model("g_gl.md3"));
- precache_model(W_Model("v_gl.md3"));
- precache_model(W_Model("h_gl.iqm"));
- precache_sound(W_Sound("grenade_bounce1"));
- precache_sound(W_Sound("grenade_bounce2"));
- precache_sound(W_Sound("grenade_bounce3"));
- precache_sound(W_Sound("grenade_bounce4"));
- precache_sound(W_Sound("grenade_bounce5"));
- precache_sound(W_Sound("grenade_bounce6"));
- precache_sound(W_Sound("grenade_stick"));
- precache_sound(W_Sound("grenade_fire"));
MORTAR_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
return true;
}
}
case WR_RELOAD:
{
- W_Reload(min(WEP_CVAR_PRI(mortar, ammo), WEP_CVAR_SEC(mortar, ammo)), W_Sound("reload")); // WEAPONTODO
+ W_Reload(min(WEP_CVAR_PRI(mortar, ammo), WEP_CVAR_SEC(mortar, ammo)), SND(RELOAD)); // WEAPONTODO
return true;
}
case WR_SUICIDEMESSAGE:
org2 = w_org + w_backoff * 12;
pointparticles(particleeffectnum(EFFECT_GRENADE_EXPLODE), org2, '0 0 0', 1);
if(!w_issilent)
- sound(self, CH_SHOTS, W_Sound("grenade_impact"), VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, SND_GRENADE_IMPACT, VOL_BASE, ATTN_NORM);
return true;
}
case WR_INIT:
{
- precache_sound(W_Sound("grenade_impact"));
return true;
}
case WR_ZOOMRETICLE: