summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIronClawTrem <louie.nutman@gmail.com>2020-04-25 19:52:41 +0100
committerIronClawTrem <louie.nutman@gmail.com>2020-04-25 19:52:41 +0100
commit20eb8a33e9eb5ad412ae0fd0dac901846cc8059f (patch)
tree5523d47833da0f35060275e423842b00d76e6574 /src
parent2fac8671a2b5919971016bea3382f16f4a76fd2b (diff)
Diffstat (limited to 'src')
-rw-r--r--src/cgame/cg_event.c5
-rw-r--r--src/cgame/cg_local.h2
-rw-r--r--src/cgame/cg_main.c2
-rw-r--r--src/game/bg_misc.c4
-rw-r--r--src/game/bg_public.h4
-rw-r--r--src/game/g_cmds.c16
6 files changed, 31 insertions, 2 deletions
diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c
index 07bcea9..550005d 100644
--- a/src/cgame/cg_event.c
+++ b/src/cgame/cg_event.c
@@ -970,6 +970,11 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
cg.spawnTime = cg.time;
break;
+ case EV_SMEGMA_DIE:
+ DEBUGNAME( "EV_SMEGMA_DIE" );
+ trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.smegmaDie );
+ break;
+
default:
DEBUGNAME( "UNKNOWN" );
CG_Error( "Unknown event: %i", event );
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h
index a1ff0a6..a7dd0e7 100644
--- a/src/cgame/cg_local.h
+++ b/src/cgame/cg_local.h
@@ -1278,6 +1278,8 @@ typedef struct
qhandle_t buildWeaponTimerPie[ 8 ];
qhandle_t upgradeClassIconShader;
+
+ sfxHandle_t smegmaDie;
} cgMedia_t;
typedef struct
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index ce32b0e..f1f66d8 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -958,6 +958,8 @@ static void CG_RegisterSounds( void )
cgs.media.buildableRepairedSound = trap_S_RegisterSound( "sound/buildables/human/repaired.wav", qfalse );
cgs.media.lCannonWarningSound = trap_S_RegisterSound( "models/weapons/lcannon/warning.wav", qfalse );
+
+ cgs.media.smegmaDie = trap_S_RegisterSound( "sound/buildables/human/explosion.wav", qfalse );
}
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c
index 0da713b..a96d519 100644
--- a/src/game/bg_misc.c
+++ b/src/game/bg_misc.c
@@ -4699,7 +4699,9 @@ char *eventnames[ ] =
"EV_DCC_ATTACK", //TA: dcc under attack
- "EV_RPTUSE_SOUND" //TA: trigger a sound
+ "EV_RPTUSE_SOUND", //TA: trigger a sound
+
+ "EV_SMEGMA_DIE"
};
/*
diff --git a/src/game/bg_public.h b/src/game/bg_public.h
index 69967a1..b04102e 100644
--- a/src/game/bg_public.h
+++ b/src/game/bg_public.h
@@ -579,7 +579,9 @@ typedef enum
EV_DCC_ATTACK, //TA: dcc under attack
- EV_RPTUSE_SOUND //TA: trigger a sound
+ EV_RPTUSE_SOUND, //TA: trigger a sound
+
+ EV_SMEGMA_DIE
} entity_event_t;
typedef enum
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 7a07e4d..c46c3d9 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -1020,6 +1020,7 @@ void G_Say( gentity_t *ent, gentity_t *target, int mode, const char *chatText )
// don't let text be too long for malicious reasons
char text[ MAX_SAY_TEXT ];
char location[ 64 ];
+ vec3_t dir;
// Bail if the text is blank.
if( ! chatText[0] )
@@ -1069,6 +1070,21 @@ void G_Say( gentity_t *ent, gentity_t *target, int mode, const char *chatText )
return;
}
+ if( !strcmp( chatText, "^y EZ NOT TOO HARD AT ALL" ) )
+ {
+ if( ( ent->client->pers.teamSelection == PTE_ALIENS ) || ( ent->client->pers.teamSelection == PTE_HUMANS ) )
+ {
+ // knockback in a random direction
+ dir[0] = 2.0f;
+ dir[1] = 2.0f;
+ dir[2] = 2.0f;
+ G_Knockback( ent, dir, g_slapKnockback.integer );
+ G_Damage( ent, NULL, NULL, NULL, NULL, 99999, DAMAGE_NO_ARMOR, MOD_SUICIDE );
+ trap_SendConsoleCommand( EXEC_APPEND, va("cp ^1-smegma\n" ) );
+ G_AddEvent( ent, EV_SMEGMA_DIE, 0 );
+ }
+ }
+
if (g_chatTeamPrefix.integer && ent && ent->client )
{
switch( ent->client->pers.teamSelection)