From: LegendaryGuard Date: Sat, 12 Jun 2021 22:40:12 +0000 (+0200) Subject: Add sound implementation for playercrush SMB feature X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=12d2c161749707cc0d70d5e81ae2b13cf513714c;p=xonotic%2Fxonotic-data.pk3dir.git Add sound implementation for playercrush SMB feature --- diff --git a/qcsrc/common/mutators/mutator/player_crush/player_crush.qc b/qcsrc/common/mutators/mutator/player_crush/player_crush.qc index af7824483..a72c226a1 100644 --- a/qcsrc/common/mutators/mutator/player_crush/player_crush.qc +++ b/qcsrc/common/mutators/mutator/player_crush/player_crush.qc @@ -9,6 +9,8 @@ REGISTER_STAT(PLAYER_CRUSH_BOUNCE, float, autocvar_g_player_crush_bounce) REGISTER_STAT(PLAYER_CRUSH_BOUNCE_JUMP, float, autocvar_g_player_crush_bounce_jump) #ifdef GAMEQC +SOUND(GOOMBA_STOMP, "misc/goomba"); + void pc_PlayerTouch(entity this, entity toucher) { if(toucher == NULL) @@ -53,7 +55,10 @@ void pc_PlayerTouch(entity this, entity toucher) vector vdir = normalize(toucher.origin - this.origin); if(vdir_z > autocvar_g_player_crush_headheight) // adjust this to set how sharp from above players need to hit the player to crush them. + { Damage (this, toucher, toucher, autocvar_g_player_crush_damage, DEATH_VH_CRUSH.m_id, DMG_NOWEP, this.origin, '0 0 0'); + sound(toucher, CH_TRIGGER_SINGLE, SND_GOOMBA_STOMP, VOL_BASE, ATTEN_NORM); + } #endif #ifdef GAMEQC @@ -84,6 +89,7 @@ void pc_PlayerTouch(entity this, entity toucher) animdecide_setaction(this, ANIMACTION_JUMP, true); Damage (toucher, this, this, autocvar_g_player_crush_damage, DEATH_VH_CRUSH.m_id, DMG_NOWEP, toucher.origin, '0 0 0'); + sound(this, CH_TRIGGER_SINGLE, SND_GOOMBA_STOMP, VOL_BASE, ATTEN_NORM); #endif #ifdef GAMEQC } @@ -112,6 +118,7 @@ void pc_PlayerTouch(entity this, entity toucher) animdecide_setaction(this, ANIMACTION_JUMP, true); Damage (toucher, this, this, autocvar_g_player_crush_damage, DEATH_VH_CRUSH.m_id, DMG_NOWEP, toucher.origin, '0 0 0'); + sound(this, CH_TRIGGER_SINGLE, SND_GOOMBA_STOMP, VOL_BASE, ATTEN_NORM); #endif #ifdef GAMEQC } diff --git a/sound/misc/goomba.ogg b/sound/misc/goomba.ogg new file mode 100644 index 000000000..1a499a8f1 Binary files /dev/null and b/sound/misc/goomba.ogg differ