diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2015-06-26 02:54:21 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2015-06-26 02:54:21 +0200 |
commit | 7a9d256ea39e7ed8797801f8184e6ab7f27a21dc (patch) | |
tree | 60717f0117b2b696693efa0e7070c58ea266cdcf /src | |
parent | b28d5f6dbedd5b895eed4cc5b730581df3b2215d (diff) |
Bug fixes for Wraith.
Diffstat (limited to 'src')
-rw-r--r-- | src/cgame/cg_event.c | 67 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 1 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 1 | ||||
-rw-r--r-- | src/cgame/cg_players.c | 12 | ||||
-rw-r--r-- | src/cgame/cg_scanner.c | 5 | ||||
-rw-r--r-- | src/game/bg_pmove.c | 11 | ||||
-rw-r--r-- | src/game/tremulous.h | 7 |
7 files changed, 71 insertions, 33 deletions
diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index 2ff1520..c1d4ee8 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -620,6 +620,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) int clientNum; clientInfo_t *ci; int steptime; + qboolean warpingEnemyWraith = qfalse; if( cg.snap->ps.persistant[ PERS_SPECSTATE ] != SPECTATOR_NOT ) steptime = 200; @@ -642,13 +643,20 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) ci = &cgs.clientinfo[ clientNum ]; + if( ci->team != cg.snap->ps.stats[ STAT_TEAM ] && + ( es->eFlags & EF_WARPING ) ) + { + warpingEnemyWraith = qtrue; + } + switch( event ) { // // movement generated events // case EV_FOOTSTEP: - if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE ) + if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE && + !warpingEnemyWraith ) { if( ci->footsteps == FOOTSTEP_CUSTOM ) trap_S_StartSound( NULL, es->number, CHAN_BODY, @@ -660,7 +668,8 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) break; case EV_FOOTSTEP_METAL: - if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE ) + if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE && + !warpingEnemyWraith ) { if( ci->footsteps == FOOTSTEP_CUSTOM ) trap_S_StartSound( NULL, es->number, CHAN_BODY, @@ -672,7 +681,8 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) break; case EV_FOOTSTEP_SQUELCH: - if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE ) + if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE && + !warpingEnemyWraith ) { trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.footsteps[ FOOTSTEP_FLESH ][ rand( ) & 3 ] ); @@ -680,7 +690,8 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) break; case EV_FOOTSPLASH: - if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE ) + if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE && + !warpingEnemyWraith ) { trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.footsteps[ FOOTSTEP_SPLASH ][ rand( ) & 3 ] ); @@ -688,7 +699,8 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) break; case EV_FOOTWADE: - if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE ) + if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE && + !warpingEnemyWraith ) { trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.footsteps[ FOOTSTEP_SPLASH ][ rand( ) & 3 ] ); @@ -696,7 +708,8 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) break; case EV_SWIM: - if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE ) + if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE && + !warpingEnemyWraith ) { trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.footsteps[ FOOTSTEP_SPLASH ][ rand( ) & 3 ] ); @@ -794,33 +807,35 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) } case EV_JUMP: - trap_S_StartSound( NULL, es->number, CHAN_VOICE, CG_CustomSound( es->number, "*jump1.wav" ) ); - - if( BG_ClassHasAbility( cg.predictedPlayerState.stats[ STAT_CLASS ], SCA_WALLJUMPER ) ) + if( !warpingEnemyWraith ) { - vec3_t surfNormal, refNormal = { 0.0f, 0.0f, 1.0f }; - vec3_t is; + trap_S_StartSound( NULL, es->number, CHAN_VOICE, CG_CustomSound( es->number, "*jump1.wav" ) ); - if( clientNum != cg.predictedPlayerState.clientNum ) - break; + if( BG_ClassHasAbility( cg.predictedPlayerState.stats[ STAT_CLASS ], SCA_WALLJUMPER ) ) + { + vec3_t surfNormal, refNormal = { 0.0f, 0.0f, 1.0f }; + vec3_t is; - //set surfNormal - VectorCopy( cg.predictedPlayerState.grapplePoint, surfNormal ); + if( clientNum != cg.predictedPlayerState.clientNum ) + break; - //if we are moving from one surface to another smooth the transition - if( !VectorCompare( surfNormal, cg.lastNormal ) && surfNormal[ 2 ] != 1.0f ) - { - CrossProduct( refNormal, surfNormal, is ); - VectorNormalize( is ); + //set surfNormal + VectorCopy( cg.predictedPlayerState.grapplePoint, surfNormal ); - //add the op - CG_addSmoothOp( is, 15.0f, 1.0f ); - } + //if we are moving from one surface to another smooth the transition + if( !VectorCompare( surfNormal, cg.lastNormal ) && surfNormal[ 2 ] != 1.0f ) + { + CrossProduct( refNormal, surfNormal, is ); + VectorNormalize( is ); - //copy the current normal to the lastNormal - VectorCopy( surfNormal, cg.lastNormal ); - } + //add the op + CG_addSmoothOp( is, 15.0f, 1.0f ); + } + //copy the current normal to the lastNormal + VectorCopy( surfNormal, cg.lastNormal ); + } + } break; case EV_AIRPOUNCE: diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 9a4793c..5b8f8b0 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -1361,6 +1361,7 @@ typedef struct sfxHandle_t warpingSound; qhandle_t warpOverlay; qhandle_t warpOverlayBlocked; + qhandle_t warpingShader; } cgMedia_t; typedef struct diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index c224171..2fae20f 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -938,6 +938,7 @@ static void CG_RegisterGraphics( void ) cgs.media.warpExitPS = CG_RegisterParticleSystem( "gfx/level1/warpExitPS" ); cgs.media.warpOverlay = trap_R_RegisterShader( "gfx/level1/warpOverlay" ); cgs.media.warpOverlayBlocked = trap_R_RegisterShader( "gfx/level1/warpOverlayBlocked" ); + cgs.media.warpingShader = trap_R_RegisterShader( "gfx/level1/warping" ); CG_BuildableStatusParse( "ui/assets/human/buildstat.cfg", &cgs.humanBuildStat ); CG_BuildableStatusParse( "ui/assets/alien/buildstat.cfg", &cgs.alienBuildStat ); diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c index e0bb622..8da8757 100644 --- a/src/cgame/cg_players.c +++ b/src/cgame/cg_players.c @@ -1897,6 +1897,13 @@ void CG_Player( centity_t *cent ) if( es->eFlags & EF_NODRAW ) return; + if( ( es->eFlags & EF_WARPING ) && + ( cgs.clientinfo[ es->number ].team != cg.snap->ps.stats[ STAT_TEAM ] || + cg.snap->ps.stats[ STAT_TEAM ] == TEAM_NONE ) ) + { + return; + } + // get the player model information renderfx = 0; if( es->number == cg.snap->ps.clientNum ) @@ -2060,6 +2067,11 @@ void CG_Player( centity_t *cent ) VectorCopy( legs.origin, legs.lightingOrigin ); VectorCopy( legs.origin, legs.oldorigin ); // don't positionally lerp at all + if( es->eFlags & EF_WARPING ) + { + legs.customShader = cgs.media.warpingShader; + } + trap_R_AddRefEntityToScene( &legs ); // if the model failed, allow the default nullmodel to be displayed diff --git a/src/cgame/cg_scanner.c b/src/cgame/cg_scanner.c index 6659b98..5e134cd 100644 --- a/src/cgame/cg_scanner.c +++ b/src/cgame/cg_scanner.c @@ -58,6 +58,11 @@ void CG_UpdateEntityPositions( void ) { cent = &cg_entities[ cg.snap->entities[ i ].number ]; + if( cent->currentState.eFlags & EF_NODRAW ) + { + continue; + } + if( cent->currentState.eType == ET_BUILDABLE && !( cent->currentState.eFlags & EF_DEAD )) { diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 78bc15a..1e1fb69 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -2625,8 +2625,7 @@ static void PM_Footsteps( void ) pm->xyspeed = sqrt( pm->ps->velocity[ 0 ] * pm->ps->velocity[ 0 ] + pm->ps->velocity[ 1 ] * pm->ps->velocity[ 1 ] ); - if( pm->ps->groundEntityNum == ENTITYNUM_NONE || - ( pm->ps->eFlags & EF_WARPING ) ) + if( pm->ps->groundEntityNum == ENTITYNUM_NONE ) { // airborne leaves position in cycle intact, but doesn't advance if( pm->waterlevel > 1 ) @@ -3808,6 +3807,11 @@ void PM_ForceFields( void ) forceField_t *ff; vec3_t total = { 0 }; + if( pm->ps->eFlags & EF_WARPING ) + { + return; + } + for( i = 0; i < pm->numForceFields; i++ ) { vec3_t delta; @@ -3869,6 +3873,7 @@ void PM_WraithMechanics( void ) { pm->ps->eFlags |= EF_WARPING; PM_AddEvent( EV_WARP_ENTER ); + pm->ps->stats[ STAT_MISC ] -= LEVEL1_WARP_COST; } else { @@ -3902,12 +3907,10 @@ done: { pm->tracemask = MASK_SOLID; pm->ps->stats[ STAT_MISC ] -= pml.msec; - pm->ps->eFlags |= EF_NODRAW; } else { pm->tracemask = MASK_PLAYERSOLID; - pm->ps->eFlags &= ~EF_NODRAW; } } diff --git a/src/game/tremulous.h b/src/game/tremulous.h index 92bf74e..84d8a27 100644 --- a/src/game/tremulous.h +++ b/src/game/tremulous.h @@ -127,8 +127,8 @@ TREMULOUS EDGE MOD SRC FILE //Wraith #define LEVEL1_SPEED 1.25f -#define LEVEL1_VALUE AVM(270) -#define LEVEL1_HEALTH AHM(60) +#define LEVEL1_VALUE AVM(370) +#define LEVEL1_HEALTH AHM(80) #define LEVEL1_REGEN (0.03f * LEVEL1_HEALTH) #define LEVEL1_COST 1 @@ -139,9 +139,10 @@ TREMULOUS EDGE MOD SRC FILE #define LEVEL1_CLAW_REPEAT 600 #define LEVEL1_CLAW_K_SCALE 1.0f -#define LEVEL1_WARP_TIME 5000 +#define LEVEL1_WARP_TIME 5500 #define LEVEL1_WARP_REGEN_DELAY 2000 #define LEVEL1_WARP_REGEN_RATE 1 +#define LEVEL1_WARP_COST 500 //Marauder #define LEVEL2_SPEED 1.2f |