diff options
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_buildable.c | 6 | ||||
-rw-r--r-- | src/cgame/cg_event.c | 45 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 11 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 33 |
4 files changed, 68 insertions, 27 deletions
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c index 4c1db197..86353f12 100644 --- a/src/cgame/cg_buildable.c +++ b/src/cgame/cg_buildable.c @@ -340,7 +340,6 @@ static void CG_SetBuildableLerpFrameAnimation( buildable_t buildable, lerpFrame_ animation_t *anim; lf->animationNumber = newAnimation; - newAnimation &= ~( ANIM_TOGGLEBIT|ANIM_FORCEBIT ); if( newAnimation < 0 || newAnimation >= MAX_BUILDABLE_ANIMATIONS ) CG_Error( "Bad animation number: %i", newAnimation ); @@ -373,6 +372,8 @@ static void CG_RunBuildableLerpFrame( centity_t *cent ) lerpFrame_t *lf = ¢->lerpFrame; animation_t *anim; buildableAnimNumber_t newAnimation = cent->buildableAnim; + + newAnimation &= ~( ANIM_TOGGLEBIT|ANIM_FORCEBIT ); // debugging tool to get no animations if( cg_animSpeed.integer == 0 ) @@ -386,6 +387,9 @@ static void CG_RunBuildableLerpFrame( centity_t *cent ) { CG_SetBuildableLerpFrameAnimation( buildable, lf, newAnimation ); + CG_Printf( "new anim/sound: %d %d\n", !cg_buildables[ buildable ].sounds[ newAnimation ].looped, + cg_buildables[ buildable ].sounds[ newAnimation ].enabled ); + if( !cg_buildables[ buildable ].sounds[ newAnimation ].looped && cg_buildables[ buildable ].sounds[ newAnimation ].enabled ) trap_S_StartSound( cent->lerpOrigin, cent->currentState.number, CHAN_AUTO, diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index 087dafc1..87f10a8d 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -799,19 +799,46 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) } break; - case EV_POISONCLOUD: - DEBUGNAME( "EV_POISONCLOUD" ); - cg.firstPoisonedTime = cg.time; + case EV_BUILD_REPAIR: + DEBUGNAME( "EV_BUILD_REPAIR" ); + trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.buildableRepairSound ); + break; + + case EV_BUILD_REPAIRED: + DEBUGNAME( "EV_BUILD_REPAIRED" ); + trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.buildableRepairedSound ); + break; + + case EV_OVERMIND_ATTACK: + DEBUGNAME( "EV_OVERMIND_ATTACK" ); + if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_ALIENS ) + { + trap_S_StartLocalSound( cgs.media.alienOvermindAttack, CHAN_ANNOUNCER ); + CG_CenterPrint( "The Overmind is under attack!", 200, GIANTCHAR_WIDTH * 4 ); + } break; - case EV_KNOCKOVER: - DEBUGNAME( "EV_KNOCKOVER" ); - cg.firstKnockedTime = cg.time; + case EV_OVERMIND_DYING: + DEBUGNAME( "EV_OVERMIND_DYING" ); + if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_ALIENS ) + { + trap_S_StartLocalSound( cgs.media.alienOvermindDying, CHAN_ANNOUNCER ); + CG_CenterPrint( "The Overmind is dying!", 200, GIANTCHAR_WIDTH * 4 ); + } break; - case EV_GETUP: - DEBUGNAME( "EV_GETUP" ); - cg.firstGetUpTime = cg.time; + case EV_OVERMIND_SPAWNS: + DEBUGNAME( "EV_OVERMIND_SPAWNS" ); + if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_ALIENS ) + { + trap_S_StartLocalSound( cgs.media.alienOvermindSpawns, CHAN_ANNOUNCER ); + CG_CenterPrint( "The Overmind needs spawns!", 200, GIANTCHAR_WIDTH * 4 ); + } + break; + + case EV_POISONCLOUD: + DEBUGNAME( "EV_POISONCLOUD" ); + cg.firstPoisonedTime = cg.time; break; case EV_PLAYER_RESPAWN: diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 177ab40c..d3aadb32 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -737,10 +737,6 @@ typedef struct int poisonedTime; //TA: poison cloud int firstPoisonedTime; //TA: poison cloud - int lastRumbleTime; //TA: knocked over time - vec3_t rumbleVector; //TA: vertical displacement whilst rumbling - int firstKnockedTime; //TA: knocked over time - int firstGetUpTime; //TA: getting up time float charModelFraction; //TA: loading percentages float mediaFraction; @@ -924,6 +920,10 @@ typedef struct sfxHandle_t alienStageTransition; sfxHandle_t humanStageTransition; + sfxHandle_t alienOvermindAttack; + sfxHandle_t alienOvermindDying; + sfxHandle_t alienOvermindSpawns; + sfxHandle_t humanBuildableExpl; qhandle_t cursor; @@ -948,6 +948,9 @@ typedef struct qhandle_t jetpackFlashModel; sfxHandle_t repeaterUseSound; + + sfxHandle_t buildableRepairSound; + sfxHandle_t buildableRepairedSound; } cgMedia_t; diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index d52c77ec..0f1308b7 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -564,6 +564,10 @@ static void CG_RegisterSounds( void ) cgs.media.alienStageTransition = trap_S_RegisterSound( "sound/announcements/overmindevolved.wav", qtrue ); cgs.media.humanStageTransition = trap_S_RegisterSound( "sound/announcements/reinforcement.wav", qtrue ); + cgs.media.alienOvermindAttack = trap_S_RegisterSound( "sound/announcements/overmindattack.wav", qtrue ); + cgs.media.alienOvermindDying = trap_S_RegisterSound( "sound/announcements/overminddying.wav", qtrue ); + cgs.media.alienOvermindSpawns = trap_S_RegisterSound( "sound/announcements/overmindspawns.wav", qtrue ); + cgs.media.tracerSound = trap_S_RegisterSound( "sound/weapons/machinegun/buletby1.wav", qfalse ); cgs.media.selectSound = trap_S_RegisterSound( "sound/weapons/change.wav", qfalse ); cgs.media.wearOffSound = trap_S_RegisterSound( "sound/items/wearoff.wav", qfalse ); @@ -628,23 +632,26 @@ static void CG_RegisterSounds( void ) } //TA: - cgs.media.jetpackDescendSound = trap_S_RegisterSound( "sound/upgrades/jetpack/low.wav", qfalse ); - cgs.media.jetpackIdleSound = trap_S_RegisterSound( "sound/upgrades/jetpack/idle.wav", qfalse ); - cgs.media.jetpackAscendSound = trap_S_RegisterSound( "sound/upgrades/jetpack/hi.wav", qfalse ); + cgs.media.jetpackDescendSound = trap_S_RegisterSound( "sound/upgrades/jetpack/low.wav", qfalse ); + cgs.media.jetpackIdleSound = trap_S_RegisterSound( "sound/upgrades/jetpack/idle.wav", qfalse ); + cgs.media.jetpackAscendSound = trap_S_RegisterSound( "sound/upgrades/jetpack/hi.wav", qfalse ); - cgs.media.humanBuildableExpl = trap_S_RegisterSound( "sound/weapons/rocket/rocklx1a.wav", qfalse ); + cgs.media.humanBuildableExpl = trap_S_RegisterSound( "sound/weapons/rocket/rocklx1a.wav", qfalse ); // FIXME: only needed with item - cgs.media.sfx_ric1 = trap_S_RegisterSound( "sound/weapons/machinegun/ric1.wav", qfalse ); - cgs.media.sfx_ric2 = trap_S_RegisterSound( "sound/weapons/machinegun/ric2.wav", qfalse ); - cgs.media.sfx_ric3 = trap_S_RegisterSound( "sound/weapons/machinegun/ric3.wav", qfalse ); - cgs.media.sfx_plasmaexp = trap_S_RegisterSound( "sound/weapons/plasma/plasmx1a.wav", qfalse ); - cgs.media.sfx_flamerexp = trap_S_RegisterSound( "sound/weapons/flamer/fireimpc.wav", qfalse ); - - cgs.media.hgrenb1aSound = trap_S_RegisterSound( "sound/weapons/grenade/hgrenb1a.wav", qfalse ); - cgs.media.hgrenb2aSound = trap_S_RegisterSound( "sound/weapons/grenade/hgrenb2a.wav", qfalse ); + cgs.media.sfx_ric1 = trap_S_RegisterSound( "sound/weapons/machinegun/ric1.wav", qfalse ); + cgs.media.sfx_ric2 = trap_S_RegisterSound( "sound/weapons/machinegun/ric2.wav", qfalse ); + cgs.media.sfx_ric3 = trap_S_RegisterSound( "sound/weapons/machinegun/ric3.wav", qfalse ); + cgs.media.sfx_plasmaexp = trap_S_RegisterSound( "sound/weapons/plasma/plasmx1a.wav", qfalse ); + cgs.media.sfx_flamerexp = trap_S_RegisterSound( "sound/weapons/flamer/fireimpc.wav", qfalse ); + + cgs.media.hgrenb1aSound = trap_S_RegisterSound( "sound/weapons/grenade/hgrenb1a.wav", qfalse ); + cgs.media.hgrenb2aSound = trap_S_RegisterSound( "sound/weapons/grenade/hgrenb2a.wav", qfalse ); + + cgs.media.repeaterUseSound = trap_S_RegisterSound( "sound/buildables/repeater/use.wav", qfalse ); - cgs.media.repeaterUseSound = trap_S_RegisterSound( "sound/buildables/repeater/use.wav", qfalse ); + cgs.media.buildableRepairSound = trap_S_RegisterSound( "sound/buildables/human/repair.wav", qfalse ); + cgs.media.buildableRepairedSound = trap_S_RegisterSound( "sound/buildables/human/repaired.wav", qfalse ); } |