Merge pull request #88 from nzp-team/cypress_soundrevamp

SERVER: Sound Processing Overhaul
This commit is contained in:
cypress 2024-09-01 18:14:29 -07:00 committed by GitHub
commit 3ae20465cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 804 additions and 484 deletions

View file

@ -20,6 +20,7 @@ defs/standard.qc
#endif #endif
shared_defs.qc shared_defs.qc
defs/custom.qc defs/custom.qc
utilities/sound_helper.qc
weapon_stats.qc weapon_stats.qc
utilities/math.qc utilities/math.qc
clientfuncs.qc clientfuncs.qc

View file

@ -1141,7 +1141,7 @@ noref void() CSQC_Parse_Event =
else else
track_extension = ".ogg"; track_extension = ".ogg";
localsound_enhanced(strcat("tracks/", track_name, track_extension), CHAN_MUSIC, 1); localsound_enhanced(strcat("tracks/", track_name, track_extension), CHAN_MUSIC, 0.85);
break; break;
case CSQC_EVENT_GIVEACHIEVEMENT: case CSQC_EVENT_GIVEACHIEVEMENT:
float achievement_id = readbyte(); float achievement_id = readbyte();

View file

@ -25,7 +25,7 @@
*/ */
void(float what) play_sound_z; void(float type) Zombie_PlaySoundType;
void() LinkZombiesHitbox; void() LinkZombiesHitbox;
entity() Dog_FindEnemy; entity() Dog_FindEnemy;
@ -825,7 +825,6 @@ void(float dist) Zombie_Walk = {
} }
if(self.outside == 2) { if(self.outside == 2) {
//play_sound_z(2);
Window_Hop(dist); Window_Hop(dist);
//handle special walk case for walking to org //handle special walk case for walking to org
return; return;
@ -846,18 +845,25 @@ void() Zombie_AI = {
self.flags = self.flags | FL_PARTIALGROUND; self.flags = self.flags | FL_PARTIALGROUND;
//check_onfire(); //check_onfire();
if(self.outside == TRUE) { //
play_sound_z(2); // Try to play some zombie sounds.
//self.calc_time = time + (0.3 * random()); //
//Window_Walk(dist);
return; // Crawling
} else if(self.outside == 2) { if (self.crawling == true) {
play_sound_z(2); Zombie_PlaySoundType(ZOMBIE_SOUND_TYPE_CRAWL);
//Window_Hop(0); } else {
return; // Walking
} else if(self.outside == FALSE) { if (self.walktype < 4) {
play_sound_z(2); Zombie_PlaySoundType(ZOMBIE_SOUND_TYPE_WALK);
//self.calc_time = time + (0.25 + (0.15 * random())); }
// Running
else {
Zombie_PlaySoundType(ZOMBIE_SOUND_TYPE_SPRINT);
}
}
if(self.outside == FALSE) {
Inside_Walk(dist); Inside_Walk(dist);
} }
} }

View file

@ -44,12 +44,12 @@ void() crawler_footstep
if(self.laststep == 1) if(self.laststep == 1)
{ {
self.laststep = 0; self.laststep = 0;
sound(self, 5, "sounds/zombie/sc0.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/zombie/sc0.wav", SOUND_TYPE_PLAYER_FOOTSTEP, SOUND_PRIORITY_PLAYALWAYS);
} }
else else
{ {
self.laststep = 1; self.laststep = 1;
sound(self, 5, "sounds/zombie/sc1.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/zombie/sc1.wav", SOUND_TYPE_PLAYER_FOOTSTEP, SOUND_PRIORITY_PLAYALWAYS);
} }
} }
@ -128,7 +128,7 @@ void(float which) crawler_attack_choose =
zombie_decide(); zombie_decide();
return; return;
} }
play_sound_z(1); Zombie_PlaySoundType(ZOMBIE_SOUND_TYPE_MELEE);
crawler_atk1(); crawler_atk1();
}; };
@ -153,7 +153,7 @@ void() crawler_die2 =[ 1, crawler_die3] {self.frame = 38;};
void() crawler_die3 =[ 2, SUB_Null] {self.iszomb = 0; self.frame = 39;self.nextthink = time + 3;self.think = removeZombie; if (crawler_num > 0) {crawler_num = crawler_num - 1;}}; void() crawler_die3 =[ 2, SUB_Null] {self.iszomb = 0; self.frame = 39;self.nextthink = time + 3;self.think = removeZombie; if (crawler_num > 0) {crawler_num = crawler_num - 1;}};
//====================== Crawler Tesla Death ============================ //====================== Crawler Tesla Death ============================
void() crawler_death_wunder1 =[ 72, crawler_death_wunder2 ] {tesla_arc(); play_sound_z(4); }; void() crawler_death_wunder1 =[ 72, crawler_death_wunder2 ] {tesla_arc(); Zombie_PlaySoundType(ZOMBIE_SOUND_TYPE_DEATH); };
void() crawler_death_wunder2 =[ 73, crawler_death_wunder3 ] {tesla_arc(); }; void() crawler_death_wunder2 =[ 73, crawler_death_wunder3 ] {tesla_arc(); };
void() crawler_death_wunder3 =[ 74, crawler_death_wunder4 ] {tesla_arc(); }; void() crawler_death_wunder3 =[ 74, crawler_death_wunder4 ] {tesla_arc(); };
void() crawler_death_wunder4 =[ 75, crawler_death_wunder5 ] {tesla_arc(); }; void() crawler_death_wunder4 =[ 75, crawler_death_wunder5 ] {tesla_arc(); };

View file

@ -69,7 +69,7 @@ void() dog_idleanim6 =[ $dogstand6, dog_idleanim ] {Dog_Think();self.frame = 24;
// 25-34 // 25-34
$frame dogmelee1 dogmelee2 dogmelee3 dogmelee4 dogmelee5 dogmelee6 dogmelee7 dogmelee8 dogmelee9 dogmelee10 $frame dogmelee1 dogmelee2 dogmelee3 dogmelee4 dogmelee5 dogmelee6 dogmelee7 dogmelee8 dogmelee9 dogmelee10
void() dog_meleeanim =[ $dogmelee1, dog_meleeanim2 ] {Dog_Think(); makevectors(self.angles); self.velocity += v_forward * 50; self.frame = 26;}; void() dog_meleeanim =[ $dogmelee1, dog_meleeanim2 ] {Dog_Think(); makevectors(self.angles); self.velocity += v_forward * 50; self.frame = 26;};
void() dog_meleeanim2 =[ $dogmelee2, dog_meleeanim3 ] {Dog_Think();Zombie_Walk(0);self.frame = 28;sound(self, CHAN_VOICE, "sounds/hound/a0.wav", 1, ATTN_NORM);}; void() dog_meleeanim2 =[ $dogmelee2, dog_meleeanim3 ] {Dog_Think();Zombie_Walk(0);self.frame = 28; Sound_PlaySound(self, "sounds/hound/a0.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_PLAYALWAYS);};
void() dog_meleeanim3 =[ $dogmelee3, dog_meleeanim4 ] {Dog_Think();Zombie_Walk(0);zombie_attack2();self.frame = 30;}; void() dog_meleeanim3 =[ $dogmelee3, dog_meleeanim4 ] {Dog_Think();Zombie_Walk(0);zombie_attack2();self.frame = 30;};
void() dog_meleeanim4 =[ $dogmelee4, dog_meleeanim5 ] {Dog_Think();Zombie_Walk(0);self.frame = 32;}; void() dog_meleeanim4 =[ $dogmelee4, dog_meleeanim5 ] {Dog_Think();Zombie_Walk(0);self.frame = 32;};
void() dog_meleeanim5 =[ $dogmelee5, dog_runanim ] {Dog_Think();Zombie_Walk(0);self.frame = 34;}; void() dog_meleeanim5 =[ $dogmelee5, dog_runanim ] {Dog_Think();Zombie_Walk(0);self.frame = 34;};
@ -127,10 +127,11 @@ void() Dog_Taunt =
self.sound_time = time + 3 * random(); self.sound_time = time + 3 * random();
if (random() > 0.5) if (random() > 0.5) {
sound(self, CHAN_VOICE, "sounds/hound/t0.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/hound/t0.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_PLAYALWAYS);
else } else {
sound(self, CHAN_VOICE, "sounds/hound/t1.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/hound/t1.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_PLAYALWAYS);
}
} }
void() Dog_Think = void() Dog_Think =
@ -173,7 +174,7 @@ void(entity ent) Dog_Death_Cleanup = {
ent.movetype = MOVETYPE_NONE; ent.movetype = MOVETYPE_NONE;
ent.takedamage = DAMAGE_NO; ent.takedamage = DAMAGE_NO;
sound(ent, 5, "sounds/null.wav", 1, ATTN_NORM); sound(ent, CHAN_WEAPON, "sounds/null.wav", 1, ATTN_NORM);
ent.usedent = world; ent.usedent = world;
ent.health = 0; ent.health = 0;
@ -184,12 +185,6 @@ void(entity ent) Dog_Death_Cleanup = {
void() Dog_Death = { void() Dog_Death = {
Dog_Death_Cleanup(self); Dog_Death_Cleanup(self);
play_sound_z(3);
//Gotta' make sure we set it back down instead of glitching it up, yo'
if(self.s_time > 0 && sounds_playing > 0) {
sounds_playing --;
self.s_time = 0;
}
if(rounds == dogRound && Remaining_Zombies == 0) { if(rounds == dogRound && Remaining_Zombies == 0) {
Spawn_Powerup(self.origin, PU_MAXAMMO); Spawn_Powerup(self.origin, PU_MAXAMMO);
@ -198,13 +193,13 @@ void() Dog_Death = {
if (self.onfire || self.electro_targeted) { if (self.onfire || self.electro_targeted) {
self.frame = 0; self.frame = 0;
setmodel(self, "models/sprites/explosion.spr"); setmodel(self, "models/sprites/explosion.spr");
sound (self, CHAN_WEAPON, "sounds/weapons/grenade/explode.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/grenade/explode.wav", SOUND_TYPE_WEAPON_EXPLODE, SOUND_PRIORITY_PLAYALWAYS);
dog_explodeanim(); dog_explodeanim();
} else { } else {
dog_deathanim(); dog_deathanim();
} }
sound(self, CHAN_BODY, "sounds/hound/d0.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/hound/d0.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_PLAYALWAYS);
self.onfire = 0; self.onfire = 0;
self.ads_release = 0; self.ads_release = 0;
@ -322,7 +317,7 @@ void(entity where) spawn_a_dogB =
sdog.gravity = 1.0; sdog.gravity = 1.0;
sdog.mins = '-16 -16 -32'; sdog.mins = '-16 -16 -32';
sdog.maxs = '16 16 4'; sdog.maxs = '16 16 16';
setsize (sdog, sdog.mins, sdog.maxs); setsize (sdog, sdog.mins, sdog.maxs);
if(pointcontents(sdog.origin - '0 0 36') == -2) if(pointcontents(sdog.origin - '0 0 36') == -2)
@ -414,7 +409,7 @@ void(entity where) spawn_dog_lightning =
dogsprite.ltime = time + 1.3; // we use ltime here to be out remove timer, dogsprite.ltime = time + 1.3; // we use ltime here to be out remove timer,
// since using frames interrupts think() // since using frames interrupts think()
sound(self, CHAN_AUTO, "sounds/misc/electric_bolt.wav", 1, ATTN_NONE); Sound_PlaySound(world, "sounds/misc/electric_bolt.wav", SOUND_TYPE_ENV_VOICE, SOUND_PRIORITY_PLAYALWAYS);
} }
float() spawn_a_dogA = float() spawn_a_dogA =

View file

@ -46,163 +46,266 @@ float JOG_BBOX = 7;
float RUN_BBOX = 8; float RUN_BBOX = 8;
float CRAWLER_BBOX = 9; float CRAWLER_BBOX = 9;
void(float what) play_sound_z = void(float type) Zombie_PlaySoundType =
{ {
// If we already have ambient groaning type sounds playing, don't allow another.
// We DO want to allow attacks, deaths, etc. though.
if (self.sound_time > time && type != ZOMBIE_SOUND_TYPE_MELEE && type != ZOMBIE_SOUND_TYPE_DEATH)
return;
if(self.classname == "ai_zombie") if(self.classname == "ai_zombie")
{ {
local float e; float next_sound_time = 0;
e = random(); float curr_sound_len = 0;
float rand = 0;
if(what == 1)//attack switch(type) {
{ // 8 options.
if (e < 0.125) case ZOMBIE_SOUND_TYPE_MELEE:
sound(self, CHAN_WEAPON, "sounds/zombie/a0.wav", 1, ATTN_NORM); rand = rint(random() * 7) + 1;
else if (e < 0.25)
sound(self, CHAN_WEAPON, "sounds/zombie/a1.wav", 1, ATTN_NORM);
else if (e < 0.375)
sound(self, CHAN_WEAPON, "sounds/zombie/a2.wav", 1, ATTN_NORM);
else if( e < 0.5)
sound(self, CHAN_WEAPON, "sounds/zombie/a3.wav", 1, ATTN_NORM);
else if( e < 0.625)
sound(self, CHAN_WEAPON, "sounds/zombie/a4.wav", 1, ATTN_NORM);
else if( e < 0.75)
sound(self, CHAN_WEAPON, "sounds/zombie/a5.wav", 1, ATTN_NORM);
else if( e < 0.875)
sound(self, CHAN_WEAPON, "sounds/zombie/a6.wav", 1, ATTN_NORM);
else
sound(self, CHAN_WEAPON, "sounds/zombie/a7.wav", 1, ATTN_NORM);
return;
}
if(what == 2)//walking!
{
if(self.s_time < time && self.s_time > 0) switch(rand) {
{ case 1:
sounds_playing --; Sound_PlaySound(self.head, "sounds/zombie/a0.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_PLAYALWAYS);
self.s_time = 0; curr_sound_len = 1.1;
break;
case 2:
Sound_PlaySound(self.head, "sounds/zombie/a1.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_PLAYALWAYS);
curr_sound_len = 0.8;
break;
case 3:
Sound_PlaySound(self.head, "sounds/zombie/a2.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_PLAYALWAYS);
curr_sound_len = 0.9;
break;
case 4:
Sound_PlaySound(self.head, "sounds/zombie/a3.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_PLAYALWAYS);
curr_sound_len = 0.8;
break;
case 5:
Sound_PlaySound(self.head, "sounds/zombie/a4.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_PLAYALWAYS);
curr_sound_len = 1;
break;
case 6:
Sound_PlaySound(self.head, "sounds/zombie/a5.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_PLAYALWAYS);
curr_sound_len = 1;
break;
case 7:
Sound_PlaySound(self.head, "sounds/zombie/a6.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_PLAYALWAYS);
curr_sound_len = 1;
break;
case 8:
Sound_PlaySound(self.head, "sounds/zombie/a7.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_PLAYALWAYS);
curr_sound_len = 1;
break;
default:
break;
} }
if(sounds_playing >= 3) break;
{
return;
}
sounds_playing++;
self.s_time = time + 1;
// 15 options.
case ZOMBIE_SOUND_TYPE_WALK:
rand = rint(random() * 14) + 1;
next_sound_time = rint(random() * 4) + 1;
if(self.sound_time < time) // Don't allow overriding current playing sounds.
{ if (self.s_time > time)
play_sound_z(4); break;
if(self.crawling == TRUE) switch(rand) {
{ case 1:
self.sound_time = time + 3 + random()*2; Sound_PlaySound(self.head, "sounds/zombie/w0.wav", SOUND_TYPE_ZOMBIE_QUIET, SOUND_PRIORITY_ALLOWSKIP);
if(e < 0.2) curr_sound_len = 1.3;
sound(self, CHAN_VOICE, "sounds/zombie/t0.wav", 1, ATTN_NORM); break;
else if (e < 0.4) case 2:
sound(self, CHAN_VOICE, "sounds/zombie/t1.wav", 1, ATTN_NORM); Sound_PlaySound(self.head, "sounds/zombie/w1.wav", SOUND_TYPE_ZOMBIE_QUIET, SOUND_PRIORITY_ALLOWSKIP);
else if (e < 0.6) curr_sound_len = 1.75;
sound(self, CHAN_VOICE, "sounds/zombie/t2.wav", 1, ATTN_NORM); break;
else if (e < 0.8) case 3:
sound(self, CHAN_VOICE, "sounds/zombie/t3.wav", 1, ATTN_NORM); Sound_PlaySound(self.head, "sounds/zombie/w2.wav", SOUND_TYPE_ZOMBIE_QUIET, SOUND_PRIORITY_ALLOWSKIP);
else curr_sound_len = 1.95;
sound(self, CHAN_VOICE, "sounds/zombie/t4.wav", 1, ATTN_NORM); break;
return; case 4:
Sound_PlaySound(self.head, "sounds/zombie/w3.wav", SOUND_TYPE_ZOMBIE_QUIET, SOUND_PRIORITY_ALLOWSKIP);
curr_sound_len = 1.4;
break;
case 5:
Sound_PlaySound(self.head, "sounds/zombie/w4.wav", SOUND_TYPE_ZOMBIE_QUIET, SOUND_PRIORITY_ALLOWSKIP);
curr_sound_len = 2.7;
break;
case 6:
Sound_PlaySound(self.head, "sounds/zombie/w5.wav", SOUND_TYPE_ZOMBIE_QUIET, SOUND_PRIORITY_ALLOWSKIP);
curr_sound_len = 1.9;
break;
case 7:
Sound_PlaySound(self.head, "sounds/zombie/w6.wav", SOUND_TYPE_ZOMBIE_QUIET, SOUND_PRIORITY_ALLOWSKIP);
curr_sound_len = 1.6;
break;
case 8:
Sound_PlaySound(self.head, "sounds/zombie/w7.wav", SOUND_TYPE_ZOMBIE_QUIET, SOUND_PRIORITY_ALLOWSKIP);
curr_sound_len = 1.9;
break;
case 9:
Sound_PlaySound(self.head, "sounds/zombie/w8.wav", SOUND_TYPE_ZOMBIE_QUIET, SOUND_PRIORITY_ALLOWSKIP);
curr_sound_len = 2.4;
break;
case 10:
Sound_PlaySound(self.head, "sounds/zombie/w9.wav", SOUND_TYPE_ZOMBIE_QUIET, SOUND_PRIORITY_ALLOWSKIP);
curr_sound_len = 1.5;
break;
case 11:
Sound_PlaySound(self.head, "sounds/zombie/t0.wav", SOUND_TYPE_ZOMBIE_QUIET, SOUND_PRIORITY_ALLOWSKIP);
curr_sound_len = 1.5;
break;
case 12:
Sound_PlaySound(self.head, "sounds/zombie/t1.wav", SOUND_TYPE_ZOMBIE_QUIET, SOUND_PRIORITY_ALLOWSKIP);
curr_sound_len = 1.6;
break;
case 13:
Sound_PlaySound(self.head, "sounds/zombie/t2.wav", SOUND_TYPE_ZOMBIE_QUIET, SOUND_PRIORITY_ALLOWSKIP);
curr_sound_len = 2.3;
break;
case 14:
Sound_PlaySound(self.head, "sounds/zombie/t3.wav", SOUND_TYPE_ZOMBIE_QUIET, SOUND_PRIORITY_ALLOWSKIP);
curr_sound_len = 1.75;
break;
case 15:
Sound_PlaySound(self.head, "sounds/zombie/t4.wav", SOUND_TYPE_ZOMBIE_QUIET, SOUND_PRIORITY_ALLOWSKIP);
curr_sound_len = 1.7;
break;
default:
break;
} }
if(self.walktype == 1 || self.walktype == 2 || self.walktype == 3) break;
{
self.sound_time = time + 3 + random(); // 5 options.
if (e < 0.1) case ZOMBIE_SOUND_TYPE_CRAWL:
sound(self, CHAN_VOICE, "sounds/zombie/w0.wav", 1, ATTN_NORM); rand = rint(random() * 4) + 1;
else if (e < 0.2) next_sound_time = rint(random() * 4) + 1;
sound(self, CHAN_VOICE, "sounds/zombie/w1.wav", 1, ATTN_NORM);
else if (e < 0.3) // Don't allow overriding current playing sounds.
sound(self, CHAN_VOICE, "sounds/zombie/w2.wav", 1, ATTN_NORM); if (self.s_time > time)
else if( e < 0.4) break;
sound(self, CHAN_VOICE, "sounds/zombie/w3.wav", 1, ATTN_NORM);
else if( e < 0.5) switch(rand) {
sound(self, CHAN_VOICE, "sounds/zombie/w4.wav", 1, ATTN_NORM); case 1:
else if( e < 0.6) Sound_PlaySound(self.head, "sounds/zombie/t0.wav", SOUND_TYPE_ZOMBIE_CRAWLER, SOUND_PRIORITY_ALLOWSKIP);
sound(self, CHAN_VOICE, "sounds/zombie/w5.wav", 1, ATTN_NORM); curr_sound_len = 1.5;
else if( e < 0.7) break;
sound(self, CHAN_VOICE, "sounds/zombie/w6.wav", 1, ATTN_NORM); case 2:
else if( e < 0.8) Sound_PlaySound(self.head, "sounds/zombie/t1.wav", SOUND_TYPE_ZOMBIE_CRAWLER, SOUND_PRIORITY_ALLOWSKIP);
sound(self, CHAN_VOICE, "sounds/zombie/w7.wav", 1, ATTN_NORM); curr_sound_len = 1.6;
else if( e < 0.9) break;
sound(self, CHAN_VOICE, "sounds/zombie/w8.wav", 1, ATTN_NORM); case 3:
else Sound_PlaySound(self.head, "sounds/zombie/t2.wav", SOUND_TYPE_ZOMBIE_CRAWLER, SOUND_PRIORITY_ALLOWSKIP);
sound(self, CHAN_VOICE, "sounds/zombie/w9.wav", 1, ATTN_NORM); curr_sound_len = 2.3;
return; break;
case 4:
Sound_PlaySound(self.head, "sounds/zombie/t3.wav", SOUND_TYPE_ZOMBIE_CRAWLER, SOUND_PRIORITY_ALLOWSKIP);
curr_sound_len = 1.75;
break;
case 5:
Sound_PlaySound(self.head, "sounds/zombie/t4.wav", SOUND_TYPE_ZOMBIE_CRAWLER, SOUND_PRIORITY_ALLOWSKIP);
curr_sound_len = 1.7;
break;
default:
break;
} }
else if(self.walktype == 4 || self.walktype == 5) break;
{
self.sound_time = time + 4 + random()*2; // 10 options.
if (e < 0.1) case ZOMBIE_SOUND_TYPE_SPRINT:
sound(self, CHAN_VOICE, "sounds/zombie/r0.wav", 1, ATTN_NORM); rand = rint(random() * 9) + 1;
else if (e < 0.2) next_sound_time = rint(random() * 4) + 1;
sound(self, CHAN_VOICE, "sounds/zombie/r1.wav", 1, ATTN_NORM);
else if (e < 0.3) // Don't allow overriding current playing sounds.
sound(self, CHAN_VOICE, "sounds/zombie/r2.wav", 1, ATTN_NORM); if (self.s_time > time)
else if( e < 0.4) break;
sound(self, CHAN_VOICE, "sounds/zombie/r3.wav", 1, ATTN_NORM);
else if( e < 0.5) switch(rand) {
sound(self, CHAN_VOICE, "sounds/zombie/r4.wav", 1, ATTN_NORM); case 1:
else if( e < 0.6) Sound_PlaySound(self.head, "sounds/zombie/r0.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_ALLOWSKIP);
sound(self, CHAN_VOICE, "sounds/zombie/r5.wav", 1, ATTN_NORM); curr_sound_len = 3.1;
else if( e < 0.7) break;
sound(self, CHAN_VOICE, "sounds/zombie/r6.wav", 1, ATTN_NORM); case 2:
else if( e < 0.8) Sound_PlaySound(self.head, "sounds/zombie/r1.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_ALLOWSKIP);
sound(self, CHAN_VOICE, "sounds/zombie/r7.wav", 1, ATTN_NORM); curr_sound_len = 4.6;
else if( e < 0.9) break;
sound(self, CHAN_VOICE, "sounds/zombie/r8.wav", 1, ATTN_NORM); case 3:
else Sound_PlaySound(self.head, "sounds/zombie/r2.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_ALLOWSKIP);
sound(self, CHAN_VOICE, "sounds/zombie/r9.wav", 1, ATTN_NORM); curr_sound_len = 3.4;
return; break;
case 4:
Sound_PlaySound(self.head, "sounds/zombie/r3.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_ALLOWSKIP);
curr_sound_len = 5.1;
break;
case 5:
Sound_PlaySound(self.head, "sounds/zombie/r4.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_ALLOWSKIP);
curr_sound_len = 3.5;
break;
case 6:
Sound_PlaySound(self.head, "sounds/zombie/r5.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_ALLOWSKIP);
curr_sound_len = 3.2;
break;
case 7:
Sound_PlaySound(self.head, "sounds/zombie/r6.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_ALLOWSKIP);
curr_sound_len = 5.1;
break;
case 8:
Sound_PlaySound(self.head, "sounds/zombie/r7.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_ALLOWSKIP);
curr_sound_len = 5.1;
break;
case 9:
Sound_PlaySound(self.head, "sounds/zombie/r8.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_ALLOWSKIP);
curr_sound_len = 3;
break;
case 10:
Sound_PlaySound(self.head, "sounds/zombie/r9.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_ALLOWSKIP);
curr_sound_len = 4.1;
break;
default:
break;
}
break;
// 8 options.
case ZOMBIE_SOUND_TYPE_DEATH:
rand = rint(random() * 7) + 1;
next_sound_time = 0.1;
curr_sound_len = 2;
switch(rand) {
case 1:
Sound_PlaySound(self.head, "sounds/zombie/d0.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_PLAYALWAYS);
break;
case 2:
Sound_PlaySound(self.head, "sounds/zombie/d1.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_PLAYALWAYS);
break;
case 3:
Sound_PlaySound(self.head, "sounds/zombie/d2.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_PLAYALWAYS);
break;
case 4:
Sound_PlaySound(self.head, "sounds/zombie/d3.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_PLAYALWAYS);
break;
case 5:
Sound_PlaySound(self.head, "sounds/zombie/d4.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_PLAYALWAYS);
break;
case 6:
Sound_PlaySound(self.head, "sounds/zombie/d5.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_PLAYALWAYS);
break;
case 7:
Sound_PlaySound(self.head, "sounds/zombie/d6.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_PLAYALWAYS);
break;
case 8:
Sound_PlaySound(self.head, "sounds/zombie/d7.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_PLAYALWAYS);
break;
default:
break;
}
break;
} }
} self.sound_time = time + next_sound_time;
} self.s_time = time + curr_sound_len;
if(what == 3)//death!
{
if (e < 0.125)
sound(self, CHAN_BODY, "sounds/zombie/d0.wav", 1, ATTN_NORM);
else if (e < 0.25)
sound(self, CHAN_BODY, "sounds/zombie/d1.wav", 1, ATTN_NORM);
else if (e < 0.375)
sound(self, CHAN_BODY, "sounds/zombie/d2.wav", 1, ATTN_NORM);
else if( e < 0.5)
sound(self, CHAN_BODY, "sounds/zombie/d3.wav", 1, ATTN_NORM);
else if( e < 0.625)
sound(self, CHAN_BODY, "sounds/zombie/d4.wav", 1, ATTN_NORM);
else if( e < 0.75)
sound(self, CHAN_BODY, "sounds/zombie/d5.wav", 1, ATTN_NORM);
else if( e < 0.875)
sound(self, CHAN_BODY, "sounds/zombie/d6.wav", 1, ATTN_NORM);
else
sound(self, CHAN_BODY, "sounds/zombie/d7.wav", 1, ATTN_NORM);
return;
}
if(what == 4)//Taunt!
{
if(random() < 0.83)
return;
if(e < 0.2)
sound(self, CHAN_ITEM, "sounds/zombie/t0.wav", 1, ATTN_NORM);
else if (e < 0.4)
sound(self, CHAN_ITEM, "sounds/zombie/t1.wav", 1, ATTN_NORM);
else if (e < 0.6)
sound(self, CHAN_ITEM, "sounds/zombie/t2.wav", 1, ATTN_NORM);
else if (e < 0.8)
sound(self, CHAN_ITEM, "sounds/zombie/t3.wav", 1, ATTN_NORM);
else
sound(self, CHAN_ITEM, "sounds/zombie/t4.wav", 1, ATTN_NORM);
return;
}
if (what == 5) // Electric Zap
{
sound(self, CHAN_ITEM, "sounds/machines/elec_shock.wav", 1, ATTN_NORM);
}
} }
}; };
@ -438,12 +541,12 @@ void() zombie_footstep
if(self.laststep == 1) if(self.laststep == 1)
{ {
self.laststep = 0; self.laststep = 0;
sound(self, 5, "sounds/zombie/s0.wav", 0.6, ATTN_NORM); Sound_PlaySound(self, "sounds/zombie/s0.wav", SOUND_TYPE_PLAYER_FOOTSTEP, SOUND_PRIORITY_PLAYALWAYS);
} }
else else
{ {
self.laststep = 1; self.laststep = 1;
sound(self, 5, "sounds/zombie/s1.wav", 0.6, ATTN_NORM); Sound_PlaySound(self, "sounds/zombie/s1.wav", SOUND_TYPE_PLAYER_FOOTSTEP, SOUND_PRIORITY_PLAYALWAYS);
} }
} }
@ -743,7 +846,7 @@ void() zombie_ripboardB10 =[ $zripB10, zombie_decide ] {self.frame = 201;Zom
//186-188 //186-188
void() zombie_attack_through_window = void() zombie_attack_through_window =
{ {
play_sound_z(1); Zombie_PlaySoundType(ZOMBIE_SOUND_TYPE_MELEE);
local entity who; local entity who;
who = findradius(self.origin, 70); who = findradius(self.origin, 70);
while(who) while(who)
@ -789,43 +892,43 @@ void() zombie_attack_through_w19 =[ $zatkw9, zombie_decide ] {self.is_attacki
void() zm_swipe_right_slow =[ 1, zm_swipe_right_slow1 ] {self.is_attacking = true; self.frame = 102; SetZombieHitBox(BASE_BBOX); Zombie_Think(); }; void() zm_swipe_right_slow =[ 1, zm_swipe_right_slow1 ] {self.is_attacking = true; self.frame = 102; SetZombieHitBox(BASE_BBOX); Zombie_Think(); };
void() zm_swipe_right_slow1 =[ 2, zm_swipe_right_slow2 ] {self.frame = 103; Zombie_Think(); }; void() zm_swipe_right_slow1 =[ 2, zm_swipe_right_slow2 ] {self.frame = 103; Zombie_Think(); };
void() zm_swipe_right_slow2 =[ 3, zm_swipe_right_slow3 ] {self.frame = 104; Zombie_Think(); }; void() zm_swipe_right_slow2 =[ 3, zm_swipe_right_slow3 ] {self.frame = 104; Zombie_Think(); Zombie_PlaySoundType(ZOMBIE_SOUND_TYPE_MELEE); };
void() zm_swipe_right_slow3 =[ 4, zm_swipe_right_slow4 ] {zombie_attack2(); self.frame = 105; Zombie_Think(); }; void() zm_swipe_right_slow3 =[ 4, zm_swipe_right_slow4 ] {zombie_attack2(); self.frame = 105; Zombie_Think(); };
void() zm_swipe_right_slow4 =[ 5, zombie_decide ] {self.is_attacking = false; self.frame = 106; Zombie_Think(); }; void() zm_swipe_right_slow4 =[ 5, zombie_decide ] {self.is_attacking = false; self.frame = 106; Zombie_Think(); };
void() zm_swipe_right_fast =[ 1, zm_swipe_right_fast1 ] {self.is_attacking = true; self.frame = 104; Zombie_Think(); }; void() zm_swipe_right_fast =[ 1, zm_swipe_right_fast1 ] {self.is_attacking = true; self.frame = 104; Zombie_Think(); Zombie_PlaySoundType(ZOMBIE_SOUND_TYPE_MELEE); };
void() zm_swipe_right_fast1 =[ 2, zm_swipe_right_fast2 ] {zombie_attack2(); self.frame = 105; Zombie_Think(); }; void() zm_swipe_right_fast1 =[ 2, zm_swipe_right_fast2 ] {zombie_attack2(); self.frame = 105; Zombie_Think(); };
void() zm_swipe_right_fast2 =[ 3, zombie_decide ] {self.is_attacking = false; self.frame = 106; Zombie_Think(); }; void() zm_swipe_right_fast2 =[ 3, zombie_decide ] {self.is_attacking = false; self.frame = 106; Zombie_Think(); };
void() zm_swipe_left_slow =[ 1, zm_swipe_left_slow1 ] {self.is_attacking = true; self.frame = 107; SetZombieHitBox(BASE_BBOX); Zombie_Think(); }; void() zm_swipe_left_slow =[ 1, zm_swipe_left_slow1 ] {self.is_attacking = true; self.frame = 107; SetZombieHitBox(BASE_BBOX); Zombie_Think(); };
void() zm_swipe_left_slow1 =[ 2, zm_swipe_left_slow2 ] {self.frame = 108; Zombie_Think(); }; void() zm_swipe_left_slow1 =[ 2, zm_swipe_left_slow2 ] {self.frame = 108; Zombie_Think(); };
void() zm_swipe_left_slow2 =[ 3, zm_swipe_left_slow3 ] {self.frame = 109; Zombie_Think(); }; void() zm_swipe_left_slow2 =[ 3, zm_swipe_left_slow3 ] {self.frame = 109; Zombie_Think(); Zombie_PlaySoundType(ZOMBIE_SOUND_TYPE_MELEE); };
void() zm_swipe_left_slow3 =[ 4, zm_swipe_left_slow4 ] {zombie_attack2(); self.frame = 110; Zombie_Think(); }; void() zm_swipe_left_slow3 =[ 4, zm_swipe_left_slow4 ] {zombie_attack2(); self.frame = 110; Zombie_Think(); };
void() zm_swipe_left_slow4 =[ 5, zm_swipe_left_slow5 ] {self.frame = 111; Zombie_Think(); }; void() zm_swipe_left_slow4 =[ 5, zm_swipe_left_slow5 ] {self.frame = 111; Zombie_Think(); };
void() zm_swipe_left_slow5 =[ 6, zombie_decide ] {self.is_attacking = false; self.frame = 112; Zombie_Think(); }; void() zm_swipe_left_slow5 =[ 6, zombie_decide ] {self.is_attacking = false; self.frame = 112; Zombie_Think(); };
void() zm_swipe_left_fast =[ 1, zm_swipe_left_fast1 ] {self.is_attacking = true; self.frame = 109; SetZombieHitBox(BASE_BBOX); Zombie_Think(); }; void() zm_swipe_left_fast =[ 1, zm_swipe_left_fast1 ] {self.is_attacking = true; self.frame = 109; SetZombieHitBox(BASE_BBOX); Zombie_Think(); Zombie_PlaySoundType(ZOMBIE_SOUND_TYPE_MELEE); };
void() zm_swipe_left_fast1 =[ 2, zm_swipe_left_fast2 ] {zombie_attack2(); self.frame = 110; Zombie_Think(); }; void() zm_swipe_left_fast1 =[ 2, zm_swipe_left_fast2 ] {zombie_attack2(); self.frame = 110; Zombie_Think(); };
void() zm_swipe_left_fast2 =[ 3, zm_swipe_left_fast3 ] {self.frame = 111; Zombie_Think(); }; void() zm_swipe_left_fast2 =[ 3, zm_swipe_left_fast3 ] {self.frame = 111; Zombie_Think(); };
void() zm_swipe_left_fast3 =[ 4, zombie_decide ] {self.is_attacking = false; self.frame = 112; Zombie_Think(); }; void() zm_swipe_left_fast3 =[ 4, zombie_decide ] {self.is_attacking = false; self.frame = 112; Zombie_Think(); };
void() zm_swipe_both_slow =[ 1, zm_swipe_both_slow1 ] {self.is_attacking = true; self.frame = 102; SetZombieHitBox(BASE_BBOX); Zombie_Think(); }; void() zm_swipe_both_slow =[ 1, zm_swipe_both_slow1 ] {self.is_attacking = true; self.frame = 102; SetZombieHitBox(BASE_BBOX); Zombie_Think(); };
void() zm_swipe_both_slow1 =[ 2, zm_swipe_both_slow2 ] {self.frame = 103; Zombie_Think(); }; void() zm_swipe_both_slow1 =[ 2, zm_swipe_both_slow2 ] {self.frame = 103; Zombie_Think(); };
void() zm_swipe_both_slow2 =[ 3, zm_swipe_both_slow3 ] {self.frame = 104; Zombie_Think(); }; void() zm_swipe_both_slow2 =[ 3, zm_swipe_both_slow3 ] {self.frame = 104; Zombie_Think(); Zombie_PlaySoundType(ZOMBIE_SOUND_TYPE_MELEE); };
void() zm_swipe_both_slow3 =[ 4, zm_swipe_both_slow4 ] {zombie_attack2(); self.frame = 105; Zombie_Think(); }; void() zm_swipe_both_slow3 =[ 4, zm_swipe_both_slow4 ] {zombie_attack2(); self.frame = 105; Zombie_Think(); };
void() zm_swipe_both_slow4 =[ 5, zm_swipe_both_slow5 ] {self.frame = 106; Zombie_Think(); }; void() zm_swipe_both_slow4 =[ 5, zm_swipe_both_slow5 ] {self.frame = 106; Zombie_Think(); };
void() zm_swipe_both_slow5 =[ 6, zm_swipe_both_slow6 ] {self.frame = 107; Zombie_Think(); }; void() zm_swipe_both_slow5 =[ 6, zm_swipe_both_slow6 ] {self.frame = 107; Zombie_Think(); };
void() zm_swipe_both_slow6 =[ 7, zm_swipe_both_slow7 ] {self.frame = 108; Zombie_Think(); }; void() zm_swipe_both_slow6 =[ 7, zm_swipe_both_slow7 ] {self.frame = 108; Zombie_Think(); };
void() zm_swipe_both_slow7 =[ 8, zm_swipe_both_slow8 ] {self.frame = 109; Zombie_Think(); }; void() zm_swipe_both_slow7 =[ 8, zm_swipe_both_slow8 ] {self.frame = 109; Zombie_Think(); };
void() zm_swipe_both_slow8 =[ 9, zm_swipe_both_slow9 ] {self.frame = 110; Zombie_Think(); }; void() zm_swipe_both_slow8 =[ 9, zm_swipe_both_slow9 ] {self.frame = 110; Zombie_Think(); Zombie_PlaySoundType(ZOMBIE_SOUND_TYPE_MELEE); };
void() zm_swipe_both_slow9 =[ 10, zombie_decide ] {zombie_attack2(); self.is_attacking = false; self.frame = 111; Zombie_Think(); }; void() zm_swipe_both_slow9 =[ 10, zombie_decide ] {zombie_attack2(); self.is_attacking = false; self.frame = 111; Zombie_Think(); };
void() zm_swipe_both_fast =[ 1, zm_swipe_both_fast1 ] {self.is_attacking = true; self.frame = 104; SetZombieHitBox(BASE_BBOX); Zombie_Think(); }; void() zm_swipe_both_fast =[ 1, zm_swipe_both_fast1 ] {self.is_attacking = true; self.frame = 104; SetZombieHitBox(BASE_BBOX); Zombie_Think(); Zombie_PlaySoundType(ZOMBIE_SOUND_TYPE_MELEE); };
void() zm_swipe_both_fast1 =[ 2, zm_swipe_both_fast2 ] {zombie_attack2(); self.frame = 105; Zombie_Think(); }; void() zm_swipe_both_fast1 =[ 2, zm_swipe_both_fast2 ] {zombie_attack2(); self.frame = 105; Zombie_Think(); };
void() zm_swipe_both_fast2 =[ 3, zm_swipe_both_fast3 ] {self.frame = 106; Zombie_Think(); }; void() zm_swipe_both_fast2 =[ 3, zm_swipe_both_fast3 ] {self.frame = 106; Zombie_Think(); };
void() zm_swipe_both_fast3 =[ 4, zm_swipe_both_fast4 ] {self.frame = 109; Zombie_Think(); }; void() zm_swipe_both_fast3 =[ 4, zm_swipe_both_fast4 ] {self.frame = 109; Zombie_Think(); };
void() zm_swipe_both_fast4 =[ 5, zm_swipe_both_fast5 ] {self.frame = 110; Zombie_Think(); }; void() zm_swipe_both_fast4 =[ 5, zm_swipe_both_fast5 ] {self.frame = 110; Zombie_Think(); };
void() zm_swipe_both_fast5 =[ 6, zm_swipe_both_fast6 ] {self.frame = 111; Zombie_Think(); }; void() zm_swipe_both_fast5 =[ 6, zm_swipe_both_fast6 ] {self.frame = 111; Zombie_Think(); Zombie_PlaySoundType(ZOMBIE_SOUND_TYPE_MELEE); };
void() zm_swipe_both_fast6 =[ 7, zombie_decide ] {zombie_attack2(); self.is_attacking = false; self.frame = 112; Zombie_Think(); }; void() zm_swipe_both_fast6 =[ 7, zombie_decide ] {zombie_attack2(); self.is_attacking = false; self.frame = 112; Zombie_Think(); };
void(float which) zombie_attack_choose = void(float which) zombie_attack_choose =
@ -841,8 +944,6 @@ void(float which) zombie_attack_choose =
} }
} }
play_sound_z(1);
// //
// choose what attack to play // choose what attack to play
// //
@ -1196,16 +1297,9 @@ void() Zombie_Death =
// Death Noises // Death Noises
if (self.electro_targeted == false) if (self.electro_targeted == false)
play_sound_z(3); Zombie_PlaySoundType(ZOMBIE_SOUND_TYPE_DEATH);
else else
play_sound_z(5); Sound_PlaySound(self.head, "sounds/machines/elec_shock.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_PLAYALWAYS);
//Gotta' make sure we set it back down instead of glitching it up, yo'
if(self.s_time > 0 && sounds_playing > 0)
{
sounds_playing --;
self.s_time = 0;
}
if(self.outside == false && self.electro_targeted == false) if(self.outside == false && self.electro_targeted == false)
{ {
@ -1314,7 +1408,7 @@ void() Z_ElectroShock =
} }
// Play the first Electro-Sound // Play the first Electro-Sound
play_sound_z(5); Sound_PlaySound(self.head, "sounds/machines/elec_shock.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_PLAYALWAYS);
} }
/////////////////////ZOMBIE WAFFE STUFF///////////////////// /////////////////////ZOMBIE WAFFE STUFF/////////////////////
@ -1323,14 +1417,14 @@ void() Z_ElectroShock =
// 149-152 (FIXME - animate wunder'd zombies) // 149-152 (FIXME - animate wunder'd zombies)
$frame wunder1 wunder2 wunder3 wunder4 wunder5 wunder6 wunder7 wunder8 wunder9 wunder10 $frame wunder1 wunder2 wunder3 wunder4 wunder5 wunder6 wunder7 wunder8 wunder9 wunder10
void() zombie_wunder1 =[ $wunder1, zombie_wunder2 ] {tesla_arc(); play_sound_z(4); self.frame = 149;}; void() zombie_wunder1 =[ $wunder1, zombie_wunder2 ] {tesla_arc(); Zombie_PlaySoundType(ZOMBIE_SOUND_TYPE_CRAWL); self.frame = 149;};
void() zombie_wunder2 =[ $wunder2, zombie_wunder3 ] {tesla_arc(); self.frame = 150;}; void() zombie_wunder2 =[ $wunder2, zombie_wunder3 ] {tesla_arc(); self.frame = 150;};
void() zombie_wunder3 =[ $wunder3, zombie_wunder4 ] {tesla_arc(); self.frame = 151;}; void() zombie_wunder3 =[ $wunder3, zombie_wunder4 ] {tesla_arc(); self.frame = 151;};
void() zombie_wunder4 =[ $wunder4, zombie_wunder5 ] {tesla_arc(); self.frame = 152;}; void() zombie_wunder4 =[ $wunder4, zombie_wunder5 ] {tesla_arc(); self.frame = 152;};
void() zombie_wunder5 =[ $wunder5, zombie_wunder6 ] {tesla_arc(); self.frame = 151;}; void() zombie_wunder5 =[ $wunder5, zombie_wunder6 ] {tesla_arc(); self.frame = 151;};
void() zombie_wunder6 =[ $wunder6, zombie_wunder7 ] {tesla_arc(); self.frame = 152;}; void() zombie_wunder6 =[ $wunder6, zombie_wunder7 ] {tesla_arc(); self.frame = 152;};
void() zombie_wunder7 =[ $wunder7, zombie_wunder8 ] {tesla_arc(); self.frame = 151;}; void() zombie_wunder7 =[ $wunder7, zombie_wunder8 ] {tesla_arc(); self.frame = 151;};
void() zombie_wunder8 =[ $wunder8, zombie_wunder9 ] {tesla_arc(); play_sound_z(3); self.frame = 152;}; void() zombie_wunder8 =[ $wunder8, zombie_wunder9 ] {tesla_arc(); Zombie_PlaySoundType(ZOMBIE_SOUND_TYPE_DEATH); self.frame = 152;};
void() zombie_wunder9 =[ $wunder9, zombie_wunder10 ] {tesla_arc(); self.frame = 151;}; void() zombie_wunder9 =[ $wunder9, zombie_wunder10 ] {tesla_arc(); self.frame = 151;};
void() zombie_wunder10 =[ $wunder10, SUB_Null ] { void() zombie_wunder10 =[ $wunder10, SUB_Null ] {
tesla_arc(); self.iszomb = 0; self.nextthink = time + 3; self.think = removeZombie;self.frame = 152; tesla_arc(); self.iszomb = 0; self.nextthink = time + 3; self.think = removeZombie;self.frame = 152;

View file

@ -150,7 +150,7 @@ void() EndGameSetup =
self.movetype = MOVETYPE_TOSS; self.movetype = MOVETYPE_TOSS;
if (!game_over) { if (!game_over) {
sound(self, CHAN_AUTO, "sounds/music/end.wav", 1, ATTN_NONE); Rounds_PlayTransition("sounds/music/end.wav");
NotifyGameEnd(); NotifyGameEnd();
} }
game_over = true; game_over = true;
@ -243,7 +243,7 @@ void(entity attacker, float d_style) DieHandler =
points_earned = DMG_SCORE_GRENADE; points_earned = DMG_SCORE_GRENADE;
// override their death sound (FIXME: make a new sound..) // override their death sound (FIXME: make a new sound..)
sound(self, CHAN_BODY, "sounds/pu/drop.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/pu/drop.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_PLAYALWAYS);
break; break;
case DMG_TYPE_GRENADE: case DMG_TYPE_GRENADE:
points_earned = DMG_SCORE_GRENADE; points_earned = DMG_SCORE_GRENADE;
@ -334,10 +334,11 @@ void(entity victim, entity attacker, float damage, float d_style) DamageHandler
victim.punchangle_y = distance_y; victim.punchangle_y = distance_y;
// Play pain noise if this isn't done by an electric barrier. // Play pain noise if this isn't done by an electric barrier.
if (d_style != DMG_TYPE_ELECTRICTRAP) if (d_style != DMG_TYPE_ELECTRICTRAP) {
sound (victim, CHAN_AUTO, "sounds/player/pain4.wav", 1, ATTN_NORM); Sound_PlaySound(victim, "sounds/player/pain4.wav", SOUND_TYPE_PLAYER_VOICE, SOUND_PRIORITY_PLAYALWAYS);
else } else {
sound (victim, CHAN_AUTO, "sounds/machines/elec_shock.wav", 1, ATTN_NORM); Sound_PlaySound(victim, "sounds/machines/elec_shock.wav", SOUND_TYPE_PLAYER_VOICE, SOUND_PRIORITY_PLAYALWAYS);
}
if (victim.sprinting) { if (victim.sprinting) {
old_self = self; old_self = self;

View file

@ -385,9 +385,18 @@ float tracemove(vector start, vector min, vector max, vector end, float nomonste
.float way_path[40]; .float way_path[40];
.float way_cur; .float way_cur;
//
// Zombie Sound System
//
#define ZOMBIE_SOUND_TYPE_MELEE 0
#define ZOMBIE_SOUND_TYPE_WALK 1
#define ZOMBIE_SOUND_TYPE_CRAWL 2
#define ZOMBIE_SOUND_TYPE_SPRINT 3
#define ZOMBIE_SOUND_TYPE_DEATH 4
.float sound_time; .float sound_time;
.float s_time; .float s_time;
float sounds_playing;
.float fall; .float fall;
//.vector lastOrg;//Zombie's last origin, for checking stuckness //.vector lastOrg;//Zombie's last origin, for checking stuckness
@ -518,7 +527,6 @@ float blink_return;
float delay_at_round; float delay_at_round;
float spawn_delay; float spawn_delay;
float totalpowerups; float totalpowerups;
float sounds_playing;
float barricade_reward_maximum; float barricade_reward_maximum;
.float barricade_reward; .float barricade_reward;

View file

@ -274,19 +274,30 @@ if (self.state == STATE_TOP || self.state == STATE_UP)
if (other.points >= self.cost) if (other.points >= self.cost)
{ {
door_fire(); door_fire();
sound(self, 0, "sounds/misc/ching.wav", 1, 1);
sound(self, 1, "sounds/misc/buy.wav", 1, 1); // We need to create a new entity with the specific assignment of
// just playing the door sound, due to the door moving if we just
// assign the sound to the door, it cannot be heard when the engine
// supports SOUNDFLAG_FOLLOW.
entity door_sound = spawn();
setorigin(door_sound, other.origin);
door_sound.think = SUB_Remove;
door_sound.nextthink = time + 5;
Sound_PlaySound(other, "sounds/misc/ching.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
Sound_PlaySound(door_sound, "sounds/misc/buy.wav", SOUND_TYPE_ENV_IMPORTANT, SOUND_PRIORITY_PLAYALWAYS);
switch(self.sounds) switch(self.sounds)
{ {
case 1: case 1:
sound(self, 2, "sounds/misc/wood_door.wav", 1, 1); Sound_PlaySound(door_sound, "sounds/misc/wood_door.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
break; break;
case 2: case 2:
sound(self, 2, "sounds/misc/debris.wav", 1, 1); Sound_PlaySound(door_sound, "sounds/misc/debris.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
break; break;
default: default:
break; break;
} }
Player_RemoveScore(other, self.cost); Player_RemoveScore(other, self.cost);
self.solid = SOLID_NOT; self.solid = SOLID_NOT;
} }
@ -295,7 +306,7 @@ if (self.state == STATE_TOP || self.state == STATE_UP)
if(other.classname == "player" && !other.downed) if(other.classname == "player" && !other.downed)
{ {
centerprint (other, STR_NOTENOUGHPOINTS); centerprint (other, STR_NOTENOUGHPOINTS);
sound(other, 0, "sounds/misc/denybuy.wav", 1, 1); Sound_PlaySound(other, "sounds/misc/denybuy.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
other.semi_actions |= SEMIACTION_USE; other.semi_actions |= SEMIACTION_USE;
} }
} }

View file

@ -31,7 +31,7 @@
// //
void() Barrel_Explode = void() Barrel_Explode =
{ {
sound (self, CHAN_WEAPON, self.oldmodel, 1, ATTN_NORM); Sound_PlaySound(self, self.oldmodel, SOUND_TYPE_WEAPON_EXPLODE, SOUND_PRIORITY_PLAYALWAYS);
DamgageExplode (self, self.enemy, 1, 250, 250); DamgageExplode (self, self.enemy, 1, 250, 250);
#ifdef FTE #ifdef FTE

View file

@ -174,7 +174,7 @@ void() train_wait =
{ {
if (self.wait) { if (self.wait) {
self.nextthink = self.ltime + self.wait; self.nextthink = self.ltime + self.wait;
sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
} else { } else {
self.nextthink = self.ltime + 0.1; self.nextthink = self.ltime + 0.1;
} }
@ -204,7 +204,7 @@ void() train_next =
else else
self.wait = 0; self.wait = 0;
sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
SUB_CalcMove (targ.origin - self.mins, self.speed, train_wait); SUB_CalcMove (targ.origin - self.mins, self.speed, train_wait);
}; };
@ -237,16 +237,16 @@ void() func_train =
if (self.sounds == 0) { if (self.sounds == 0) {
self.noise = ("sounds/null.wav"); self.noise = ("sounds/null.wav");
precache_sound ("sounds/null.wav"); precache_sound("sounds/null.wav");
self.noise1 = ("sounds/null.wav"); self.noise1 = ("sounds/null.wav");
precache_sound ("sounds/null.wav"); precache_sound("sounds/null.wav");
} }
if (self.sounds == 1) { if (self.sounds == 1) {
self.noise = ("sounds/misc/debris.wav"); self.noise = ("sounds/misc/debris.wav");
precache_sound ("sounds/misc/debris.wav"); precache_sound("sounds/misc/debris.wav");
self.noise1 = ("sounds/misc/debris.wav"); self.noise1 = ("sounds/misc/debris.wav");
precache_sound ("sounds/misc/debris.wav"); precache_sound("sounds/misc/debris.wav");
} }
self.cnt = 1; self.cnt = 1;
@ -315,7 +315,7 @@ void() button_fire =
if (self.state == STATE_UP || self.state == STATE_TOP) if (self.state == STATE_UP || self.state == STATE_TOP)
return; return;
sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); //sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
self.state = STATE_UP; self.state = STATE_UP;
SUB_CalcMove (self.pos2, self.speed, button_wait); SUB_CalcMove (self.pos2, self.speed, button_wait);
@ -349,7 +349,7 @@ void() button_touch =
return; return;
} else { } else {
centerprint(other, STR_NOTENOUGHPOINTS); centerprint(other, STR_NOTENOUGHPOINTS);
sound(other, 0, "sounds/misc/denybuy.wav", 1, 1); Sound_PlaySound(other, "sounds/misc/denybuy.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
} }
} }
} }

View file

@ -117,7 +117,7 @@ void DrinkPerk() {
self.knife_delay = self.reload_delay2 = self.fire_delay2 = self.fire_delay = self.reload_delay = 3 + time; self.knife_delay = self.reload_delay2 = self.fire_delay2 = self.fire_delay = self.reload_delay = 3 + time;
W_HideCrosshair(self); W_HideCrosshair(self);
Set_W_Frame (machine.weapon_animduration, machine.weapon2_animduration, 2.25, 0, PERK, GivePerk, machine.weapon2model, true, S_RIGHT, true); Set_W_Frame (machine.weapon_animduration, machine.weapon2_animduration, 2.25, 0, PERK, GivePerk, machine.weapon2model, true, S_RIGHT, true);
sound(self, CHAN_ITEM, machine.oldmodel, 1, ATTN_NORM); Sound_PlaySound(self, machine.oldmodel, SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
// Communicate to our engines that this client should display correct Double-Tap icon. // Communicate to our engines that this client should display correct Double-Tap icon.
if (self.style == P_DOUBLE) { if (self.style == P_DOUBLE) {
@ -172,7 +172,7 @@ void() Perk_StopLeaveAnimation =
Light_None(self); // Remove light effect Light_None(self); // Remove light effect
SUB_UseTargets(); SUB_UseTargets();
sound(self,CHAN_ITEM,"sounds/pu/drop.wav",1,ATTN_NONE); // Play a fitting sound Sound_PlaySound(self, "sounds/pu/drop.wav", SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS); // Play a fitting sound
} }
void() Perk_MachineLeaveAnimation = void() Perk_MachineLeaveAnimation =
@ -200,7 +200,7 @@ void() Perk_MachineGoAwayForReal =
self.movetype = MOVETYPE_NOCLIP; self.movetype = MOVETYPE_NOCLIP;
self.velocity = v_up * 7; self.velocity = v_up * 7;
sound(self, CHAN_ITEM, "sounds/pu/byebye.wav", 1, ATTN_NORM); Sound_PlaySound(world, "sounds/pu/byebye.wav", SOUND_TYPE_ENV_VOICE, SOUND_PRIORITY_PLAYALWAYS);
// Do our silly little animation for 6 seconds // Do our silly little animation for 6 seconds
self.ltime = time + 6; self.ltime = time + 6;
@ -277,11 +277,11 @@ void() touch_perk =
Player_RemoveScore(other, price); Player_RemoveScore(other, price);
// Play the sound of the bottle "vending" // Play the sound of the bottle "vending"
sound(self, CHAN_ITEM,"sounds/machines/vend.wav", 1, 1); Sound_PlaySound(self, "sounds/machines/vend.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
// Play Perk Sting if we can and it exists // Play Perk Sting if we can and it exists
if (self.aistatus && self.ltime < time) { if (self.aistatus && self.ltime < time) {
sound(self, CHAN_AUTO, self.aistatus, 0.8, ATTN_IDLE); Sound_PlaySound(self, self.aistatus, SOUND_TYPE_ENV_MUSIC, SOUND_PRIORITY_PLAYALWAYS);
self.ltime = time + self.anim_weapon_time; self.ltime = time + self.anim_weapon_time;
} }
@ -318,7 +318,7 @@ void() touch_perk =
} else if (other.button7 && !(other.semi_actions & SEMIACTION_USE)) { } else if (other.button7 && !(other.semi_actions & SEMIACTION_USE)) {
// We tried to use, but we don't have the cash.. // We tried to use, but we don't have the cash..
centerprint(other, STR_NOTENOUGHPOINTS); centerprint(other, STR_NOTENOUGHPOINTS);
sound(other, 0, "sounds/misc/denybuy.wav", 1, 1); Sound_PlaySound(other, "sounds/misc/denybuy.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
other.semi_actions |= SEMIACTION_USE; other.semi_actions |= SEMIACTION_USE;
} }
} }
@ -387,9 +387,9 @@ void() Perk_Jingle =
self.nextthink = time + jinglewaittime; self.nextthink = time + jinglewaittime;
} else { } else {
// 15% Chance to Play Jingle // 15% Chance to Play Jingle
local float chance = random(); float chance = random();
if (chance <= 0.15) { if (chance <= 0.15) {
sound(self, CHAN_AUTO, self.powerup_vo, 0.8, ATTN_IDLE); Sound_PlaySound(self, self.powerup_vo, SOUND_TYPE_ENV_MUSIC, SOUND_PRIORITY_PLAYALWAYS);
self.ltime = time + self.anim_weapon2_time; self.ltime = time + self.anim_weapon2_time;
jinglewaittime += self.anim_weapon2_time; jinglewaittime += self.anim_weapon2_time;
} }
@ -645,7 +645,7 @@ void() touch_power_Switch =
if (other.button7 && !isPowerOn) { if (other.button7 && !isPowerOn) {
turnpower1(); turnpower1();
isPowerOn = true; isPowerOn = true;
sound(self, CHAN_ITEM, self.oldmodel, 1, ATTN_NONE); Sound_PlaySound(world, self.oldmodel, SOUND_TYPE_ENV_VOICE, SOUND_PRIORITY_PLAYALWAYS);
// Print message // Print message
if (self.message) { if (self.message) {

View file

@ -53,7 +53,7 @@ void() radioPlay =
self.health = 1; self.health = 1;
if (self.radioState == 1) { if (self.radioState == 1) {
sound (self, CHAN_ITEM, self.tune, 1, ATTN_NORM); Sound_PlaySound(self, self.tune, SOUND_TYPE_ENV_IMPORTANT, SOUND_PRIORITY_PLAYALWAYS);
if (!(self.spawnflags & SPAWNFLAG_RADIO_PLAYONCE)) if (!(self.spawnflags & SPAWNFLAG_RADIO_PLAYONCE))
@ -69,7 +69,7 @@ void() radioPlay =
self.think = radioPlay; self.think = radioPlay;
} else if (self.radioState == 0) { } else if (self.radioState == 0) {
sound (self, CHAN_ITEM, "sounds/null.wav", 1, ATTN_NONE); sound(self, CHAN_ITEM, "sounds/null.wav", 1, ATTN_NONE);
self.nextthink = 0; self.nextthink = 0;
self.think = SUB_Null; self.think = SUB_Null;
} }
@ -79,7 +79,7 @@ void() radio_hit =
{ {
self.health = 1; self.health = 1;
sound (self, CHAN_ITEM, "sounds/misc/radio.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/misc/radio.wav", SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS);
self.nextthink = time + 1; self.nextthink = time + 1;
self.think = radioPlay; self.think = radioPlay;
@ -99,7 +99,7 @@ void() item_radio =
if (!self.maxs) self.maxs = '8 8 4'; if (!self.maxs) self.maxs = '8 8 4';
precache_model (self.model); precache_model (self.model);
precache_sound ("sounds/misc/radio.wav"); precache_sound("sounds/misc/radio.wav");
// Backwards compatibility // Backwards compatibility
if (!self.tune) { if (!self.tune) {
@ -107,7 +107,7 @@ void() item_radio =
self.length = 10.1; self.length = 10.1;
} }
precache_sound (self.tune); precache_sound(self.tune);
self.movetype = MOVETYPE_NONE; // so it doesn't get pushed by anything self.movetype = MOVETYPE_NONE; // so it doesn't get pushed by anything
self.solid=SOLID_BBOX; self.solid=SOLID_BBOX;
self.classname = "item_radio"; self.classname = "item_radio";
@ -140,7 +140,7 @@ void() teddy_spawn =
self.th_die = teddy_react; self.th_die = teddy_react;
if (self.noise) if (self.noise)
precache_sound (self.noise); precache_sound(self.noise);
}; };
/* ================== /* ==================

View file

@ -86,7 +86,7 @@ inline void() MBOX_Reset =
// Plays the open animation for the Mystery Box, // Plays the open animation for the Mystery Box,
// frames 9-12. // frames 9-12.
// //
void() MBOX_PlayCloseAnimation = [9, MBOX_CloseAnimation2 ] { self.frame = 9; MBOX_UpdateGlowFrame(); sound (self, CHAN_ITEM, mystery_box_close_sound, 1, ATTN_NORM); Light_None(self); }; void() MBOX_PlayCloseAnimation = [9, MBOX_CloseAnimation2 ] { self.frame = 9; MBOX_UpdateGlowFrame(); Sound_PlaySound(self, mystery_box_close_sound, SOUND_TYPE_ENV_MUSIC, SOUND_PRIORITY_PLAYALWAYS); Light_None(self); };
void() MBOX_CloseAnimation2 = [10, MBOX_CloseAnimation3 ] { self.frame = 10; MBOX_UpdateGlowFrame(); }; void() MBOX_CloseAnimation2 = [10, MBOX_CloseAnimation3 ] { self.frame = 10; MBOX_UpdateGlowFrame(); };
void() MBOX_CloseAnimation3 = [10, MBOX_CloseAnimation4 ] { self.frame = 11; MBOX_UpdateGlowFrame(); }; void() MBOX_CloseAnimation3 = [10, MBOX_CloseAnimation4 ] { self.frame = 11; MBOX_UpdateGlowFrame(); };
void() MBOX_CloseAnimation4 = [10, MBOX_Reset ] { self.frame = 12; MBOX_UpdateGlowFrame(); }; void() MBOX_CloseAnimation4 = [10, MBOX_Reset ] { self.frame = 12; MBOX_UpdateGlowFrame(); };
@ -308,7 +308,7 @@ void() MBOX_FindNewSpot =
// Spawn some sparkles so it doesn't just "appear" // Spawn some sparkles so it doesn't just "appear"
SpawnSpark(new_box.origin, 0.75); SpawnSpark(new_box.origin, 0.75);
// "Woosh" Effect // "Woosh" Effect
sound(new_box, CHAN_AUTO, "sounds/pu/drop.wav", 1, ATTN_NORM); Sound_PlaySound(new_box, "sounds/pu/drop.wav", SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS);
} }
// //
@ -321,7 +321,7 @@ void() MBOX_StopFlying =
// Spark Effect // Spark Effect
SpawnSpark(self.origin, 0.75); SpawnSpark(self.origin, 0.75);
// "Woosh" Effect // "Woosh" Effect
sound(self, CHAN_AUTO, "sounds/pu/drop.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/pu/drop.wav", SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS);
// Disappear! // Disappear!
self.model = "models/props/teddy.mdl"; self.model = "models/props/teddy.mdl";
setmodel(self, self.model); setmodel(self, self.model);
@ -385,9 +385,9 @@ void() MBOX_FlyAway =
void() MBOX_Leave = void() MBOX_Leave =
{ {
// Broadcast the laughter // Broadcast the laughter
sound(self, CHAN_ITEM, "sounds/pu/byebye.wav", 1, ATTN_NONE); Sound_PlaySound(world, "sounds/pu/byebye.wav", SOUND_TYPE_ENV_VOICE, SOUND_PRIORITY_PLAYALWAYS);
// "Woosh" Effect // "Woosh" Effect
sound(self, CHAN_AUTO, "sounds/pu/drop.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/pu/drop.wav", SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS);
// Spark Effect // Spark Effect
SpawnSpark(self.origin, 0.75); SpawnSpark(self.origin, 0.75);
// Turn off Light & Glow // Turn off Light & Glow
@ -440,8 +440,9 @@ void() MBOX_PresentTeddy =
Player_AddScore(self.owner.owner, mystery_box_cost, false); Player_AddScore(self.owner.owner, mystery_box_cost, false);
// Broadcast the bad luck. // Broadcast the bad luck.
sound(self, CHAN_ITEM, "sounds/misc/buy.wav", 1, ATTN_NONE); Sound_PlaySound(self, "sounds/misc/buy.wav", SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS);
sound(self, 2, "sounds/misc/giggle.wav", 1, ATTN_NONE); Sound_PlaySound(self, "sounds/misc/giggle.wav", SOUND_TYPE_ENV_VOICE, SOUND_PRIORITY_PLAYALWAYS);
// Linger for 2 seconds, and then fly away. // Linger for 2 seconds, and then fly away.
self.think = MBOX_TeddyLeave; self.think = MBOX_TeddyLeave;
self.nextthink = time + 2; self.nextthink = time + 2;
@ -621,8 +622,8 @@ void() Create_Floating_Weapon =
void() mystery_box_tp_spot = void() mystery_box_tp_spot =
{ {
precache_model ("models/props/teddy.mdl"); precache_model ("models/props/teddy.mdl");
precache_sound ("sounds/pu/byebye.wav"); precache_sound("sounds/pu/byebye.wav");
precache_sound ("sounds/misc/giggle.wav"); precache_sound("sounds/misc/giggle.wav");
self.solid=SOLID_TRIGGER; self.solid=SOLID_TRIGGER;
self.classname = "mystery_box_tp_spot"; self.classname = "mystery_box_tp_spot";
@ -687,7 +688,7 @@ void() MBOX_Touch =
{ {
if (other.points >= mystery_box_cost) if (other.points >= mystery_box_cost)
{ {
sound (self, CHAN_ITEM, mystery_box_open_sound, 1, ATTN_NORM); Sound_PlaySound(self, mystery_box_open_sound, SOUND_TYPE_ENV_MUSIC, SOUND_PRIORITY_PLAYALWAYS);
Player_RemoveScore(other, mystery_box_cost); Player_RemoveScore(other, mystery_box_cost);
self.boxstatus = 1; self.boxstatus = 1;
self.owner = other; self.owner = other;
@ -698,7 +699,7 @@ void() MBOX_Touch =
} }
else { else {
centerprint (other, STR_NOTENOUGHPOINTS); centerprint (other, STR_NOTENOUGHPOINTS);
sound(other, 0, "sounds/misc/denybuy.wav", 1, 1); Sound_PlaySound(other, "sounds/misc/denybuy.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
} }
} }
if (self.boxstatus == 2) if (self.boxstatus == 2)
@ -707,7 +708,7 @@ void() MBOX_Touch =
{ {
other.reload_delay = 0; other.reload_delay = 0;
self.owner = world; self.owner = world;
sound(self, 0,"sounds/misc/ching.wav", 1, 1); Sound_PlaySound(self, "sounds/misc/ching.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
tempe = self; tempe = self;
self = other; self = other;

View file

@ -128,7 +128,7 @@ void() PAP_Tick =
if (self.ltime < time) if (self.ltime < time)
PAP_Reset(); PAP_Reset();
else { else {
sound(self, CHAN_BODY, "sounds/machines/packapunch/tick.wav", 1, 1); Sound_PlaySound(self, "sounds/machines/packapunch/tick.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
self.nextthink = time + 0.87; self.nextthink = time + 0.87;
} }
}; };
@ -187,11 +187,11 @@ void(entity pap, entity buyer) PAP_UpgradeWeapon =
// Give a nice blue glow and play upgrade sound // Give a nice blue glow and play upgrade sound
Light_Cyan(pap, false); Light_Cyan(pap, false);
sound(pap, CHAN_ITEM, pap.oldmodel, 0.8, 1); Sound_PlaySound(pap, pap.oldmodel, SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS);
// Mapper-provided musical sting. // Mapper-provided musical sting.
if (pap.powerup_vo) if (pap.powerup_vo)
sound(pap, CHAN_AUTO, pap.powerup_vo, 1, ATTN_IDLE); Sound_PlaySound(pap, pap.powerup_vo, SOUND_TYPE_ENV_MUSIC, SOUND_PRIORITY_PLAYALWAYS);
// //
// Spawn and prepare the floating Weapon // Spawn and prepare the floating Weapon
@ -226,7 +226,7 @@ void(entity pap, entity buyer) PAP_UpgradeWeapon =
// Play Player's view model animation and sound. // Play Player's view model animation and sound.
self.fire_delay = self.reload_delay = 2.0 + time; self.fire_delay = self.reload_delay = 2.0 + time;
sound(self,CHAN_WEAPON,"sounds/machines/papsound.wav",1,ATTN_NORM); Sound_PlaySound(self, "sounds/machines/papsound.wav", SOUND_TYPE_PLAYER_VOICE, SOUND_PRIORITY_PLAYALWAYS);
pap.weapon = self.weapon; pap.weapon = self.weapon;
@ -284,7 +284,7 @@ void() PAP_Touch =
else if (other.button7 && other.weapon && !(other.semi_actions & SEMIACTION_USE)) { else if (other.button7 && other.weapon && !(other.semi_actions & SEMIACTION_USE)) {
other.semi_actions |= SEMIACTION_USE; other.semi_actions |= SEMIACTION_USE;
centerprint (other, STR_NOTENOUGHPOINTS); centerprint (other, STR_NOTENOUGHPOINTS);
sound(other, 0, "sounds/misc/denybuy.wav", 1, 1); Sound_PlaySound(other, "sounds/misc/denybuy.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
} }
} }
@ -319,7 +319,7 @@ void() PAP_Touch =
void() PAP_Click = void() PAP_Click =
{ {
if (!self.active_door.papState) if (!self.active_door.papState)
sound(self, CHAN_ITEM, "sounds/machines/packapunch/gear_shift.wav", 1, 1); Sound_PlaySound(self, "sounds/machines/packapunch/gear_shift.wav", SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS);
self.nextthink = time + 0.75; self.nextthink = time + 0.75;
}; };
@ -428,7 +428,7 @@ void() perk_pap =
if (self.powerup_vo) if (self.powerup_vo)
precache_sound(self.powerup_vo); precache_sound(self.powerup_vo);
precache_sound ("sounds/machines/papsound.wav"); precache_sound("sounds/machines/papsound.wav");
precache_sound("sounds/weapons/papfire.wav"); precache_sound("sounds/weapons/papfire.wav");
precache_sound("sounds/machines/packapunch/gear_shift.wav"); precache_sound("sounds/machines/packapunch/gear_shift.wav");
precache_sound("sounds/machines/packapunch/tick.wav"); precache_sound("sounds/machines/packapunch/tick.wav");

View file

@ -314,7 +314,7 @@ void() PU_NukeKill =
self.th_die(); self.th_die();
// override their death sound // override their death sound
sound(self, CHAN_BODY, "sounds/pu/nuke.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/pu/nuke.wav", SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS);
// restore self // restore self
self = oldself; self = oldself;
@ -663,7 +663,7 @@ void() PU_Flash =
// //
void() PU_PlayVO = void() PU_PlayVO =
{ {
sound(self, CHAN_VOICE, self.powerup_vo, 1, ATTN_NONE); Sound_PlaySound(world, self.powerup_vo, SOUND_TYPE_ENV_VOICE, SOUND_PRIORITY_ALLOWSKIP);
PU_FreeEnt(self); PU_FreeEnt(self);
}; };
@ -700,7 +700,7 @@ void() PU_Touch =
if (other.classname == "player") if (other.classname == "player")
{ {
// Acquire sound // Acquire sound
sound(self.owner, CHAN_VOICE, "sounds/pu/pickup.wav", 1, ATTN_NONE); Sound_PlaySound(self.owner, "sounds/pu/pickup.wav", SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS);
// Prepare for VO and destruction // Prepare for VO and destruction
self.think = PU_PlayVO; self.think = PU_PlayVO;
@ -749,7 +749,7 @@ void() PU_SparkleThink =
if(self.calc_time <= time) if(self.calc_time <= time)
{ {
sound(self, CHAN_VOICE, "sounds/pu/powerup.wav", 0.6, ATTN_NORM); Sound_PlaySound(self, "sounds/pu/powerup.wav", SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS);
self.calc_time = time + 2.998; self.calc_time = time + 2.998;
} }
}; };
@ -827,8 +827,8 @@ void(vector where, float type) Spawn_Powerup =
sparkle.nextthink = time + 0.1; sparkle.nextthink = time + 0.1;
// Drop Sounds // Drop Sounds
sound(sparkle, CHAN_VOICE, "sounds/pu/powerup.wav", 0.6, ATTN_NORM); Sound_PlaySound(sparkle, "sounds/pu/powerup.wav", SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS);
sound(powerup, CHAN_AUTO, "sounds/pu/drop.wav", 1, ATTN_NONE); Sound_PlaySound(powerup, "sounds/pu/drop.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
// Check if we were forcefully assigned an ID // Check if we were forcefully assigned an ID
if (type != -1) { if (type != -1) {

View file

@ -74,7 +74,7 @@ void() teleport_entities_back =
SUB_UseTargets(); SUB_UseTargets();
self.iszomb = 0; self.iszomb = 0;
sound(self.entities[0], CHAN_WEAPON, "sounds/machines/elec_shock.wav", 1, ATTN_NORM); Sound_PlaySound(self.entities[0], "sounds/machines/elec_shock.wav", SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS);
for(float i = 0; i < 4; i++) { for(float i = 0; i < 4; i++) {
if (self.entities[i].classname == "player") { if (self.entities[i].classname == "player") {
@ -223,7 +223,7 @@ void() teleport_pad_touch =
if (other.button7) { if (other.button7) {
self.host.isLinked = true; self.host.isLinked = true;
self.host.waitLink = false; self.host.waitLink = false;
sound(self, CHAN_WEAPON, "sounds/weapons/tesla/switchon.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/tesla/switchon.wav", SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS);
} }
} else { } else {
if (self.host.mode == 2) { if (self.host.mode == 2) {
@ -242,7 +242,7 @@ void() teleporter_link_touch =
local entity en; local entity en;
en = find(world, targetname, self.target2); en = find(world, targetname, self.target2);
sound(self, CHAN_WEAPON, "sounds/weapons/tesla/switchoff.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/tesla/switchoff.wav", SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS);
self.waitLink = true; self.waitLink = true;
en.host = self; en.host = self;
} }
@ -281,7 +281,7 @@ void() teleport_touch =
if (other.points < self.cost) { if (other.points < self.cost) {
centerprint(other, STR_NOTENOUGHPOINTS); centerprint(other, STR_NOTENOUGHPOINTS);
sound(other, 0, "sounds/misc/denybuy.wav", 1, 1); Sound_PlaySound(other, "sounds/misc/denybuy.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
return; return;
} }
@ -298,7 +298,7 @@ void() teleport_touch =
people.movetype = MOVETYPE_NONE; people.movetype = MOVETYPE_NONE;
} }
else if (people.classname == "ai_dog" && !people.electro_targeted) { else if (people.classname == "ai_dog" && !people.electro_targeted) {
sound(self, CHAN_WEAPON, "sounds/machines/elec_shock.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/machines/elec_shock.wav", SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS);
tempe = self; tempe = self;
self = people; self = people;
@ -322,7 +322,7 @@ void() teleport_touch =
self.think = teleport_entities; self.think = teleport_entities;
self.nextthink = time + 1; self.nextthink = time + 1;
SpawnSpark(self.origin + '0 0 32', 1.5); SpawnSpark(self.origin + '0 0 32', 1.5);
sound(self, CHAN_WEAPON, "sounds/machines/elec_shock.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/machines/elec_shock.wav", SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS);
} }
if (other.button1) { if (other.button1) {

View file

@ -110,7 +110,7 @@ void() zapper_do_damage =
// - Dogs should always explode on contact, instantly. // - Dogs should always explode on contact, instantly.
// - Trap plays Electro-Shock sound, dog plays explosion. // - Trap plays Electro-Shock sound, dog plays explosion.
else if (other.classname == "ai_dog") { else if (other.classname == "ai_dog") {
sound(self, CHAN_WEAPON, "sounds/machines/elec_shock.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/machines/elec_shock.wav", SOUND_TYPE_ZOMBIE_LOUD, SOUND_PRIORITY_PLAYALWAYS);
tempe = self; tempe = self;
self = other; self = other;
@ -250,7 +250,7 @@ void() zapper_touch =
other.semi_actions |= SEMIACTION_USE; other.semi_actions |= SEMIACTION_USE;
if (other.points < self.cost) { if (other.points < self.cost) {
centerprint(other, STR_NOTENOUGHPOINTS); centerprint(other, STR_NOTENOUGHPOINTS);
sound(other, 0, "sounds/misc/denybuy.wav", 1, 1); Sound_PlaySound(other, "sounds/misc/denybuy.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
return; return;
} }

View file

@ -231,7 +231,7 @@ void() trigger_interact_touch =
if (other.button7) { if (other.button7) {
if (self.noise) if (self.noise)
sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM); Sound_PlaySound(other, self.noise, SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS);
multi_trigger(); multi_trigger();
} }
} }
@ -265,7 +265,7 @@ void() teddy_react =
if (self.noise) if (self.noise)
sound (dummy, CHAN_ITEM, self.noise, 1, ATTN_NORM); Sound_PlaySound(dummy, self.noise, SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS);
Ent_FakeRemove(self); Ent_FakeRemove(self);
} }
@ -381,7 +381,7 @@ void() trigger_awardpoints_touch =
Player_AddScore(other, self.points, (self.spawnflags & SPAWNFLAG_TRIGGERSCORE_APPLY2XPOINTS)); Player_AddScore(other, self.points, (self.spawnflags & SPAWNFLAG_TRIGGERSCORE_APPLY2XPOINTS));
if (self.noise != "") if (self.noise != "")
sound(self, 0, self.noise, 1, 1); Sound_PlaySound(self, self.noise, SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
self.health = 0; self.health = 0;
} }

View file

@ -52,7 +52,7 @@ void() WallWeapon_Use =
return; return;
// Play a sound for it "spawning" // Play a sound for it "spawning"
sound(self, 1, "sounds/misc/buy.wav", 1, 1); Sound_PlaySound(self, "sounds/misc/buy.wav", SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS);
// MP5K and Waffe were added in late in the mix-up.. needs special case. Also grenade bag. // MP5K and Waffe were added in late in the mix-up.. needs special case. Also grenade bag.
switch(self.sequence + 1) { switch(self.sequence + 1) {
@ -186,7 +186,7 @@ void () WallWeapon_TouchTrigger =
// Player doesn't have enough points. Abort. // Player doesn't have enough points. Abort.
if (other.points < wcost) { if (other.points < wcost) {
centerprint(other, STR_NOTENOUGHPOINTS); centerprint(other, STR_NOTENOUGHPOINTS);
sound(other, 0, "sounds/misc/denybuy.wav", 1, 1); Sound_PlaySound(other, "sounds/misc/denybuy.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
return; return;
} }
@ -195,7 +195,7 @@ void () WallWeapon_TouchTrigger =
// Set the weapon's ammo to the max capacity. // Set the weapon's ammo to the max capacity.
Weapon_SetPlayerAmmoInSlot(other, slot, wall_ammo); Weapon_SetPlayerAmmoInSlot(other, slot, wall_ammo);
sound(other, 0, "sounds/misc/ching.wav", 1, 1); Sound_PlaySound(other, "sounds/misc/ching.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
other.reload_delay = 0; other.reload_delay = 0;
// Subtract the cost from player points. // Subtract the cost from player points.
@ -234,13 +234,13 @@ void () WallWeapon_TouchTrigger =
// Player doesn't have enough points. Abort. // Player doesn't have enough points. Abort.
if (other.points < wcost) { if (other.points < wcost) {
centerprint(other, STR_NOTENOUGHPOINTS); centerprint(other, STR_NOTENOUGHPOINTS);
sound(other, 0, "sounds/misc/denybuy.wav", 1, 1); Sound_PlaySound(other, "sounds/misc/denybuy.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
return; return;
} }
other.weapons[0].weapon_reserve = getWeaponAmmo(other.weapon); other.weapons[0].weapon_reserve = getWeaponAmmo(other.weapon);
sound(other, 0, "sounds/misc/ching.wav", 1, 1); Sound_PlaySound(other, "sounds/misc/ching.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
other.reload_delay = 0; other.reload_delay = 0;
// Subtract the cost from player points. // Subtract the cost from player points.
@ -267,14 +267,14 @@ void () WallWeapon_TouchTrigger =
if (other.points < self.cost2) if (other.points < self.cost2)
{ {
centerprint(other, STR_NOTENOUGHPOINTS); centerprint(other, STR_NOTENOUGHPOINTS);
sound(other, 0, "sounds/misc/denybuy.wav", 1, 1); Sound_PlaySound(other, "sounds/misc/denybuy.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
return; return;
} }
else else
{ {
other.ach_tracker_coll++; other.ach_tracker_coll++;
other.reload_delay = 0; other.reload_delay = 0;
sound(other, 0, "sounds/misc/ching.wav", 1, 1); Sound_PlaySound(other, "sounds/misc/ching.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
//other.boughtweapon = true; //other.boughtweapon = true;
Player_RemoveScore(other, self.cost2); Player_RemoveScore(other, self.cost2);
other.grenades = other.grenades | 2; other.grenades = other.grenades | 2;
@ -302,14 +302,14 @@ void () WallWeapon_TouchTrigger =
if (other.points < self.cost) if (other.points < self.cost)
{ {
centerprint(other, STR_NOTENOUGHPOINTS); centerprint(other, STR_NOTENOUGHPOINTS);
sound(other, 0, "sounds/misc/denybuy.wav", 1, 1); Sound_PlaySound(other, "sounds/misc/denybuy.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
return; return;
} }
else else
{ {
other.ach_tracker_coll++; other.ach_tracker_coll++;
other.reload_delay = 0; other.reload_delay = 0;
sound(other, 0, "sounds/misc/ching.wav", 1, 1); Sound_PlaySound(other, "sounds/misc/ching.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
//other.boughtweapon = true; //other.boughtweapon = true;
Player_RemoveScore(other, self.cost); Player_RemoveScore(other, self.cost);
other.primary_grenades = 4; other.primary_grenades = 4;
@ -332,12 +332,12 @@ void () WallWeapon_TouchTrigger =
{ {
if (other.points < self.cost2) { if (other.points < self.cost2) {
centerprint(other, STR_NOTENOUGHPOINTS); centerprint(other, STR_NOTENOUGHPOINTS);
sound(other, 0, "sounds/misc/denybuy.wav", 1, 1); Sound_PlaySound(other, "sounds/misc/denybuy.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
return; return;
} else { } else {
W_HideCrosshair(other); W_HideCrosshair(other);
Player_RemoveScore(other, self.cost2); Player_RemoveScore(other, self.cost2);
sound(other, 0, "sounds/misc/ching.wav", 1, 1); Sound_PlaySound(other, "sounds/misc/ching.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
other.ach_tracker_coll++; other.ach_tracker_coll++;
if (self.enemy) if (self.enemy)
{ {
@ -369,12 +369,12 @@ void () WallWeapon_TouchTrigger =
other.semi_actions |= SEMIACTION_USE; other.semi_actions |= SEMIACTION_USE;
if (other.points < self.cost) { if (other.points < self.cost) {
centerprint (other, STR_NOTENOUGHPOINTS); centerprint (other, STR_NOTENOUGHPOINTS);
sound(other, 0, "sounds/misc/denybuy.wav", 1, 1); Sound_PlaySound(other, "sounds/misc/denybuy.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
return; return;
} }
other.ach_tracker_coll++; other.ach_tracker_coll++;
sound(other, 0, "sounds/misc/ching.wav", 1, 1); Sound_PlaySound(other, "sounds/misc/ching.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
other.reload_delay = 0; other.reload_delay = 0;
Player_RemoveScore(other, self.cost); Player_RemoveScore(other, self.cost);
if (self.enemy) { if (self.enemy) {

View file

@ -61,7 +61,7 @@ void() Window_repaired =
{ {
if (barricade_reward_maximum > self.enemy.barricade_reward) if (barricade_reward_maximum > self.enemy.barricade_reward)
{ {
sound(self, 0,"sounds/misc/ching.wav", 1, ATTN_NORM); Sound_PlaySound(self.enemy, "sounds/misc/ching.wav", SOUND_TYPE_ENV_CHING, SOUND_PRIORITY_PLAYALWAYS);
Player_AddScore(self.enemy, 10, true); Player_AddScore(self.enemy, 10, true);
self.enemy.barricade_reward += 10; self.enemy.barricade_reward += 10;
@ -72,7 +72,7 @@ void() Window_repaired =
void() Barricade_hit_window = void() Barricade_hit_window =
{ {
sound(self, 0, self.oldmodel, 1, ATTN_NORM); Sound_PlaySound(self, self.oldmodel, SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS);
} }
void(void() next) checkForSpeed = { void(void() next) checkForSpeed = {
@ -227,17 +227,17 @@ void() window_repair6_6 =[ 6, window_repair6_7 ] {self.frame = 46;};
void() window_repair6_7 =[ 7, window_repair6_8 ] {self.frame = 47;Barricade_hit_window();}; void() window_repair6_7 =[ 7, window_repair6_8 ] {self.frame = 47;Barricade_hit_window();};
void() window_repair6_8 =[ 8, SUB_Null ] {self.frame = 48; Window_repaired();}; void() window_repair6_8 =[ 8, SUB_Null ] {self.frame = 48; Window_repaired();};
void() window_carpenter_1 =[ 1, window_carpenter_2 ] {self.frame = 47;sound(self, 0, self.oldmodel, 1, ATTN_NORM);}; void() window_carpenter_1 =[ 1, window_carpenter_2 ] {self.frame = 47; Sound_PlaySound(self, self.oldmodel, SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS); };
void() window_carpenter_2 =[ 2, window_carpenter_3 ] {self.frame = 48;}; void() window_carpenter_2 =[ 2, window_carpenter_3 ] {self.frame = 48;};
void() window_carpenter_3 =[ 3, window_carpenter_4 ] {self.frame = 55;sound(self, 1, self.oldmodel, 1, ATTN_NORM);}; void() window_carpenter_3 =[ 3, window_carpenter_4 ] {self.frame = 55; Sound_PlaySound(self, self.oldmodel, SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS); };
void() window_carpenter_4 =[ 4, window_carpenter_5 ] {self.frame = 56;}; void() window_carpenter_4 =[ 4, window_carpenter_5 ] {self.frame = 56;};
void() window_carpenter_5 =[ 5, window_carpenter_6 ] {self.frame = 63;sound(self, 2, self.oldmodel, 1, ATTN_NORM);}; void() window_carpenter_5 =[ 5, window_carpenter_6 ] {self.frame = 63; Sound_PlaySound(self, self.oldmodel, SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS); };
void() window_carpenter_6 =[ 6, window_carpenter_7 ] {self.frame = 64;}; void() window_carpenter_6 =[ 6, window_carpenter_7 ] {self.frame = 64;};
void() window_carpenter_7 =[ 7, window_carpenter_8 ] {self.frame = 71;sound(self, 0, self.oldmodel, 1, ATTN_NORM);}; void() window_carpenter_7 =[ 7, window_carpenter_8 ] {self.frame = 71; Sound_PlaySound(self, self.oldmodel, SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS); };
void() window_carpenter_8 =[ 8, window_carpenter_9 ] {self.frame = 72;}; void() window_carpenter_8 =[ 8, window_carpenter_9 ] {self.frame = 72;};
void() window_carpenter_9 =[ 7, window_carpenter_10 ] {self.frame = 79;sound(self, 1, self.oldmodel, 1, ATTN_NORM);}; void() window_carpenter_9 =[ 7, window_carpenter_10 ] {self.frame = 79; Sound_PlaySound(self, self.oldmodel, SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS); };
void() window_carpenter_10 =[ 8, window_carpenter_11 ] {self.frame = 80;}; void() window_carpenter_10 =[ 8, window_carpenter_11 ] {self.frame = 80;};
void() window_carpenter_11 =[ 7, window_carpenter_12 ] {self.frame = 87;sound(self, 2, self.oldmodel, 1, ATTN_NORM);}; void() window_carpenter_11 =[ 7, window_carpenter_12 ] {self.frame = 87; Sound_PlaySound(self, self.oldmodel, SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS); };
void() window_carpenter_12 =[ 8, SUB_Null ] {self.frame = 88;self.isspec = 0;}; void() window_carpenter_12 =[ 8, SUB_Null ] {self.frame = 88;self.isspec = 0;};
@ -246,7 +246,7 @@ void() Window_Damage =
if(self.health == 0 || self.owner) if(self.health == 0 || self.owner)
return; return;
sound(self, CHAN_VOICE, self.aistatus, 1, ATTN_NORM); Sound_PlaySound(self, self.aistatus, SOUND_TYPE_ENV_OBJECT, SOUND_PRIORITY_PLAYALWAYS);
self.health = self.health - 1; self.health = self.health - 1;

View file

@ -145,7 +145,7 @@ void() StartFrame =
} else if (time_before_gamestart < time) { } else if (time_before_gamestart < time) {
InitRounds(); InitRounds();
nzp_screenflash(world, SCREENFLASH_COLOR_BLACK, 1, SCREENFLASH_FADE_OUT); nzp_screenflash(world, SCREENFLASH_COLOR_BLACK, 1, SCREENFLASH_FADE_OUT);
sound(self, CHAN_AUTO, "sounds/rounds/splash.wav", 1, ATTN_NONE); Rounds_PlayTransition("sounds/rounds/splash.wav");
entity players = find(world, classname, "player"); entity players = find(world, classname, "player");
@ -277,67 +277,67 @@ void() precaches =
precache_sound("sounds/misc/denybuy.wav"); precache_sound("sounds/misc/denybuy.wav");
// power-ups // power-ups
precache_sound ("sounds/pu/pickup.wav"); precache_sound("sounds/pu/pickup.wav");
precache_sound ("sounds/pu/powerup.wav"); precache_sound("sounds/pu/powerup.wav");
precache_sound ("sounds/pu/drop.wav"); precache_sound("sounds/pu/drop.wav");
precache_sound ("sounds/pu/byebye.wav"); precache_sound("sounds/pu/byebye.wav");
// zombie walk // zombie walk
precache_sound ("sounds/zombie/w0.wav"); precache_sound("sounds/zombie/w0.wav");
precache_sound ("sounds/zombie/w1.wav"); precache_sound("sounds/zombie/w1.wav");
precache_sound ("sounds/zombie/w2.wav"); precache_sound("sounds/zombie/w2.wav");
precache_sound ("sounds/zombie/w3.wav"); precache_sound("sounds/zombie/w3.wav");
precache_sound ("sounds/zombie/w4.wav"); precache_sound("sounds/zombie/w4.wav");
precache_sound ("sounds/zombie/w5.wav"); precache_sound("sounds/zombie/w5.wav");
precache_sound ("sounds/zombie/w6.wav"); precache_sound("sounds/zombie/w6.wav");
precache_sound ("sounds/zombie/w7.wav"); precache_sound("sounds/zombie/w7.wav");
precache_sound ("sounds/zombie/w8.wav"); precache_sound("sounds/zombie/w8.wav");
precache_sound ("sounds/zombie/w9.wav"); precache_sound("sounds/zombie/w9.wav");
// zombie run // zombie run
precache_sound ("sounds/zombie/r0.wav"); precache_sound("sounds/zombie/r0.wav");
precache_sound ("sounds/zombie/r1.wav"); precache_sound("sounds/zombie/r1.wav");
precache_sound ("sounds/zombie/r2.wav"); precache_sound("sounds/zombie/r2.wav");
precache_sound ("sounds/zombie/r3.wav"); precache_sound("sounds/zombie/r3.wav");
precache_sound ("sounds/zombie/r4.wav"); precache_sound("sounds/zombie/r4.wav");
precache_sound ("sounds/zombie/r5.wav"); precache_sound("sounds/zombie/r5.wav");
precache_sound ("sounds/zombie/r6.wav"); precache_sound("sounds/zombie/r6.wav");
precache_sound ("sounds/zombie/r7.wav"); precache_sound("sounds/zombie/r7.wav");
precache_sound ("sounds/zombie/r8.wav"); precache_sound("sounds/zombie/r8.wav");
precache_sound ("sounds/zombie/r9.wav"); precache_sound("sounds/zombie/r9.wav");
// zombie swipe // zombie swipe
precache_sound ("sounds/zombie/a0.wav"); precache_sound("sounds/zombie/a0.wav");
precache_sound ("sounds/zombie/a1.wav"); precache_sound("sounds/zombie/a1.wav");
precache_sound ("sounds/zombie/a2.wav"); precache_sound("sounds/zombie/a2.wav");
precache_sound ("sounds/zombie/a3.wav"); precache_sound("sounds/zombie/a3.wav");
precache_sound ("sounds/zombie/a4.wav"); precache_sound("sounds/zombie/a4.wav");
precache_sound ("sounds/zombie/a5.wav"); precache_sound("sounds/zombie/a5.wav");
precache_sound ("sounds/zombie/a6.wav"); precache_sound("sounds/zombie/a6.wav");
precache_sound ("sounds/zombie/a7.wav"); precache_sound("sounds/zombie/a7.wav");
// zombie death // zombie death
precache_sound ("sounds/zombie/d0.wav"); precache_sound("sounds/zombie/d0.wav");
precache_sound ("sounds/zombie/d1.wav"); precache_sound("sounds/zombie/d1.wav");
precache_sound ("sounds/zombie/d2.wav"); precache_sound("sounds/zombie/d2.wav");
precache_sound ("sounds/zombie/d3.wav"); precache_sound("sounds/zombie/d3.wav");
precache_sound ("sounds/zombie/d4.wav"); precache_sound("sounds/zombie/d4.wav");
precache_sound ("sounds/zombie/d5.wav"); precache_sound("sounds/zombie/d5.wav");
precache_sound ("sounds/zombie/d6.wav"); precache_sound("sounds/zombie/d6.wav");
precache_sound ("sounds/zombie/d7.wav"); precache_sound("sounds/zombie/d7.wav");
// zombie taunt // zombie taunt
precache_sound ("sounds/zombie/t0.wav"); precache_sound("sounds/zombie/t0.wav");
precache_sound ("sounds/zombie/t1.wav"); precache_sound("sounds/zombie/t1.wav");
precache_sound ("sounds/zombie/t2.wav"); precache_sound("sounds/zombie/t2.wav");
precache_sound ("sounds/zombie/t3.wav"); precache_sound("sounds/zombie/t3.wav");
precache_sound ("sounds/zombie/t4.wav"); precache_sound("sounds/zombie/t4.wav");
// zombie footsteps // zombie footsteps
precache_sound ("sounds/zombie/s0.wav"); precache_sound("sounds/zombie/s0.wav");
precache_sound ("sounds/zombie/s1.wav"); precache_sound("sounds/zombie/s1.wav");
precache_sound ("sounds/zombie/sc0.wav"); precache_sound("sounds/zombie/sc0.wav");
precache_sound ("sounds/zombie/sc1.wav"); precache_sound("sounds/zombie/sc1.wav");
// null // null
precache_sound("sounds/null.wav"); precache_sound("sounds/null.wav");

View file

@ -630,7 +630,7 @@ void() PlayerPostThink =
//landsound //landsound
if((self.oldvelocity_z < -212) && (self.flags & FL_ONGROUND)) if((self.oldvelocity_z < -212) && (self.flags & FL_ONGROUND))
{ {
sound(self, CHAN_BODY, "sounds/player/land.wav", 0.6, 1.75); Sound_PlaySound(self, "sounds/player/land.wav", SOUND_TYPE_PLAYER_FOOTSTEP, SOUND_PRIORITY_PLAYALWAYS);
self.lastsound_time = time - 0.15; self.lastsound_time = time - 0.15;
} }
@ -674,15 +674,15 @@ void() PlayerPostThink =
{ {
local float ran = random(); local float ran = random();
if(ran > 0.8) if(ran > 0.8)
sound(self, CHAN_BODY, "sounds/player/footstep1.wav", 0.6, 2.5); Sound_PlaySound(self, "sounds/player/footstep1.wav", SOUND_TYPE_PLAYER_FOOTSTEP, SOUND_PRIORITY_PLAYALWAYS);
else if(ran > 0.6) else if(ran > 0.6)
sound(self, CHAN_BODY, "sounds/player/footstep2.wav", 0.6, 2.5); Sound_PlaySound(self, "sounds/player/footstep2.wav", SOUND_TYPE_PLAYER_FOOTSTEP, SOUND_PRIORITY_PLAYALWAYS);
else if(ran > 0.4) else if(ran > 0.4)
sound(self, CHAN_BODY, "sounds/player/footstep3.wav", 0.6, 2.5); Sound_PlaySound(self, "sounds/player/footstep3.wav", SOUND_TYPE_PLAYER_FOOTSTEP, SOUND_PRIORITY_PLAYALWAYS);
else if(ran > 0.2) else if(ran > 0.2)
sound(self, CHAN_BODY, "sounds/player/footstep4.wav", 0.6, 2.5); Sound_PlaySound(self, "sounds/player/footstep4.wav", SOUND_TYPE_PLAYER_FOOTSTEP, SOUND_PRIORITY_PLAYALWAYS);
else else
sound(self, CHAN_BODY, "sounds/player/footstep5.wav", 0.6, 2.5); Sound_PlaySound(self, "sounds/player/footstep5.wav", SOUND_TYPE_PLAYER_FOOTSTEP, SOUND_PRIORITY_PLAYALWAYS);
self.lastsound_time = time; self.lastsound_time = time;
} }
} }

View file

@ -106,9 +106,7 @@ void(string sound_path) Rounds_PlayTransition =
if (music_override > time) if (music_override > time)
return; return;
// Pick a random player because it needs a source. Sound_PlaySound(world, sound_path, SOUND_TYPE_MUSIC_ROUND, SOUND_PRIORITY_PLAYALWAYS);
entity some_player = find(world, classname, "player");
sound(some_player, CHAN_AUTO, sound_path, 1, ATTN_NONE);
} }
void() updateDogRound = void() updateDogRound =
@ -185,7 +183,6 @@ void() NewRound =
entity tempe; entity tempe;
round_changetime = 0; round_changetime = 0;
spawn_time = time + 5; spawn_time = time + 5;
sounds_playing = 0;//just in case it ever somehow glitches
if (delay_at_round > 0.08) if (delay_at_round > 0.08)
{ {
delay_at_round = delay_at_round*0.95; delay_at_round = delay_at_round*0.95;

View file

@ -0,0 +1,204 @@
/*
server/utilities/sound_helper.qc
Logic designed to assist in audio balancing and different types
of audio channels.
Copyright (C) 2021-2024 NZ:P Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA
*/
#define SOUND_PRIORITY_ALLOWSKIP 0
#define SOUND_PRIORITY_PLAYALWAYS 1
#define SOUND_TYPE_ZOMBIE_QUIET 0
#define SOUND_TYPE_ZOMBIE_LOUD 1
#define SOUND_TYPE_ZOMBIE_CRAWLER 2
#define SOUND_TYPE_MUSIC_ROUND 3
#define SOUND_TYPE_WEAPON_FIRE 4
#define SOUND_TYPE_WEAPON_OTHER 5
#define SOUND_TYPE_WEAPON_PACK 6
#define SOUND_TYPE_WEAPON_EXPLODE 7
#define SOUND_TYPE_PLAYER_VOICE 8
#define SOUND_TYPE_PLAYER_FOOTSTEP 9
#define SOUND_TYPE_ENV_OBJECT 10
#define SOUND_TYPE_ENV_CHING 11
#define SOUND_TYPE_ENV_VOICE 12
#define SOUND_TYPE_ENV_MUSIC 13
#define SOUND_TYPE_ENV_IMPORTANT 14
#define SOUND_MAX_ZOMBIE_GROANS 4
#define SOUND_MAX_WEAPON_EXPLODE 8
#define SOUND_MAX_ENV_VOICE 1
// On FTE, we should always be using SOUNDFLAG_FOLLOW because we want
// sounds like the longer zombie groans to not feel desynconized from
// the actual action, other engines don't support this though, so wrap
// it.
#ifdef FTE
#define PLAYSOUND(ent, channel, path, volume, attenuation) sound(ent, channel, path, volume, attenuation, 0, SOUNDFLAG_FOLLOW)
#else
#define PLAYSOUND(ent, channel, path, volume, attenuation) sound(ent, channel, path, volume, attenuation)
#endif // FTE
float zombie_groan_times[SOUND_MAX_ZOMBIE_GROANS];
float weapon_explode_times[SOUND_MAX_WEAPON_EXPLODE];
float environment_voice_times[SOUND_MAX_ENV_VOICE];
float() Sound_GetEnvironmentVoice =
{
// Search for an available Explosion slot.
for(float i = 0; i < SOUND_MAX_ENV_VOICE; i++) {
if (environment_voice_times[i] < time) {
return i;
}
}
// None available.
return -1;
};
void(float priority, float index) Sound_SetEnvironmentVoice =
{
if (priority == SOUND_PRIORITY_PLAYALWAYS)
return;
environment_voice_times[index] = time + 2;
};
float() Sound_GetWeaponExplosion =
{
// Search for an available Explosion slot.
for(float i = 0; i < SOUND_MAX_WEAPON_EXPLODE; i++) {
if (weapon_explode_times[i] < time) {
return i;
}
}
// None available.
return -1;
};
void(float priority, float index) Sound_SetWeaponExplosion =
{
if (priority == SOUND_PRIORITY_PLAYALWAYS)
return;
weapon_explode_times[index] = time + 1.2;
};
float() Sound_GetZombieGroan =
{
// Search for an available Groan slot.
for(float i = 0; i < SOUND_MAX_ZOMBIE_GROANS; i++) {
if (zombie_groan_times[i] < time) {
return i;
}
}
// None available.
return -1;
};
void(float priority, float index) Sound_SetZombieGroan =
{
if (priority == SOUND_PRIORITY_PLAYALWAYS)
return;
zombie_groan_times[index] = time + 4.5;
};
void(entity source_ent, string path, float type, float priority) Sound_PlaySound =
{
switch(type) {
case SOUND_TYPE_ZOMBIE_QUIET:
float zombie_quiet_groan = Sound_GetZombieGroan();
if (priority == SOUND_PRIORITY_PLAYALWAYS || zombie_quiet_groan != -1) {
PLAYSOUND(source_ent, CHAN_VOICE, path, 0.60, 1);
Sound_SetZombieGroan(priority, zombie_quiet_groan);
}
break;
case SOUND_TYPE_ZOMBIE_LOUD:
float zombie_loud_groan = Sound_GetZombieGroan();
if (priority == SOUND_PRIORITY_PLAYALWAYS || zombie_loud_groan != -1) {
PLAYSOUND(source_ent, CHAN_WEAPON, path, 0.70, 1);
Sound_SetZombieGroan(priority, zombie_loud_groan);
}
break;
case SOUND_TYPE_ZOMBIE_CRAWLER:
float zombie_crawler_groan = Sound_GetZombieGroan();
if (priority == SOUND_PRIORITY_PLAYALWAYS || zombie_crawler_groan != -1) {
PLAYSOUND(source_ent, CHAN_ITEM, path, 0.60, 1);
Sound_SetZombieGroan(priority, zombie_crawler_groan);
}
break;
case SOUND_TYPE_MUSIC_ROUND:
PLAYSOUND(source_ent, CHAN_ITEM, path, 0.85, 0);
break;
case SOUND_TYPE_WEAPON_FIRE:
PLAYSOUND(source_ent, CHAN_AUTO, path, 0.80, 2);
break;
case SOUND_TYPE_WEAPON_OTHER:
PLAYSOUND(source_ent, CHAN_ITEM, path, 0.60, 2);
break;
case SOUND_TYPE_WEAPON_PACK:
PLAYSOUND(source_ent, CHAN_ITEM, path, 0.95, 2);
break;
case SOUND_TYPE_WEAPON_EXPLODE:
float weapon_explosion_index = Sound_GetWeaponExplosion();
if (priority == SOUND_PRIORITY_PLAYALWAYS || weapon_explosion_index != -1) {
PLAYSOUND(source_ent, 0, path, 0.70, 1);
Sound_SetWeaponExplosion(priority, weapon_explosion_index);
}
break;
case SOUND_TYPE_PLAYER_VOICE:
PLAYSOUND(source_ent, CHAN_VOICE, path, 0.90, 2);
break;
case SOUND_TYPE_PLAYER_FOOTSTEP:
PLAYSOUND(source_ent, 0, path, 0.40, 3);
break;
case SOUND_TYPE_ENV_OBJECT:
PLAYSOUND(source_ent, CHAN_ITEM, path, 0.50, 2);
break;
case SOUND_TYPE_ENV_CHING:
PLAYSOUND(source_ent, CHAN_AUTO, path, 0.75, 3);
break;
case SOUND_TYPE_ENV_VOICE:
float environment_voice_index = Sound_GetEnvironmentVoice();
if (priority == SOUND_PRIORITY_PLAYALWAYS || environment_voice_index != -1) {
PLAYSOUND(source_ent, CHAN_VOICE, path, 0.80, 0);
Sound_SetEnvironmentVoice(priority, environment_voice_index);
}
break;
case SOUND_TYPE_ENV_MUSIC:
PLAYSOUND(source_ent, CHAN_WEAPON, path, 0.75, 3);
break;
case SOUND_TYPE_ENV_IMPORTANT:
PLAYSOUND(source_ent, CHAN_ITEM, path, 1, 2);
break;
default:
break;
}
};

View file

@ -142,7 +142,7 @@ void() Betty_CheckForRelease =
self.grenade_delay = time + 0.05; self.grenade_delay = time + 0.05;
self.isBuying = true; self.isBuying = true;
Set_W_Frame (13, 19, 0.3, 5, GRENADE, Betty_Drop, "models/weapons/grenade/v_betty.mdl", true, S_RIGHT, true); Set_W_Frame (13, 19, 0.3, 5, GRENADE, Betty_Drop, "models/weapons/grenade/v_betty.mdl", true, S_RIGHT, true);
sound (self, CHAN_WEAPON, "sounds/weapons/grenade/throw.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/grenade/throw.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
self.reload_delay2 = self.fire_delay2 = self.reload_delay = self.fire_delay = time + 0.4; self.reload_delay2 = self.fire_delay2 = self.reload_delay = self.fire_delay = time + 0.4;
self.throw_delay = time + 0.9; self.throw_delay = time + 0.9;
} }

View file

@ -163,7 +163,7 @@ void () W_Frame_Update =
// FIXME: We need a way to play sounds at specific frames for any viewmodel, not just weapons // FIXME: We need a way to play sounds at specific frames for any viewmodel, not just weapons
if (self.weaponmodel == "models/weapons/grenade/v_betty.mdl" && self.weaponframe == 9) { if (self.weaponmodel == "models/weapons/grenade/v_betty.mdl" && self.weaponframe == 9) {
sound (self, CHAN_WEAPON, "sounds/weapons/grenade/prime.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/grenade/prime.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
nzp_rumble(self, 1000, 1200, 75); nzp_rumble(self, 1000, 1200, 75);
} }
return; return;

View file

@ -1149,8 +1149,7 @@ void(float side) W_Fire =
Set_W_Frame (startframe, endframe, delay, 0, FIRE, WeaponCore_CheckForReload, modelname, FALSE, side, false); Set_W_Frame (startframe, endframe, delay, 0, FIRE, WeaponCore_CheckForReload, modelname, FALSE, side, false);
} }
Sound_PlaySound(self, soundname, SOUND_TYPE_WEAPON_FIRE, SOUND_PRIORITY_PLAYALWAYS);
sound (self, CHAN_WEAPON, soundname, 1, ATTN_NORM);
if (side == S_RIGHT) { if (side == S_RIGHT) {
self.weapons[0].weapon_magazine = self.weapons[0].weapon_magazine - 1; self.weapons[0].weapon_magazine = self.weapons[0].weapon_magazine - 1;
@ -1161,7 +1160,7 @@ void(float side) W_Fire =
} }
if (IsPapWeapon(self.weapon) && !WepDef_DoesNotPlayUpgradedSound(self.weapon)) { if (IsPapWeapon(self.weapon) && !WepDef_DoesNotPlayUpgradedSound(self.weapon)) {
sound (self, 0, "sounds/weapons/papfire.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/papfire.wav", SOUND_TYPE_WEAPON_PACK, SOUND_PRIORITY_PLAYALWAYS);
} }
SetUpdate(self, UT_HUD, 6, 0, 0); SetUpdate(self, UT_HUD, 6, 0, 0);
@ -1227,15 +1226,15 @@ void() WeaponCore_Melee =
if (!trace_ent.takedamage && !(trace_ent.flags & FL_CLIENT)) { if (!trace_ent.takedamage && !(trace_ent.flags & FL_CLIENT)) {
// Hit a solid surface, so play hard melee sound. // Hit a solid surface, so play hard melee sound.
if (trace_fraction < 1.0) if (trace_fraction < 1.0)
sound (self, CHAN_WEAPON, "sounds/weapons/knife/knife_hit.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/knife/knife_hit.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
// Dead air, swing! // Dead air, swing!
else else
sound (self, CHAN_WEAPON, "sounds/weapons/knife/knife.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/knife/knife.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
} else { } else {
// AI has a more involved routine than other entities // AI has a more involved routine than other entities
if (trace_ent.aistatus == "1") { if (trace_ent.aistatus == "1") {
// Play a flesh-y impact sound, spawn blood. // Play a flesh-y impact sound, spawn blood.
sound (self, CHAN_WEAPON, "sounds/weapons/knife/knife_hitbod.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/knife/knife_hitbod.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
SpawnBlood(trace_source + (v_forward * 20), trace_source + (v_forward * 20), 50); SpawnBlood(trace_source + (v_forward * 20), trace_source + (v_forward * 20), 50);
// Calculate distance to use for the Lunge velocity // Calculate distance to use for the Lunge velocity
@ -1255,10 +1254,10 @@ void() WeaponCore_Melee =
// Is this a player? Play the body hit sound and spawn blood, otherwise, solid swing. // Is this a player? Play the body hit sound and spawn blood, otherwise, solid swing.
if (trace_ent.flags & FL_CLIENT) { if (trace_ent.flags & FL_CLIENT) {
sound (self, CHAN_WEAPON, "sounds/weapons/knife/knife_hitbod.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/knife/knife_hitbod.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
SpawnBlood(trace_source + (v_forward * 20), trace_source + (v_forward * 20), 50); SpawnBlood(trace_source + (v_forward * 20), trace_source + (v_forward * 20), 50);
} else { } else {
sound (self, CHAN_WEAPON, "sounds/weapons/knife/knife_hit.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/knife/knife_hit.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
} }
} }
@ -1321,7 +1320,7 @@ void() switch_nade =
void() GrenadeExplode = void() GrenadeExplode =
{ {
sound (self, CHAN_WEAPON, "sounds/weapons/grenade/explode.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/grenade/explode.wav", SOUND_TYPE_WEAPON_EXPLODE, SOUND_PRIORITY_ALLOWSKIP);
if (self.classname == "grenade") if (self.classname == "grenade")
DamgageExplode (self, self.owner, 200, 50, 200); DamgageExplode (self, self.owner, 200, 50, 200);
@ -1445,7 +1444,7 @@ void() checkHold =
self.isBuying = true; self.isBuying = true;
Set_W_Frame (3, 6, 0, 5, GRENADE, W_ThrowGrenade, "models/weapons/grenade/v_grenade.mdl", true, S_RIGHT, true); Set_W_Frame (3, 6, 0, 5, GRENADE, W_ThrowGrenade, "models/weapons/grenade/v_grenade.mdl", true, S_RIGHT, true);
sound (self, CHAN_WEAPON, "sounds/weapons/grenade/throw.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/grenade/throw.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
self.reload_delay2 = self.fire_delay2 = self.reload_delay = self.fire_delay = time + 0.4; self.reload_delay2 = self.fire_delay2 = self.reload_delay = self.fire_delay = time + 0.4;
self.throw_delay = time + 0.9; self.throw_delay = time + 0.9;
nzp_rumble(self, 1000, 1200, 75); nzp_rumble(self, 1000, 1200, 75);
@ -1479,7 +1478,7 @@ void() W_Grenade =
W_HideCrosshair(self); W_HideCrosshair(self);
Set_W_Frame (0, 2, 0.6, 0, GRENADE, checkHold, "models/weapons/grenade/v_grenade.mdl", true, S_RIGHT, true); Set_W_Frame (0, 2, 0.6, 0, GRENADE, checkHold, "models/weapons/grenade/v_grenade.mdl", true, S_RIGHT, true);
sound (self, CHAN_WEAPON, "sounds/weapons/grenade/prime.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/grenade/prime.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
self.primary_grenades -= 1; self.primary_grenades -= 1;
self.reload_delay2 = self.fire_delay2 = self.throw_delay = self.reload_delay = self.fire_delay = time + 6; self.reload_delay2 = self.fire_delay2 = self.throw_delay = self.reload_delay = self.fire_delay = time + 6;
self.grenade_delay = time + 5; self.grenade_delay = time + 5;
@ -1568,7 +1567,7 @@ void() dolphin_dive = //naievil
W_SprintStop(); W_SprintStop();
PAnim_EnterDive(); PAnim_EnterDive();
sound(self, CHAN_VOICE, "sounds/player/jump.wav", 1, 1); Sound_PlaySound(self, "sounds/player/jump.wav", SOUND_TYPE_PLAYER_VOICE, SOUND_PRIORITY_PLAYALWAYS);
self.oldz = self.origin_z; self.oldz = self.origin_z;
Player_SetStance(self, PLAYER_STANCE_PRONE, false); Player_SetStance(self, PLAYER_STANCE_PRONE, false);
@ -1747,7 +1746,7 @@ void() CheckPlayer =
if (self.dive) { if (self.dive) {
if (self.perks & P_FLOP && dist >= 64) { if (self.perks & P_FLOP && dist >= 64) {
sound (self, CHAN_WEAPON, "sounds/weapons/grenade/explode.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/grenade/explode.wav", SOUND_TYPE_WEAPON_EXPLODE, SOUND_PRIORITY_PLAYALWAYS);
DamgageExplode (self, self, 5000, 1000, 300); DamgageExplode (self, self, 5000, 1000, 300);
#ifdef FTE #ifdef FTE

View file

@ -3090,6 +3090,8 @@ float(float wep) EqualPapWeapon =
} }
} }
#ifndef CSQC
float(float wep, float anim_style, float dualwep, float curweaponframe) PlayWeaponSound = float(float wep, float anim_style, float dualwep, float curweaponframe) PlayWeaponSound =
{ {
if (anim_style == KNIFE) { if (anim_style == KNIFE) {
@ -3107,24 +3109,24 @@ float(float wep, float anim_style, float dualwep, float curweaponframe) PlayWeap
if (wep == W_KAR || wep == W_ARMAGEDDON || wep == W_KAR_SCOPE || wep == W_HEADCRACKER || wep == W_SPRING || wep == W_PULVERIZER) if (wep == W_KAR || wep == W_ARMAGEDDON || wep == W_KAR_SCOPE || wep == W_HEADCRACKER || wep == W_SPRING || wep == W_PULVERIZER)
{ {
if (curweaponframe == 6) { if (curweaponframe == 6) {
sound (self ,5, "sounds/weapons/boltaction/boltup.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/boltaction/boltup.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
else if (curweaponframe == 7) { else if (curweaponframe == 7) {
sound (self ,5, "sounds/weapons/boltaction/boltback.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/boltaction/boltback.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 9) { } else if (curweaponframe == 9) {
sound (self ,5, "sounds/weapons/boltaction/boltforward.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/boltaction/boltforward.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 10) { } else if (curweaponframe == 10) {
sound (self ,5, "sounds/weapons/boltaction/boltdown.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/boltaction/boltdown.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
} }
else if (wep == W_TRENCH || wep == W_GUT) else if (wep == W_TRENCH || wep == W_GUT)
{ {
if (curweaponframe == 7) { if (curweaponframe == 7) {
sound (self ,5, "sounds/weapons/shotgun/pump.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/shotgun/pump.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
} }
@ -3136,13 +3138,13 @@ float(float wep, float anim_style, float dualwep, float curweaponframe) PlayWeap
switch (wep) { switch (wep) {
case W_COLT: case W_COLT:
if (curweaponframe == 5) { if (curweaponframe == 5) {
sound (self ,5, "sounds/weapons/colt/magout.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/colt/magout.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 12) { } else if (curweaponframe == 12) {
sound (self ,5, "sounds/weapons/colt/magin.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/colt/magin.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if(curweaponframe == 18) { } else if(curweaponframe == 18) {
sound (self ,5, "sounds/weapons/colt/slide.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/colt/slide.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
@ -3151,92 +3153,92 @@ float(float wep, float anim_style, float dualwep, float curweaponframe) PlayWeap
case W_SPRING: case W_SPRING:
case W_PULVERIZER: case W_PULVERIZER:
if (curweaponframe == 15) { if (curweaponframe == 15) {
sound (self ,5, "sounds/weapons/boltaction/boltup.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/boltaction/boltup.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 16) { } else if (curweaponframe == 16) {
sound (self ,5, "sounds/weapons/boltaction/boltback.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/boltaction/boltback.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 20) { } else if (curweaponframe == 20) {
sound (self ,5, "sounds/weapons/boltaction/clipin.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/boltaction/clipin.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 25) { } else if (curweaponframe == 25) {
sound (self ,5, "sounds/weapons/boltaction/boltforward.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/boltaction/boltforward.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 26) { } else if (curweaponframe == 26) {
sound (self ,5, "sounds/weapons/boltaction/clipoff.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/boltaction/clipoff.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 27) { } else if (curweaponframe == 27) {
sound (self ,5, "sounds/weapons/boltaction/boltdown.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/boltaction/boltdown.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
case W_THOMPSON: case W_THOMPSON:
case W_GIBS: case W_GIBS:
if (curweaponframe == 6) { if (curweaponframe == 6) {
sound (self ,5, "sounds/weapons/thomp/magout.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/thomp/magout.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 12) { } else if (curweaponframe == 12) {
sound (self ,5, "sounds/weapons/thomp/magin.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/thomp/magin.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 19) { } else if (curweaponframe == 19) {
sound (self ,5, "sounds/weapons/thomp/boltback.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/thomp/boltback.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
case W_357: case W_357:
case W_KILLU: case W_KILLU:
if (curweaponframe == 5) { if (curweaponframe == 5) {
sound (self ,5, "sounds/weapons/357/open.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/357/open.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 9) { } else if (curweaponframe == 9) {
sound (self ,5, "sounds/weapons/357/out.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/357/out.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 15) { } else if (curweaponframe == 15) {
sound (self ,5, "sounds/weapons/357/in.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/357/in.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 20) { } else if (curweaponframe == 20) {
sound (self ,5, "sounds/weapons/357/close.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/357/close.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
case W_BAR: case W_BAR:
case W_WIDOW: case W_WIDOW:
if (curweaponframe == 6 || curweaponframe == 31) { if (curweaponframe == 6 || curweaponframe == 31) {
sound (self ,5, "sounds/weapons/bar/magout.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/bar/magout.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 19 || curweaponframe == 29) { } else if (curweaponframe == 19 || curweaponframe == 29) {
sound (self ,5, "sounds/weapons/bar/magin.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/bar/magin.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 23) { } else if (curweaponframe == 23) {
sound (self ,5, "sounds/weapons/bar/maghit.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/bar/maghit.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
case W_BROWNING: case W_BROWNING:
case W_ACCELERATOR: case W_ACCELERATOR:
if (curweaponframe == 6 || curweaponframe == 60) { if (curweaponframe == 6 || curweaponframe == 60) {
sound (self ,5, "sounds/weapons/browning/boltback.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/browning/boltback.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 16 || curweaponframe == 69) { } else if (curweaponframe == 16 || curweaponframe == 69) {
sound (self ,5, "sounds/weapons/browning/topopen.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/browning/topopen.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 21) { } else if (curweaponframe == 21) {
sound (self ,5, "sounds/weapons/browning/chainoff.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/browning/chainoff.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 27) { } else if (curweaponframe == 27) {
sound (self ,5, "sounds/weapons/browning/chainon.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/browning/chainon.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 30) { } else if (curweaponframe == 30) {
sound (self ,5, "sounds/weapons/browning/chainplace.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/browning/chainplace.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 36) { } else if (curweaponframe == 36) {
sound (self ,5, "sounds/weapons/browning/topclose.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/browning/topclose.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 41) { } else if (curweaponframe == 41) {
sound (self ,5, "sounds/weapons/browning/tophit.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/browning/tophit.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 48) { } else if (curweaponframe == 48) {
sound (self ,5, "sounds/weapons/browning/boltforward.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/browning/boltforward.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
@ -3244,63 +3246,63 @@ float(float wep, float anim_style, float dualwep, float curweaponframe) PlayWeap
case W_SAWNOFF: case W_SAWNOFF:
case W_BORE: case W_BORE:
if (curweaponframe == 6) { if (curweaponframe == 6) {
sound (self ,5, "sounds/weapons/shotgun/open.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/shotgun/open.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 12) { } else if (curweaponframe == 12) {
sound (self ,5, "sounds/weapons/shotgun/out.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/shotgun/out.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 20) { } else if (curweaponframe == 20) {
sound (self ,5, "sounds/weapons/shotgun/in.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/shotgun/in.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 26) { } else if (curweaponframe == 26) {
sound (self ,5, "sounds/weapons/shotgun/close.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/shotgun/close.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
case W_SNUFF: case W_SNUFF:
if (curweaponframe == 15) { if (curweaponframe == 15) {
sound (self ,5, "sounds/weapons/shotgun/open.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/shotgun/open.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 23) { } else if (curweaponframe == 23) {
sound (self ,5, "sounds/weapons/shotgun/out.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/shotgun/out.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 33) { } else if (curweaponframe == 33) {
sound (self ,5, "sounds/weapons/shotgun/in.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/shotgun/in.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 40) { } else if (curweaponframe == 40) {
sound (self ,5, "sounds/weapons/shotgun/close.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/shotgun/close.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
case W_FG: case W_FG:
case W_IMPELLER: case W_IMPELLER:
if (curweaponframe == 6) { if (curweaponframe == 6) {
sound (self ,5, "sounds/weapons/fg42/magout.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/fg42/magout.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 14) { } else if (curweaponframe == 14) {
sound (self ,5, "sounds/weapons/fg42/magin.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/fg42/magin.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 23) { } else if (curweaponframe == 23) {
sound (self ,5, "sounds/weapons/fg42/boltback.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/fg42/boltback.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 26) { } else if (curweaponframe == 26) {
sound (self ,5, "sounds/weapons/fg42/boltforward.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/fg42/boltforward.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
case W_GEWEHR: case W_GEWEHR:
case W_COMPRESSOR: case W_COMPRESSOR:
if (curweaponframe == 21) { if (curweaponframe == 21) {
sound (self ,5, "sounds/weapons/gewehr/magout.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/gewehr/magout.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 32) { } else if (curweaponframe == 32) {
sound (self ,5, "sounds/weapons/gewehr/magin.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/gewehr/magin.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 36) { } else if (curweaponframe == 36) {
sound (self ,5, "sounds/weapons/gewehr/maghit.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/gewehr/maghit.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 45) { } else if (curweaponframe == 45) {
sound (self ,5, "sounds/weapons/gewehr/boltrelease.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/gewehr/boltrelease.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
@ -3309,231 +3311,231 @@ float(float wep, float anim_style, float dualwep, float curweaponframe) PlayWeap
case W_SPRING: case W_SPRING:
case W_PULVERIZER: case W_PULVERIZER:
if (curweaponframe == 15) { if (curweaponframe == 15) {
sound (self ,5, "sounds/weapons/boltaction/boltup.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/boltaction/boltup.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 16) { } else if (curweaponframe == 16) {
sound (self ,5, "sounds/weapons/boltaction/boltback.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/boltaction/boltback.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 20) { } else if (curweaponframe == 20) {
sound (self ,5, "sounds/weapons/boltaction/insert.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/boltaction/insert.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 25) { } else if (curweaponframe == 25) {
sound (self ,5, "sounds/weapons/boltaction/boltforward.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/boltaction/boltforward.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 27) { } else if (curweaponframe == 27) {
sound (self ,5, "sounds/weapons/boltaction/boltdown.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/boltaction/boltdown.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
case W_M1: case W_M1:
case W_M1000: case W_M1000:
if (curweaponframe == 5 || curweaponframe == 25) { if (curweaponframe == 5 || curweaponframe == 25) {
sound (self ,5, "sounds/weapons/garand/clipout.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/garand/clipout.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 13) { } else if (curweaponframe == 13) {
sound (self ,5, "sounds/weapons/garand/clipin.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/garand/clipin.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 15) { } else if (curweaponframe == 15) {
sound (self ,5, "sounds/weapons/garand/boltrelease.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/garand/boltrelease.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 24) { } else if (curweaponframe == 24) {
sound (self ,5, "sounds/weapons/garand/clippush.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/garand/clippush.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
case W_M1A1: case W_M1A1:
case W_WIDDER: case W_WIDDER:
if (curweaponframe == 6) { if (curweaponframe == 6) {
sound (self ,5, "sounds/weapons/m1carbine/magout.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/m1carbine/magout.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 14) { } else if (curweaponframe == 14) {
sound (self ,5, "sounds/weapons/m1carbine/magin.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/m1carbine/magin.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if(curweaponframe == 16) { } else if(curweaponframe == 16) {
sound (self ,5, "sounds/weapons/m1carbine/maghit.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/m1carbine/maghit.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 24) { } else if (curweaponframe == 24) {
sound (self ,5, "sounds/weapons/m1carbine/bolt.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/m1carbine/bolt.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
case W_MP40: case W_MP40:
case W_AFTERBURNER: case W_AFTERBURNER:
if (curweaponframe == 7) { if (curweaponframe == 7) {
sound (self ,5, "sounds/weapons/mp40/magout.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/mp40/magout.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 17) { } else if (curweaponframe == 17) {
sound (self ,5, "sounds/weapons/mp40/magin.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/mp40/magin.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 25) { } else if (curweaponframe == 25) {
sound (self ,5, "sounds/weapons/mp40/boltback.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/mp40/boltback.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
case W_MP5K: case W_MP5K:
case W_KOLLIDER: case W_KOLLIDER:
if (curweaponframe == 16) { if (curweaponframe == 16) {
sound (self ,5, "sounds/weapons/mp5k/magout.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/mp5k/magout.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 31) { } else if (curweaponframe == 31) {
sound (self ,5, "sounds/weapons/mp5k/magin.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/mp5k/magin.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 39) { } else if (curweaponframe == 39) {
sound (self ,5, "sounds/weapons/mp5k/slap.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/mp5k/slap.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
case W_PANZER: case W_PANZER:
case W_LONGINUS: case W_LONGINUS:
if (curweaponframe == 12) { if (curweaponframe == 12) {
sound (self ,5, "sounds/weapons/panzer/move.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/panzer/move.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 16) { } else if (curweaponframe == 16) {
sound (self ,5, "sounds/weapons/panzer/insert.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/panzer/insert.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
case W_MG: case W_MG:
case W_BARRACUDA: case W_BARRACUDA:
if (curweaponframe == 8) { if (curweaponframe == 8) {
sound (self ,5, "sounds/weapons/mg42/magout.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/mg42/magout.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 19) { } else if (curweaponframe == 19) {
sound (self ,5, "sounds/weapons/mg42/magin.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/mg42/magin.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 29) { } else if (curweaponframe == 29) {
sound (self ,5, "sounds/weapons/mg42/charge.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/mg42/charge.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
case W_PPSH: case W_PPSH:
case W_REAPER: case W_REAPER:
if (curweaponframe == 8) { if (curweaponframe == 8) {
sound (self ,5, "sounds/weapons/ppsh/magout.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/ppsh/magout.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 20) { } else if (curweaponframe == 20) {
sound (self ,5, "sounds/weapons/ppsh/magin.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/ppsh/magin.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 22) { } else if (curweaponframe == 22) {
sound (self ,5, "sounds/weapons/ppsh/maghit.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/ppsh/maghit.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 30) { } else if (curweaponframe == 30) {
sound (self ,5, "sounds/weapons/ppsh/boltback.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/ppsh/boltback.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 33) { } else if (curweaponframe == 33) {
sound (self ,5, "sounds/weapons/ppsh/boltrelease.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/ppsh/boltrelease.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
case W_PTRS: case W_PTRS:
case W_PENETRATOR: case W_PENETRATOR:
if (curweaponframe == 7) { if (curweaponframe == 7) {
sound (self ,5, "sounds/weapons/ptrs/open.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/ptrs/open.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 13 || curweaponframe == 31) { } else if (curweaponframe == 13 || curweaponframe == 31) {
sound (self ,5, "sounds/weapons/ptrs/magin.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/ptrs/magin.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 21) { } else if (curweaponframe == 21) {
sound (self ,5, "sounds/weapons/ptrs/maghit.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/ptrs/maghit.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 23) { } else if (curweaponframe == 23) {
sound (self ,5, "sounds/weapons/ptrs/close.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/ptrs/close.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
case W_RAY: case W_RAY:
case W_PORTER: case W_PORTER:
if (curweaponframe == 10) { if (curweaponframe == 10) {
sound (self ,5, "sounds/weapons/raygun/open.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/raygun/open.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 19) { } else if (curweaponframe == 19) {
sound (self ,5, "sounds/weapons/raygun/out.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/raygun/out.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 33) { } else if (curweaponframe == 33) {
sound (self ,5, "sounds/weapons/raygun/in.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/raygun/in.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 41) { } else if (curweaponframe == 41) {
sound (self ,5, "sounds/weapons/raygun/close.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/raygun/close.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
case W_STG: case W_STG:
case W_SPATZ: case W_SPATZ:
if (curweaponframe == 15) { if (curweaponframe == 15) {
sound (self ,5, "sounds/weapons/stg/magout.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/stg/magout.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 28) { } else if (curweaponframe == 28) {
sound (self ,5, "sounds/weapons/stg/magin.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/stg/magin.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 37) { } else if (curweaponframe == 37) {
sound (self ,5, "sounds/weapons/stg/boltback.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/stg/boltback.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 41) { } else if (curweaponframe == 41) {
sound (self ,5, "sounds/weapons/stg/boltrelease.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/stg/boltrelease.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
case W_TRENCH: case W_TRENCH:
case W_GUT: case W_GUT:
if (curweaponframe == 19) { if (curweaponframe == 19) {
sound (self ,5, "sounds/weapons/shotgun/insert.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/shotgun/insert.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
case W_TYPE: case W_TYPE:
case W_SAMURAI: case W_SAMURAI:
if (curweaponframe == 6) { if (curweaponframe == 6) {
sound (self ,5, "sounds/weapons/type100/magout.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/type100/magout.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 15) { } else if (curweaponframe == 15) {
sound (self ,5, "sounds/weapons/type100/magin.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/type100/magin.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 20) { } else if (curweaponframe == 20) {
sound (self ,5, "sounds/weapons/type100/boltpull.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/type100/boltpull.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
case W_BIATCH: case W_BIATCH:
if (curweaponframe == 23) { if (curweaponframe == 23) {
sound (self ,5, "sounds/weapons/colt/magout.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/colt/magout.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe ==30) { } else if (curweaponframe ==30) {
sound (self ,5, "sounds/weapons/colt/magin.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/colt/magin.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if(curweaponframe == 36) { } else if(curweaponframe == 36) {
sound (self ,5, "sounds/weapons/biatch/slideback.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/biatch/slideback.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if(curweaponframe == 42) { } else if(curweaponframe == 42) {
sound (self ,5, "sounds/weapons/biatch/sliderelease.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/biatch/sliderelease.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
case W_TESLA: case W_TESLA:
case W_DG3: case W_DG3:
if (curweaponframe == 20) { if (curweaponframe == 20) {
sound (self ,5, "sounds/weapons/tesla/switchoff.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/tesla/switchoff.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 25) { } else if (curweaponframe == 25) {
sound (self ,5, "sounds/weapons/tesla/pulllever.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/tesla/pulllever.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 31) { } else if (curweaponframe == 31) {
sound (self ,5, "sounds/weapons/tesla/glassbreak.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/tesla/glassbreak.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 38) { } else if (curweaponframe == 38) {
sound (self ,5, "sounds/weapons/tesla/clipin.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/tesla/clipin.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 43) { } else if (curweaponframe == 43) {
sound (self ,5, "sounds/weapons/tesla/clipoff.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/tesla/clipoff.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} else if (curweaponframe == 51) { } else if (curweaponframe == 51) {
sound (self ,5, "sounds/weapons/tesla/switchon.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/tesla/switchon.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
case W_BK: case W_BK:
case W_KRAUS: case W_KRAUS:
if (curweaponframe == 41) { if (curweaponframe == 41) {
sound(self, 5, "sounds/weapons/ballknife/insert.wav", 1, ATTN_NORM); Sound_PlaySound(self, "sounds/weapons/ballknife/insert.wav", SOUND_TYPE_WEAPON_OTHER, SOUND_PRIORITY_PLAYALWAYS);
return true; return true;
} }
return false; return false;
@ -3544,6 +3546,7 @@ float(float wep, float anim_style, float dualwep, float curweaponframe) PlayWeap
return false; return false;
} }
#endif // CSQC
void(float weptype) precache_extra = void(float weptype) precache_extra =
{ {