summaryrefslogtreecommitdiff
path: root/src/cgame/cg_event.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2005-06-05 22:16:54 +0000
committerTim Angus <tim@ngus.net>2005-06-05 22:16:54 +0000
commitfb6006e34c1fe83acfb7976e50cb2f498e9c70b6 (patch)
treeb8b3f26b52c3b2e71b51d40ff84e86b5bfb9d52d /src/cgame/cg_event.c
parent47221c9c78f4a027211a041eb2ad527339b4d54b (diff)
* Added flashing alien icon if already at maximum class
* Improved scanner render and refactored scanner code * Added animated projectiles * Grenade * Changed model names to be human name agnostic * Added sounds for lev1 grab and lev4 charge * Added sound for failed evolution * Added battery pack rendering code * Added functionality to particle system to allow attachment of particle systems to particles (for nice explosions) * Implemented CG_FileExists * Added some code to gracefully handle missing sounds (easier than making the sounds :D) * cg_drawBBOX now draws player BBOXen * Renamed the alien classes (now done in class override scripts) * Implemented Vector4Add * The usual assorted bug fixes
Diffstat (limited to 'src/cgame/cg_event.c')
-rw-r--r--src/cgame/cg_event.c92
1 files changed, 74 insertions, 18 deletions
diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c
index 9b60df70..3a1138e6 100644
--- a/src/cgame/cg_event.c
+++ b/src/cgame/cg_event.c
@@ -32,6 +32,7 @@ static void CG_Obituary( entityState_t *ent )
const char *attackerInfo;
char targetName[ 32 ];
char attackerName[ 32 ];
+ char className[ 64 ];
gender_t gender;
clientInfo_t *ci;
@@ -57,7 +58,7 @@ static void CG_Obituary( entityState_t *ent )
if( !targetInfo )
return;
- Q_strncpyz( targetName, Info_ValueForKey( targetInfo, "n" ), sizeof( targetName ) - 2);
+ Q_strncpyz( targetName, Info_ValueForKey( targetInfo, "n" ), sizeof( targetName ) - 2 );
strcat( targetName, S_COLOR_WHITE );
message2 = "";
@@ -145,6 +146,15 @@ static void CG_Obituary( entityState_t *ent )
message = "irradiated himself";
break;
+ case MOD_GRENADE:
+ if( gender == GENDER_FEMALE )
+ message = "blew herself up";
+ else if( gender == GENDER_NEUTER )
+ message = "blew itself up";
+ else
+ message = "blew himself up";
+ break;
+
default:
if( gender == GENDER_FEMALE )
message = "killed herself";
@@ -221,50 +231,70 @@ static void CG_Obituary( entityState_t *ent )
message = "was caught in the fallout of";
message2 = "'s lucifer cannon";
break;
+ case MOD_GRENADE:
+ message = "couldn't escape";
+ message2 = "'s grenade";
+ break;
case MOD_ABUILDER_CLAW:
message = "should leave";
message2 = "'s buildings alone";
break;
- case MOD_SOLDIER_BITE:
+ case MOD_LEVEL0_BITE:
message = "was bitten by";
break;
- case MOD_HYDRA_CLAW:
+ case MOD_LEVEL1_CLAW:
message = "was swiped by";
- message2 = "'s hydra";
+ Com_sprintf( className, 64, "'s %s",
+ BG_FindHumanNameForClassNum( PCL_ALIEN_LEVEL1 ) );
+ message2 = className;
break;
- case MOD_DRAGOON_CLAW:
+ case MOD_LEVEL3_CLAW:
message = "was clawed by";
- message2 = "'s dragoon";
+ Com_sprintf( className, 64, "'s %s",
+ BG_FindHumanNameForClassNum( PCL_ALIEN_LEVEL3 ) );
+ message2 = className;
break;
- case MOD_DRAGOON_POUNCE:
+ case MOD_LEVEL3_POUNCE:
message = "was pounced upon by";
- message2 = "'s dragoon";
+ Com_sprintf( className, 64, "'s %s",
+ BG_FindHumanNameForClassNum( PCL_ALIEN_LEVEL3 ) );
+ message2 = className;
break;
- case MOD_CHIMERA_CLAW:
+ case MOD_LEVEL2_CLAW:
message = "was clawed by";
- message2 = "'s chimera";
+ Com_sprintf( className, 64, "'s %s",
+ BG_FindHumanNameForClassNum( PCL_ALIEN_LEVEL3 ) );
+ message2 = className;
break;
- case MOD_CHIMERA_ZAP:
+ case MOD_LEVEL2_ZAP:
message = "was zapped by";
- message2 = "'s chimera";
+ Com_sprintf( className, 64, "'s %s",
+ BG_FindHumanNameForClassNum( PCL_ALIEN_LEVEL3 ) );
+ message2 = className;
break;
- case MOD_BMOFO_CLAW:
+ case MOD_LEVEL4_CLAW:
message = "was mauled by";
- message2 = "'s big mofo";
+ Com_sprintf( className, 64, "'s %s",
+ BG_FindHumanNameForClassNum( PCL_ALIEN_LEVEL4 ) );
+ message2 = className;
break;
- case MOD_BMOFO_CHARGE:
+ case MOD_LEVEL4_CHARGE:
message = "should have gotten out of the way of";
- message2 = "'s big mofo";
+ Com_sprintf( className, 64, "'s %s",
+ BG_FindHumanNameForClassNum( PCL_ALIEN_LEVEL4 ) );
+ message2 = className;
break;
case MOD_POISON:
message = "should have used antitox against";
message2 = "'s poison";
break;
- case MOD_HYDRA_PCLOUD:
+ case MOD_LEVEL1_PCLOUD:
message = "was gassed by";
- message2 = "'s hydra";
+ Com_sprintf( className, 64, "'s %s",
+ BG_FindHumanNameForClassNum( PCL_ALIEN_LEVEL1 ) );
+ message2 = className;
break;
@@ -580,6 +610,22 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
break;
+ case EV_LEV1_GRAB:
+ DEBUGNAME( "EV_LEV1_GRAB" );
+ trap_S_StartSound( NULL, es->number, CHAN_VOICE, cgs.media.alienL1Grab );
+ break;
+
+ case EV_LEV4_CHARGE_PREPARE:
+ DEBUGNAME( "EV_LEV4_CHARGE_PREPARE" );
+ trap_S_StartSound( NULL, es->number, CHAN_VOICE, cgs.media.alienL4ChargePrepare );
+ break;
+
+ case EV_LEV4_CHARGE_START:
+ DEBUGNAME( "EV_LEV4_CHARGE_START" );
+ //FIXME: stop cgs.media.alienL4ChargePrepare playing here
+ trap_S_StartSound( NULL, es->number, CHAN_VOICE, cgs.media.alienL4ChargeStart );
+ break;
+
case EV_TAUNT:
DEBUGNAME( "EV_TAUNT" );
trap_S_StartSound( NULL, es->number, CHAN_VOICE, CG_CustomSound( es->number, "*taunt.wav" ) );
@@ -882,6 +928,16 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
cg.spawnTime = cg.time;
break;
+ case EV_ALIEN_EVOLVE_FAILED:
+ DEBUGNAME( "EV_ALIEN_EVOLVE_FAILED" );
+ if( clientNum == cg.predictedPlayerState.clientNum )
+ {
+ //FIXME: change to "negative" sound
+ trap_S_StartLocalSound( cgs.media.buildableRepairedSound, CHAN_LOCAL_SOUND );
+ cg.lastEvolveAttempt = cg.time;
+ }
+ break;
+
case EV_ALIEN_ACIDTUBE:
DEBUGNAME( "EV_ALIEN_ACIDTUBE" );
{