Skip to content

Commit

Permalink
- Make the basilisk swipe attack manual.
Browse files Browse the repository at this point in the history
- Only check for basilisk grab while it is swiping.
- Apply unlagged to the basilisk grab.
- Reduce further the angular speed of the rets while they are grabbed.
  • Loading branch information
dGr8LookinSparky committed Feb 5, 2018
1 parent 13cf0e5 commit 3821cc4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 36 deletions.
13 changes: 0 additions & 13 deletions src/game/bg_pmove.c
Expand Up @@ -4540,19 +4540,6 @@ static void PM_Weapon( void )
//venom is only autohit
return;

case WP_ALEVEL1:
case WP_ALEVEL1_UPG:
// autoswipe while grabbing
if( pm->ps->stats[ STAT_STATE ] & SS_GRABBING )
{
attack1 = qtrue;
} else if( !attack1 && !attack2 && !attack3 )
{
pm->ps->weaponTime = 0;
pm->ps->weaponstate = WEAPON_READY;
return;
}
break;
case WP_ALEVEL3:
case WP_ALEVEL3_UPG:
//pouncing has primary secondary AND autohit procedures
Expand Down
1 change: 0 additions & 1 deletion src/game/bg_public.h
Expand Up @@ -343,7 +343,6 @@ typedef enum
#define SS_HEALING_3X 0x00001000 // triple healing rate
#define SS_HOVELING 0x00002000 // indicates if the entity is occupying a hovel
#define SS_HOVEL_MARKED 0x00004000 // tells if the hovel occupied is marked
#define SS_GRABBING 0x00008000 // only for non-builders
#define SS_PRECISE_BUILD 0x00008000 // pecision positioning for buildables, only for non-grabbers

#define SB_VALID_TOGGLEBIT 0x00004000
Expand Down
6 changes: 0 additions & 6 deletions src/game/g_active.c
Expand Up @@ -802,7 +802,6 @@ void ClientTimerActions( gentity_t *ent, int msec )
client->ps.weapon == WP_ALEVEL1_UPG ) )
{
if( ( ucmd->buttons & BUTTON_ATTACK ) ||
( client->ps.stats[ STAT_STATE ] & SS_GRABBING ) ||
( ( ucmd->buttons & BUTTON_ATTACK2 ) &&
BG_Weapon( client->ps.weapon )->hasAltMode ) ||
ent->pain_debounce_time > level.time ||
Expand Down Expand Up @@ -2557,11 +2556,6 @@ void ClientThink_real( gentity_t *ent )
}
break;

case WP_ALEVEL1:
case WP_ALEVEL1_UPG:
CheckGrabAttack( ent );
break;

case WP_ALEVEL3:
case WP_ALEVEL3_UPG:
if( !CheckPounceAttack( ent ) )
Expand Down
25 changes: 10 additions & 15 deletions src/game/g_weapon.c
Expand Up @@ -1352,24 +1352,23 @@ CheckGrabAttack
*/
void CheckGrabAttack( gentity_t *ent )
{
trace_t tr;
vec3_t end, dir;
gentity_t *traceEnt;
trace_t tr;
vec3_t end, dir;
gentity_t *traceEnt;
const float range = ent->client->ps.weapon == WP_ALEVEL1 ?
LEVEL1_GRAB_RANGE : LEVEL1_GRAB_U_RANGE;

// reset autoswipping
ent->client->ps.stats[ STAT_STATE ] &= ~SS_GRABBING;

// set aiming directions
AngleVectors( ent->client->ps.viewangles, forward, right, up );

BG_CalcMuzzlePointFromPS( &ent->client->ps, forward, right, up, muzzle );

if( ent->client->ps.weapon == WP_ALEVEL1 )
VectorMA( muzzle, LEVEL1_GRAB_RANGE, forward, end );
else if( ent->client->ps.weapon == WP_ALEVEL1_UPG )
VectorMA( muzzle, LEVEL1_GRAB_U_RANGE, forward, end );
VectorMA( muzzle, range, forward, end );

G_UnlaggedOn( ent->s.number, muzzle, range );
SV_Trace( &tr, muzzle, NULL, NULL, end, ent->s.number, MASK_SHOT, TT_AABB );
G_UnlaggedOff();
if( tr.surfaceFlags & SURF_NOIMPACT )
return;

Expand Down Expand Up @@ -1397,9 +1396,6 @@ void CheckGrabAttack( gentity_t *ent )

traceEnt->client->ps.stats[ STAT_STATE ] |= SS_GRABBED;

// for autoswipping grabbed clients
ent->client->ps.stats[ STAT_STATE ] |= SS_GRABBING;

if( ent->client->ps.weapon == WP_ALEVEL1 )
traceEnt->client->grabExpiryTime = level.time + LEVEL1_GRAB_TIME;
else if( ent->client->ps.weapon == WP_ALEVEL1_UPG )
Expand All @@ -1412,9 +1408,6 @@ void CheckGrabAttack( gentity_t *ent )

traceEnt->lev1Grabbed = qtrue;
traceEnt->lev1GrabTime = level.time;

// for autoswipping grabbed rets
ent->client->ps.stats[ STAT_STATE ] |= SS_GRABBING;
}
}

Expand Down Expand Up @@ -2333,10 +2326,12 @@ void FireWeapon( gentity_t *ent )
case WP_ALEVEL1:
meleeAttack( ent, LEVEL1_CLAW_RANGE, LEVEL1_CLAW_WIDTH, LEVEL1_CLAW_WIDTH,
LEVEL1_CLAW_DMG, MOD_LEVEL1_CLAW );
CheckGrabAttack( ent );
break;
case WP_ALEVEL1_UPG:
meleeAttack( ent, LEVEL1_CLAW_U_RANGE, LEVEL1_CLAW_WIDTH, LEVEL1_CLAW_WIDTH,
LEVEL1_CLAW_DMG, MOD_LEVEL1_CLAW );
CheckGrabAttack( ent );
break;
case WP_ALEVEL3:
meleeAttack( ent, LEVEL3_CLAW_RANGE, LEVEL3_CLAW_WIDTH, LEVEL3_CLAW_WIDTH,
Expand Down
2 changes: 1 addition & 1 deletion src/game/tremulous.h
Expand Up @@ -777,7 +777,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define MGTURRET_VALUE ( 3 * ALIEN_CREDITS_PER_KILL / 2 )
#define MGTURRET_BAT_PWR 25000
#define MGTURRET_DCC_ANGULARSPEED 15
#define MGTURRET_GRAB_ANGULARSPEED 5
#define MGTURRET_GRAB_ANGULARSPEED 1

#define TESLAGEN_BP 10
#define TESLAGEN_BT 15000
Expand Down

0 comments on commit 3821cc4

Please sign in to comment.