]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add sound implementation for playercrush SMB feature
authorLegendaryGuard <rootuser999@gmail.com>
Sat, 12 Jun 2021 22:40:12 +0000 (00:40 +0200)
committerLegendaryGuard <rootuser999@gmail.com>
Sat, 12 Jun 2021 22:40:12 +0000 (00:40 +0200)
qcsrc/common/mutators/mutator/player_crush/player_crush.qc
sound/misc/goomba.ogg [new file with mode: 0644]

index af7824483577bb1acf7b7f104bf0fe49ad545fa9..a72c226a1c20cbf331628ef051fa1f970f731562 100644 (file)
@@ -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 (file)
index 0000000..1a499a8
Binary files /dev/null and b/sound/misc/goomba.ogg differ