diff options
author | Michael Levin <risujin@fastmail.fm> | 2009-10-03 11:29:22 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:15:02 +0000 |
commit | 685e9535db65b8117a93afd68b93ce1521a6ec28 (patch) | |
tree | 379a6571720a38230181bc082caaabc921d31772 | |
parent | 7fed4f2d94817bb4c6d0a3bff665a5cae0ce8ff3 (diff) |
* Lucifer cannon projectile a little bigger with charge
* Sitting on a booster won't make it blink the warning bolt (SS_BOOSTEDWARNING), also made the warning fade
* Lucifer Cannon repeat rates fixed
* G_Damage() wont deal damage to dead entities
* Maybe fixed the buildable killed with shotgun won't show dying anim bug
* Attacked hives won't attack back when the OM is dead
* The monstrous hive bounding boxes shrunk to something reasonable
* Tesla Generator muzzle offset to the ball part, now fires over turrets
* HUDs can make vertical charge bars
* Human charge bar no longer overlaps scanner
* "There are no spawns remaining"
Changes to trample attack:
* No longer deals locational damage (wtf?)
* Charge "holding" restored
* Hit repeat rate limited to 50 ms
Changes to health cross icons:
* Inspired by Techhead, made new icons (sorry, yours didn't look so good in game :-\ )
* Icons fade from one to another
* Switched SS_HEALING_2X and SS_HEALING_ACTIVE meaning for Humans -- glows when on medi station, special icon for medkit
* Poisoned icon for humans (Techhead's idea)
-rw-r--r-- | models/weapons/lcannon/weapon.cfg | 2 | ||||
-rw-r--r-- | overrides/buildables/hive.cfg | 4 | ||||
-rw-r--r-- | scripts/weapons.particle | 4 | ||||
-rw-r--r-- | src/cgame/cg_draw.c | 167 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 8 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 8 | ||||
-rw-r--r-- | src/cgame/cg_playerstate.c | 7 | ||||
-rw-r--r-- | src/cgame/cg_view.c | 6 | ||||
-rw-r--r-- | src/game/bg_misc.c | 2 | ||||
-rw-r--r-- | src/game/bg_pmove.c | 28 | ||||
-rw-r--r-- | src/game/bg_public.h | 6 | ||||
-rw-r--r-- | src/game/g_active.c | 22 | ||||
-rw-r--r-- | src/game/g_buildable.c | 77 | ||||
-rw-r--r-- | src/game/g_cmds.c | 13 | ||||
-rw-r--r-- | src/game/g_combat.c | 16 | ||||
-rw-r--r-- | src/game/g_weapon.c | 17 | ||||
-rw-r--r-- | src/game/tremulous.h | 20 | ||||
-rw-r--r-- | ui/menudef.h | 6 | ||||
-rw-r--r-- | ui/tremulous_alien_common_hud.h | 35 | ||||
-rw-r--r-- | ui/tremulous_human_hud.menu | 37 |
20 files changed, 237 insertions, 248 deletions
diff --git a/models/weapons/lcannon/weapon.cfg b/models/weapons/lcannon/weapon.cfg index 530e3545..06cf1b4b 100644 --- a/models/weapons/lcannon/weapon.cfg +++ b/models/weapons/lcannon/weapon.cfg @@ -6,7 +6,7 @@ idleSound models/weapons/lcannon/idle.wav primary
{
missileSprite 16 gfx/lcannon/primary
- missileSpriteCharge 0.2
+ missileSpriteCharge 0.27
missileSound models/weapons/lcannon/missle.wav
missileParticleSystem models/weapons/lcannon/missilePS diff --git a/overrides/buildables/hive.cfg b/overrides/buildables/hive.cfg new file mode 100644 index 00000000..296a9b0d --- /dev/null +++ b/overrides/buildables/hive.cfg @@ -0,0 +1,4 @@ +model 0 models/buildables/hive/hive.md3
+mins -20 -20 -20
+maxs 20 20 20
+zOffset 0
diff --git a/scripts/weapons.particle b/scripts/weapons.particle index bdd0c101..dc69fbc9 100644 --- a/scripts/weapons.particle +++ b/scripts/weapons.particle @@ -551,7 +551,7 @@ models/weapons/lcannon/impactPS alpha 0 1.0 0.0
rotation 0 ~360 - - scaleWithCharge 0.1
+ scaleWithCharge 0.13
lifeTime 250
}
@@ -619,7 +619,7 @@ models/weapons/lcannon/impactPS rotation 0 ~360 -
bounce 1.0 - scaleWithCharge 0.1
+ scaleWithCharge 0.13
lifeTime 1000~1000
}
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index e99d48d1..24121df5 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -488,7 +488,8 @@ static void CG_DrawPlayerStaminaBolt( rectDef_t *rect, vec4_t color, qhandle_t s if( stamina < 0 ) color[ 3 ] = HH_MIN_ALPHA; else if( cg.predictedPlayerState.stats[ STAT_STATE ] & SS_SPEEDBOOST ) - color[ 3 ] = 1.0f; + color[ 3 ] = HH_MIN_ALPHA + HH_MAX_ALPHA * + ( 0.5f + sin( cg.time / 200.0f ) / 2 ); else color[ 3 ] = HH_MAX_ALPHA; @@ -573,7 +574,7 @@ CG_DrawPlayerBoosted */ static void CG_DrawPlayerBoosted( rectDef_t *rect, vec4_t color, qhandle_t shader ) { - if( cg.boostedTime >= 0 ) + if( cg.snap->ps.stats[ STAT_STATE ] & SS_BOOSTED ) color[ 3 ] = AH_MAX_ALPHA; else color[ 3 ] = AH_MIN_ALPHA; @@ -596,9 +597,9 @@ static void CG_DrawPlayerBoosterBolt( rectDef_t *rect, vec4_t color, qhandle_t s // Flash bolts when the boost is almost out if( ( cg.snap->ps.stats[ STAT_STATE ] & SS_BOOSTED ) && - cg.boostedTime > 0 && cg.time - cg.boostedTime > BOOST_TIME - 5000 && - cg.time & 256 ) - localColor[ 3 ] = 1.0f; + ( cg.snap->ps.stats[ STAT_STATE ] & SS_BOOSTEDWARNING ) ) + localColor[ 3 ] += ( 1.0f - localColor[ 3 ] ) * + ( 0.5f + sin( cg.time / 100.0f ) / 2 ); trap_R_SetColor( localColor ); CG_DrawPic( rect->x, rect->y, rect->w, rect->h, shader ); @@ -857,44 +858,67 @@ static void CG_DrawPlayerHealthValue( rectDef_t *rect, vec4_t color ) CG_DrawPlayerHealthCross ============== */ -static void CG_DrawPlayerHealthCross( rectDef_t *rect, vec4_t color, qhandle_t shader ) +static void CG_DrawPlayerHealthCross( rectDef_t *rect, vec4_t ref_color ) { - if( ( cg.snap->ps.stats[ STAT_STATE ] & SS_HEALING_2X ) || - ( cg.snap->ps.stats[ STAT_STATE ] & SS_HEALING_3X ) ) - return; + qhandle_t shader; + vec4_t color; + float ref_alpha; + + // Pick the current icon + shader = cgs.media.healthCross; + if( cg.snap->ps.stats[ STAT_STATE ] & SS_HEALING_3X ) + shader = cgs.media.healthCross3X; + else if( cg.snap->ps.stats[ STAT_STATE ] & SS_HEALING_2X ) + { + if( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + shader = cgs.media.healthCross2X; + else + shader = cgs.media.healthCrossMedkit; + } + else if( cg.snap->ps.stats[ STAT_STATE ] & SS_POISONED ) + shader = cgs.media.healthCrossPoisoned; + + // Pick the alpha value + Vector4Copy( ref_color, color ); if( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_HUMANS && cg.snap->ps.stats[ STAT_HEALTH ] < 10 ) { color[ 0 ] = 1.0f; color[ 1 ] = color[ 2 ] = 0.0f; } + ref_alpha = ref_color[ 3 ]; if( cg.snap->ps.stats[ STAT_STATE ] & SS_HEALING_ACTIVE ) - color[ 3 ] = 1.0f; - - trap_R_SetColor( color ); - CG_DrawPic( rect->x, rect->y, rect->w, rect->h, shader ); - trap_R_SetColor( NULL ); -} - -static void CG_DrawPlayerHealthCross2( rectDef_t *rect, vec4_t color, qhandle_t shader ) -{ - if( !( cg.snap->ps.stats[ STAT_STATE ] & SS_HEALING_2X ) ) - return; - if( cg.snap->ps.stats[ STAT_STATE ] & SS_HEALING_ACTIVE ) - color[ 3 ] = 1.0f; + ref_alpha = 1.0f; + + // Don't fade from nothing + if( !cg.lastHealthCross ) + cg.lastHealthCross = shader; - trap_R_SetColor( color ); - CG_DrawPic( rect->x, rect->y, rect->w, rect->h, shader ); - trap_R_SetColor( NULL ); -} + // Fade the icon during transition + if( cg.lastHealthCross != shader ) + { + cg.healthCrossFade += cg.frametime / 500.f; + if( cg.healthCrossFade > 1.f ) + { + cg.healthCrossFade = 0.f; + cg.lastHealthCross = shader; + } + else + { + // Fading between two icons + color[ 3 ] = ref_alpha * cg.healthCrossFade; + trap_R_SetColor( color ); + CG_DrawPic( rect->x, rect->y, rect->w, rect->h, shader ); + color[ 3 ] = ref_alpha * ( 1.f - cg.healthCrossFade ); + trap_R_SetColor( color ); + CG_DrawPic( rect->x, rect->y, rect->w, rect->h, cg.lastHealthCross ); + trap_R_SetColor( NULL ); + return; + } + } -static void CG_DrawPlayerHealthCross3( rectDef_t *rect, vec4_t color, qhandle_t shader ) -{ - if( !( cg.snap->ps.stats[ STAT_STATE ] & SS_HEALING_3X ) ) - return; - if( cg.snap->ps.stats[ STAT_STATE ] & SS_HEALING_ACTIVE ) - color[ 3 ] = 1.0f; - + // Not fading, draw a single icon + color[ 3 ] = ref_alpha; trap_R_SetColor( color ); CG_DrawPic( rect->x, rect->y, rect->w, rect->h, shader ); trap_R_SetColor( NULL ); @@ -917,8 +941,16 @@ static float CG_ChargeProgress( void ) } else if( cg.snap->ps.weapon == WP_ALEVEL4 ) { - min = LEVEL4_TRAMPLE_CHARGE_MIN; - max = LEVEL4_TRAMPLE_CHARGE_MAX; + if( cg.predictedPlayerState.stats[ STAT_STATE ] & SS_CHARGING ) + { + min = 0; + max = LEVEL4_TRAMPLE_DURATION; + } + else + { + min = LEVEL4_TRAMPLE_CHARGE_MIN; + max = LEVEL4_TRAMPLE_CHARGE_MAX; + } } else if( cg.snap->ps.weapon == WP_LUCIFER_CANNON ) { @@ -962,11 +994,14 @@ static void CG_DrawPlayerChargeBarBG( rectDef_t *rect, vec4_t ref_color, trap_R_SetColor( NULL ); } +// FIXME: This should come from the element info +#define CHARGE_BAR_CAP_SIZE 3 + static void CG_DrawPlayerChargeBar( rectDef_t *rect, vec4_t ref_color, qhandle_t shader ) { vec4_t color; - float x, y, width, height, cap_width, progress; + float x, y, width, height, cap_size, progress; if( !cg_drawChargeBar.integer ) return; @@ -1005,21 +1040,45 @@ static void CG_DrawPlayerChargeBar( rectDef_t *rect, vec4_t ref_color, color[ 2 ] = 0.0f; } - // Calculate bar coords x = rect->x; y = rect->y; - width = ( rect->w - 6 ) * cg.chargeMeterValue; - height = rect->h; - CG_AdjustFrom640( &x, &y, &width, &height ); - cap_width = 3 * cgs.screenXScale; - // Draw the meter - trap_R_SetColor( color ); - trap_R_DrawStretchPic( x, y, cap_width, height, 0, 0, 1, 1, shader ); - trap_R_DrawStretchPic( x + width + cap_width, y, cap_width, height, - 1, 0, 0, 1, shader ); - trap_R_DrawStretchPic( x + cap_width, y, width, height, 1, 0, 1, 1, shader ); - trap_R_SetColor( NULL ); + // Horizontal charge bar + if( rect->w >= rect->h ) + { + width = ( rect->w - CHARGE_BAR_CAP_SIZE * 2 ) * cg.chargeMeterValue; + height = rect->h; + CG_AdjustFrom640( &x, &y, &width, &height ); + cap_size = CHARGE_BAR_CAP_SIZE * cgs.screenXScale; + + // Draw the meter + trap_R_SetColor( color ); + trap_R_DrawStretchPic( x, y, cap_size, height, 0, 0, 1, 1, shader ); + trap_R_DrawStretchPic( x + width + cap_size, y, cap_size, height, + 1, 0, 0, 1, shader ); + trap_R_DrawStretchPic( x + cap_size, y, width, height, 1, 0, 1, 1, shader ); + trap_R_SetColor( NULL ); + } + + // Vertical charge bar + else + { + y += rect->h; + width = rect->w; + height = ( rect->h - CHARGE_BAR_CAP_SIZE * 2 ) * cg.chargeMeterValue; + CG_AdjustFrom640( &x, &y, &width, &height ); + cap_size = CHARGE_BAR_CAP_SIZE * cgs.screenYScale; + + // Draw the meter + trap_R_SetColor( color ); + trap_R_DrawStretchPic( x, y - cap_size, width, cap_size, + 0, 1, 1, 0, shader ); + trap_R_DrawStretchPic( x, y - height - cap_size * 2, width, + cap_size, 0, 0, 1, 1, shader ); + trap_R_DrawStretchPic( x, y - height - cap_size, width, height, + 0, 1, 1, 1, shader ); + trap_R_SetColor( NULL ); + } } static void CG_DrawProgressLabel( rectDef_t *rect, float text_x, float text_y, vec4_t color, @@ -2261,13 +2320,7 @@ void CG_OwnerDraw( float x, float y, float w, float h, float text_x, CG_DrawPlayerHealthValue( &rect, color ); break; case CG_PLAYER_HEALTH_CROSS: - CG_DrawPlayerHealthCross( &rect, color, shader ); - break; - case CG_PLAYER_HEALTH_CROSS2: - CG_DrawPlayerHealthCross2( &rect, color, shader ); - break; - case CG_PLAYER_HEALTH_CROSS3: - CG_DrawPlayerHealthCross3( &rect, color, shader ); + CG_DrawPlayerHealthCross( &rect, color ); break; case CG_PLAYER_CHARGE_BAR_BG: CG_DrawPlayerChargeBarBG( &rect, color, shader ); @@ -2870,7 +2923,9 @@ static qboolean CG_DrawQueue( void ) w = UI_Text_Width( buffer, 0.7f, 0 ); UI_Text_Paint( 320 - w / 2, 360, 0.7f, color, buffer, 0, 0, ITEM_TEXTSTYLE_SHADOWED ); - if( cg.snap->ps.persistant[ PERS_SPAWNS ] == 1 ) + if( cg.snap->ps.persistant[ PERS_SPAWNS ] == 0 ) + Com_sprintf( buffer, MAX_STRING_CHARS, "There are no spawns remaining" ); + else if( cg.snap->ps.persistant[ PERS_SPAWNS ] == 1 ) Com_sprintf( buffer, MAX_STRING_CHARS, "There is 1 spawn remaining" ); else Com_sprintf( buffer, MAX_STRING_CHARS, "There are %d spawns remaining", diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 3f4a0d80..2c04f4e6 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -1101,7 +1101,6 @@ typedef struct qboolean weapon2Firing; qboolean weapon3Firing; - int boostedTime; int poisonedTime; vec3_t lastNormal; // view smoothage @@ -1139,6 +1138,8 @@ typedef struct float chargeMeterAlpha; float chargeMeterValue; + qhandle_t lastHealthCross; + float healthCrossFade; int nextWeaponClickTime; } cg_t; @@ -1277,6 +1278,11 @@ typedef struct qhandle_t buildWeaponTimerPie[ 8 ]; qhandle_t upgradeClassIconShader; + qhandle_t healthCross; + qhandle_t healthCross2X; + qhandle_t healthCross3X; + qhandle_t healthCrossMedkit; + qhandle_t healthCrossPoisoned; } cgMedia_t; typedef struct diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index f07df10f..67db0a61 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -846,6 +846,13 @@ static void CG_RegisterGraphics( void ) for( i = 0; i < 8; i++ ) cgs.media.buildWeaponTimerPie[ i ] = trap_R_RegisterShader( buildWeaponTimerPieShaders[ i ] ); + // player health cross shaders + cgs.media.healthCross = trap_R_RegisterShader( "ui/assets/neutral/cross.tga" ); + cgs.media.healthCross2X = trap_R_RegisterShader( "ui/assets/neutral/cross2.tga" ); + cgs.media.healthCross3X = trap_R_RegisterShader( "ui/assets/neutral/cross3.tga" ); + cgs.media.healthCrossMedkit = trap_R_RegisterShader( "ui/assets/neutral/cross_medkit.tga" ); + cgs.media.healthCrossPoisoned = trap_R_RegisterShader( "ui/assets/neutral/cross_poison.tga" ); + cgs.media.upgradeClassIconShader = trap_R_RegisterShader( "icons/icona_upgrade.tga" ); cgs.media.balloonShader = trap_R_RegisterShader( "gfx/sprites/chatballoon" ); @@ -1812,7 +1819,6 @@ void CG_Init( int serverMessageNum, int serverCommandSequence, int clientNum ) CG_LoadHudMenu( ); cg.weaponSelect = WP_NONE; - cg.boostedTime = -1; // old servers diff --git a/src/cgame/cg_playerstate.c b/src/cgame/cg_playerstate.c index e1bcb091..6999e773 100644 --- a/src/cgame/cg_playerstate.c +++ b/src/cgame/cg_playerstate.c @@ -313,5 +313,12 @@ void CG_TransitionPlayerState( playerState_t *ps, playerState_t *ops ) cg.duckChange = ps->viewheight - ops->viewheight; cg.duckTime = cg.time; } + + // changed team + if( ps->persistant[ PERS_TEAM ] != ops->persistant[ PERS_TEAM ] ) + { + cg.lastHealthCross = 0; + cg.chargeMeterAlpha = 0.0f; + } } diff --git a/src/cgame/cg_view.c b/src/cgame/cg_view.c index 94e7187c..f18773c0 100644 --- a/src/cgame/cg_view.c +++ b/src/cgame/cg_view.c @@ -1234,12 +1234,6 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView, qboolean demo // decide on third person view cg.renderingThirdPerson = cg_thirdPerson.integer || ( cg.snap->ps.stats[ STAT_HEALTH ] <= 0 ); - // Infer when we first became boosted - if( ( cg.snap->ps.stats[ STAT_STATE ] & SS_BOOSTED ) && cg.boostedTime < 0 ) - cg.boostedTime = cg.time; - else if( !( cg.snap->ps.stats[ STAT_STATE ] & SS_BOOSTED ) && cg.boostedTime >= 0 ) - cg.boostedTime = -1; - // build cg.refdef inwater = CG_CalcViewValues( ); diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index 59c76e3a..9b988371 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -3421,7 +3421,7 @@ weaponAttributes_t bg_weapons[ ] = qfalse, //int infiniteAmmo; qtrue, //int usesEnergy; LCANNON_REPEAT, //int repeatRate1; - LCANNON_CHARGEREPEAT, //int repeatRate2; + LCANNON_SECONDARY_REPEAT, //int repeatRate2; 0, //int repeatRate3; LCANNON_RELOAD, //int reloadTime; LCANNON_K_SCALE, //float knockbackScale; diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index f1c1d116..a6dc15cf 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -406,7 +406,7 @@ static float PM_CmdScale( usercmd_t *cmd ) if( pm->ps->weapon == WP_ALEVEL4 && pm->ps->pm_flags & PMF_CHARGE ) modifier *= 1.0f + ( pm->ps->stats[ STAT_MISC ] * ( LEVEL4_TRAMPLE_SPEED - 1.0f ) / - LEVEL4_TRAMPLE_CHARGE_MAX ); + LEVEL4_TRAMPLE_DURATION ); //slow player if charging up for a pounce if( ( pm->ps->weapon == WP_ALEVEL3 || pm->ps->weapon == WP_ALEVEL3_UPG ) && @@ -2829,21 +2829,14 @@ static void PM_Weapon( void ) if( !( pm->ps->stats[ STAT_STATE ] & SS_CHARGING ) ) { // Charge button held - if( pm->ps->stats[ STAT_MISC ] < LEVEL4_TRAMPLE_CHARGE_MAX && + if( pm->ps->stats[ STAT_MISC ] < LEVEL4_TRAMPLE_CHARGE_TRIGGER && ( pm->cmd.buttons & BUTTON_ATTACK2 ) ) { pm->ps->stats[ STAT_STATE ] &= ~SS_CHARGING; if( pm->cmd.forwardmove > 0 ) - pm->ps->stats[ STAT_MISC ] += pml.msec * LEVEL4_TRAMPLE_CHARGE_MAX / - LEVEL4_TRAMPLE_CHARGE_TIME_MAX; + pm->ps->stats[ STAT_MISC ] += pml.msec; else pm->ps->stats[ STAT_MISC ] = 0; - if( pm->ps->stats[ STAT_MISC ] > LEVEL4_TRAMPLE_CHARGE_MAX ) - { - pm->ps->stats[ STAT_MISC ] = LEVEL4_TRAMPLE_CHARGE_MAX; - pm->ps->stats[ STAT_STATE ] |= SS_CHARGING; - PM_AddEvent( EV_LEV4_TRAMPLE_START ); - } } // Charge button released @@ -2851,6 +2844,11 @@ static void PM_Weapon( void ) { if( pm->ps->stats[ STAT_MISC ] > LEVEL4_TRAMPLE_CHARGE_MIN ) { + if( pm->ps->stats[ STAT_MISC ] > LEVEL4_TRAMPLE_CHARGE_MAX ) + pm->ps->stats[ STAT_MISC ] = LEVEL4_TRAMPLE_CHARGE_MAX; + pm->ps->stats[ STAT_MISC ] = pm->ps->stats[ STAT_MISC ] * + LEVEL4_TRAMPLE_DURATION / + LEVEL4_TRAMPLE_CHARGE_MAX; pm->ps->stats[ STAT_STATE ] |= SS_CHARGING; PM_AddEvent( EV_LEV4_TRAMPLE_START ); } @@ -2903,22 +2901,22 @@ static void PM_Weapon( void ) if( pm->ps->pm_flags & PMF_RESPAWNED ) return; - // no slash during charge - if( pm->ps->stats[ STAT_STATE ] & SS_CHARGING ) - return; - // no bite during pounce if( ( pm->ps->weapon == WP_ALEVEL3 || pm->ps->weapon == WP_ALEVEL3_UPG ) && ( pm->cmd.buttons & BUTTON_ATTACK ) && ( pm->ps->pm_flags & PMF_CHARGE ) ) return; - // make weapon function + // pump weapon delays (repeat times etc) if( pm->ps->weaponTime > 0 ) pm->ps->weaponTime -= pml.msec; if( pm->ps->weaponTime < 0 ) pm->ps->weaponTime = 0; + // no slash during charge + if( pm->ps->stats[ STAT_STATE ] & SS_CHARGING ) + return; + // check for weapon change // can't change if weapon is firing, but can change // again if lowering or raising diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 18c0d28f..7ad0b2a0 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -243,10 +243,10 @@ typedef enum #define SS_HOVELING 0x00000100 #define SS_BOOSTED 0x00000200 #define SS_SLOWLOCKED 0x00000400 -//#define SS_POISONCLOUDED 0x00000800 // unused +#define SS_BOOSTEDWARNING 0x00000800 // booster poison is running out #define SS_CHARGING 0x00001000 -#define SS_HEALING_ACTIVE 0x00002000 // medkit for Humans, creep for Aliens -#define SS_HEALING_2X 0x00004000 // double healing rate (for HUD) +#define SS_HEALING_ACTIVE 0x00002000 // medistat for Humans, creep for Aliens +#define SS_HEALING_2X 0x00004000 // medkit or double healing rate (for HUD) #define SS_HEALING_3X 0x00008000 // triple healing rate (for HUD) #define SB_VALID_TOGGLEBIT 0x00004000 diff --git a/src/game/g_active.c b/src/game/g_active.c index 9faa2c33..e30f8bf4 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -663,7 +663,7 @@ void ClientTimerActions( gentity_t *ent, int msec ) } if( ent->client->pers.teamSelection == PTE_HUMANS && - ( client->ps.stats[ STAT_STATE ] & SS_HEALING_ACTIVE ) ) + ( client->ps.stats[ STAT_STATE ] & SS_HEALING_2X ) ) { int remainingStartupTime = MEDKIT_STARTUP_TIME - ( level.time - client->lastMedKitTime ); @@ -677,7 +677,7 @@ void ClientTimerActions( gentity_t *ent, int msec ) ent->health++; } else - ent->client->ps.stats[ STAT_STATE ] &= ~SS_HEALING_ACTIVE; + ent->client->ps.stats[ STAT_STATE ] &= ~SS_HEALING_2X; } else { @@ -696,7 +696,7 @@ void ClientTimerActions( gentity_t *ent, int msec ) } } else - ent->client->ps.stats[ STAT_STATE ] &= ~SS_HEALING_ACTIVE; + ent->client->ps.stats[ STAT_STATE ] &= ~SS_HEALING_2X; } } } @@ -1409,9 +1409,15 @@ void ClientThink_real( gentity_t *ent ) client->lastSlowTime + ABUILDER_BLOB_TIME < level.time ) client->ps.stats[ STAT_STATE ] &= ~SS_SLOWLOCKED; - if( ( client->ps.stats[ STAT_STATE ] & SS_BOOSTED ) && - level.time - client->boostedTime >= BOOST_TIME ) - client->ps.stats[ STAT_STATE ] &= ~SS_BOOSTED; + // Update boosted state flags + client->ps.stats[ STAT_STATE ] &= ~SS_BOOSTEDWARNING; + if( client->ps.stats[ STAT_STATE ] & SS_BOOSTED ) + { + if( level.time - client->boostedTime >= BOOST_TIME ) + client->ps.stats[ STAT_STATE ] &= ~SS_BOOSTED; + else if( level.time - client->boostedTime >= BOOST_WARN_TIME ) + client->ps.stats[ STAT_STATE ] |= SS_BOOSTEDWARNING; + } // Check if poison cloud has worn off if( ( client->ps.eFlags & EF_POISONCLOUDED ) && @@ -1429,7 +1435,7 @@ void ClientThink_real( gentity_t *ent ) BG_UpgradeIsActive( UP_MEDKIT, client->ps.stats ) ) { //if currently using a medkit or have no need for a medkit now - if( client->ps.stats[ STAT_STATE ] & SS_HEALING_ACTIVE || + if( client->ps.stats[ STAT_STATE ] & SS_HEALING_2X || ( client->ps.stats[ STAT_HEALTH ] == client->ps.stats[ STAT_MAX_HEALTH ] && !( client->ps.stats[ STAT_STATE ] & SS_POISONED ) ) ) { @@ -1444,7 +1450,7 @@ void ClientThink_real( gentity_t *ent ) client->ps.stats[ STAT_STATE ] &= ~SS_POISONED; client->poisonImmunityTime = level.time + MEDKIT_POISON_IMMUNITY_TIME; - client->ps.stats[ STAT_STATE ] |= SS_HEALING_ACTIVE; + client->ps.stats[ STAT_STATE ] |= SS_HEALING_2X; client->lastMedKitTime = level.time; client->medKitHealthToRestore = client->ps.stats[ STAT_MAX_HEALTH ] - client->ps.stats[ STAT_HEALTH ]; diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 96a8face..dd4a9672 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -668,10 +668,11 @@ A generic pain function for Alien buildables */ void AGeneric_Pain( gentity_t *self, gentity_t *attacker, int damage ) { - if( rand( ) % 1 ) - G_SetBuildableAnim( self, BANIM_PAIN1, qfalse ); - else - G_SetBuildableAnim( self, BANIM_PAIN2, qfalse ); + if( self->health <= 0 ) + return; + + // Alien buildables only have the first pain animation defined + G_SetBuildableAnim( self, BANIM_PAIN1, qfalse ); } @@ -693,19 +694,7 @@ void ASpawn_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int { int i; - G_RewardAttackers( self ); - G_SetBuildableAnim( self, BANIM_DESTROY1, qtrue ); - G_SetIdleBuildableAnim( self, BANIM_DESTROYED ); - - self->die = nullDieFunction; - self->think = AGeneric_Blast; - - if( self->spawned ) - self->nextthink = level.time + 5000; - else - self->nextthink = level.time; //blast immediately - - self->s.eFlags &= ~EF_FIRING; //prevent any firing effects + AGeneric_Die( self, inflictor, attacker, damage, mod ); // All supported structures that no longer have creep will have been killed // by whoever killed this structure @@ -718,24 +707,6 @@ void ASpawn_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int continue; ent->killedBy = attacker - g_entities; } - - if( attacker && attacker->client ) - { - if( attacker->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS && - !self->deconstruct ) - { - G_TeamCommand( PTE_ALIENS, - va( "print \"%s ^3DESTROYED^7 by teammate %s^7\n\"", - BG_FindHumanNameForBuildable( self->s.modelindex ), - attacker->client->pers.netname ) ); - } - - G_LogPrintf( "Decon: %i %i %i: %s destroyed %s by %s\n", - attacker->client->ps.clientNum, self->s.modelindex, mod, - attacker->client->pers.netname, - BG_FindNameForBuildable( self->s.modelindex ), - modNames[ mod ] ); - } } /* @@ -775,18 +746,6 @@ void ASpawn_Think( gentity_t *self ) self->nextthink = level.time + BG_FindNextThinkForBuildable( self->s.modelindex ); } -/* -================ -ASpawn_Pain - -pain function for Alien Spawn -================ -*/ -void ASpawn_Pain( gentity_t *self, gentity_t *attacker, int damage ) -{ - G_SetBuildableAnim( self, BANIM_PAIN1, qfalse ); -} - @@ -913,6 +872,9 @@ Barricade pain animation depends on shrunk state */ void ABarricade_Pain( gentity_t *self, gentity_t *attacker, int damage ) { + if( self->health <= 0 ) + return; + if( !self->shrunkTime ) G_SetBuildableAnim( self, BANIM_PAIN1, qfalse ); else @@ -1193,6 +1155,9 @@ pain function for Alien Hive */ void AHive_Pain( gentity_t *self, gentity_t *attacker, int damage ) { + if( self->health <= 0 || !G_IsOvermindBuilt( ) ) + return; + if( !self->active ) AHive_CheckTarget( self, attacker ); @@ -1861,7 +1826,7 @@ void HMedistat_Die( gentity_t *self, gentity_t *inflictor, { //clear target's healing flag if( self->enemy && self->enemy->client ) - self->enemy->client->ps.stats[ STAT_STATE ] &= ~SS_HEALING_3X; + self->enemy->client->ps.stats[ STAT_STATE ] &= ~SS_HEALING_ACTIVE; HSpawn_Die( self, inflictor, attacker, damage, mod ); } @@ -1885,7 +1850,7 @@ void HMedistat_Think( gentity_t *self ) //clear target's healing flag if( self->enemy && self->enemy->client ) - self->enemy->client->ps.stats[ STAT_STATE ] &= ~SS_HEALING_3X; + self->enemy->client->ps.stats[ STAT_STATE ] &= ~SS_HEALING_ACTIVE; //make sure we have power if( !( self->powered = G_FindPower( self ) ) ) @@ -1926,7 +1891,7 @@ void HMedistat_Think( gentity_t *self ) player->client->ps.pm_type != PM_DEAD ) { occupied = qtrue; - player->client->ps.stats[ STAT_STATE ] |= SS_HEALING_3X; + player->client->ps.stats[ STAT_STATE ] |= SS_HEALING_ACTIVE; } } @@ -1952,7 +1917,7 @@ void HMedistat_Think( gentity_t *self ) { G_SetBuildableAnim( self, BANIM_ATTACK1, qfalse ); self->active = qtrue; - player->client->ps.stats[ STAT_STATE ] |= SS_HEALING_3X; + player->client->ps.stats[ STAT_STATE ] |= SS_HEALING_ACTIVE; } } else if( !BG_InventoryContainsUpgrade( UP_MEDKIT, player->client->ps.stats ) ) @@ -3238,7 +3203,7 @@ static gentity_t *G_Build( gentity_t *builder, buildable_t buildable, vec3_t ori case BA_A_SPAWN: built->die = ASpawn_Die; built->think = ASpawn_Think; - built->pain = ASpawn_Pain; + built->pain = AGeneric_Pain; break; case BA_A_BARRICADE: @@ -3260,7 +3225,7 @@ static gentity_t *G_Build( gentity_t *builder, buildable_t buildable, vec3_t ori case BA_A_ACIDTUBE: built->die = AGeneric_Die; built->think = AAcidTube_Think; - built->pain = ASpawn_Pain; + built->pain = AGeneric_Pain; break; case BA_A_HIVE: @@ -3272,20 +3237,20 @@ static gentity_t *G_Build( gentity_t *builder, buildable_t buildable, vec3_t ori case BA_A_TRAPPER: built->die = AGeneric_Die; built->think = ATrapper_Think; - built->pain = ASpawn_Pain; + built->pain = AGeneric_Pain; break; case BA_A_OVERMIND: built->die = ASpawn_Die; built->think = AOvermind_Think; - built->pain = ASpawn_Pain; + built->pain = AGeneric_Pain; break; case BA_A_HOVEL: built->die = AHovel_Die; built->use = AHovel_Use; built->think = AHovel_Think; - built->pain = ASpawn_Pain; + built->pain = AGeneric_Pain; break; case BA_H_SPAWN: diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 29a2acc4..01abca02 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -366,8 +366,17 @@ void Cmd_Give_f( gentity_t *ent ) if( Q_stricmp( name, "poison" ) == 0 ) { - ent->client->ps.stats[ STAT_STATE ] |= SS_BOOSTED; - ent->client->boostedTime = level.time; + if( ent->client->pers.teamSelection == PTE_HUMANS ) + { + ent->client->ps.stats[ STAT_STATE ] |= SS_POISONED; + ent->client->lastPoisonTime = level.time; + ent->client->lastPoisonClient = ent; + } + else + { + ent->client->ps.stats[ STAT_STATE ] |= SS_BOOSTED; + ent->client->boostedTime = level.time; + } } if( give_all || Q_stricmp( name, "ammo" ) == 0 ) diff --git a/src/game/g_combat.c b/src/game/g_combat.c index a347b921..1abb9780 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -871,12 +871,8 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, int asave = 0; int knockback; - if( !targ->takedamage ) - return; - - // the intermission has allready been qualified for, so don't - // allow any extra scoring - if( level.intermissionQueued ) + // Can't deal damage sometimes + if( !targ->takedamage || targ->health <= 0 || level.intermissionQueued ) return; if( !inflictor ) @@ -896,12 +892,8 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, } client = targ->client; - - if( client ) - { - if( client->noclip ) - return; - } + if( client && client->noclip ) + return; if( !dir ) dflags |= DAMAGE_NO_KNOCKBACK; diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index c78e6ec6..a74848f4 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -77,8 +77,6 @@ void G_ForceWeaponChange( gentity_t *ent, weapon_t weapon ) // force this here to prevent flamer effect from continuing ps->generic1 = WPM_NOTFIRING; - - ps->weapon = ent->client->ps.persistant[ PERS_NEWWEAPON ]; } /* @@ -1355,23 +1353,26 @@ void G_ChargeAttack( gentity_t *ent, gentity_t *victim ) vec3_t forward, normal; if( ent->client->ps.stats[ STAT_MISC ] <= 0 || - !( ent->client->ps.stats[ STAT_STATE ] & SS_CHARGING ) ) + !( ent->client->ps.stats[ STAT_STATE ] & SS_CHARGING ) || + ent->client->ps.weaponTime ) return; VectorSubtract( victim->s.origin, ent->s.origin, forward ); VectorNormalize( forward ); VectorNegate( forward, normal ); - + if( !victim->takedamage ) return; WideBloodSpurt( ent, victim, NULL ); damage = LEVEL4_TRAMPLE_DMG * ent->client->ps.stats[ STAT_MISC ] / - LEVEL4_TRAMPLE_CHARGE_MAX; + LEVEL4_TRAMPLE_DURATION; G_Damage( victim, ent, ent, forward, victim->s.origin, damage, - 0, MOD_LEVEL4_TRAMPLE ); + DAMAGE_NO_LOCDAMAGE, MOD_LEVEL4_TRAMPLE ); + + ent->client->ps.weaponTime += LEVEL4_TRAMPLE_REPEAT; if( !victim->client ) ent->client->ps.stats[ STAT_MISC ] = 0; @@ -1539,6 +1540,10 @@ void FireWeapon( gentity_t *ent ) // Hive muzzle point is on the tip if( ent->s.eType == ET_BUILDABLE && ent->s.modelindex == BA_A_HIVE ) VectorMA( muzzle, ent->r.maxs[ 2 ], ent->s.origin2, muzzle ); + + // Tesla generator muzzle point is offset too + if( ent->s.eType == ET_BUILDABLE && ent->s.modelindex == BA_H_TESLAGEN ) + VectorMA( muzzle, 28.0f, ent->s.origin2, muzzle ); } // fire the specific weapon diff --git a/src/game/tremulous.h b/src/game/tremulous.h index b0d3cb8e..30ea1d2f 100644 --- a/src/game/tremulous.h +++ b/src/game/tremulous.h @@ -117,15 +117,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define LEVEL4_TRAMPLE_DMG ADM(110) #define LEVEL4_TRAMPLE_SPEED 2.0f -#define LEVEL4_TRAMPLE_CHARGE_TIME_MIN 375 -#define LEVEL4_TRAMPLE_CHARGE_TIME_MAX 1000 -#define LEVEL4_TRAMPLE_DURATION 3000 -#define LEVEL4_TRAMPLE_STOP_PENALTY 1 // msec of charge lost when stopped - -#define LEVEL4_TRAMPLE_CHARGE_MIN ( LEVEL4_TRAMPLE_CHARGE_TIME_MIN * \ - LEVEL4_TRAMPLE_DURATION / \ - LEVEL4_TRAMPLE_CHARGE_TIME_MAX ) -#define LEVEL4_TRAMPLE_CHARGE_MAX LEVEL4_TRAMPLE_DURATION +#define LEVEL4_TRAMPLE_CHARGE_MIN 375 // minimum msec to start a charge +#define LEVEL4_TRAMPLE_CHARGE_MAX 1000 // msec to maximum charge stored +#define LEVEL4_TRAMPLE_CHARGE_TRIGGER 3000 // msec charge starts on its own +#define LEVEL4_TRAMPLE_DURATION 3000 // msec trample lasts on full charge +#define LEVEL4_TRAMPLE_STOP_PENALTY 1 // charge lost per msec when stopped +#define LEVEL4_TRAMPLE_REPEAT 50 // msec before a trample will rehit a player #define LEVEL4_CRUSH_DAMAGE_PER_V 0.5f // damage per falling velocity #define LEVEL4_CRUSH_DAMAGE 120 // to players only @@ -265,6 +262,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define BOOSTER_REGEN_MOD 3.0f #define BOOSTER_VALUE ABVM(BOOSTER_BP) #define BOOST_TIME 20000 +#define BOOST_WARN_TIME 15000 #define ACIDTUBE_BP 8 #define ACIDTUBE_BT 15000 @@ -455,9 +453,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define LCANNON_PRICE 600 #define LCANNON_AMMO 80 -#define LCANNON_REPEAT 1000 #define LCANNON_K_SCALE 1.0f -#define LCANNON_CHARGEREPEAT 500 +#define LCANNON_REPEAT 500 #define LCANNON_RELOAD 0 #define LCANNON_DAMAGE HDM(265) #define LCANNON_RADIUS 150 @@ -465,6 +462,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define LCANNON_SECONDARY_RADIUS 75 #define LCANNON_SECONDARY_SPEED 1400 #define LCANNON_SECONDARY_RELOAD 2000 +#define LCANNON_SECONDARY_REPEAT 1000 #define LCANNON_SPEED 700 #define LCANNON_CHARGE_TIME_MAX 3000 #define LCANNON_CHARGE_TIME_MIN 100 diff --git a/ui/menudef.h b/ui/menudef.h index 18432272..6b9705e1 100644 --- a/ui/menudef.h +++ b/ui/menudef.h @@ -175,9 +175,7 @@ #define UI_HBUILDINFOPANE 74 #define UI_HELPINFOPANE 75 -#define CG_PLAYER_HEALTH_CROSS2 76 -#define CG_PLAYER_HEALTH_CROSS3 77 -#define CG_PLAYER_CHARGE_BAR_BG 78 -#define CG_PLAYER_CHARGE_BAR 79 +#define CG_PLAYER_CHARGE_BAR_BG 76 +#define CG_PLAYER_CHARGE_BAR 77 #endif diff --git a/ui/tremulous_alien_common_hud.h b/ui/tremulous_alien_common_hud.h index d4e8a4ce..466ed184 100644 --- a/ui/tremulous_alien_common_hud.h +++ b/ui/tremulous_alien_common_hud.h @@ -92,41 +92,14 @@ itemDef itemDef { name "cross" - rect 152.5 420.5 20 20 + rect 150 417.5 25 25 aspectBias ALIGN_LEFT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.5 - background "ui/assets/neutral/cross.tga" ownerdraw CG_PLAYER_HEALTH_CROSS } -//CROSS 2X -itemDef -{ - name "cross" - rect 152.5 420.5 20 20 - aspectBias ALIGN_LEFT - visible MENU_TRUE - decoration - forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.5 - background "ui/assets/neutral/cross2.tga" - ownerdraw CG_PLAYER_HEALTH_CROSS2 -} - -//CROSS 3X -itemDef -{ - name "cross" - rect 152.5 420.5 20 20 - aspectBias ALIGN_LEFT - visible MENU_TRUE - decoration - forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.5 - background "ui/assets/neutral/cross3.tga" - ownerdraw CG_PLAYER_HEALTH_CROSS3 -} - //LEFT RING itemDef { @@ -207,7 +180,7 @@ itemDef itemDef { name "organs" - rect 570.5 415.95 15 15 + rect 570 416 15 15 aspectBias ALIGN_RIGHT visible MENU_TRUE decoration @@ -235,7 +208,7 @@ itemDef decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.5 ownerdraw CG_PLAYER_CHARGE_BAR - background "ui/assets/neutral/charge_cap.tga" + background "ui/assets/neutral/charge_cap_h.tga" } //CHARGE BAR BG @@ -248,6 +221,6 @@ itemDef decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.25 ownerdraw CG_PLAYER_CHARGE_BAR_BG - background "ui/assets/neutral/charge_bg.tga" + background "ui/assets/neutral/charge_bg_h.tga" } diff --git a/ui/tremulous_human_hud.menu b/ui/tremulous_human_hud.menu index 5847ceaf..e38a25ce 100644 --- a/ui/tremulous_human_hud.menu +++ b/ui/tremulous_human_hud.menu @@ -121,41 +121,14 @@ itemDef { name "cross" - rect 135 427.5 20 20 + rect 132.5 425 25 25 aspectBias ALIGN_LEFT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.5 - background "ui/assets/neutral/cross.tga" ownerdraw CG_PLAYER_HEALTH_CROSS } - //CROSS 2X - itemDef - { - name "cross" - rect 135 427.5 20 20 - aspectBias ALIGN_LEFT - visible MENU_TRUE - decoration - forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.5 - background "ui/assets/neutral/cross2.tga" - ownerdraw CG_PLAYER_HEALTH_CROSS2 - } - - //CROSS 3X - itemDef - { - name "cross" - rect 135 427.5 20 20 - aspectBias ALIGN_LEFT - visible MENU_TRUE - decoration - forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.5 - background "ui/assets/neutral/cross3.tga" - ownerdraw CG_PLAYER_HEALTH_CROSS3 - } - //STAMINA 1 itemDef { @@ -349,26 +322,26 @@ itemDef { name "charge" - rect 292 404 56 8 + rect 510 384 56 8 aspectBias ALIGN_CENTER visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.5 ownerdraw CG_PLAYER_CHARGE_BAR - background "ui/assets/neutral/charge_cap.tga" + background "ui/assets/neutral/charge_cap_h.tga" } //CHARGE BAR BG itemDef { name "chargebg" - rect 288 400 64 16 + rect 506 380 64 16 aspectBias ALIGN_CENTER visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.25 ownerdraw CG_PLAYER_CHARGE_BAR_BG - background "ui/assets/neutral/charge_bg.tga" + background "ui/assets/neutral/charge_bg_h.tga" } //SELECTED |