Realistic Saber (dismemberment)

This commit is contained in:
Simon 2023-03-12 10:03:25 +00:00
parent f46644c08c
commit 0d5162626d
3 changed files with 10 additions and 4 deletions

View file

@ -664,9 +664,9 @@ void G_InitCvars( void ) {
g_TeamBeefDirectorsCut = gi.cvar( "g_TeamBeefDirectorsCut", "1", CVAR_ARCHIVE ); // Team Beef Director's Cut tweaks
g_saberAutoDeflect1stPerson = gi.cvar( "g_saberAutoDeflect1stPerson", "0", CVAR_CHEAT );//Whether the saber will auto deflect missiles in first person
g_saberAutoDeflect1stPerson = gi.cvar( "g_saberAutoDeflect1stPerson", "0", CVAR_ARCHIVE );//Whether the saber will auto deflect missiles in first person
g_saberAutoBlocking = gi.cvar( "g_saberAutoBlocking", "0", CVAR_CHEAT );//must press +block button to do any blocking
g_saberRealisticCombat = gi.cvar( "g_saberMoreRealistic", "1", CVAR_ARCHIVE );//makes collision more precise, increases damage
g_saberRealisticCombat = gi.cvar( "g_saberMoreRealistic", "3", CVAR_ARCHIVE );//makes collision more precise, increases damage
debug_subdivision = gi.cvar( "debug_subdivision", "0", CVAR_ARCHIVE );//debug for dismemberment
g_dismemberProbabilities = gi.cvar ( "g_dismemberProbabilities", "1", CVAR_ARCHIVE );//0 = ignore probabilities, 1 = use probabilities
g_saberDamageCapping = gi.cvar( "g_saberDamageCapping", "1", CVAR_CHEAT );//caps damage of sabers vs players and NPC who use sabers

View file

@ -160,6 +160,9 @@ void WP_ForcePowerDrain( gentity_t *self, forcePowers_t forcePower, int override
void WP_DeactivateSaber( gentity_t *self, qboolean clearLength = qfalse );
qboolean FP_ForceDrainGrippableEnt( gentity_t *victim );
extern cvar_t *g_TeamBeefDirectorsCut;
extern cvar_t *g_saberAutoDeflect1stPerson;
extern cvar_t *g_saberAutoBlocking;
extern cvar_t *g_saberRealisticCombat;
extern cvar_t *g_saberDamageCapping;
@ -7994,9 +7997,12 @@ void WP_SaberUpdate( gentity_t *self, usercmd_t *ucmd )
else if ( self->client->ps.saberBlocking == BLK_TIGHT
|| self->client->ps.saberBlocking == BLK_WIDE )
{//FIXME: keep bbox in front of player, even when wide?
bool autoBlocking = (cg_thirdPerson.integer && g_saberAutoBlocking->integer) ||
(!cg_thirdPerson.integer && g_saberAutoDeflect1stPerson->integer);
vec3_t saberOrg;
if ( !forceBlock
&& ( (self->s.number&&!Jedi_SaberBusy(self)&&!g_saberRealisticCombat->integer) || (self->s.number == 0 && self->client->ps.saberBlocking == BLK_WIDE && (g_saberAutoBlocking->integer||self->client->ps.saberBlockingTime>level.time)) )
&& ( (self->s.number&&!Jedi_SaberBusy(self)&&!g_saberRealisticCombat->integer) ||
(self->s.number == 0 && self->client->ps.saberBlocking == BLK_WIDE && (autoBlocking||self->client->ps.saberBlockingTime>level.time)) )
&& self->client->ps.weaponTime <= 0
&& !G_InCinematicSaberAnim( self ) )
{//full-size blocking for non-attacking player with g_saberAutoBlocking on

View file

@ -588,7 +588,7 @@ void G_InitCvars( void ) {
g_TeamBeefDirectorsCut = gi.cvar( "g_TeamBeefDirectorsCut", "1", CVAR_ARCHIVE ); // Team Beef Director's Cut tweaks
g_saberAutoDeflect1stPerson = gi.cvar( "g_saberAutoDeflect1stPerson", "0", CVAR_ARCHIVE|CVAR_CHEAT );//Whether the saber will auto deflect missiles in first person
g_saberAutoDeflect1stPerson = gi.cvar( "g_saberAutoDeflect1stPerson", "0", CVAR_ARCHIVE );//Whether the saber will auto deflect missiles in first person
g_saberAutoBlocking = gi.cvar( "g_saberAutoBlocking", "0", CVAR_ARCHIVE|CVAR_CHEAT );//must press +block button to do any blocking
g_saberRealisticCombat = gi.cvar( "g_saberRealisticCombat", "1", CVAR_ARCHIVE );//makes collision more precise, increases damage
g_saberMoveSpeed = gi.cvar( "g_saberMoveSpeed", "1", CVAR_ARCHIVE|CVAR_CHEAT );//how fast you run while attacking with a saber