diff options
-rw-r--r-- | src/cgame/cg_buildable.c | 15 | ||||
-rw-r--r-- | src/cgame/cg_draw.c | 98 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 7 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 19 | ||||
-rw-r--r-- | src/game/bg_pmove.c | 17 | ||||
-rw-r--r-- | src/game/g_cmds.c | 14 | ||||
-rw-r--r-- | src/game/g_local.h | 2 | ||||
-rw-r--r-- | src/game/g_weapon.c | 4 | ||||
-rw-r--r-- | src/game/tremulous.h | 10 | ||||
-rw-r--r-- | ui/menudef.h | 1 |
10 files changed, 155 insertions, 32 deletions
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c index 708e8277..9420af94 100644 --- a/src/cgame/cg_buildable.c +++ b/src/cgame/cg_buildable.c @@ -81,18 +81,29 @@ void CG_AlienBuildableExplosion( vec3_t origin, vec3_t dir ) vec3_t velocity; int count; particleSystem_t *ps; + qhandle_t gibModel; + int i; trap_S_StartSound( origin, ENTITYNUM_WORLD, CHAN_AUTO, cgs.media.alienBuildableExplosion ); // allow gibs to be turned off for speed if( cg_gibs.integer ) { - for( count = 0; count <= 9; count++ ) + for( count = 0; count <= 8; count++ ) { velocity[ 0 ] = crandom( ) * GGIB_VELOCITY; velocity[ 1 ] = crandom( ) * GGIB_VELOCITY; velocity[ 2 ] = GGIB_JUMP + crandom( ) * GGIB_VELOCITY; - CG_AlienBuildableExplosionFragment( origin, velocity, cgs.media.gibAbdomen ); + + switch( i ) + { + case 1: case 5: gibModel = cgs.media.alienGib1; break; + case 2: case 6: gibModel = cgs.media.alienGib2; break; + case 3: case 7: gibModel = cgs.media.alienGib3; break; + case 4: case 8: gibModel = cgs.media.alienGib4; break; + } + + CG_AlienBuildableExplosionFragment( origin, velocity, gibModel ); } } diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 266d03e9..d321d34e 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -537,9 +537,16 @@ static void CG_DrawPlayerCreditsValue( rectDef_t *rect, vec4_t color, qboolean p { int value; playerState_t *ps; + centity_t *cent; + cent = &cg_entities[ cg.snap->ps.clientNum ]; ps = &cg.snap->ps; + //if the build timer pie is showing don't show this + if( ( cent->currentState.weapon == WP_ABUILD || + cent->currentState.weapon == WP_ABUILD2 ) && ps->stats[ STAT_MISC ] ) + return; + value = ps->persistant[ PERS_CREDIT ]; if( value > -1 ) { @@ -1011,9 +1018,10 @@ static void CG_DrawUsableBuildable( rectDef_t *rect, qhandle_t shader, vec4_t co #define BUILD_DELAY_TIME 2000 -static void CG_DrawPlayerClipsValue( rectDef_t *rect, vec4_t color ) +static void CG_DrawPlayerBuildTimer( rectDef_t *rect, vec4_t color ) { - int value; + float progress; + int index; centity_t *cent; playerState_t *ps; @@ -1025,33 +1033,82 @@ static void CG_DrawPlayerClipsValue( rectDef_t *rect, vec4_t color ) switch( cent->currentState.weapon ) { case WP_ABUILD: + progress = (float)ps->stats[ STAT_MISC ] / (float)ABUILDER_BASE_DELAY; + break; + case WP_ABUILD2: + progress = (float)ps->stats[ STAT_MISC ] / (float)ABUILDER_ADV_DELAY; + break; + case WP_HBUILD: + progress = (float)ps->stats[ STAT_MISC ] / (float)HBUILD_DELAY; + break; + case WP_HBUILD2: - //remaining build delay - value = (int)( ceil( (float)ps->stats[ STAT_MISC ] / 1000.0f ) ); - - if( cg.time - cg.lastBuildAttempt <= BUILD_DELAY_TIME ) - { - if( ( cg.time / 300 ) % 2 ) - { - color[ 0 ] = 1.0f; - color[ 1 ] = color[ 2 ] = 0.0f; - color[ 3 ] = 1.0f; - } - } + progress = (float)ps->stats[ STAT_MISC ] / (float)HBUILD2_DELAY; break; default: - BG_unpackAmmoArray( cent->currentState.weapon, ps->ammo, ps->powerups, NULL, &value, NULL ); + return; break; } + + if( !ps->stats[ STAT_MISC ] ) + return; - if( value > -1 ) + index = (int)( progress * 8.0f ); + + if( index > 7 ) + index = 7; + else if( index < 0 ) + index = 0; + + if( cg.time - cg.lastBuildAttempt <= BUILD_DELAY_TIME ) { - trap_R_SetColor( color ); - CG_DrawField( rect->x, rect->y, 4, rect->w / 4, rect->h, value ); - trap_R_SetColor( NULL ); + if( ( cg.time / 300 ) % 2 ) + { + color[ 0 ] = 1.0f; + color[ 1 ] = color[ 2 ] = 0.0f; + color[ 3 ] = 1.0f; + } + } + + trap_R_SetColor( color ); + CG_DrawPic( rect->x, rect->y, rect->w, rect->h, + cgs.media.buildWeaponTimerPie[ index ] ); + trap_R_SetColor( NULL ); + } +} + +static void CG_DrawPlayerClipsValue( rectDef_t *rect, vec4_t color ) +{ + int value; + centity_t *cent; + playerState_t *ps; + + cent = &cg_entities[ cg.snap->ps.clientNum ]; + ps = &cg.snap->ps; + + if( cent->currentState.weapon ) + { + switch( cent->currentState.weapon ) + { + case WP_ABUILD: + case WP_ABUILD2: + case WP_HBUILD: + case WP_HBUILD2: + break; + + default: + BG_unpackAmmoArray( cent->currentState.weapon, ps->ammo, ps->powerups, NULL, &value, NULL ); + + if( value > -1 ) + { + trap_R_SetColor( color ); + CG_DrawField( rect->x, rect->y, 4, rect->w / 4, rect->h, value ); + trap_R_SetColor( NULL ); + } + break; } } } @@ -2335,6 +2392,9 @@ void CG_OwnerDraw( float x, float y, float w, float h, float text_x, case CG_PLAYER_CLIPS_VALUE: CG_DrawPlayerClipsValue( &rect, color ); break; + case CG_PLAYER_BUILD_TIMER: + CG_DrawPlayerBuildTimer( &rect, color ); + break; case CG_PLAYER_HEALTH: CG_DrawPlayerHealthValue( &rect, color ); break; diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 36d859fb..12ed3c7b 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -1059,6 +1059,11 @@ typedef struct qhandle_t metalGib7; qhandle_t metalGib8; + qhandle_t alienGib1; + qhandle_t alienGib2; + qhandle_t alienGib3; + qhandle_t alienGib4; + qhandle_t gibSpark1; qhandle_t gibSpark2; @@ -1223,6 +1228,8 @@ typedef struct qhandle_t alienBuildableDestroyedPS; sfxHandle_t lCannonWarningSound; + + qhandle_t buildWeaponTimerPie[ 8 ]; } cgMedia_t; diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index 4995cde0..782db516 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -706,6 +706,17 @@ static void CG_RegisterGraphics( void ) "gfx/2d/numbers/nine_32b", "gfx/2d/numbers/minus_32b", }; + static char *buildWeaponTimerPieShaders[ 8 ] = + { + "ui/assets/neutral/1_5pie", + "ui/assets/neutral/3_0pie", + "ui/assets/neutral/4_5pie", + "ui/assets/neutral/6_0pie", + "ui/assets/neutral/7_5pie", + "ui/assets/neutral/9_0pie", + "ui/assets/neutral/10_5pie", + "ui/assets/neutral/12_0pie", + }; // clear any references to old media memset( &cg.refdef, 0, sizeof( cg.refdef ) ); @@ -757,6 +768,9 @@ static void CG_RegisterGraphics( void ) cgs.media.noPowerShader = trap_R_RegisterShader("gfx/2d/nopower" ); cgs.media.humanSpawningShader = trap_R_RegisterShader("models/buildables/telenode/rep_cyl" ); + for( i = 0; i < 8; i++ ) + cgs.media.buildWeaponTimerPie[ i ] = trap_R_RegisterShader( buildWeaponTimerPieShaders[ i ] ); + cgs.media.machinegunBrassModel = trap_R_RegisterModel( "models/weapons2/shells/m_shell.md3" ); cgs.media.shotgunBrassModel = trap_R_RegisterModel( "models/weapons2/shells/s_shell.md3" ); @@ -783,6 +797,11 @@ static void CG_RegisterGraphics( void ) cgs.media.gibSpark1 = trap_R_RegisterShader( "models/fx/metal_gibs/spark.jpg" ); cgs.media.gibSpark2 = trap_R_RegisterShader( "models/fx/metal_gibs/spark2.jpg" ); + cgs.media.alienGib1 = trap_R_RegisterModel( "models/fx/alien_gibs/a_gib1.md3" ); + cgs.media.alienGib2 = trap_R_RegisterModel( "models/fx/alien_gibs/a_gib2.md3" ); + cgs.media.alienGib3 = trap_R_RegisterModel( "models/fx/alien_gibs/a_gib3.md3" ); + cgs.media.alienGib4 = trap_R_RegisterModel( "models/fx/alien_gibs/a_gib4.md3" ); + cgs.media.smoke2 = trap_R_RegisterModel( "models/weapons2/shells/s_shell.md3" ); cgs.media.balloonShader = trap_R_RegisterShader( "sprites/balloon3" ); diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 24e6940d..ebfe0b15 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -2919,7 +2919,22 @@ static void PM_Weapon( void ) } if( !( pm->ps->persistant[ PERS_STATE ] & PS_NONSEGMODEL ) ) - PM_StartTorsoAnim( TORSO_ATTACK ); + { + //FIXME: this should be an option in the client weapon.cfg + switch( pm->ps->weapon ) + { + case WP_FLAMER: + if( pm->ps->weaponstate == WEAPON_READY ) + { + PM_StartTorsoAnim( TORSO_ATTACK ); + } + break; + + default: + PM_StartTorsoAnim( TORSO_ATTACK ); + break; + } + } else { if( pm->ps->weapon == WP_BIGMOFO ) diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 8249eddb..17503b26 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -423,8 +423,8 @@ void Cmd_Kill_f( gentity_t *ent ) { if( ent->suicideTime == 0 ) { - trap_SendServerCommand( ent-g_entities, "print \"You will suicide in 10 seconds.\n\"" ); - ent->suicideTime = level.time + 10000; + trap_SendServerCommand( ent-g_entities, "print \"You will suicide in 20 seconds.\n\"" ); + ent->suicideTime = level.time + 20000; } else if( ent->suicideTime > level.time ) { @@ -1623,6 +1623,16 @@ void Cmd_Buy_f( gentity_t *ent ) !BG_FindInfinteAmmoForWeapon( i ) ) { BG_FindAmmoForWeapon( i, &quan, &clips, &maxClips ); + + if( buyingEnergyAmmo ) + { + G_AddEvent( ent, EV_RPTUSE_SOUND, 0 ); + ent->client->lastRefilTime = level.time; + + if( BG_gotItem( UP_BATTPACK, ent->client->ps.stats ) ) + quan = (int)( (float)quan * BATTPACK_MODIFIER ); + } + BG_packAmmoArray( i, ent->client->ps.ammo, ent->client->ps.powerups, quan, clips, maxClips ); } diff --git a/src/game/g_local.h b/src/game/g_local.h index 84acff1c..ee802f47 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -703,7 +703,7 @@ void G_InitDamageLocations( void ); #define DAMAGE_NO_ARMOR 0x00000002 // armour does not protect from this damage #define DAMAGE_NO_KNOCKBACK 0x00000004 // do not affect velocity, just view angles #define DAMAGE_NO_PROTECTION 0x00000008 // armor, shields, invulnerability, and godmode have no effect -#define DAMAGE_NO_LOCDAMAGE 0x00000010 // so not apply locational damage +#define DAMAGE_NO_LOCDAMAGE 0x00000010 // do not apply locational damage // // g_missile.c diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index dbcf33d2..2ab1abd5 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -961,12 +961,12 @@ void areaZapFire( gentity_t *ent ) //do some damage G_Damage( enemy, ent, ent, dir, tr.endpos, - damage, DAMAGE_NO_KNOCKBACK, MOD_CHIMERA_ZAP ); + damage, DAMAGE_NO_KNOCKBACK | DAMAGE_NO_LOCDAMAGE, MOD_CHIMERA_ZAP ); // snap the endpos to integers to save net bandwidth, but nudged towards the line SnapVectorTowards( tr.endpos, muzzle ); - // send railgun beam effect + // send arc effect tent = G_TempEntity( enemy->s.pos.trBase, EV_ALIENZAP ); VectorCopy( ent->client->ps.origin, tent->s.origin2 ); diff --git a/src/game/tremulous.h b/src/game/tremulous.h index 2ba0dd50..8f2ffd34 100644 --- a/src/game/tremulous.h +++ b/src/game/tremulous.h @@ -60,7 +60,7 @@ #define CHIMERA_CLAW_WIDTH 12.0f #define CHIMERA_CLAW_REPEAT 500 #define CHIMERA_CLAW_U_REPEAT 400 -#define CHIMERA_AREAZAP_DMG ADM(200) +#define CHIMERA_AREAZAP_DMG ADM(100) #define CHIMERA_AREAZAP_RANGE 300.0f #define CHIMERA_AREAZAP_REPEAT 1500 #define CHIMERA_WALLJUMP_MAXSPEED 1000.0f @@ -465,7 +465,7 @@ #define MGTURRET_BP 8 #define MGTURRET_BT 10000 -#define MGTURRET_HEALTH HBHM(400) +#define MGTURRET_HEALTH HBHM(300) #define MGTURRET_SPLASHDAMAGE 200 #define MGTURRET_SPLASHRADIUS 150 #define MGTURRET_ANGULARSPEED 6 //degrees/think ~= 200deg/sec @@ -489,13 +489,13 @@ #define DC_BP 8 #define DC_BT 10000 -#define DC_HEALTH HBHM(150) +#define DC_HEALTH HBHM(300) #define DC_SPLASHDAMAGE 50 #define DC_SPLASHRADIUS 100 #define ARMOURY_BP 10 #define ARMOURY_BT 10000 -#define ARMOURY_HEALTH HBHM(200) +#define ARMOURY_HEALTH HBHM(400) #define ARMOURY_SPLASHDAMAGE 50 #define ARMOURY_SPLASHRADIUS 100 @@ -511,7 +511,7 @@ #define REPEATER_BP 10 #define REPEATER_BT 10000 -#define REPEATER_HEALTH HBHM(200) +#define REPEATER_HEALTH HBHM(400) #define REPEATER_SPLASHDAMAGE 50 #define REPEATER_SPLASHRADIUS 100 diff --git a/ui/menudef.h b/ui/menudef.h index dc84b0e2..ac81b6c8 100644 --- a/ui/menudef.h +++ b/ui/menudef.h @@ -138,6 +138,7 @@ #define CG_PLAYER_AMMO_ICON 5 #define CG_PLAYER_AMMO_VALUE 6 #define CG_PLAYER_CLIPS_VALUE 70 +#define CG_PLAYER_BUILD_TIMER 115 #define CG_PLAYER_CREDITS_VALUE 71 #define CG_PLAYER_BANK_VALUE 72 #define CG_PLAYER_CREDITS_VALUE_NOPAD 106 |