diff options
author | Michael Levin <risujin@fastmail.fm> | 2009-10-03 11:26:03 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:14:59 +0000 |
commit | 617fac98d0df82c4beda446547ca021b7a12d9dd (patch) | |
tree | ddea2c0785b61aec075c9fcb3d20a29045fb4af5 /src/game | |
parent | c2772cce6c591f4b043da4526764298d88cce9a9 (diff) |
* Build delay pie slices are now 5 sec each for both teams
* Removed individual weapon build delay
* Removed Advanced Construction Kit, everything is built by the normal kit
* S2+ buildables cannot be built by regular grangers
* Clicking to pick team during spectator mode fixed
* New cvar: cg_printDuplicate, when set to 0 (default) prevents duplicate messages from being printed to screen (they still show up in console)
* Pressing ESC while editing a UI item (esp. new Say menu) will not cause your cursor to disappear next time you open a menu
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_misc.c | 103 | ||||
-rw-r--r-- | src/game/bg_public.h | 3 | ||||
-rw-r--r-- | src/game/g_active.c | 10 | ||||
-rw-r--r-- | src/game/g_client.c | 1 | ||||
-rw-r--r-- | src/game/g_cmds.c | 15 | ||||
-rw-r--r-- | src/game/g_weapon.c | 41 | ||||
-rw-r--r-- | src/game/tremulous.h | 10 |
7 files changed, 41 insertions, 142 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index 3c66bab8..5198fb28 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -138,7 +138,7 @@ buildableAttributes_t bg_buildableList[ ] = BOOSTER_SPLASHRADIUS, //int splashRadius; MOD_ASPAWN, //int meansOfDeath; BIT_ALIENS, //int team; - ( 1 << WP_ABUILD )|( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; + ( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; BOOSTER_BT, //int buildTime; @@ -217,7 +217,7 @@ buildableAttributes_t bg_buildableList[ ] = HIVE_SPLASHRADIUS, //int splashRadius; MOD_ASPAWN, //int meansOfDeath; BIT_ALIENS, //int team; - ( 1 << WP_ABUILD )|( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; + ( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 500, //int nextthink; HIVE_BT, //int buildTime; @@ -257,7 +257,7 @@ buildableAttributes_t bg_buildableList[ ] = TRAPPER_SPLASHRADIUS, //int splashRadius; MOD_ASPAWN, //int meansOfDeath; BIT_ALIENS, //int team; - ( 1 << WP_ABUILD )|( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; + ( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; TRAPPER_BT, //int buildTime; @@ -337,7 +337,7 @@ buildableAttributes_t bg_buildableList[ ] = HOVEL_SPLASHRADIUS, //int splashRadius; MOD_ASPAWN, //int meansOfDeath; BIT_ALIENS, //int team; - ( 1 << WP_ABUILD )|( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; + ( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 150, //int nextthink; HOVEL_BT, //int buildTime; @@ -377,7 +377,7 @@ buildableAttributes_t bg_buildableList[ ] = HSPAWN_SPLASHRADIUS, //int splashRadius; MOD_HSPAWN, //int meansOfDeath; BIT_HUMANS, //int team; - ( 1 << WP_HBUILD )|( 1 << WP_HBUILD2 ), //weapon_t buildWeapon; + ( 1 << WP_HBUILD ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; HSPAWN_BT, //int buildTime; @@ -418,7 +418,7 @@ buildableAttributes_t bg_buildableList[ ] = MEDISTAT_SPLASHRADIUS, //int splashRadius; MOD_HSPAWN, //int meansOfDeath; BIT_HUMANS, //int team; - ( 1 << WP_HBUILD )|( 1 << WP_HBUILD2 ), //weapon_t buildWeapon; + ( 1 << WP_HBUILD ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; MEDISTAT_BT, //int buildTime; @@ -460,7 +460,7 @@ buildableAttributes_t bg_buildableList[ ] = MGTURRET_SPLASHRADIUS, //int splashRadius; MOD_HSPAWN, //int meansOfDeath; BIT_HUMANS, //int team; - ( 1 << WP_HBUILD )|( 1 << WP_HBUILD2 ), //weapon_t buildWeapon; + ( 1 << WP_HBUILD ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 50, //int nextthink; MGTURRET_BT, //int buildTime; @@ -500,7 +500,7 @@ buildableAttributes_t bg_buildableList[ ] = TESLAGEN_SPLASHRADIUS, //int splashRadius; MOD_HSPAWN, //int meansOfDeath; BIT_HUMANS, //int team; - ( 1 << WP_HBUILD2 ), //weapon_t buildWeapon; + ( 1 << WP_HBUILD ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 150, //int nextthink; TESLAGEN_BT, //int buildTime; @@ -540,7 +540,7 @@ buildableAttributes_t bg_buildableList[ ] = DC_SPLASHRADIUS, //int splashRadius; MOD_HSPAWN, //int meansOfDeath; BIT_HUMANS, //int team; - ( 1 << WP_HBUILD2 ), //weapon_t buildWeapon; + ( 1 << WP_HBUILD ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; DC_BT, //int buildTime; @@ -580,7 +580,7 @@ buildableAttributes_t bg_buildableList[ ] = ARMOURY_SPLASHRADIUS, //int splashRadius; MOD_HSPAWN, //int meansOfDeath; BIT_HUMANS, //int team; - ( 1 << WP_HBUILD )|( 1 << WP_HBUILD2 ), //weapon_t buildWeapon; + ( 1 << WP_HBUILD ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; ARMOURY_BT, //int buildTime; @@ -620,7 +620,7 @@ buildableAttributes_t bg_buildableList[ ] = REACTOR_SPLASHRADIUS, //int splashRadius; MOD_HSPAWN, //int meansOfDeath; BIT_HUMANS, //int team; - ( 1 << WP_HBUILD )|( 1 << WP_HBUILD2 ), //weapon_t buildWeapon; + ( 1 << WP_HBUILD ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; REACTOR_ATTACK_DCC_REPEAT, //int nextthink; REACTOR_BT, //int buildTime; @@ -660,7 +660,7 @@ buildableAttributes_t bg_buildableList[ ] = REPEATER_SPLASHRADIUS, //int splashRadius; MOD_HSPAWN, //int meansOfDeath; BIT_HUMANS, //int team; - ( 1 << WP_HBUILD )|( 1 << WP_HBUILD2 ), //weapon_t buildWeapon; + ( 1 << WP_HBUILD ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; REPEATER_BT, //int buildTime; @@ -3244,7 +3244,6 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qtrue, //qboolean longRanged; - 0, //int buildDelay; WUT_HUMANS //WUTeam_t team; }, { @@ -3271,7 +3270,6 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qtrue, //qboolean purchasable; qtrue, //qboolean longRanged; - 0, //int buildDelay; WUT_HUMANS //WUTeam_t team; }, { @@ -3299,7 +3297,6 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qtrue, //qboolean purchasable; qtrue, //qboolean longRanged; - 0, //int buildDelay; WUT_HUMANS //WUTeam_t team; }, { @@ -3327,7 +3324,6 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qtrue, //qboolean purchasable; qtrue, //qboolean longRanged; - 0, //int buildDelay; WUT_HUMANS //WUTeam_t team; }, { @@ -3355,7 +3351,6 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qtrue, //qboolean purchasable; qtrue, //qboolean longRanged; - 0, //int buildDelay; WUT_HUMANS //WUTeam_t team; }, { @@ -3384,7 +3379,6 @@ weaponAttributes_t bg_weapons[ ] = 20.0f, //float zoomFov; qtrue, //qboolean purchasable; qtrue, //qboolean longRanged; - 0, //int buildDelay; WUT_HUMANS //WUTeam_t team; }, { @@ -3410,7 +3404,6 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qtrue, //qboolean purchasable; qtrue, //qboolean longRanged; - 0, //int buildDelay; WUT_HUMANS //WUTeam_t team; }, { @@ -3438,7 +3431,6 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qtrue, //qboolean purchasable; qtrue, //qboolean longRanged; - 0, //int buildDelay; WUT_HUMANS //WUTeam_t team; }, { @@ -3465,7 +3457,6 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qtrue, //qboolean purchasable; qtrue, //qboolean longRanged; - 0, //int buildDelay; WUT_HUMANS //WUTeam_t team; }, { @@ -3493,7 +3484,6 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qtrue, //qboolean purchasable; qfalse, //qboolean longRanged; - 0, //int buildDelay; WUT_HUMANS //WUTeam_t team; }, { @@ -3519,7 +3509,6 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qfalse, //qboolean longRanged; - 0, //int buildDelay; WUT_HUMANS //WUTeam_t team; }, { @@ -3529,8 +3518,9 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "ckit", //char *weaponName; "Construction Kit", //char *weaponHumanName; - "Used for building basic structures. This includes " - "spawns, power and basic defense.", + "Used for building structures. This includes " + "spawns, power and basic defense. More structures become " + "available with new stages.", 0, //int maxAmmo; 0, //int maxClips; qtrue, //int infiniteAmmo; @@ -3546,35 +3536,6 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qtrue, //qboolean purchasable; qfalse, //qboolean longRanged; - HBUILD_DELAY, //int buildDelay; - WUT_HUMANS //WUTeam_t team; - }, - { - WP_HBUILD2, //int weaponNum; - HBUILD2_PRICE, //int price; - ( 1 << S2 )|( 1 << S3 ), //int stages - SLOT_WEAPON, //int slots; - "ackit", //char *weaponName; - "Adv Construction Kit",//char *weaponHumanName; - "Used for building basic and advanced structures. " - "Advanced structures include Defense Computers " - "and Tesla Generators.", - 0, //int maxAmmo; - 0, //int maxClips; - qtrue, //int infiniteAmmo; - qfalse, //int usesEnergy; - HBUILD2_REPEAT, //int repeatRate1; - HBUILD2_REPEAT, //int repeatRate2; - 0, //int repeatRate3; - 0, //int reloadTime; - 0.0f, //float knockbackScale; - qtrue, //qboolean hasAltMode; - qfalse, //qboolean hasThirdMode; - qfalse, //qboolean canZoom; - 90.0f, //float zoomFov; - qtrue, //qboolean purchasable; - qfalse, //qboolean longRanged; - HBUILD2_DELAY, //int buildDelay; WUT_HUMANS //WUTeam_t team; }, { @@ -3600,7 +3561,6 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qtrue, //qboolean purchasable; qfalse, //qboolean longRanged; - ABUILDER_BASE_DELAY, //int buildDelay; WUT_ALIENS //WUTeam_t team; }, { @@ -3626,7 +3586,6 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qtrue, //qboolean purchasable; qfalse, //qboolean longRanged; - ABUILDER_ADV_DELAY, //int buildDelay; WUT_ALIENS //WUTeam_t team; }, { @@ -3652,7 +3611,6 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qfalse, //qboolean longRanged; - 0, //int buildDelay; WUT_ALIENS //WUTeam_t team; }, { @@ -3678,7 +3636,6 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qfalse, //qboolean longRanged; - 0, //int buildDelay; WUT_ALIENS //WUTeam_t team; }, { @@ -3704,7 +3661,6 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qtrue, //qboolean longRanged; - 0, //int buildDelay; WUT_ALIENS //WUTeam_t team; }, { @@ -3730,7 +3686,6 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qfalse, //qboolean longRanged; - 0, //int buildDelay; WUT_ALIENS //WUTeam_t team; }, { @@ -3756,7 +3711,6 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qfalse, //qboolean longRanged; - 0, //int buildDelay; WUT_ALIENS //WUTeam_t team; }, { @@ -3782,7 +3736,6 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qfalse, //qboolean longRanged; - 0, //int buildDelay; WUT_ALIENS //WUTeam_t team; }, { @@ -3808,7 +3761,6 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qtrue, //qboolean longRanged; - 0, //int buildDelay; WUT_ALIENS //WUTeam_t team; }, { @@ -3834,7 +3786,6 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qfalse, //qboolean longRanged; - 0, //int buildDelay; WUT_ALIENS //WUTeam_t team; }, { @@ -3860,7 +3811,6 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qfalse, //qboolean longRanged; - 0, //int buildDelay; WUT_ALIENS //WUTeam_t team; }, { @@ -3886,7 +3836,6 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qfalse, //qboolean longRanged; - 0, //int buildDelay; WUT_ALIENS //WUTeam_t team; }, { @@ -3912,7 +3861,6 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qfalse, //qboolean longRanged; - 0, //int buildDelay; WUT_HUMANS //WUTeam_t team; }, { @@ -3938,7 +3886,6 @@ weaponAttributes_t bg_weapons[ ] = 90.0f, //float zoomFov; qfalse, //qboolean purchasable; qfalse, //qboolean longRanged; - 0, //int buildDelay; WUT_HUMANS //WUTeam_t team; } }; @@ -4364,26 +4311,6 @@ qboolean BG_FindLongRangedForWeapon( int weapon ) /* ============== -BG_FindBuildDelayForWeapon -============== -*/ -int BG_FindBuildDelayForWeapon( int weapon ) -{ - int i; - - for( i = 0; i < bg_numWeapons; i++ ) - { - if( bg_weapons[ i ].weaponNum == weapon ) - { - return bg_weapons[ i ].buildDelay; - } - } - - return 0; -} - -/* -============== BG_FindTeamForWeapon ============== */ diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 68af42cc..e3ffc434 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -354,7 +354,6 @@ typedef enum //build weapons must remain in a block WP_ABUILD, WP_ABUILD2, - WP_HBUILD2, WP_HBUILD, //ok? @@ -1087,8 +1086,6 @@ typedef struct qboolean purchasable; qboolean longRanged; - int buildDelay; - WUTeam_t team; } weaponAttributes_t; diff --git a/src/game/g_active.c b/src/game/g_active.c index 9fe75f92..998040d9 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -418,11 +418,12 @@ void SpectatorThink( gentity_t *ent, usercmd_t *ucmd ) } // Check to see if we are in the spawn queue - queued = qfalse; if( client->pers.teamSelection == PTE_ALIENS ) queued = G_SearchSpawnQueue( &level.alienSpawnQueue, ent - g_entities ); else if( client->pers.teamSelection == PTE_HUMANS ) queued = G_SearchSpawnQueue( &level.humanSpawnQueue, ent - g_entities ); + else + queued = qfalse; // Wants to get out of spawn queue if( attack1 && queued ) @@ -438,8 +439,7 @@ void SpectatorThink( gentity_t *ent, usercmd_t *ucmd ) client->ps.pm_flags &= ~PMF_QUEUED; queued = qfalse; } - else if( attack1 && client->pers.teamSelection != PTE_NONE && - client->pers.classSelection == PCL_NONE ) + else if( attack1 ) { // Wants to get into spawn queue if( client->sess.spectatorState == SPECTATOR_FOLLOW ) @@ -692,8 +692,7 @@ void ClientTimerActions( gentity_t *ent, int msec ) } if( client->ps.weapon == WP_ABUILD || client->ps.weapon == WP_ABUILD2 || - BG_InventoryContainsWeapon( WP_HBUILD, client->ps.stats ) || - BG_InventoryContainsWeapon( WP_HBUILD2, client->ps.stats ) ) + BG_InventoryContainsWeapon( WP_HBUILD, client->ps.stats ) ) { //update build timer if( client->ps.stats[ STAT_MISC ] > 0 ) @@ -708,7 +707,6 @@ void ClientTimerActions( gentity_t *ent, int msec ) case WP_ABUILD: case WP_ABUILD2: case WP_HBUILD: - case WP_HBUILD2: //set validity bit on buildable if( ( client->ps.stats[ STAT_BUILDABLE ] & ~SB_VALID_TOGGLEBIT ) > BA_NONE ) { diff --git a/src/game/g_client.c b/src/game/g_client.c index 1a2714cb..9298eb55 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -1462,6 +1462,7 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles client->ps.stats[ STAT_WEAPONS ] = 0; client->ps.stats[ STAT_WEAPONS2 ] = 0; client->ps.stats[ STAT_SLOTS ] = 0; + client->ps.stats[ STAT_MISC ] = 0; client->ps.eFlags = flags; client->ps.clientNum = index; diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 2918e0be..88d11646 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -705,8 +705,7 @@ void Cmd_Team_f( gentity_t *ent ) if( oldteam != PTE_NONE && ent->client->sess.sessionTeam != TEAM_SPECTATOR && ( ent->client->ps.stats[ STAT_PCLASS ] == PCL_ALIEN_BUILDER0 || ent->client->ps.stats[ STAT_PCLASS ] == PCL_ALIEN_BUILDER0_UPG || - BG_InventoryContainsWeapon( WP_HBUILD, ent->client->ps.stats ) || - BG_InventoryContainsWeapon( WP_HBUILD2, ent->client->ps.stats ) ) && + BG_InventoryContainsWeapon( WP_HBUILD, ent->client->ps.stats ) ) && ent->client->ps.stats[ STAT_MISC ] > 0 ) { if( ent->client->pers.teamSelection == PTE_ALIENS ) @@ -1577,12 +1576,6 @@ void Cmd_Class_f( gentity_t *ent ) { ent->client->pers.humanItemSelection = WP_HBUILD; } - else if( !Q_stricmp( s, BG_FindNameForWeapon( WP_HBUILD2 ) ) && - BG_WeaponIsAllowed( WP_HBUILD2 ) && - BG_FindStagesForWeapon( WP_HBUILD2, g_humanStage.integer ) ) - { - ent->client->pers.humanItemSelection = WP_HBUILD2; - } else { G_TriggerMenu( ent->client->ps.clientNum, MN_H_UNKNOWNSPAWNITEM ); @@ -2182,8 +2175,7 @@ void Cmd_Sell_f( gentity_t *ent ) if( BG_InventoryContainsWeapon( weapon, ent->client->ps.stats ) ) { //guard against selling the HBUILD weapons exploit - if( ( weapon == WP_HBUILD || weapon == WP_HBUILD2 ) && - ent->client->ps.stats[ STAT_MISC ] > 0 ) + if( weapon == WP_HBUILD && ent->client->ps.stats[ STAT_MISC ] > 0 ) { G_TriggerMenu( ent->client->ps.clientNum, MN_H_ARMOURYBUILDTIMER ); return; @@ -2240,8 +2232,7 @@ void Cmd_Sell_f( gentity_t *ent ) for( i = WP_NONE + 1; i < WP_NUM_WEAPONS; i++ ) { //guard against selling the HBUILD weapons exploit - if( ( i == WP_HBUILD || i == WP_HBUILD2 ) && - ent->client->ps.stats[ STAT_MISC ] > 0 ) + if( i == WP_HBUILD && ent->client->ps.stats[ STAT_MISC ] > 0 ) { G_TriggerMenu( ent->client->ps.clientNum, MN_H_ARMOURYBUILDTIMER ); continue; diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index 438350cf..fc915d86 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -863,27 +863,25 @@ void cancelBuildFire( gentity_t *ent ) gentity_t *traceEnt; int bHealth; + // Cancel ghost buildable if( ent->client->ps.stats[ STAT_BUILDABLE ] != BA_NONE ) { ent->client->ps.stats[ STAT_BUILDABLE ] = BA_NONE; return; } - //repair buildable + // Construction kit repair if( ent->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) { AngleVectors( ent->client->ps.viewangles, forward, NULL, NULL ); VectorMA( ent->client->ps.origin, 100, forward, end ); - - trap_Trace( &tr, ent->client->ps.origin, NULL, NULL, end, ent->s.number, MASK_PLAYERSOLID ); + + trap_Trace( &tr, ent->client->ps.origin, NULL, NULL, end, ent->s.number, + MASK_PLAYERSOLID ); traceEnt = &g_entities[ tr.entityNum ]; - if( tr.fraction < 1.0 && - ( traceEnt->s.eType == ET_BUILDABLE ) && - ( traceEnt->biteam == ent->client->ps.stats[ STAT_PTEAM ] ) && - ( ( ent->client->ps.weapon >= WP_HBUILD2 ) && - ( ent->client->ps.weapon <= WP_HBUILD ) ) && - traceEnt->spawned && traceEnt->health > 0 ) + if( tr.fraction < 1.0f && traceEnt->spawned && traceEnt->health > 0 && + traceEnt->s.eType == ET_BUILDABLE && traceEnt->biteam == BIT_HUMANS ) { if( ent->client->ps.stats[ STAT_MISC ] > 0 ) { @@ -892,20 +890,20 @@ void cancelBuildFire( gentity_t *ent ) } bHealth = BG_FindHealthForBuildable( traceEnt->s.modelindex ); - traceEnt->health += HBUILD_HEALRATE; - - if( traceEnt->health > bHealth ) + if( traceEnt->health >= bHealth ) + { traceEnt->health = bHealth; - - if( traceEnt->health == bHealth ) G_AddEvent( ent, EV_BUILD_REPAIRED, 0 ); + } else G_AddEvent( ent, EV_BUILD_REPAIR, 0 ); } } + + // Granger slash else if( ent->client->ps.weapon == WP_ABUILD || - ent->client->ps.weapon == WP_ABUILD2 ) + ent->client->ps.weapon == WP_ABUILD2 ) meleeAttack( ent, ABUILDER_CLAW_RANGE, ABUILDER_CLAW_WIDTH, ABUILDER_CLAW_WIDTH, ABUILDER_CLAW_DMG, MOD_ABUILDER_CLAW ); } @@ -930,22 +928,15 @@ void buildFire( gentity_t *ent, dynMenu_t menu ) if( G_BuildIfValid( ent, buildable ) ) { - if( g_cheats.integer ) - { - ent->client->ps.stats[ STAT_MISC ] = 0; - } - else + if( !g_cheats.integer ) { ent->client->ps.stats[ STAT_MISC ] += BG_FindBuildTimeForBuildable( buildable ); } ent->client->ps.stats[ STAT_BUILDABLE ] = BA_NONE; - - // don't want it bigger than 32k - if( ent->client->ps.stats[ STAT_MISC ] > 30000 ) - ent->client->ps.stats[ STAT_MISC ] = 30000; } + return; } @@ -1525,7 +1516,6 @@ void FireWeapon2( gentity_t *ent ) case WP_ABUILD: case WP_ABUILD2: case WP_HBUILD: - case WP_HBUILD2: cancelBuildFire( ent ); break; default: @@ -1633,7 +1623,6 @@ void FireWeapon( gentity_t *ent ) buildFire( ent, MN_A_BUILD ); break; case WP_HBUILD: - case WP_HBUILD2: buildFire( ent, MN_H_BUILD ); break; default: diff --git a/src/game/tremulous.h b/src/game/tremulous.h index 1262e836..0bcd81fe 100644 --- a/src/game/tremulous.h +++ b/src/game/tremulous.h @@ -41,8 +41,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define ABUILDER_CLAW_WIDTH 4.0f #define ABUILDER_CLAW_REPEAT 1000 #define ABUILDER_CLAW_K_SCALE 1.0f -#define ABUILDER_BASE_DELAY 17000 -#define ABUILDER_ADV_DELAY 12000 #define ABUILDER_BLOB_DMG ADM(4) #define ABUILDER_BLOB_REPEAT 1000 #define ABUILDER_BLOB_SPEED 800.0f @@ -477,13 +475,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define HBUILD_PRICE 0 #define HBUILD_REPEAT 1000 -#define HBUILD_DELAY 17500 #define HBUILD_HEALRATE 18 -#define HBUILD2_PRICE 0 -#define HBUILD2_REPEAT 1000 -#define HBUILD2_DELAY 15000 - /* * HUMAN upgrades */ @@ -675,3 +668,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define DAMAGE_FRACTION_FOR_KILL 0.5f //how much damage players (versus structures) need to //do to increment the stage kill counters + +#define MAXIMUM_BUILD_TIME 20000 // used for pie timer + |