Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,14 @@ set using command line arguments:
"Network protocols" section below
(startup only)

g_shotgunMorePellets - Doubles the amount of pellets that the
shotgun fires, while keeping the damage
the same, like in Quake Live. Increases
the reliability of the shotgun damage.
Note that client-side this might not be
visible, due to the usage of a different
`cgame.vm`.

in_joystickNo - select which joystick to use
in_availableJoysticks - list of available Joysticks
in_keyboardDebug - print keyboard debug info
Expand Down
1 change: 1 addition & 0 deletions code/cgame/cg_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,7 @@ typedef struct {
char mapname[MAX_QPATH];
char redTeam[MAX_QPATH];
char blueTeam[MAX_QPATH];
qboolean g_shotgunMorePellets;

int voteTime;
int voteYes;
Expand Down
1 change: 1 addition & 0 deletions code/cgame/cg_servercmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ void CG_ParseServerinfo( void ) {
trap_Cvar_Set("g_redTeam", cgs.redTeam);
Q_strncpyz( cgs.blueTeam, Info_ValueForKey( info, "g_blueTeam" ), sizeof(cgs.blueTeam) );
trap_Cvar_Set("g_blueTeam", cgs.blueTeam);
cgs.g_shotgunMorePellets = atoi( Info_ValueForKey( info, "g_shotgunMorePellets" ) );
}

/*
Expand Down
4 changes: 3 additions & 1 deletion code/cgame/cg_weapons.c
Original file line number Diff line number Diff line change
Expand Up @@ -2034,6 +2034,7 @@ hit splashes
*/
static void CG_ShotgunPattern( vec3_t origin, vec3_t origin2, int seed, int otherEntNum ) {
int i;
int numPellets;
float r, u;
vec3_t end;
vec3_t forward, right, up;
Expand All @@ -2044,8 +2045,9 @@ static void CG_ShotgunPattern( vec3_t origin, vec3_t origin2, int seed, int othe
PerpendicularVector( right, forward );
CrossProduct( forward, right, up );

numPellets = DEFAULT_SHOTGUN_COUNT * (cgs.g_shotgunMorePellets ? 2 : 1);
// generate the "random" spread pattern
for ( i = 0 ; i < DEFAULT_SHOTGUN_COUNT ; i++ ) {
for ( i = 0 ; i < numPellets ; i++ ) {
r = Q_crandom( &seed ) * DEFAULT_SHOTGUN_SPREAD * 16;
u = Q_crandom( &seed ) * DEFAULT_SHOTGUN_SPREAD * 16;
VectorMA( origin, 8192 * 16, forward, end);
Expand Down
1 change: 1 addition & 0 deletions code/game/g_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,7 @@ extern vmCvar_t g_gravity;
extern vmCvar_t g_speed;
extern vmCvar_t g_knockback;
extern vmCvar_t g_quadfactor;
extern vmCvar_t g_shotgunMorePellets;
extern vmCvar_t g_forcerespawn;
extern vmCvar_t g_inactivity;
extern vmCvar_t g_debugMove;
Expand Down
5 changes: 5 additions & 0 deletions code/game/g_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ vmCvar_t g_gravity;
vmCvar_t g_cheats;
vmCvar_t g_knockback;
vmCvar_t g_quadfactor;
vmCvar_t g_shotgunMorePellets;
vmCvar_t g_forcerespawn;
vmCvar_t g_inactivity;
vmCvar_t g_debugMove;
Expand Down Expand Up @@ -142,6 +143,10 @@ static cvarTable_t gameCvarTable[] = {
{ &g_gravity, "g_gravity", "800", 0, 0, qtrue },
{ &g_knockback, "g_knockback", "1000", 0, 0, qtrue },
{ &g_quadfactor, "g_quadfactor", "3", 0, 0, qtrue },
// So is it supposed to be `g_` or `com_`?
// Because these are `CVAR_SERVERINFO` things, the client cannot set them
// separately.
{ &g_shotgunMorePellets, "g_shotgunMorePellets", "0", CVAR_SERVERINFO, 0, qtrue },
{ &g_weaponRespawn, "g_weaponrespawn", "5", 0, 0, qtrue },
{ &g_weaponTeamRespawn, "g_weaponTeamRespawn", "30", 0, 0, qtrue },
{ &g_forcerespawn, "g_forcerespawn", "20", 0, 0, qtrue },
Expand Down
6 changes: 4 additions & 2 deletions code/game/g_weapon.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ qboolean ShotgunPellet( vec3_t start, vec3_t end, gentity_t *ent ) {
}

if ( traceEnt->takedamage) {
damage = DEFAULT_SHOTGUN_DAMAGE * s_quadFactor;
damage = DEFAULT_SHOTGUN_DAMAGE / (g_shotgunMorePellets.integer ? 2 : 1) * s_quadFactor;
#ifdef MISSIONPACK
if ( traceEnt->client && traceEnt->client->invulnerabilityTime > level.time ) {
if (G_InvulnerabilityEffect( traceEnt, forward, tr.endpos, impactpoint, bouncedir )) {
Expand Down Expand Up @@ -320,6 +320,7 @@ qboolean ShotgunPellet( vec3_t start, vec3_t end, gentity_t *ent ) {
// this should match CG_ShotgunPattern
void ShotgunPattern( vec3_t origin, vec3_t origin2, int seed, gentity_t *ent ) {
int i;
int numPellets;
float r, u;
vec3_t end;
vec3_t localForward, localRight, localUp;
Expand All @@ -332,7 +333,8 @@ void ShotgunPattern( vec3_t origin, vec3_t origin2, int seed, gentity_t *ent ) {
CrossProduct( localForward, localRight, localUp );

// generate the "random" spread pattern
for ( i = 0 ; i < DEFAULT_SHOTGUN_COUNT ; i++ ) {
numPellets = DEFAULT_SHOTGUN_COUNT * (g_shotgunMorePellets.integer ? 2 : 1);
for ( i = 0 ; i < numPellets ; i++ ) {
r = Q_crandom( &seed ) * DEFAULT_SHOTGUN_SPREAD * 16;
u = Q_crandom( &seed ) * DEFAULT_SHOTGUN_SPREAD * 16;
VectorMA( origin, 8192 * 16, localForward, end);
Expand Down