diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cgame/cg_buildable.c | 54 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 5 | ||||
-rw-r--r-- | src/cgame/cg_servercmds.c | 4 | ||||
-rw-r--r-- | src/game/bg_misc.c | 28 | ||||
-rw-r--r-- | src/game/bg_public.h | 6 | ||||
-rw-r--r-- | src/game/g_buildable.c | 62 | ||||
-rw-r--r-- | src/game/g_cmds.c | 8 | ||||
-rw-r--r-- | src/game/g_local.h | 4 | ||||
-rw-r--r-- | src/game/tremulous.h | 8 | ||||
-rw-r--r-- | src/ui/ui_shared.c | 3 |
10 files changed, 120 insertions, 62 deletions
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c index 2f85d48a..a75169da 100644 --- a/src/cgame/cg_buildable.c +++ b/src/cgame/cg_buildable.c @@ -34,6 +34,60 @@ char *cg_buildableSoundNames[ MAX_BUILDABLE_ANIMATIONS ] = sfxHandle_t defaultAlienSounds[ MAX_BUILDABLE_ANIMATIONS ]; sfxHandle_t defaultHumanSounds[ MAX_BUILDABLE_ANIMATIONS ]; +#define CREEP_SCALEUP_TIME 3000 +#define CREEP_SCALEDOWN_TIME 3000 +#define CREEP_SIZE 64.0f + +/* +================== +CG_Creep +================== +*/ +static void CG_Creep( centity_t *cent ) +{ + polyVert_t verts[ 4 ]; + vec3_t square[ 4 ]; + vec2_t tex[ 4 ]; + int i, msec, seed; + float size, newsize, frac; + float length; + trace_t tr, tr2; + vec3_t temp, origin, p1, p2; + int creepSize = BG_FindCreepSizeForBuildable( cent->currentState.clientNum ); + + //should the creep be growing or receding? + if( cent->miscTime >= 0 ) + { + msec = cg.time - cent->miscTime; + if( msec >= 0 && msec < CREEP_SCALEUP_TIME ) + frac = (float)msec / CREEP_SCALEUP_TIME; + else + frac = 1.0f; + } + else if( cent->miscTime < 0 ) + { + msec = cg.time + cent->miscTime; + if( msec >= 0 && msec < CREEP_SCALEDOWN_TIME ) + frac = 1.0f - ( (float)msec / CREEP_SCALEDOWN_TIME ); + else + frac = 0.0f; + } + + VectorCopy( cent->currentState.origin2, temp ); + VectorScale( temp, -4096, temp ); + VectorAdd( temp, cent->lerpOrigin, temp ); + + CG_Trace( &tr, cent->lerpOrigin, NULL, NULL, temp, cent->currentState.number, MASK_SOLID ); + + VectorCopy( tr.endpos, origin ); + + size = CREEP_SIZE * frac; + + if( size > 0.0f ) + CG_ImpactMark( cgs.media.greenBloodMarkShader, origin, cent->currentState.origin2, + 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, qfalse, size, qtrue ); +} + /* ====================== CG_ParseBuildableAnimationFile diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 3d580b4c..f4663f80 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -1347,11 +1347,6 @@ void CG_DrawItemSelectText( rectDef_t *rect, float scale, int textStyle ) // -// cg_creep.c -// -void CG_Creep( centity_t *cent ); - -// // cg_scanner.c // void CG_Scanner( rectDef_t *rect, qhandle_t shader ); diff --git a/src/cgame/cg_servercmds.c b/src/cgame/cg_servercmds.c index b469d0f1..8e9cba9f 100644 --- a/src/cgame/cg_servercmds.c +++ b/src/cgame/cg_servercmds.c @@ -624,7 +624,7 @@ void CG_Menu( int menu ) trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); break; - case MN_A_NOHVMND: + case MN_A_NOOVMND: trap_Cvar_Set( "ui_dialog", "There is no Overmind. An Overmind must be built to control " "the structure you tried to place" ); trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); @@ -636,7 +636,7 @@ void CG_Menu( int menu ) trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); break; - case MN_A_HIVEMIND: + case MN_A_OVERMIND: trap_Cvar_Set( "ui_dialog", "There can only be one Overmind. Destroy the existing one if you " "wish to move it." ); trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index f5037629..d13bf40b 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -181,10 +181,10 @@ buildableAttributes_t bg_buildableList[ ] = qfalse //qboolean reactorTest; }, { - BA_A_HIVEMIND, //int buildNum; - "hivemind", //char *buildName; + BA_A_OVERMIND, //int buildNum; + "overmind", //char *buildName; "Overmind", //char *humanName; - "team_alien_hivemind", //char *entityName; + "team_alien_overmind", //char *entityName; { "models/buildables/hivemind/hivemind.md3", 0, 0, 0 }, { -45, -45, -15 }, //vec3_t mins; { 45, 45, 95 }, //vec3_t maxs; @@ -205,7 +205,7 @@ buildableAttributes_t bg_buildableList[ ] = 0, //int turretRange; 0, //int turretFireSpeed; WP_NONE, //weapon_t turretProjType; - 0.707f, //float minNormal; + 0.95f, //float minNormal; qfalse, //qboolean invertNormal; qfalse, //qboolean creepTest; OVERMIND_CREEPSIZE, //int creepSize; @@ -269,7 +269,7 @@ buildableAttributes_t bg_buildableList[ ] = 0, //int turretRange; 0, //int turretFireSpeed; WP_NONE, //weapon_t turretProjType; - 0.907f, //float minNormal; + 0.95f, //float minNormal; qfalse, //qboolean invertNormal; qfalse, //qboolean creepTest; 0, //int creepSize; @@ -301,7 +301,7 @@ buildableAttributes_t bg_buildableList[ ] = 0, //int turretRange; 0, //int turretFireSpeed; WP_NONE, //weapon_t turretProjType; - 0.907f, //float minNormal; + 0.95f, //float minNormal; qfalse, //qboolean invertNormal; qfalse, //qboolean creepTest; 0, //int creepSize; @@ -335,7 +335,7 @@ buildableAttributes_t bg_buildableList[ ] = MGTURRET_RANGE, //int turretRange; MGTURRET_REPEAT, //int turretFireSpeed; WP_MACHINEGUN, //weapon_t turretProjType; - 0.907f, //float minNormal; + 0.95f, //float minNormal; qfalse, //qboolean invertNormal; qfalse, //qboolean creepTest; 0, //int creepSize; @@ -367,7 +367,7 @@ buildableAttributes_t bg_buildableList[ ] = TESLAGEN_RANGE, //int turretRange; TESLAGEN_REPEAT, //int turretFireSpeed; WP_TESLAGEN, //weapon_t turretProjType; - 0.907f, //float minNormal; + 0.95f, //float minNormal; qfalse, //qboolean invertNormal; qfalse, //qboolean creepTest; 0, //int creepSize; @@ -399,7 +399,7 @@ buildableAttributes_t bg_buildableList[ ] = 0, //int turretRange; 0, //int turretFireSpeed; WP_NONE, //weapon_t turretProjType; - 0.907f, //float minNormal; + 0.95f, //float minNormal; qfalse, //qboolean invertNormal; qfalse, //qboolean creepTest; 0, //int creepSize; @@ -432,7 +432,7 @@ buildableAttributes_t bg_buildableList[ ] = 0, //int turretRange; 0, //int turretFireSpeed; WP_NONE, //weapon_t turretProjType; - 0.907f, //float minNormal; + 0.95f, //float minNormal; qfalse, //qboolean invertNormal; qfalse, //qboolean creepTest; 0, //int creepSize; @@ -464,7 +464,7 @@ buildableAttributes_t bg_buildableList[ ] = 0, //int turretRange; 0, //int turretFireSpeed; WP_NONE, //weapon_t turretProjType; - 0.907f, //float minNormal; + 0.95f, //float minNormal; qfalse, //qboolean invertNormal; qfalse, //qboolean creepTest; 0, //int creepSize; @@ -496,7 +496,7 @@ buildableAttributes_t bg_buildableList[ ] = 0, //int turretRange; 0, //int turretFireSpeed; WP_NONE, //weapon_t turretProjType; - 0.907f, //float minNormal; + 0.95f, //float minNormal; qfalse, //qboolean invertNormal; qfalse, //qboolean creepTest; 0, //int creepSize; @@ -528,7 +528,7 @@ buildableAttributes_t bg_buildableList[ ] = 0, //int turretRange; 0, //int turretFireSpeed; WP_NONE, //weapon_t turretProjType; - 0.907f, //float minNormal; + 0.95f, //float minNormal; qfalse, //qboolean invertNormal; qfalse, //qboolean creepTest; 0, //int creepSize; @@ -2991,7 +2991,7 @@ upgradeAttributes_t bg_upgrades[ ] = UP_BATTLESUIT, //int upgradeNum; BSUIT_PRICE, //int price; ( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages - SLOT_HEAD|SLOT_TORSO|SLOT_ARMS|SLOT_LEGS, //int slots; + SLOT_HEAD|SLOT_TORSO|SLOT_ARMS|SLOT_LEGS|SLOT_BACKPACK, //int slots; "bsuit", //char *upgradeName; "Battlesuit", //char *upgradeHumanName; "icons/iconu_bsuit", diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 9ca3d6a1..c914643a 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -388,7 +388,7 @@ typedef enum BA_NONE, BA_A_SPAWN, - BA_A_HIVEMIND, + BA_A_OVERMIND, BA_A_BARRICADE, BA_A_ACIDTUBE, @@ -544,8 +544,8 @@ typedef enum MN_A_INFEST, MN_A_NOROOM, MN_A_NOCREEP, - MN_A_NOHVMND, - MN_A_HIVEMIND, + MN_A_NOOVMND, + MN_A_OVERMIND, MN_A_NOASSERT, MN_A_SPWNWARN, MN_A_NORMAL, diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index b27b1064..93514727 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -231,7 +231,7 @@ static qboolean findCreep( gentity_t *self ) if( !ent->classname || ent->s.eType != ET_BUILDABLE ) continue; - if( ent->s.modelindex == BA_A_SPAWN || ent->s.modelindex == BA_A_HIVEMIND ) + if( ent->s.modelindex == BA_A_SPAWN || ent->s.modelindex == BA_A_OVERMIND ) { VectorSubtract( self->s.origin, ent->s.origin, temp_v ); distance = VectorLength( temp_v ); @@ -530,18 +530,21 @@ void AOvermind_Think( gentity_t *self ) VectorAdd( self->s.origin, range, maxs ); VectorSubtract( self->s.origin, range, mins ); - //do some damage - num = trap_EntitiesInBox( mins, maxs, entityList, MAX_GENTITIES ); - for( i = 0; i < num; i++ ) + if( self->health > 0 ) { - enemy = &g_entities[ entityList[ i ] ]; - - if( enemy->client && enemy->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + //do some damage + num = trap_EntitiesInBox( mins, maxs, entityList, MAX_GENTITIES ); + for( i = 0; i < num; i++ ) { - self->timestamp = level.time; - G_SelectiveRadiusDamage( self->s.pos.trBase, self, self->splashDamage, - self->splashRadius, self, MOD_SHOTGUN, PTE_ALIENS ); - G_setBuildableAnim( self, BANIM_ATTACK1, qfalse ); + enemy = &g_entities[ entityList[ i ] ]; + + if( enemy->client && enemy->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + { + self->timestamp = level.time; + G_SelectiveRadiusDamage( self->s.pos.trBase, self, self->splashDamage, + self->splashRadius, self, MOD_SHOTGUN, PTE_ALIENS ); + G_setBuildableAnim( self, BANIM_ATTACK1, qfalse ); + } } } @@ -1759,6 +1762,8 @@ itemBuildError_t G_itemFits( gentity_t *ent, buildable_t buildable, int distance gentity_t *tempent, *closestPower; int minDistance = 10000; int templength; + float minNormal; + qboolean invert; if( ent->client->ps.stats[ STAT_STATE ] & SS_WALLCLIMBING ) { @@ -1801,17 +1806,18 @@ itemBuildError_t G_itemFits( gentity_t *ent, buildable_t buildable, int distance if( tr2.fraction < 1.0 || tr3.fraction < 1.0 ) return IBE_NOROOM; //NO other reason is allowed to override this + VectorCopy( tr1.plane.normal, normal ); + minNormal = BG_FindMinNormalForBuildable( buildable ); + invert = BG_FindInvertNormalForBuildable( buildable ); + + //can we build at this angle? + if( !( normal[ 2 ] >= minNormal || ( invert && normal[ 2 ] <= -minNormal ) ) ) + return IBE_NORMAL; + if( ent->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) { //alien criteria - float minNormal = BG_FindMinNormalForBuildable( buildable ); - qboolean invert = BG_FindInvertNormalForBuildable( buildable ); - - //can we build at this angle? - if( !( normal[ 2 ] >= minNormal || ( invert && normal[ 2 ] <= -minNormal ) ) ) - return IBE_NORMAL; - //check there is creep near by for building on if( BG_FindCreepTestForBuildable( buildable ) ) @@ -1825,17 +1831,17 @@ itemBuildError_t G_itemFits( gentity_t *ent, buildable_t buildable, int distance { if( !tempent->classname || tempent->s.eType != ET_BUILDABLE ) continue; - if( tempent->s.modelindex == BA_A_HIVEMIND ) + if( tempent->s.modelindex == BA_A_OVERMIND ) break; } //if none found... - if( i >= level.num_entities && buildable != BA_A_HIVEMIND ) + if( i >= level.num_entities && buildable != BA_A_OVERMIND ) { if( buildable == BA_A_SPAWN ) reason = IBE_SPWNWARN; else - reason = IBE_NOHIVEMIND; + reason = IBE_NOOVERMIND; } //can we only have one of these? @@ -1846,9 +1852,9 @@ itemBuildError_t G_itemFits( gentity_t *ent, buildable_t buildable, int distance if( !tempent->classname || tempent->s.eType != ET_BUILDABLE ) continue; - if( tempent->s.modelindex == BA_A_HIVEMIND ) + if( tempent->s.modelindex == BA_A_OVERMIND ) { - reason = IBE_HIVEMIND; + reason = IBE_OVERMIND; break; } } @@ -1982,7 +1988,7 @@ gentity_t *G_buildItem( gentity_t *builder, buildable_t buildable, vec3_t origin built->pain = ASpawn_Pain; break; - case BA_A_HIVEMIND: + case BA_A_OVERMIND: built->die = ASpawn_Die; built->think = AOvermind_Think; built->pain = ASpawn_Pain; @@ -2129,12 +2135,12 @@ qboolean G_ValidateBuild( gentity_t *ent, buildable_t buildable ) G_TriggerMenu( ent->client->ps.clientNum, MN_A_NOASSERT ); return qfalse; - case IBE_NOHIVEMIND: - G_TriggerMenu( ent->client->ps.clientNum, MN_A_NOHVMND ); + case IBE_NOOVERMIND: + G_TriggerMenu( ent->client->ps.clientNum, MN_A_NOOVMND ); return qfalse; - case IBE_HIVEMIND: - G_TriggerMenu( ent->client->ps.clientNum, MN_A_HIVEMIND ); + case IBE_OVERMIND: + G_TriggerMenu( ent->client->ps.clientNum, MN_A_OVERMIND ); return qfalse; case IBE_NORMAL: diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 8ac5bf79..009caf81 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1728,12 +1728,12 @@ void Cmd_Build_f( gentity_t *ent ) G_TriggerMenu( ent->client->ps.clientNum, MN_A_NOASSERT ); break; - case IBE_NOHIVEMIND: - G_TriggerMenu( ent->client->ps.clientNum, MN_A_NOHVMND ); + case IBE_NOOVERMIND: + G_TriggerMenu( ent->client->ps.clientNum, MN_A_NOOVMND ); break; - case IBE_HIVEMIND: - G_TriggerMenu( ent->client->ps.clientNum, MN_A_HIVEMIND ); + case IBE_OVERMIND: + G_TriggerMenu( ent->client->ps.clientNum, MN_A_OVERMIND ); break; case IBE_REACTOR: diff --git a/src/game/g_local.h b/src/game/g_local.h index 966fad93..5eb10512 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -534,8 +534,8 @@ typedef enum IBE_NONE, IBE_NOROOM, - IBE_NOHIVEMIND, - IBE_HIVEMIND, + IBE_NOOVERMIND, + IBE_OVERMIND, IBE_NOASSERT, IBE_SPWNWARN, IBE_REACTOR, diff --git a/src/game/tremulous.h b/src/game/tremulous.h index d3561a6e..016600ac 100644 --- a/src/game/tremulous.h +++ b/src/game/tremulous.h @@ -313,9 +313,9 @@ #define PRIFLE_SPAWNCLIPS 3 #define PRIFLE_MAXCLIPS 3 #define PRIFLE_PRICE 250 -#define PRIFLE_REPEAT 50 +#define PRIFLE_REPEAT 100 #define PRIFLE_RELOAD 2000 -#define PRIFLE_DMG HDM(20) +#define PRIFLE_DMG HDM(15) #define PRIFLE_SPEED 1500 #define LCANNON_PRICE 400 @@ -364,8 +364,8 @@ #define BATTPACK_MODIFIER 2.0f //modifier for extra energy storage available #define JETPACK_PRICE 120 -#define JETPACK_FLOAT_SPEED 256.0f //up movement speed -#define JETPACK_SINK_SPEED 384.0f //down movement speed +#define JETPACK_FLOAT_SPEED 128.0f //up movement speed +#define JETPACK_SINK_SPEED 192.0f //down movement speed #define BSUIT_PRICE 200 diff --git a/src/ui/ui_shared.c b/src/ui/ui_shared.c index 5b0e8e30..90286152 100644 --- a/src/ui/ui_shared.c +++ b/src/ui/ui_shared.c @@ -4417,7 +4417,10 @@ menuDef_t *Menus_ActivateByName(const char *p) { for( j = 0; j < m->itemCount; j++ ) //TA: reset selection in listboxes when opened { if( m->items[ j ]->type == ITEM_TYPE_LISTBOX ) + { m->items[ j ]->cursorPos = 0; + DC->feederSelection( m->items[ j ]->special, 0 ); + } } if (openMenuCount < MAX_OPEN_MENUS && focus != NULL) { |