From 48ce47c288f195919487a5f8e38f9658704e727c Mon Sep 17 00:00:00 2001 From: Michael Levin Date: Sat, 3 Oct 2009 11:24:23 +0000 Subject: * Norfenstein's increased Dretch attack repeat Scaled back the gameplay implications of the recent wallwalking changes a bit: * Wallwalking players will not get knocked off walls by knockback forces * Cannot shove enemies again * Shoving will still knock wallwalkers off of you * Getting shoved off of someone while toggle wallwalking will not disable your WW --- src/game/bg_pmove.c | 11 +++++++++-- src/game/bg_public.h | 3 ++- src/game/g_active.c | 22 ++++++++++++++++++---- src/game/tremulous.h | 2 +- 4 files changed, 30 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 25746f9b..ed39a1a3 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -400,7 +400,7 @@ static float PM_CmdScale( usercmd_t *cmd ) modifier *= PCLOUD_ARMOUR_MODIFIER; else modifier *= PCLOUD_MODIFIER; - } + } } if( pm->ps->weapon == WP_ALEVEL4 && pm->ps->pm_flags & PMF_CHARGE ) @@ -2141,7 +2141,8 @@ static void PM_GroundTrace( void ) pm->ps->stats[ STAT_STATE ] &= ~SS_WALLCLIMBING; } - if( pm->ps->pm_type == PM_DEAD || pm->ps->pm_time ) + if( pm->ps->pm_type == PM_DEAD || + ( pm->ps->pm_time && ( pm->ps->pm_flags & PMF_TIME_KNOCKOFF ) ) ) pm->ps->stats[ STAT_STATE ] &= ~SS_WALLCLIMBING; if( pm->ps->stats[ STAT_STATE ] & SS_WALLCLIMBING ) @@ -3285,6 +3286,12 @@ static void PM_DropTimers( void ) { if( pml.msec >= pm->ps->pm_time ) { + // If this is a toggle wallwalker that got knocked off, + // turn their wallwalk back on + if( ( pm->ps->pm_flags & PMF_TIME_KNOCKOFF ) && + ( pm->ps->persistant[ PERS_STATE ] & PS_WALLCLIMBINGTOGGLE ) ) + pm->ps->stats[ STAT_STATE ] |= SS_WALLCLIMBING; + pm->ps->pm_flags &= ~PMF_ALL_TIMES; pm->ps->pm_time = 0; } diff --git a/src/game/bg_public.h b/src/game/bg_public.h index a5d6680c..3c753092 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -136,6 +136,7 @@ typedef enum #define PMF_BACKWARDS_RUN 16 // coast down to backwards run #define PMF_TIME_LAND 32 // pm_time is time before rejump #define PMF_TIME_KNOCKBACK 64 // pm_time is an air-accelerate only time +#define PMF_TIME_KNOCKOFF 128 // pm_time is no-wallwalk time #define PMF_TIME_WATERJUMP 256 // pm_time is waterjump #define PMF_RESPAWNED 512 // clear after attack and jump buttons come up #define PMF_USE_ITEM_HELD 1024 @@ -147,7 +148,7 @@ typedef enum #define PMF_WEAPON_SWITCH 65536 // force a weapon switch -#define PMF_ALL_TIMES (PMF_TIME_WATERJUMP|PMF_TIME_LAND|PMF_TIME_KNOCKBACK|PMF_TIME_WALLJUMP) +#define PMF_ALL_TIMES (PMF_TIME_WATERJUMP|PMF_TIME_LAND|PMF_TIME_KNOCKBACK|PMF_TIME_KNOCKOFF|PMF_TIME_WALLJUMP) typedef struct { diff --git a/src/game/g_active.c b/src/game/g_active.c index f641d7ca..47fd446c 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -198,7 +198,7 @@ ClientShove */ static int GetClientMass( gentity_t *ent ) { - int entMass = 100; + int entMass = 75; if( ent->client->pers.teamSelection == PTE_ALIENS ) entMass = BG_FindHealthForClass( ent->client->pers.classSelection ); @@ -223,19 +223,28 @@ static void ClientShove( gentity_t *ent, gentity_t *victim ) !ent->client->pers.cmd.upmove ) return; - // Shove is scaled by relative mass + // Cannot push enemy players unless they are walking on the player + if( !OnSameTeam( ent, victim ) && + victim->client->ps.groundEntityNum != ent - g_entities ) + return; + + // Shove force is scaled by relative mass entMass = GetClientMass( ent ); vicMass = GetClientMass( victim ); if( vicMass <= 0 || entMass <= 0 ) return; + force = g_shove.value * entMass / vicMass; + if( force < 0 ) + force = 0; + if( force > 150 ) + force = 150; // Give the victim some shove velocity VectorSubtract( victim->r.currentOrigin, ent->r.currentOrigin, dir ); VectorNormalizeFast( dir ); - force = g_shove.value * entMass / vicMass; VectorScale( dir, force, push ); VectorAdd( victim->client->ps.velocity, push, victim->client->ps.velocity ); - + // Set the pmove timer so that the other client can't cancel // out the movement immediately if( !victim->client->ps.pm_time ) @@ -249,6 +258,11 @@ static void ClientShove( gentity_t *ent, gentity_t *victim ) time = 200; victim->client->ps.pm_time = time; victim->client->ps.pm_flags |= PMF_TIME_KNOCKBACK; + + // Knock victim off if they are wallwalking on us + if( ( victim->client->ps.groundEntityNum == ent - g_entities ) && + ( victim->client->ps.stats[ STAT_STATE ] & SS_WALLCLIMBING ) ) + victim->client->ps.pm_flags |= PMF_TIME_KNOCKOFF; } } diff --git a/src/game/tremulous.h b/src/game/tremulous.h index a0f0908a..9dfd7b9a 100644 --- a/src/game/tremulous.h +++ b/src/game/tremulous.h @@ -52,7 +52,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define LEVEL0_BITE_DMG ADM(48) #define LEVEL0_BITE_RANGE 64.0f #define LEVEL0_BITE_WIDTH 6.0f -#define LEVEL0_BITE_REPEAT 500 +#define LEVEL0_BITE_REPEAT 1000 #define LEVEL0_BITE_K_SCALE 1.0f #define LEVEL1_CLAW_DMG ADM(32) -- cgit