From fade0026cf033874f3012bc23621a476bce97919 Mon Sep 17 00:00:00 2001 From: Richard Allen Date: Tue, 28 May 2002 01:46:58 +0000 Subject: [PATCH] Added stomach gibbing --- reaction/cgame/cg_event.c | 27 +++++++++++++++++++++++++++ reaction/game/bg_public.h | 6 +++++- reaction/game/g_combat.c | 14 +++++++++++--- 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/reaction/cgame/cg_event.c b/reaction/cgame/cg_event.c index 47029609..81a8c1e5 100644 --- a/reaction/cgame/cg_event.c +++ b/reaction/cgame/cg_event.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.60 2002/05/28 01:46:58 jbravo +// Added stomach gibbing +// // Revision 1.59 2002/05/28 01:17:01 jbravo // More gib fixes. g_RQ3_gib added // @@ -1493,6 +1496,25 @@ void CG_GibPlayerHeadshot (vec3_t playerOrigin) { } } +void CG_GibPlayerStomachshot (vec3_t playerOrigin) { + vec3_t origin, velocity; + + if (!cg_blood.integer) { + return; + } + + VectorCopy (playerOrigin, origin); + origin[2]+=25; + velocity[0] = crandom()*GIB_VELOCITY; + velocity[1] = crandom()*GIB_VELOCITY; + velocity[2] = GIB_JUMP + crandom()*GIB_VELOCITY; + if (rand() & 1) { + CG_LaunchGib (origin, velocity, cgs.media.gibAbdomen); + } else { + CG_LaunchGib (origin, velocity, cgs.media.gibIntestine); + } +} + /* ============== CG_JumpKick @@ -2634,6 +2656,11 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) { cent->pe.noHead = qtrue; CG_GibPlayerHeadshot( cent->lerpOrigin ); break; + case EV_GIB_PLAYER_STOMACH: + DEBUGNAME("EV_GIB_PLAYER_STOMACH"); + trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.gibSound ); + CG_GibPlayerStomachshot( cent->lerpOrigin ); + break; case EV_BREAK_GLASS1: DEBUGNAME("EV_BREAK_GLASS1"); // Change cgs.media.gibSound to whatever sound you want it to use diff --git a/reaction/game/bg_public.h b/reaction/game/bg_public.h index f8d19641..2eb3e8ba 100644 --- a/reaction/game/bg_public.h +++ b/reaction/game/bg_public.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.74 2002/05/28 01:46:58 jbravo +// Added stomach gibbing +// // Revision 1.73 2002/05/28 01:17:01 jbravo // More gib fixes. g_RQ3_gib added // @@ -1068,7 +1071,8 @@ typedef enum { EV_POWERUP_REGEN, EV_GIB_PLAYER, // gib a previously living player - EV_GIB_PLAYER_HEADSHOT, // JBravo: for sniperheadshots + EV_GIB_PLAYER_HEADSHOT, // JBravo: for sniper head shots + EV_GIB_PLAYER_STOMACH, // JBravo: for sniper stomach shots EV_BREAK_GLASS1, // Blaze: Breakable glass EV_BREAK_GLASS2, EV_BREAK_GLASS3, diff --git a/reaction/game/g_combat.c b/reaction/game/g_combat.c index f0ef057b..de7fc62c 100644 --- a/reaction/game/g_combat.c +++ b/reaction/game/g_combat.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.84 2002/05/28 01:46:58 jbravo +// Added stomach gibbing +// // Revision 1.83 2002/05/28 01:17:01 jbravo // More gib fixes. g_RQ3_gib added // @@ -509,6 +512,11 @@ void GibEntity_Headshot (gentity_t *self, int killer) { G_AddEvent (self, EV_GIB_PLAYER_HEADSHOT, 0); self->client->noHead = qtrue; } + +// JBravo: stomach gibbing +void GibEntity_Stomach (gentity_t *self, int killer) { + G_AddEvent (self, EV_GIB_PLAYER_STOMACH, 0); +} /* ================== body_die @@ -1518,8 +1526,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int // JBravo: AQ style Sniper and HC gibbing if (g_RQ3_gib.integer > 0) { if (meansOfDeath == MOD_SNIPER && hurt == LOC_HDAM) { - G_Printf("AQ GIB!\n"); - if (g_RQ3_gib.integer == 1 || g_RQ3_gib.integer == 2) { + if (g_RQ3_gib.integer < 3) { // NiceAss: beheading =D self->client->ps.eFlags |= EF_HEADLESS; GibEntity_Headshot (self, killer); @@ -1528,8 +1535,9 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int } else { self->client->noHead = qfalse; } + if (meansOfDeath == MOD_SNIPER && hurt == LOC_SDAM) + GibEntity_Stomach (self, killer); if (meansOfDeath == MOD_HANDCANNON && g_RQ3_gib.integer > 1) { // && self->health <= -15) { - G_Printf("AQ GIB!\n"); self->client->noHead = qfalse; trap_LinkEntity (self); GibEntity (self, killer);