summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMikko Tiusanen <ams@daug.net>2014-05-15 18:27:16 +0300
committerMikko Tiusanen <ams@daug.net>2014-05-15 18:27:16 +0300
commit454a1a21c4d0be8e542160ff60f897594762501b (patch)
tree9e3951a96443785a36db76359e999ab836a1c968 /src
parent378e1bf33dce57f941d9d93defb1a81715dc5d3f (diff)
Hummel pounce no longer stays charged or damages teammates after using it.
Diffstat (limited to 'src')
-rw-r--r--src/game/bg_misc.c2
-rw-r--r--src/game/bg_pmove.c111
-rw-r--r--src/game/g_combat.c7
-rw-r--r--src/game/g_weapon.c57
-rw-r--r--src/game/tremulous.h11
5 files changed, 97 insertions, 91 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c
index d307a3e..404b24b 100644
--- a/src/game/bg_misc.c
+++ b/src/game/bg_misc.c
@@ -2442,7 +2442,7 @@ static const classAttributes_t bg_classList[ ] =
LEVEL5_UPG_HEALTH, //int health;
0.0f, //float fallDamage;
LEVEL5_UPG_REGEN, //float regenRate;
- SCA_WALLJUMPER|SCA_FOVWARPS|SCA_ALIENSENSE|SCA_WALLCLIMBER, //int abilities;
+ SCA_FOVWARPS|SCA_ALIENSENSE|SCA_WALLCLIMBER, //int abilities;
WP_ALEVEL5, //weapon_t startWeapon
0.0f, //float buildDist;
90, //int fov;
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c
index a0411c8..cd6cb21 100644
--- a/src/game/bg_pmove.c
+++ b/src/game/bg_pmove.c
@@ -476,25 +476,30 @@ static float PM_CmdScale( usercmd_t *cmd )
( LEVEL4_TRAMPLE_SPEED - 1.0f ) /
LEVEL4_TRAMPLE_DURATION );
- //slow player if charging up for a pounce
- if( ( pm->ps->weapon == WP_ALEVEL3 || pm->ps->weapon == WP_ALEVEL3_UPG ) &&
- cmd->buttons & BUTTON_ATTACK2 )
- modifier *= LEVEL3_POUNCE_SPEED_MOD;
-
- //slow player if using 2nd rifle mode
- if( ( pm->ps->weapon == WP_MACHINEGUN ) && cmd->buttons & BUTTON_ATTACK2 && pm->ps->weaponstate != WEAPON_RELOADING )
- modifier *= RIFLE_2NDMOD;
-
- //slow player if charging up for a drill
- if( pm->ps->weapon == WP_ALEVEL0_UPG && cmd->buttons & BUTTON_ATTACK2 )
- modifier *= LEVEL0_DRILL_SPEED_MOD;
-
- //slow the player if slow locked
- if( pm->ps->stats[ STAT_STATE ] & SS_SLOWLOCKED )
- modifier *= ABUILDER_BLOB_SPEED_MOD;
-
- if( pm->ps->pm_type == PM_GRABBED )
+ // Stop player if grabbed by something
+ if( pm->ps->pm_type == PM_GRABBED ) {
modifier = 0.0f;
+ } else {
+ // Attack related slow-downs
+ if( cmd->buttons & BUTTON_ATTACK2 ) {
+ //slow player if charging up for a pounce
+ if( pm->ps->weapon == WP_ALEVEL3 || pm->ps->weapon == WP_ALEVEL3_UPG )
+ modifier *= LEVEL3_POUNCE_SPEED_MOD;
+ else if( pm->ps->weapon == WP_ALEVEL5 )
+ modifier *= LEVEL5_POUNCE_SPEED_MOD;
+
+ //slow player if using 2nd rifle mode
+ else if( pm->ps->weapon == WP_MACHINEGUN && pm->ps->weaponstate != WEAPON_RELOADING )
+ modifier *= RIFLE_2NDMOD;
+
+ //slow player if charging up for a drill
+ else if( pm->ps->weapon == WP_ALEVEL0_UPG )
+ modifier *= LEVEL0_DRILL_SPEED_MOD;
+ }
+ //slow the player if slow locked
+ if( pm->ps->stats[ STAT_STATE ] & SS_SLOWLOCKED )
+ modifier *= ABUILDER_BLOB_SPEED_MOD;
+ }
if( pm->ps->pm_type != PM_SPECTATOR && pm->ps->pm_type != PM_NOCLIP )
{
@@ -699,13 +704,15 @@ static qboolean PM_CheckAirPounce( void )
int jumpMagnitude;
if( pm->ps->weapon != WP_ALEVEL5 )
- return qfalse;
+ return qfalse;
// We were pouncing, but we've landed
- if(( pm->ps->pm_flags & PMF_CHARGE ) )
+ if( /*pm->ps->groundEntityNum != ENTITYNUM_NONE &&*/
+ ( pm->ps->pm_flags & PMF_CHARGE ) )
{
pm->ps->pm_flags &= ~PMF_CHARGE;
pm->ps->weaponTime += LEVEL5_POUNCE_REPEAT;
+ pm->pmext->pouncePayload = 0;
return qfalse;
}
@@ -719,8 +726,8 @@ static qboolean PM_CheckAirPounce( void )
// Can't start a pounce
if( pm->ps->weapon == WP_ALEVEL5 )
{
- if( pm->ps->stats[ STAT_MISC ] < 500)
- return qfalse;
+ if( pm->ps->stats[ STAT_MISC ] < LEVEL5_POUNCE_TIME_MIN)
+ return qfalse;
}
// Give the player forward velocity and simulate a jump
@@ -1187,6 +1194,7 @@ static void PM_WaterMove( void )
PM_WaterJumpMove();
return;
}
+
#if 0
// jump = head for surface
if ( pm->cmd.upmove >= 10 ) {
@@ -1201,6 +1209,7 @@ static void PM_WaterMove( void )
}
}
#endif
+
PM_Friction( );
scale = PM_CmdScale( &pm->cmd );
@@ -1307,7 +1316,7 @@ static void PM_HUMMELFLY( void )
vec3_t wishdir;
float scale;
- if( PM_CheckAirPounce( ) )
+ if( PM_CheckAirPounce( ) )
{
pm->ps->torsoTimer = 1200;
return;
@@ -1330,8 +1339,8 @@ static void PM_HUMMELFLY( void )
else
{
for( i = 0; i < 3; i++ )
- wishvel[ i ] = scale * pml.forward[ i ] * pm->cmd.forwardmove + scale * pml.right[ i ] * pm->cmd.rightmove;
- wishvel[ i ] += scale * pm->cmd.upmove;
+ wishvel[ i ] = scale * pml.forward[ i ] * pm->cmd.forwardmove + scale * pml.right[ i ] * pm->cmd.rightmove;
+ wishvel[ 2 ] += scale * pm->cmd.upmove;
}
VectorCopy( wishvel, wishdir );
@@ -1342,14 +1351,13 @@ static void PM_HUMMELFLY( void )
PM_StepSlideMove( qfalse, qtrue );
- if( !( pm->ps->persistant[ PERS_STATE ] & PS_NONSEGMODEL ) )
+ if( !( pm->ps->persistant[ PERS_STATE ] & PS_NONSEGMODEL ) )
PM_ContinueLegsAnim( LEGS_LAND );
- else
+ else
PM_ContinueLegsAnim( NSPA_LAND );
- //Fly
- if( pm->ps->weapon == WP_ALEVEL5 && pm->cmd.buttons & BUTTON_WALKING )
+ //Fly
+ if( pm->ps->weapon == WP_ALEVEL5 && pm->cmd.buttons & BUTTON_WALKING )
PM_ContinueLegsAnim( NSPA_SWIM );
-
}
@@ -2967,7 +2975,7 @@ static void PM_BeginWeaponChange( int weapon )
pm->ps->weaponTime = 0;
//special case to prevent storing a charged up lcannon
- if( (pm->ps->weapon == WP_LUCIFER_CANNON || pm->ps->weapon == WP_FLAMER) )
+ if( (pm->ps->weapon == WP_LUCIFER_CANNON || pm->ps->weapon == WP_FLAMER) )
pm->ps->stats[ STAT_MISC ] = 0;
pm->ps->weaponstate = WEAPON_DROPPING;
@@ -3062,13 +3070,26 @@ static void PM_Weapon( void )
return;
}
- // Charging for a pounce or canceling a pounce
- if( pm->ps->weapon == WP_ALEVEL3 || pm->ps->weapon == WP_ALEVEL3_UPG )
+ // Charging for or canceling a pounce/drill attack
+ if( pm->ps->weapon == WP_ALEVEL3 || pm->ps->weapon == WP_ALEVEL3_UPG ||
+ pm->ps->weapon == WP_ALEVEL5 || pm->ps->weapon == WP_ALEVEL0_UPG )
{
int max;
- max = pm->ps->weapon == WP_ALEVEL3 ? LEVEL3_POUNCE_TIME :
- LEVEL3_POUNCE_TIME_UPG;
+ switch(pm->ps->weapon) {
+ case WP_ALEVEL3:
+ max = LEVEL3_POUNCE_TIME_UPG;
+ break;
+ case WP_ALEVEL3_UPG:
+ max = LEVEL3_POUNCE_TIME;
+ break;
+ case WP_ALEVEL5:
+ max = LEVEL5_POUNCE_TIME;
+ break;
+ default:
+ max = LEVEL0_DRILL_TIME;
+ break;
+ }
if( pm->cmd.buttons & BUTTON_ATTACK2 )
pm->ps->stats[ STAT_MISC ] += pml.msec;
else
@@ -3080,22 +3101,6 @@ static void PM_Weapon( void )
pm->ps->stats[ STAT_MISC ] = 0;
}
- // Charging for a drill or canceling a drill
- if( pm->ps->weapon == WP_ALEVEL0_UPG || pm->ps->weapon == WP_ALEVEL5 )
- {
- int max;
-
- max = LEVEL0_DRILL_TIME;
- if( pm->cmd.buttons & BUTTON_ATTACK2 )
- pm->ps->stats[ STAT_MISC ] += pml.msec;
- else
- pm->ps->stats[ STAT_MISC ] -= pml.msec;
- if( pm->ps->stats[ STAT_MISC ] > max )
- pm->ps->stats[ STAT_MISC ] = max;
- if( pm->ps->stats[ STAT_MISC ] < 0 )
- pm->ps->stats[ STAT_MISC ] = 0;
- }
-
// Trample charge mechanics
if( pm->ps->weapon == WP_ALEVEL4 )
{
@@ -3367,15 +3372,15 @@ static void PM_Weapon( void )
return;
case WP_ALEVEL3:
- case WP_ALEVEL5:
case WP_ALEVEL3_UPG:
+ case WP_ALEVEL5:
//pouncing has primary secondary AND autohit procedures
// pounce is autohit
if( !attack1 && !attack2 && !attack3 )
return;
break;
- case WP_FLAMER:
+ case WP_FLAMER:
attack3 = qfalse;
// Prevent firing of the Lucifer Cannon after an overcharge
diff --git a/src/game/g_combat.c b/src/game/g_combat.c
index 6fb7474..12de3a2 100644
--- a/src/game/g_combat.c
+++ b/src/game/g_combat.c
@@ -1233,8 +1233,8 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
}
// don't do friendly fire on movement attacks
- if( ( mod == MOD_LEVEL4_TRAMPLE || mod == MOD_LEVEL3_POUNCE ||
- mod == MOD_LEVEL4_CRUSH ) &&
+ if( ( mod == MOD_LEVEL4_TRAMPLE || mod == MOD_LEVEL3_POUNCE ||
+ mod == MOD_LEVEL5_POUNCE || mod == MOD_LEVEL4_CRUSH ) &&
targ->s.eType == ET_BUILDABLE && targ->buildableTeam == TEAM_ALIENS )
{
return;
@@ -1286,8 +1286,7 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
// don't do friendly fire on movement attacks
else if( mod == MOD_LEVEL4_TRAMPLE || mod == MOD_LEVEL3_POUNCE ||
-
- mod == MOD_LEVEL4_CRUSH )
+ mod == MOD_LEVEL5_POUNCE || mod == MOD_LEVEL4_CRUSH )
return;
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c
index c372771..f7c68c9 100644
--- a/src/game/g_weapon.c
+++ b/src/game/g_weapon.c
@@ -1478,14 +1478,14 @@ qboolean CheckPounceAttack( gentity_t *ent )
{
trace_t tr;
gentity_t *traceEnt;
- int damage, timeMax, pounceRange, payload;
+ int damage, timeMax, pounceRange, pounceWidth, payload;
if( ent->client->pmext.pouncePayload <= 0 )
return qfalse;
// In case the goon lands on his target, he get's one shot after landing
- payload = ent->client->pmext.pouncePayload;
- if( !( ent->client->ps.pm_flags & PMF_CHARGE || ent->client->ps.weapon == WP_ALEVEL5 ) )
+ payload = ent->client->pmext.pouncePayload;
+ if( !( ent->client->ps.pm_flags & PMF_CHARGE || ent->client->ps.weapon == WP_ALEVEL5 ) )
ent->client->pmext.pouncePayload = 0;
// Calculate muzzle point
@@ -1493,10 +1493,17 @@ qboolean CheckPounceAttack( gentity_t *ent )
CalcMuzzlePoint( ent, forward, right, up, muzzle );
// Trace from muzzle to see what we hit
- pounceRange = ent->client->ps.weapon == WP_ALEVEL3 ? LEVEL3_POUNCE_RANGE :
- LEVEL3_POUNCE_UPG_RANGE;
- G_WideTrace( &tr, ent, pounceRange, LEVEL3_POUNCE_WIDTH,
- LEVEL3_POUNCE_WIDTH, &traceEnt );
+ if( ent->client->ps.weapon == WP_ALEVEL5)
+ {
+ pounceRange = LEVEL5_POUNCE_RANGE;
+ pounceWidth = LEVEL5_POUNCE_WIDTH;
+ }
+ else
+ {
+ pounceRange = ent->client->ps.weapon == WP_ALEVEL3 ? LEVEL3_POUNCE_RANGE : LEVEL3_POUNCE_UPG_RANGE;
+ pounceWidth = LEVEL3_POUNCE_WIDTH;
+ }
+ G_WideTrace( &tr, ent, pounceRange, pounceWidth, pounceWidth, &traceEnt );
if( traceEnt == NULL )
return qfalse;
@@ -1508,29 +1515,21 @@ qboolean CheckPounceAttack( gentity_t *ent )
return qfalse;
// Deal damage
- if( ent->client->ps.weapon == WP_ALEVEL5)
- //{
- //damage = payload * LEVEL5_POUNCE_DMG / LEVEL5_POUNCE_TIME;
- //ent->client->pmext.pouncePayload = 0;
- //G_Damage( traceEnt, ent, ent, forward, tr.endpos, damage,
- //DAMAGE_NO_LOCDAMAGE, MOD_LEVEL5_POUNCE );
- //}
+ if( ent->client->ps.weapon == WP_ALEVEL5)
{
- timeMax = ent->client->ps.weapon == WP_ALEVEL5 ? LEVEL5_POUNCE_TIME :
- LEVEL3_POUNCE_TIME_UPG;
- damage = payload * LEVEL5_POUNCE_DMG / timeMax;
- ent->client->pmext.pouncePayload = 0;
- G_Damage( traceEnt, ent, ent, forward, tr.endpos, damage,
- DAMAGE_NO_LOCDAMAGE, MOD_LEVEL5_POUNCE );
+ timeMax = LEVEL5_POUNCE_TIME;
+ damage = payload * LEVEL5_POUNCE_DMG / timeMax;
+ ent->client->pmext.pouncePayload = 0;
+ G_Damage( traceEnt, ent, ent, forward, tr.endpos, damage,
+ DAMAGE_NO_LOCDAMAGE, MOD_LEVEL5_POUNCE );
}
else
{
- timeMax = ent->client->ps.weapon == WP_ALEVEL3 ? LEVEL3_POUNCE_TIME :
- LEVEL3_POUNCE_TIME_UPG;
- damage = payload * LEVEL3_POUNCE_DMG / timeMax;
- ent->client->pmext.pouncePayload = 0;
- G_Damage( traceEnt, ent, ent, forward, tr.endpos, damage,
- DAMAGE_NO_LOCDAMAGE, MOD_LEVEL3_POUNCE );
+ timeMax = ent->client->ps.weapon == WP_ALEVEL3 ? LEVEL3_POUNCE_TIME : LEVEL3_POUNCE_TIME_UPG;
+ damage = payload * LEVEL3_POUNCE_DMG / timeMax;
+ ent->client->pmext.pouncePayload = 0;
+ G_Damage( traceEnt, ent, ent, forward, tr.endpos, damage,
+ DAMAGE_NO_LOCDAMAGE, MOD_LEVEL3_POUNCE );
}
return qtrue;
}
@@ -1722,8 +1721,8 @@ gclient_t *client;
bounceBallFire_level2( ent );
break;
- case WP_ALEVEL5:
- Prickles( ent );
+ case WP_ALEVEL5:
+ Prickles( ent );
break;
case WP_ALEVEL4:
@@ -1868,7 +1867,7 @@ void FireWeapon( gentity_t *ent )
LEVEL2_CLAW_UPG_DMG, MOD_LEVEL2_CLAW );
break;
- case WP_ALEVEL5:
+ case WP_ALEVEL5:
meleeAttack( ent, LEVEL5_CLAW_U_RANGE, LEVEL5_CLAW_WIDTH, LEVEL5_CLAW_WIDTH,
LEVEL5_CLAW_DMG, MOD_LEVEL5_CLAW );
break;
diff --git a/src/game/tremulous.h b/src/game/tremulous.h
index 73cf8cc..d0c4dd1 100644
--- a/src/game/tremulous.h
+++ b/src/game/tremulous.h
@@ -301,10 +301,10 @@ TREMULOUS EDGE MOD SRC FILE
#define LEVEL5_CLAW_DMG ADM(40)
#define LEVEL5_PRICKLES_REPEAT 200
#define LEVEL5_PRICKLES_NEXTTHINK 6000
-#define LEVEL5_PRICKLES_RADIUS 50
-#define LEVEL5_PRICKLES_SPEED 1600.0f
-#define LEVEL5_PRICKLESSPLASH_DMG 3
-#define LEVEL5_PRICKLES_DMG 6
+#define LEVEL5_PRICKLES_RADIUS 50
+#define LEVEL5_PRICKLES_SPEED 1600.0f
+#define LEVEL5_PRICKLESSPLASH_DMG 3
+#define LEVEL5_PRICKLES_DMG 6
#define LEVEL5_PRICKLES_RELOADTIME 2300
#define LEVEL5_PRICKLES_AMMO 10
#define LEVEL5_POUNCE_JUMP_MAG 500
@@ -312,6 +312,9 @@ TREMULOUS EDGE MOD SRC FILE
#define LEVEL5_POUNCE_TIME 600
#define LEVEL5_POUNCE_TIME_MIN 200
#define LEVEL5_POUNCE_DMG 40
+#define LEVEL5_POUNCE_RANGE 48.0f
+#define LEVEL5_POUNCE_WIDTH 14.0f
+#define LEVEL5_POUNCE_SPEED_MOD 0.75f
/*
* HUMAN
*/