Added cvar to disable explosion entirely on infect.
This commit is contained in:
parent
209c13a3f9
commit
a0d2f58c35
@ -233,15 +233,19 @@ zr_infect_weapons_drop "1"
|
||||
|
||||
// Effects
|
||||
|
||||
// Spawn a fireball effect around player on infection.
|
||||
Disabling this will disable the fireball, smoke cloud, and sparks in a more efficient way.
|
||||
// Default: "1"
|
||||
zr_infect_explosion "1"
|
||||
|
||||
// Spawn a fireball effect around player on infection. [Dependency: zr_infect_explosion]
|
||||
// Default: "1"
|
||||
zr_infect_fireball "1"
|
||||
|
||||
// Spawn a smoke cloud effect around player on infection.
|
||||
// Spawn a smoke cloud effect around player on infection. [Dependency: zr_infect_explosion]
|
||||
// Default: "1"
|
||||
zr_infect_smoke "1"
|
||||
|
||||
// Emit sparks from player on infection.
|
||||
// Emit sparks from player on infection. [Dependency: zr_infect_explosion]
|
||||
// Default: "1"
|
||||
zr_infect_sparks "1"
|
||||
|
||||
|
@ -87,11 +87,12 @@ enum CvarsList
|
||||
Handle:CVAR_INFECT_WEAPONS_DROP,
|
||||
Handle:CVAR_INFECT_MZOMBIE_RATIO,
|
||||
Handle:CVAR_INFECT_MZOMBIE_RESPAWN,
|
||||
Handle:CVAR_INFECT_SOUND,
|
||||
Handle:CVAR_INFECT_ESPLASH,
|
||||
Handle:CVAR_INFECT_EXPLOSION,
|
||||
Handle:CVAR_INFECT_FIREBALL,
|
||||
Handle:CVAR_INFECT_SMOKE,
|
||||
Handle:CVAR_INFECT_SPARKS,
|
||||
Handle:CVAR_INFECT_SOUND,
|
||||
Handle:CVAR_INFECT_ESPLASH,
|
||||
Handle:CVAR_INFECT_SHAKE,
|
||||
Handle:CVAR_INFECT_SHAKE_AMP,
|
||||
Handle:CVAR_INFECT_SHAKE_FREQUENCY,
|
||||
@ -278,9 +279,10 @@ CvarsCreate()
|
||||
g_hCvarsList[CVAR_INFECT_WEAPONS_DROP] = CreateConVar("zr_infect_weapons_drop", "1", "Force player to drop all weapons on infect, disabling this will strip weapons instead.");
|
||||
|
||||
// Effects
|
||||
g_hCvarsList[CVAR_INFECT_FIREBALL] = CreateConVar("zr_infect_fireball", "1", "Spawn a fireball effect around player on infection.");
|
||||
g_hCvarsList[CVAR_INFECT_SMOKE] = CreateConVar("zr_infect_smoke", "1", "Spawn a smoke cloud effect around player on infection.");
|
||||
g_hCvarsList[CVAR_INFECT_SPARKS] = CreateConVar("zr_infect_sparks", "1", "Emit sparks from player on infection.");
|
||||
g_hCvarsList[CVAR_INFECT_EXPLOSION] = CreateConVar("zr_infect_explosion", "1", "Disabling this will disable the fireball, smoke cloud, and sparks in a more efficient way.");
|
||||
g_hCvarsList[CVAR_INFECT_FIREBALL] = CreateConVar("zr_infect_fireball", "1", "Spawn a fireball effect around player on infection. [Dependency: zr_infect_explosion]");
|
||||
g_hCvarsList[CVAR_INFECT_SMOKE] = CreateConVar("zr_infect_smoke", "1", "Spawn a smoke cloud effect around player on infection. [Dependency: zr_infect_explosion]");
|
||||
g_hCvarsList[CVAR_INFECT_SPARKS] = CreateConVar("zr_infect_sparks", "1", "Emit sparks from player on infection. [Dependency: zr_infect_explosion]");
|
||||
g_hCvarsList[CVAR_INFECT_SOUND] = CreateConVar("zr_infect_sound", "npc/fast_zombie/fz_scream1.wav", "Sound, relative to \"sounds\" folder, to play from player on infection. ['\"\"' = No sound]");
|
||||
g_hCvarsList[CVAR_INFECT_ESPLASH] = CreateConVar("zr_infect_esplash", "1", "Emit an energy splash from player on infection.");
|
||||
g_hCvarsList[CVAR_INFECT_SHAKE] = CreateConVar("zr_infect_shake", "1", "Shake player's view on infect.");
|
||||
|
@ -726,23 +726,9 @@ InfectFireEffects(client)
|
||||
GetClientAbsOrigin(client, clientloc);
|
||||
clientloc[2] += 30;
|
||||
|
||||
// If cvar contains path, then continue.
|
||||
decl String:sound[PLATFORM_MAX_PATH];
|
||||
GetConVarString(g_hCvarsList[CVAR_INFECT_SOUND], sound, sizeof(sound));
|
||||
if (sound[0])
|
||||
new bool:explosion = GetConVarBool(g_hCvarsList[CVAR_INFECT_EXPLOSION]);
|
||||
if (explosion)
|
||||
{
|
||||
// Emit infect sound from infected client.
|
||||
SEffectsEmitSoundFromClient(client, sound, SNDLEVEL_SCREAMING);
|
||||
}
|
||||
|
||||
// If energy splash effect is enabled, then continue.
|
||||
new bool:esplash = GetConVarBool(g_hCvarsList[CVAR_INFECT_ESPLASH]);
|
||||
if (esplash)
|
||||
{
|
||||
// Create energy splash effect.
|
||||
VEffectsCreateEnergySplash(clientloc, direction, true);
|
||||
}
|
||||
|
||||
// Initialize explosion flags variable.
|
||||
new flags;
|
||||
|
||||
@ -769,6 +755,24 @@ InfectFireEffects(client)
|
||||
|
||||
// Create explosion at client's origin.
|
||||
VEffectsCreateExplosion(clientloc, flags);
|
||||
}
|
||||
|
||||
// If cvar contains path, then continue.
|
||||
decl String:sound[PLATFORM_MAX_PATH];
|
||||
GetConVarString(g_hCvarsList[CVAR_INFECT_SOUND], sound, sizeof(sound));
|
||||
if (sound[0])
|
||||
{
|
||||
// Emit infect sound from infected client.
|
||||
SEffectsEmitSoundFromClient(client, sound, SNDLEVEL_SCREAMING);
|
||||
}
|
||||
|
||||
// If energy splash effect is enabled, then continue.
|
||||
new bool:esplash = GetConVarBool(g_hCvarsList[CVAR_INFECT_ESPLASH]);
|
||||
if (esplash)
|
||||
{
|
||||
// Create energy splash effect.
|
||||
VEffectsCreateEnergySplash(clientloc, direction, true);
|
||||
}
|
||||
|
||||
// If shake effect is enabled, then continue.
|
||||
new bool:shake = GetConVarBool(g_hCvarsList[CVAR_INFECT_SHAKE]);
|
||||
|
Loading…
Reference in New Issue
Block a user