add more buttons, remove frags

This commit is contained in:
Ryan Baldwin 2022-06-27 21:13:34 -07:00
parent 02eb7ad820
commit 6eed77bbf1
11 changed files with 61 additions and 32 deletions

Binary file not shown.

Binary file not shown.

View file

@ -1388,6 +1388,10 @@ void HUD_Draw (void)
Draw_String (vid.width - 304, 48, "Press reload to make special waypoint");
return;
}
char stuff[1024];
sprintf(stuff, "fov: %f", scr_fov.value);
Draw_String(0, 32, stuff);
/*
if (cl.stats[STAT_HEALTH] <= 0)
{

View file

@ -579,7 +579,31 @@ void CL_SendMove (usercmd_t *cmd)
bits |= 2;
in_jump.state &= ~2;
MSG_WriteByte (&buf, bits);
if (in_grenade.state & 3)
bits |= 8;
in_grenade.state &= ~2;
if (in_switch.state & 3)
bits |= 16;
in_switch.state &= ~2;
if (in_reload.state & 3)
bits |= 32;
in_reload.state &= ~2;
if (in_knife.state & 3)
bits |= 64;
in_knife.state &= ~2;
if (in_use.state & 3)
bits |= 128;
in_use.state &= ~2;
if (in_aim.state & 3)
bits |= 256;
in_aim.state &= ~2;
MSG_WriteLong (&buf, bits);
MSG_WriteByte (&buf, in_impulse);
in_impulse = 0;

View file

@ -82,7 +82,7 @@ float scr_conlines; // lines of console to display
float oldscreensize, oldfov;
cvar_t scr_viewsize = {"viewsize","100", true};
cvar_t scr_fov = {"fov","80", qtrue}; // 10 - 170
cvar_t scr_fov = {"fov","80"}; // 10 - 170
cvar_t scr_conspeed = {"scr_conspeed","300"};
cvar_t scr_centertime = {"scr_centertime","2"};
cvar_t scr_showram = {"showram","1"};
@ -499,9 +499,9 @@ float CalcFov (float fov_x, float width, float height)
if (fov_x < 1 || fov_x > 179)
Sys_Error ("Bad fov: %f", fov_x);
x = width/tan(fov_x/360*M_PI);
x = width/tanf(fov_x/360*M_PI);
a = atan (height/x);
a = atanf (height/x);
a = a*360/M_PI;
@ -1270,9 +1270,9 @@ void SCR_UpdateScreen (void)
vid.recalc_refdef = qtrue;
}
if (oldscreensize != 120)
if (oldscreensize != scr_viewsize.value)
{
oldscreensize = 120;
oldscreensize = scr_viewsize.value;
vid.recalc_refdef = qtrue;
}

View file

@ -97,7 +97,6 @@ void Host_Status_f (void)
}
else
hours = 0;
print ("#%-2u %-16.16s %3i %2i:%02i:%02i\n", j+1, client->name, (int)client->edict->v.frags, hours, minutes, seconds);
print (" %s\n", client->netconnection->address);
}
}

View file

@ -912,7 +912,7 @@ static qsocket_t *_Datagram_CheckNewConnections (void)
MSG_WriteByte(&net_message, playerNumber);
MSG_WriteString(&net_message, client->name);
MSG_WriteLong(&net_message, client->colors);
MSG_WriteLong(&net_message, (int)client->edict->v.frags);
MSG_WriteLong(&net_message, 0);
MSG_WriteLong(&net_message, (int)(net_time - client->netconnection->connecttime));
MSG_WriteString(&net_message, client->netconnection->address);
*((int *)net_message.data) = BigLong(NETFLAG_CTL | (net_message.cursize & NETFLAG_LENGTH_MASK));

View file

@ -110,7 +110,8 @@ typedef struct
float nextthink;
int groundentity;
float health;
float frags;
float points;
float kills;
float weapon;
string_t weaponmodel;
float weaponframe;
@ -125,6 +126,12 @@ typedef struct
float button0;
float button1;
float button2;
float button3;
float button4;
float button5;
float button6;
float button7;
float button8;
float impulse;
float fixangle;
vec3_t v_angle;
@ -143,6 +150,9 @@ typedef struct
float ideal_yaw;
float yaw_speed;
int aiment;
int head;
int larm;
int rarm;
int goalentity;
float spawnflags;
string_t target;
@ -159,6 +169,8 @@ typedef struct
string_t noise2;
string_t noise3;
vec3_t ADS_Offset;
vec3_t Flash_Offset;
float Flash_Size;
string_t Weapon_Name;
string_t Weapon_Name_Touch;
float maxspeed;

View file

@ -760,19 +760,7 @@ void SV_UpdateToReliableMessages (void)
// check for changes to be sent over the reliable streams
for (i=0, host_client = svs.clients ; i<svs.maxclients ; i++, host_client++)
{
if (host_client->old_frags != host_client->edict->v.frags)
{
for (j=0, client = svs.clients ; j<svs.maxclients ; j++, client++)
{
if (!client->active)
continue;
MSG_WriteByte (&client->message, svc_updatefrags);
MSG_WriteByte (&client->message, i);
MSG_WriteShort (&client->message, host_client->edict->v.frags);
}
host_client->old_frags = host_client->edict->v.frags;
}
}
for (j=0, client = svs.clients ; j<svs.maxclients ; j++, client++)

View file

@ -458,9 +458,16 @@ void SV_ReadClientMove (usercmd_t *move)
move->upmove = MSG_ReadShort ();
// read buttons
bits = MSG_ReadByte ();
bits = MSG_ReadLong ();
host_client->edict->v.button0 = bits & 1;
host_client->edict->v.button2 = (bits & 2)>>1;
host_client->edict->v.button1 = (bits & 4)>>1;
host_client->edict->v.button3 = (bits & 8)>>1;
host_client->edict->v.button4 = (bits & 16)>>1;
host_client->edict->v.button5 = (bits & 32)>>1;
host_client->edict->v.button6 = (bits & 64)>>1;
host_client->edict->v.button7 = (bits & 128)>>1;
host_client->edict->v.button8 = (bits & 256)>>1;
i = MSG_ReadByte ();
if (i)

View file

@ -338,7 +338,7 @@ cshift_t cshift_water = { {130,80,50}, 128 };
cshift_t cshift_slime = { {0,25,5}, 150 };
cshift_t cshift_lava = { {255,80,0}, 150 };
cvar_t v_gamma = {"gamma", "1", true};
cvar_t v_gamma = {"gamma", "2", true};
byte gammatable[256]; // palette is sent through this
@ -631,11 +631,6 @@ void V_UpdatePalette (void)
}
}
// drop the damage value
cl.cshifts[CSHIFT_DAMAGE].percent -= host_frametime*150;
if (cl.cshifts[CSHIFT_DAMAGE].percent <= 0)
cl.cshifts[CSHIFT_DAMAGE].percent = 0;
// drop the bonus value
cl.cshifts[CSHIFT_BONUS].percent -= host_frametime*100;
if (cl.cshifts[CSHIFT_BONUS].percent <= 0)