mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'followtweak' into 'master'
Follower adjustments Closes #202 See merge request KartKrew/Kart!514
This commit is contained in:
commit
f794908430
4 changed files with 25 additions and 14 deletions
|
|
@ -781,10 +781,10 @@ void D_RegisterClientCommands(void)
|
||||||
Followercolor_cons_t[i].strvalue = skincolors[i-2].name;
|
Followercolor_cons_t[i].strvalue = skincolors[i-2].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
Followercolor_cons_t[1].value = -1;
|
Followercolor_cons_t[1].value = FOLLOWERCOLOR_MATCH;
|
||||||
Followercolor_cons_t[1].strvalue = "Match"; // Add "Match" option, which will make the follower color match the player's
|
Followercolor_cons_t[1].strvalue = "Match"; // Add "Match" option, which will make the follower color match the player's
|
||||||
|
|
||||||
Followercolor_cons_t[0].value = -2;
|
Followercolor_cons_t[0].value = FOLLOWERCOLOR_OPPOSITE;
|
||||||
Followercolor_cons_t[0].strvalue = "Opposite"; // Add "Opposite" option, ...which is like "Match", but for coloropposite.
|
Followercolor_cons_t[0].strvalue = "Opposite"; // Add "Opposite" option, ...which is like "Match", but for coloropposite.
|
||||||
|
|
||||||
Color_cons_t[MAXSKINCOLORS].value = Followercolor_cons_t[MAXSKINCOLORS+2].value = 0;
|
Color_cons_t[MAXSKINCOLORS].value = Followercolor_cons_t[MAXSKINCOLORS+2].value = 0;
|
||||||
|
|
@ -1449,6 +1449,8 @@ static void SendNameAndColor(UINT8 n)
|
||||||
if (cv_follower[n].value >= -1 && cv_follower[n].value != player->followerskin)
|
if (cv_follower[n].value >= -1 && cv_follower[n].value != player->followerskin)
|
||||||
SetFollower(playernum, cv_follower[n].value);
|
SetFollower(playernum, cv_follower[n].value);
|
||||||
|
|
||||||
|
player->followercolor = cv_followercolor[n].value;
|
||||||
|
|
||||||
if (metalrecording && n == 0)
|
if (metalrecording && n == 0)
|
||||||
{ // Starring Metal Sonic as themselves, obviously.
|
{ // Starring Metal Sonic as themselves, obviously.
|
||||||
SetPlayerSkinByNum(playernum, 5);
|
SetPlayerSkinByNum(playernum, 5);
|
||||||
|
|
@ -1503,7 +1505,7 @@ static void SendNameAndColor(UINT8 n)
|
||||||
WRITEUINT16(p, (UINT16)cv_playercolor[n].value);
|
WRITEUINT16(p, (UINT16)cv_playercolor[n].value);
|
||||||
WRITEUINT8(p, (UINT8)cv_skin[n].value);
|
WRITEUINT8(p, (UINT8)cv_skin[n].value);
|
||||||
WRITESINT8(p, (SINT8)cv_follower[n].value);
|
WRITESINT8(p, (SINT8)cv_follower[n].value);
|
||||||
WRITEUINT16(p, (UINT8)cv_followercolor[n].value);
|
WRITEUINT16(p, (UINT16)cv_followercolor[n].value);
|
||||||
|
|
||||||
SendNetXCmdForPlayer(n, XD_NAMEANDCOLOR, buf, p - buf);
|
SendNetXCmdForPlayer(n, XD_NAMEANDCOLOR, buf, p - buf);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
10
src/g_demo.c
10
src/g_demo.c
|
|
@ -301,13 +301,15 @@ void G_ReadDemoExtraData(void)
|
||||||
// Follower's color
|
// Follower's color
|
||||||
M_Memcpy(name, demo_p, 16);
|
M_Memcpy(name, demo_p, 16);
|
||||||
demo_p += 16;
|
demo_p += 16;
|
||||||
for (i = 0; i < numskincolors; i++)
|
for (i = 0; i < numskincolors +2; i++) // +2 because of Match and Opposite
|
||||||
if (!stricmp(skincolors[i].name, name)) // SRB2kart
|
{
|
||||||
|
if (!stricmp(Followercolor_cons_t[i].strvalue, name))
|
||||||
{
|
{
|
||||||
players[p].followercolor = i;
|
players[p].followercolor = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (extradata & DXD_PLAYSTATE)
|
if (extradata & DXD_PLAYSTATE)
|
||||||
{
|
{
|
||||||
i = READUINT8(demo_p);
|
i = READUINT8(demo_p);
|
||||||
|
|
@ -456,7 +458,7 @@ void G_WriteDemoExtraData(void)
|
||||||
|
|
||||||
// write follower color
|
// write follower color
|
||||||
memset(name, 0, 16);
|
memset(name, 0, 16);
|
||||||
strncpy(name, Followercolor_cons_t[players[i].followercolor].strvalue, 16); // Not KartColor_Names because followercolor has extra values such as "Match"
|
strncpy(name, Followercolor_cons_t[(UINT16)(players[i].followercolor+2)].strvalue, 16); // Not KartColor_Names because followercolor has extra values such as "Match"
|
||||||
M_Memcpy(demo_p,name,16);
|
M_Memcpy(demo_p,name,16);
|
||||||
demo_p += 16;
|
demo_p += 16;
|
||||||
|
|
||||||
|
|
@ -2074,7 +2076,7 @@ void G_BeginRecording(void)
|
||||||
|
|
||||||
// Save follower's colour
|
// Save follower's colour
|
||||||
memset(name, 0, 16);
|
memset(name, 0, 16);
|
||||||
strncpy(name, Followercolor_cons_t[player->followercolor].strvalue, 16); // Not KartColor_Names because followercolor has extra values such as "Match"
|
strncpy(name, Followercolor_cons_t[(UINT16)(player->followercolor+2)].strvalue, 16); // Not KartColor_Names because followercolor has extra values such as "Match"
|
||||||
M_Memcpy(demo_p, name, 16);
|
M_Memcpy(demo_p, name, 16);
|
||||||
demo_p += 16;
|
demo_p += 16;
|
||||||
|
|
||||||
|
|
|
||||||
11
src/p_user.c
11
src/p_user.c
|
|
@ -3916,7 +3916,7 @@ static void P_HandleFollower(player_t *player)
|
||||||
follower_t fl;
|
follower_t fl;
|
||||||
angle_t an;
|
angle_t an;
|
||||||
fixed_t zoffs;
|
fixed_t zoffs;
|
||||||
fixed_t sx, sy, sz;
|
fixed_t sx, sy, sz, deltaz;
|
||||||
UINT16 color;
|
UINT16 color;
|
||||||
|
|
||||||
fixed_t bubble; // bubble scale (0 if no bubble)
|
fixed_t bubble; // bubble scale (0 if no bubble)
|
||||||
|
|
@ -3950,6 +3950,9 @@ static void P_HandleFollower(player_t *player)
|
||||||
sx = player->mo->x + FixedMul((player->mo->scale*fl.dist), FINECOSINE((an)>>ANGLETOFINESHIFT));
|
sx = player->mo->x + FixedMul((player->mo->scale*fl.dist), FINECOSINE((an)>>ANGLETOFINESHIFT));
|
||||||
sy = player->mo->y + FixedMul((player->mo->scale*fl.dist), FINESINE((an)>>ANGLETOFINESHIFT));
|
sy = player->mo->y + FixedMul((player->mo->scale*fl.dist), FINESINE((an)>>ANGLETOFINESHIFT));
|
||||||
|
|
||||||
|
// interp info helps with stretchy fix
|
||||||
|
deltaz = (player->mo->z - player->mo->old_z);
|
||||||
|
|
||||||
// for the z coordinate, don't be a doof like Steel and forget that MFE_VERTICALFLIP exists :P
|
// for the z coordinate, don't be a doof like Steel and forget that MFE_VERTICALFLIP exists :P
|
||||||
sz = player->mo->z + FixedMul(player->mo->scale, zoffs)*P_MobjFlip(player->mo);
|
sz = player->mo->z + FixedMul(player->mo->scale, zoffs)*P_MobjFlip(player->mo);
|
||||||
if (player->mo->eflags & MFE_VERTICALFLIP)
|
if (player->mo->eflags & MFE_VERTICALFLIP)
|
||||||
|
|
@ -3966,10 +3969,10 @@ static void P_HandleFollower(player_t *player)
|
||||||
// Set follower colour
|
// Set follower colour
|
||||||
switch (player->followercolor)
|
switch (player->followercolor)
|
||||||
{
|
{
|
||||||
case 255: // "Match" (-1)
|
case FOLLOWERCOLOR_MATCH: // "Match"
|
||||||
color = player->skincolor;
|
color = player->skincolor;
|
||||||
break;
|
break;
|
||||||
case 254: // "Opposite" (-2)
|
case FOLLOWERCOLOR_OPPOSITE: // "Opposite"
|
||||||
color = skincolors[player->skincolor].invcolor;
|
color = skincolors[player->skincolor].invcolor;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
@ -4033,6 +4036,7 @@ static void P_HandleFollower(player_t *player)
|
||||||
// 02/09/2021: cast lag to int32 otherwise funny things happen since it was changed to uint32 in the struct
|
// 02/09/2021: cast lag to int32 otherwise funny things happen since it was changed to uint32 in the struct
|
||||||
player->follower->momx = (sx - player->follower->x)/ (INT32)fl.horzlag;
|
player->follower->momx = (sx - player->follower->x)/ (INT32)fl.horzlag;
|
||||||
player->follower->momy = (sy - player->follower->y)/ (INT32)fl.horzlag;
|
player->follower->momy = (sy - player->follower->y)/ (INT32)fl.horzlag;
|
||||||
|
player->follower->z += (deltaz/ (INT32)fl.vertlag);
|
||||||
player->follower->momz = (sz - player->follower->z)/ (INT32)fl.vertlag;
|
player->follower->momz = (sz - player->follower->z)/ (INT32)fl.vertlag;
|
||||||
player->follower->angle = player->mo->angle;
|
player->follower->angle = player->mo->angle;
|
||||||
|
|
||||||
|
|
@ -4066,6 +4070,7 @@ static void P_HandleFollower(player_t *player)
|
||||||
// match follower's momentums and (e)flags(2).
|
// match follower's momentums and (e)flags(2).
|
||||||
bmobj->momx = player->follower->momx;
|
bmobj->momx = player->follower->momx;
|
||||||
bmobj->momy = player->follower->momy;
|
bmobj->momy = player->follower->momy;
|
||||||
|
bmobj->z += (deltaz/ (INT32)fl.vertlag);
|
||||||
bmobj->momz = player->follower->momz;
|
bmobj->momz = player->follower->momz;
|
||||||
|
|
||||||
P_SetScale(bmobj, FixedMul(bubble, player->mo->scale));
|
P_SetScale(bmobj, FixedMul(bubble, player->mo->scale));
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,8 @@ extern INT16 *hicolormaps; // remap high colors to high colors..
|
||||||
|
|
||||||
extern CV_PossibleValue_t Color_cons_t[];
|
extern CV_PossibleValue_t Color_cons_t[];
|
||||||
extern CV_PossibleValue_t Followercolor_cons_t[]; // follower colours table, not a duplicate because of the "Match" option.
|
extern CV_PossibleValue_t Followercolor_cons_t[]; // follower colours table, not a duplicate because of the "Match" option.
|
||||||
|
#define FOLLOWERCOLOR_MATCH UINT16_MAX
|
||||||
|
#define FOLLOWERCOLOR_OPPOSITE (UINT16_MAX-1)
|
||||||
|
|
||||||
// I/O, setting up the stuff.
|
// I/O, setting up the stuff.
|
||||||
void R_InitTextureData(void);
|
void R_InitTextureData(void);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue