mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-05-10 10:51:42 +00:00
Merge branch 'master' into uncapped
This commit is contained in:
commit
362f779f26
26 changed files with 471 additions and 313 deletions
|
|
@ -118,8 +118,9 @@ set(SRB2_SDL2_EXE_NAME srb2kart CACHE STRING "Executable binary output name")
|
||||||
include_directories(${CMAKE_CURRENT_BINARY_DIR}/src)
|
include_directories(${CMAKE_CURRENT_BINARY_DIR}/src)
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
add_subdirectory(assets)
|
if(NOT ${SRB2_CONFIG_DEV_BUILD})
|
||||||
|
add_subdirectory(assets)
|
||||||
|
endif()
|
||||||
|
|
||||||
## config.h generation
|
## config.h generation
|
||||||
set(GIT_EXECUTABLE "git" CACHE FILEPATH "Path to git binary")
|
set(GIT_EXECUTABLE "git" CACHE FILEPATH "Path to git binary")
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,8 @@ set(SRB2_CONFIG_YASM OFF CACHE BOOL
|
||||||
"Use YASM in place of NASM.")
|
"Use YASM in place of NASM.")
|
||||||
set(SRB2_CONFIG_STATIC_OPENGL OFF CACHE BOOL
|
set(SRB2_CONFIG_STATIC_OPENGL OFF CACHE BOOL
|
||||||
"Use statically linked OpenGL. NOT RECOMMENDED.")
|
"Use statically linked OpenGL. NOT RECOMMENDED.")
|
||||||
|
set(SRB2_CONFIG_DEV_BUILD OFF CACHE BOOL
|
||||||
|
"Compile a development build of SRB2Kart.")
|
||||||
|
|
||||||
### use internal libraries?
|
### use internal libraries?
|
||||||
if(${CMAKE_SYSTEM} MATCHES "Windows") ###set on Windows only
|
if(${CMAKE_SYSTEM} MATCHES "Windows") ###set on Windows only
|
||||||
|
|
@ -280,6 +282,10 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -Wno-absolute-value)
|
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -Wno-absolute-value)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(${SRB2_CONFIG_DEV_BUILD})
|
||||||
|
target_compile_definitions(SRB2SDL2 PRIVATE -DDEVELOP)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -Wno-trigraphs)
|
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -Wno-trigraphs)
|
||||||
|
|
||||||
target_compile_definitions(SRB2SDL2 PRIVATE -DCMAKECONFIG)
|
target_compile_definitions(SRB2SDL2 PRIVATE -DCMAKECONFIG)
|
||||||
|
|
|
||||||
|
|
@ -1916,6 +1916,8 @@ void CON_SetLoadingProgress(con_loadprogress_t newStep)
|
||||||
if (con_startup_loadprogress < LOADED_ISTARTUPGRAPHICS) // rendering not possible?
|
if (con_startup_loadprogress < LOADED_ISTARTUPGRAPHICS) // rendering not possible?
|
||||||
return;
|
return;
|
||||||
CON_DrawLoadBar(); // here we display the console text
|
CON_DrawLoadBar(); // here we display the console text
|
||||||
|
I_OsPolling();
|
||||||
|
I_UpdateNoBlit();
|
||||||
I_FinishUpdate(); // page flip or blit buffer
|
I_FinishUpdate(); // page flip or blit buffer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ UINT8 adminpassmd5[16];
|
||||||
boolean adminpasswordset = false;
|
boolean adminpasswordset = false;
|
||||||
|
|
||||||
// Client specific
|
// Client specific
|
||||||
static ticcmd_t localcmds[MAXSPLITSCREENPLAYERS];
|
static ticcmd_t localcmds[MAXSPLITSCREENPLAYERS][MAXGENTLEMENDELAY];
|
||||||
static boolean cl_packetmissed;
|
static boolean cl_packetmissed;
|
||||||
// here it is for the secondary local player (splitscreen)
|
// here it is for the secondary local player (splitscreen)
|
||||||
static UINT8 mynode; // my address pointofview server
|
static UINT8 mynode; // my address pointofview server
|
||||||
|
|
@ -440,10 +440,15 @@ static void D_Clearticcmd(tic_t tic)
|
||||||
|
|
||||||
void D_ResetTiccmds(void)
|
void D_ResetTiccmds(void)
|
||||||
{
|
{
|
||||||
INT32 i;
|
INT32 i, j;
|
||||||
|
|
||||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||||
memset(&localcmds[i], 0, sizeof(ticcmd_t));
|
{
|
||||||
|
for (j = 0; j < MAXGENTLEMENDELAY; j++)
|
||||||
|
{
|
||||||
|
memset(&localcmds[i][j], 0, sizeof(ticcmd_t));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Reset the net command list
|
// Reset the net command list
|
||||||
for (i = 0; i < TEXTCMD_HASH_SIZE; i++)
|
for (i = 0; i < TEXTCMD_HASH_SIZE; i++)
|
||||||
|
|
@ -2390,6 +2395,7 @@ void CL_RemovePlayer(INT32 playernum, kickreason_t reason)
|
||||||
|
|
||||||
// remove avatar of player
|
// remove avatar of player
|
||||||
playeringame[playernum] = false;
|
playeringame[playernum] = false;
|
||||||
|
demo_extradata[playernum] |= DXD_PLAYSTATE;
|
||||||
playernode[playernum] = UINT8_MAX;
|
playernode[playernum] = UINT8_MAX;
|
||||||
while (!playeringame[doomcom->numslots-1] && doomcom->numslots > 1)
|
while (!playeringame[doomcom->numslots-1] && doomcom->numslots > 1)
|
||||||
doomcom->numslots--;
|
doomcom->numslots--;
|
||||||
|
|
@ -4934,12 +4940,6 @@ static void CL_SendClientCmd(void)
|
||||||
size_t packetsize = 0;
|
size_t packetsize = 0;
|
||||||
boolean mis = false;
|
boolean mis = false;
|
||||||
|
|
||||||
if (lowest_lag && ( gametic % lowest_lag ))
|
|
||||||
{
|
|
||||||
cl_packetmissed = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
netbuffer->packettype = PT_CLIENTCMD;
|
netbuffer->packettype = PT_CLIENTCMD;
|
||||||
|
|
||||||
if (cl_packetmissed)
|
if (cl_packetmissed)
|
||||||
|
|
@ -4960,27 +4960,35 @@ static void CL_SendClientCmd(void)
|
||||||
}
|
}
|
||||||
else if (gamestate != GS_NULL && (addedtogame || dedicated))
|
else if (gamestate != GS_NULL && (addedtogame || dedicated))
|
||||||
{
|
{
|
||||||
|
UINT8 lagDelay = 0;
|
||||||
|
|
||||||
|
if (lowest_lag > 0)
|
||||||
|
{
|
||||||
|
// Gentlemens' ping.
|
||||||
|
lagDelay = min(lowest_lag, MAXGENTLEMENDELAY);
|
||||||
|
}
|
||||||
|
|
||||||
packetsize = sizeof (clientcmd_pak);
|
packetsize = sizeof (clientcmd_pak);
|
||||||
G_MoveTiccmd(&netbuffer->u.clientpak.cmd, &localcmds[0], 1);
|
G_MoveTiccmd(&netbuffer->u.clientpak.cmd, &localcmds[0][lagDelay], 1);
|
||||||
netbuffer->u.clientpak.consistancy = SHORT(consistancy[gametic%TICQUEUE]);
|
netbuffer->u.clientpak.consistancy = SHORT(consistancy[gametic % TICQUEUE]);
|
||||||
|
|
||||||
if (splitscreen) // Send a special packet with 2 cmd for splitscreen
|
if (splitscreen) // Send a special packet with 2 cmd for splitscreen
|
||||||
{
|
{
|
||||||
netbuffer->packettype = (mis ? PT_CLIENT2MIS : PT_CLIENT2CMD);
|
netbuffer->packettype = (mis ? PT_CLIENT2MIS : PT_CLIENT2CMD);
|
||||||
packetsize = sizeof (client2cmd_pak);
|
packetsize = sizeof (client2cmd_pak);
|
||||||
G_MoveTiccmd(&netbuffer->u.client2pak.cmd2, &localcmds[1], 1);
|
G_MoveTiccmd(&netbuffer->u.client2pak.cmd2, &localcmds[1][lagDelay], 1);
|
||||||
|
|
||||||
if (splitscreen > 1)
|
if (splitscreen > 1)
|
||||||
{
|
{
|
||||||
netbuffer->packettype = (mis ? PT_CLIENT3MIS : PT_CLIENT3CMD);
|
netbuffer->packettype = (mis ? PT_CLIENT3MIS : PT_CLIENT3CMD);
|
||||||
packetsize = sizeof (client3cmd_pak);
|
packetsize = sizeof (client3cmd_pak);
|
||||||
G_MoveTiccmd(&netbuffer->u.client3pak.cmd3, &localcmds[2], 1);
|
G_MoveTiccmd(&netbuffer->u.client3pak.cmd3, &localcmds[2][lagDelay], 1);
|
||||||
|
|
||||||
if (splitscreen > 2)
|
if (splitscreen > 2)
|
||||||
{
|
{
|
||||||
netbuffer->packettype = (mis ? PT_CLIENT4MIS : PT_CLIENT4CMD);
|
netbuffer->packettype = (mis ? PT_CLIENT4MIS : PT_CLIENT4CMD);
|
||||||
packetsize = sizeof (client4cmd_pak);
|
packetsize = sizeof (client4cmd_pak);
|
||||||
G_MoveTiccmd(&netbuffer->u.client4pak.cmd4, &localcmds[3], 1);
|
G_MoveTiccmd(&netbuffer->u.client4pak.cmd4, &localcmds[3][lagDelay], 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5143,8 +5151,23 @@ static void SV_SendTics(void)
|
||||||
//
|
//
|
||||||
// TryRunTics
|
// TryRunTics
|
||||||
//
|
//
|
||||||
|
static void CreateNewLocalCMD(UINT8 p, INT32 realtics)
|
||||||
|
{
|
||||||
|
INT32 i;
|
||||||
|
|
||||||
|
for (i = MAXGENTLEMENDELAY-1; i > 0; i--)
|
||||||
|
{
|
||||||
|
G_MoveTiccmd(&localcmds[p][i], &localcmds[p][i-1], 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
G_BuildTiccmd(&localcmds[p][0], realtics, p+1);
|
||||||
|
localcmds[p][0].flags |= TICCMD_RECEIVED;
|
||||||
|
}
|
||||||
|
|
||||||
static void Local_Maketic(INT32 realtics)
|
static void Local_Maketic(INT32 realtics)
|
||||||
{
|
{
|
||||||
|
INT32 i;
|
||||||
|
|
||||||
I_OsPolling(); // I_Getevent
|
I_OsPolling(); // I_Getevent
|
||||||
D_ProcessEvents(); // menu responder, cons responder,
|
D_ProcessEvents(); // menu responder, cons responder,
|
||||||
// game responder calls HU_Responder, AM_Responder,
|
// game responder calls HU_Responder, AM_Responder,
|
||||||
|
|
@ -5153,25 +5176,9 @@ static void Local_Maketic(INT32 realtics)
|
||||||
if (!dedicated) rendergametic = gametic;
|
if (!dedicated) rendergametic = gametic;
|
||||||
|
|
||||||
// translate inputs (keyboard/mouse/joystick) into game controls
|
// translate inputs (keyboard/mouse/joystick) into game controls
|
||||||
G_BuildTiccmd(&localcmds[0], realtics, 1);
|
for (i = 0; i <= splitscreen; i++)
|
||||||
localcmds[0].flags |= TICCMD_RECEIVED;
|
|
||||||
|
|
||||||
if (splitscreen)
|
|
||||||
{
|
{
|
||||||
G_BuildTiccmd(&localcmds[1], realtics, 2);
|
CreateNewLocalCMD(i, realtics);
|
||||||
localcmds[1].flags |= TICCMD_RECEIVED;
|
|
||||||
|
|
||||||
if (splitscreen > 1)
|
|
||||||
{
|
|
||||||
G_BuildTiccmd(&localcmds[2], realtics, 3);
|
|
||||||
localcmds[2].flags |= TICCMD_RECEIVED;
|
|
||||||
|
|
||||||
if (splitscreen > 2)
|
|
||||||
{
|
|
||||||
G_BuildTiccmd(&localcmds[3], realtics, 4);
|
|
||||||
localcmds[3].flags |= TICCMD_RECEIVED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,15 @@ applications may follow different packet versions.
|
||||||
// Networking and tick handling related.
|
// Networking and tick handling related.
|
||||||
#define TICQUEUE 512 // more than enough for most timeouts....
|
#define TICQUEUE 512 // more than enough for most timeouts....
|
||||||
#define MAXTEXTCMD 256
|
#define MAXTEXTCMD 256
|
||||||
|
|
||||||
|
// No. of tics your controls can be delayed by.
|
||||||
|
|
||||||
|
// TODO: Instead of storing a ton of extra cmds for gentlemens' delay,
|
||||||
|
// keep them in a linked-list, with timestamps to discard everything that's older than already sent.
|
||||||
|
// That will support any amount of lag, and be less wasteful for clients who don't use it.
|
||||||
|
// This just works as a quick implementation.
|
||||||
|
#define MAXGENTLEMENDELAY TICRATE
|
||||||
|
|
||||||
//
|
//
|
||||||
// Packet structure
|
// Packet structure
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -768,15 +768,21 @@ void D_RegisterClientCommands(void)
|
||||||
|
|
||||||
for (i = 0; i < MAXSKINCOLORS; i++)
|
for (i = 0; i < MAXSKINCOLORS; i++)
|
||||||
{
|
{
|
||||||
Color_cons_t[i].value = Followercolor_cons_t[i].value = i;
|
Color_cons_t[i].value = i;
|
||||||
Color_cons_t[i].strvalue = Followercolor_cons_t[i].strvalue = skincolors[i].name;
|
Color_cons_t[i].strvalue = skincolors[i].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
Followercolor_cons_t[MAXSKINCOLORS].value = MAXSKINCOLORS;
|
for (i = 2; i < MAXSKINCOLORS; i++)
|
||||||
Followercolor_cons_t[MAXSKINCOLORS].strvalue = "Match"; // Add "Match" option, which will make the follower color match the player's
|
{
|
||||||
|
Followercolor_cons_t[i].value = i-2;
|
||||||
|
Followercolor_cons_t[i].strvalue = skincolors[i-2].name;
|
||||||
|
}
|
||||||
|
|
||||||
Followercolor_cons_t[MAXSKINCOLORS+1].value = MAXSKINCOLORS+1;
|
Followercolor_cons_t[1].value = -1;
|
||||||
Followercolor_cons_t[MAXSKINCOLORS+1].strvalue = "Opposite"; // Add "Opposite" option, ...which is like "Match", but for coloropposite.
|
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].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;
|
||||||
Color_cons_t[MAXSKINCOLORS].strvalue = Followercolor_cons_t[MAXSKINCOLORS+2].strvalue = NULL;
|
Color_cons_t[MAXSKINCOLORS].strvalue = Followercolor_cons_t[MAXSKINCOLORS+2].strvalue = NULL;
|
||||||
|
|
@ -1398,7 +1404,9 @@ static void SendNameAndColor(UINT8 n)
|
||||||
|
|
||||||
if (!strcmp(cv_playername[n].string, player_names[playernum])
|
if (!strcmp(cv_playername[n].string, player_names[playernum])
|
||||||
&& cv_playercolor[n].value == player->skincolor
|
&& cv_playercolor[n].value == player->skincolor
|
||||||
&& !strcmp(cv_skin[n].string, skins[player->skin].name))
|
&& !strcmp(cv_skin[n].string, skins[player->skin].name)
|
||||||
|
&& cv_follower[n].value == player->followerskin
|
||||||
|
&& cv_followercolor[n].value == player->followercolor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
player->availabilities = R_GetSkinAvailabilities();
|
player->availabilities = R_GetSkinAvailabilities();
|
||||||
|
|
|
||||||
|
|
@ -209,7 +209,7 @@ typedef enum
|
||||||
{
|
{
|
||||||
// Unsynced, HUD or clientsided effects
|
// Unsynced, HUD or clientsided effects
|
||||||
// Item box
|
// Item box
|
||||||
khud_itemblink, // Item flashing after roulette, prevents Hyudoro stealing AND serves as a mashing indicator
|
khud_itemblink, // Item flashing after roulette, serves as a mashing indicator
|
||||||
khud_itemblinkmode, // Type of flashing: 0 = white (normal), 1 = red (mashing), 2 = rainbow (enhanced items)
|
khud_itemblinkmode, // Type of flashing: 0 = white (normal), 1 = red (mashing), 2 = rainbow (enhanced items)
|
||||||
|
|
||||||
// Rings
|
// Rings
|
||||||
|
|
|
||||||
|
|
@ -334,7 +334,6 @@ actionpointer_t actionpointers[] =
|
||||||
{{A_ReaperThinker}, "A_REAPERTHINKER"},
|
{{A_ReaperThinker}, "A_REAPERTHINKER"},
|
||||||
{{A_FlameShieldPaper}, "A_FLAMESHIELDPAPER"},
|
{{A_FlameShieldPaper}, "A_FLAMESHIELDPAPER"},
|
||||||
{{A_InvincSparkleRotate}, "A_INVINCSPARKLEROTATE"},
|
{{A_InvincSparkleRotate}, "A_INVINCSPARKLEROTATE"},
|
||||||
{{A_SpawnItemCapsuleParts}, "A_SPAWNITEMCAPSULEPARTS"},
|
|
||||||
|
|
||||||
{{NULL}, "NONE"},
|
{{NULL}, "NONE"},
|
||||||
|
|
||||||
|
|
@ -3490,9 +3489,9 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
|
||||||
"S_ITEMCAPSULE_TOP_SIDE",
|
"S_ITEMCAPSULE_TOP_SIDE",
|
||||||
"S_ITEMCAPSULE_BOTTOM_SIDE_AIR",
|
"S_ITEMCAPSULE_BOTTOM_SIDE_AIR",
|
||||||
"S_ITEMCAPSULE_BOTTOM_SIDE_GROUND",
|
"S_ITEMCAPSULE_BOTTOM_SIDE_GROUND",
|
||||||
"S_ITEMCAPSULE_TOP",
|
//"S_ITEMCAPSULE_TOP",
|
||||||
"S_ITEMCAPSULE_BOTTOM",
|
//"S_ITEMCAPSULE_BOTTOM",
|
||||||
"S_ITEMCAPSULE_INSIDE",
|
//"S_ITEMCAPSULE_INSIDE",
|
||||||
|
|
||||||
// Signpost sparkles
|
// Signpost sparkles
|
||||||
"S_SIGNSPARK1",
|
"S_SIGNSPARK1",
|
||||||
|
|
|
||||||
13
src/f_wipe.c
13
src/f_wipe.c
|
|
@ -299,16 +299,23 @@ static void F_DoWipe(fademask_t *fademask, lighttable_t *fadecolormap, boolean r
|
||||||
e = e_base + relativepos;
|
e = e_base + relativepos;
|
||||||
draw_rowstogo = draw_rowend - draw_rowstart;
|
draw_rowstogo = draw_rowend - draw_rowstart;
|
||||||
|
|
||||||
while (draw_rowstogo--)
|
if (fadecolormap)
|
||||||
{
|
{
|
||||||
if (fadecolormap != NULL)
|
if (reverse)
|
||||||
|
s = e;
|
||||||
|
while (draw_rowstogo--)
|
||||||
|
*w++ = fadecolormap[ ( m << 8 ) + *s++ ];
|
||||||
|
}
|
||||||
|
else while (draw_rowstogo--)
|
||||||
|
{
|
||||||
|
/*if (fadecolormap != NULL)
|
||||||
{
|
{
|
||||||
if (reverse)
|
if (reverse)
|
||||||
*w++ = fadecolormap[ ( m << 8 ) + *e++ ];
|
*w++ = fadecolormap[ ( m << 8 ) + *e++ ];
|
||||||
else
|
else
|
||||||
*w++ = fadecolormap[ ( m << 8 ) + *s++ ];
|
*w++ = fadecolormap[ ( m << 8 ) + *s++ ];
|
||||||
}
|
}
|
||||||
else
|
else*/
|
||||||
*w++ = transtbl[ ( *e++ << 8 ) + *s++ ];
|
*w++ = transtbl[ ( *e++ << 8 ) + *s++ ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
48
src/g_demo.c
48
src/g_demo.c
|
|
@ -112,6 +112,10 @@ demoghost *ghosts = NULL;
|
||||||
#define DF_BREAKTHECAPSULES 0x04 // This demo is from Break the Capsules and contains its final completion time!
|
#define DF_BREAKTHECAPSULES 0x04 // This demo is from Break the Capsules and contains its final completion time!
|
||||||
#define DF_ATTACKMASK 0x06 // This demo is from ??? attack and contains ???
|
#define DF_ATTACKMASK 0x06 // This demo is from ??? attack and contains ???
|
||||||
|
|
||||||
|
// 0x08 free
|
||||||
|
|
||||||
|
#define DF_NONETMP 0x10 // multiplayer but not netgame
|
||||||
|
|
||||||
#define DF_LUAVARS 0x20 // this demo contains extra lua vars
|
#define DF_LUAVARS 0x20 // this demo contains extra lua vars
|
||||||
|
|
||||||
#define DF_ATTACKSHIFT 1
|
#define DF_ATTACKSHIFT 1
|
||||||
|
|
@ -304,11 +308,12 @@ void G_ReadDemoExtraData(void)
|
||||||
}
|
}
|
||||||
if (extradata & DXD_PLAYSTATE)
|
if (extradata & DXD_PLAYSTATE)
|
||||||
{
|
{
|
||||||
extradata = READUINT8(demo_p);
|
i = READUINT8(demo_p);
|
||||||
|
|
||||||
switch (extradata) {
|
switch (i) {
|
||||||
case DXD_PST_PLAYING:
|
case DXD_PST_PLAYING:
|
||||||
players[p].pflags |= PF_WANTSTOJOIN; // fuck you
|
players[p].pflags |= PF_WANTSTOJOIN; // fuck you
|
||||||
|
//CONS_Printf("player %s is despectating on tic %d\n", player_names[p], leveltime);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DXD_PST_SPECTATING:
|
case DXD_PST_SPECTATING:
|
||||||
|
|
@ -319,9 +324,11 @@ void G_ReadDemoExtraData(void)
|
||||||
playeringame[p] = true;
|
playeringame[p] = true;
|
||||||
G_AddPlayer(p);
|
G_AddPlayer(p);
|
||||||
players[p].spectator = true;
|
players[p].spectator = true;
|
||||||
|
//CONS_Printf("player %s is joining server on tic %d\n", player_names[p], leveltime);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
//CONS_Printf("player %s is spectating on tic %d\n", player_names[p], leveltime);
|
||||||
players[p].spectator = true;
|
players[p].spectator = true;
|
||||||
if (players[p].mo)
|
if (players[p].mo)
|
||||||
P_DamageMobj(players[p].mo, NULL, NULL, 1, DMG_INSTAKILL);
|
P_DamageMobj(players[p].mo, NULL, NULL, 1, DMG_INSTAKILL);
|
||||||
|
|
@ -343,11 +350,11 @@ void G_ReadDemoExtraData(void)
|
||||||
}
|
}
|
||||||
if (extradata & DXD_WEAPONPREF)
|
if (extradata & DXD_WEAPONPREF)
|
||||||
{
|
{
|
||||||
extradata = READUINT8(demo_p);
|
i = READUINT8(demo_p);
|
||||||
players[p].pflags &= ~(PF_KICKSTARTACCEL);
|
players[p].pflags &= ~(PF_KICKSTARTACCEL);
|
||||||
if (extradata & 1)
|
if (i & 1)
|
||||||
players[p].pflags |= PF_KICKSTARTACCEL;
|
players[p].pflags |= PF_KICKSTARTACCEL;
|
||||||
//CONS_Printf("weaponpref is %d for player %d\n", extradata, p);
|
//CONS_Printf("weaponpref is %d for player %d\n", i, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
p = READUINT8(demo_p);
|
p = READUINT8(demo_p);
|
||||||
|
|
@ -366,7 +373,7 @@ void G_ReadDemoExtraData(void)
|
||||||
P_SetRandSeed(rng);
|
P_SetRandSeed(rng);
|
||||||
|
|
||||||
if (demosynced)
|
if (demosynced)
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced!\n"));
|
CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced (RNG)!\n"));
|
||||||
demosynced = false;
|
demosynced = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -493,6 +500,7 @@ void G_ReadDemoTiccmd(ticcmd_t *cmd, INT32 playernum)
|
||||||
|
|
||||||
if (!demo_p || !demo.deferstart)
|
if (!demo_p || !demo.deferstart)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ziptic = READUINT8(demo_p);
|
ziptic = READUINT8(demo_p);
|
||||||
|
|
||||||
if (ziptic & ZT_FWD)
|
if (ziptic & ZT_FWD)
|
||||||
|
|
@ -530,7 +538,7 @@ void G_WriteDemoTiccmd(ticcmd_t *cmd, INT32 playernum)
|
||||||
|
|
||||||
if (cmd->forwardmove != oldcmd[playernum].forwardmove)
|
if (cmd->forwardmove != oldcmd[playernum].forwardmove)
|
||||||
{
|
{
|
||||||
WRITEUINT8(demo_p,cmd->forwardmove);
|
WRITESINT8(demo_p,cmd->forwardmove);
|
||||||
oldcmd[playernum].forwardmove = cmd->forwardmove;
|
oldcmd[playernum].forwardmove = cmd->forwardmove;
|
||||||
ziptic |= ZT_FWD;
|
ziptic |= ZT_FWD;
|
||||||
}
|
}
|
||||||
|
|
@ -863,7 +871,12 @@ void G_WriteGhostTic(mobj_t *ghost, INT32 playernum)
|
||||||
|
|
||||||
void G_ConsAllGhostTics(void)
|
void G_ConsAllGhostTics(void)
|
||||||
{
|
{
|
||||||
UINT8 p = READUINT8(demo_p);
|
UINT8 p;
|
||||||
|
|
||||||
|
if (!demo_p || !demo.deferstart)
|
||||||
|
return;
|
||||||
|
|
||||||
|
p = READUINT8(demo_p);
|
||||||
|
|
||||||
while (p != 0xFF)
|
while (p != 0xFF)
|
||||||
{
|
{
|
||||||
|
|
@ -888,8 +901,6 @@ void G_ConsGhostTic(INT32 playernum)
|
||||||
mobj_t *testmo;
|
mobj_t *testmo;
|
||||||
UINT32 syncleeway;
|
UINT32 syncleeway;
|
||||||
|
|
||||||
if (!demo_p || !demo.deferstart)
|
|
||||||
return;
|
|
||||||
if (!(demoflags & DF_GHOST))
|
if (!(demoflags & DF_GHOST))
|
||||||
return; // No ghost data to use.
|
return; // No ghost data to use.
|
||||||
|
|
||||||
|
|
@ -966,7 +977,7 @@ void G_ConsGhostTic(INT32 playernum)
|
||||||
if (th != &thlist[THINK_MOBJ] && mobj->health != health) // Wasn't damaged?! This is desync! Fix it!
|
if (th != &thlist[THINK_MOBJ] && mobj->health != health) // Wasn't damaged?! This is desync! Fix it!
|
||||||
{
|
{
|
||||||
if (demosynced)
|
if (demosynced)
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced!\n"));
|
CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced (health)!\n"));
|
||||||
demosynced = false;
|
demosynced = false;
|
||||||
P_DamageMobj(mobj, players[0].mo, players[0].mo, 1, DMG_NORMAL);
|
P_DamageMobj(mobj, players[0].mo, players[0].mo, 1, DMG_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
@ -1019,7 +1030,7 @@ void G_ConsGhostTic(INT32 playernum)
|
||||||
if (ghostext[playernum].desyncframes >= 2)
|
if (ghostext[playernum].desyncframes >= 2)
|
||||||
{
|
{
|
||||||
if (demosynced)
|
if (demosynced)
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced!\n"));
|
CONS_Alert(CONS_WARNING, "Demo playback has desynced (player %s)!\n", player_names[playernum]);
|
||||||
demosynced = false;
|
demosynced = false;
|
||||||
|
|
||||||
P_UnsetThingPosition(testmo);
|
P_UnsetThingPosition(testmo);
|
||||||
|
|
@ -1042,7 +1053,7 @@ void G_ConsGhostTic(INT32 playernum)
|
||||||
|| players[playernum].bumpers != ghostext[playernum].kartbumpers)
|
|| players[playernum].bumpers != ghostext[playernum].kartbumpers)
|
||||||
{
|
{
|
||||||
if (demosynced)
|
if (demosynced)
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced!\n"));
|
CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced (item/bumpers)!\n"));
|
||||||
demosynced = false;
|
demosynced = false;
|
||||||
|
|
||||||
players[playernum].itemtype = ghostext[playernum].kartitem;
|
players[playernum].itemtype = ghostext[playernum].kartitem;
|
||||||
|
|
@ -1921,6 +1932,9 @@ void G_BeginRecording(void)
|
||||||
demo_p = demobuffer;
|
demo_p = demobuffer;
|
||||||
demoflags = DF_GHOST|(multiplayer ? DF_MULTIPLAYER : (modeattacking<<DF_ATTACKSHIFT));
|
demoflags = DF_GHOST|(multiplayer ? DF_MULTIPLAYER : (modeattacking<<DF_ATTACKSHIFT));
|
||||||
|
|
||||||
|
if (multiplayer && !netgame)
|
||||||
|
demoflags |= DF_NONETMP;
|
||||||
|
|
||||||
if (encoremode)
|
if (encoremode)
|
||||||
demoflags |= DF_ENCORE;
|
demoflags |= DF_ENCORE;
|
||||||
|
|
||||||
|
|
@ -2838,6 +2852,7 @@ void G_DoPlayDemo(char *defdemoname)
|
||||||
|
|
||||||
modeattacking = (demoflags & DF_ATTACKMASK)>>DF_ATTACKSHIFT;
|
modeattacking = (demoflags & DF_ATTACKMASK)>>DF_ATTACKSHIFT;
|
||||||
multiplayer = !!(demoflags & DF_MULTIPLAYER);
|
multiplayer = !!(demoflags & DF_MULTIPLAYER);
|
||||||
|
demo.netgame = (multiplayer && !(demoflags & DF_NONETMP));
|
||||||
CON_ToggleOff();
|
CON_ToggleOff();
|
||||||
|
|
||||||
hu_demotime = UINT32_MAX;
|
hu_demotime = UINT32_MAX;
|
||||||
|
|
@ -2927,7 +2942,7 @@ void G_DoPlayDemo(char *defdemoname)
|
||||||
|
|
||||||
while (p != 0xFF)
|
while (p != 0xFF)
|
||||||
{
|
{
|
||||||
if ((spectator = (p & DEMO_SPECTATOR)))
|
if ((spectator = !!(p & DEMO_SPECTATOR)))
|
||||||
{
|
{
|
||||||
p &= ~DEMO_SPECTATOR;
|
p &= ~DEMO_SPECTATOR;
|
||||||
|
|
||||||
|
|
@ -2975,6 +2990,11 @@ void G_DoPlayDemo(char *defdemoname)
|
||||||
M_Memcpy(player_names[p],demo_p,16);
|
M_Memcpy(player_names[p],demo_p,16);
|
||||||
demo_p += 16;
|
demo_p += 16;
|
||||||
|
|
||||||
|
/*if (players[p].spectator)
|
||||||
|
{
|
||||||
|
CONS_Printf("player %s is spectator at start\n", player_names[p]);
|
||||||
|
}*/
|
||||||
|
|
||||||
// Skin
|
// Skin
|
||||||
M_Memcpy(skin,demo_p,16);
|
M_Memcpy(skin,demo_p,16);
|
||||||
demo_p += 16;
|
demo_p += 16;
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ struct demovars_s {
|
||||||
boolean inreplayhut; // Go back to replayhut after demos
|
boolean inreplayhut; // Go back to replayhut after demos
|
||||||
boolean quitafterplaying; // quit after playing a demo from cmdline
|
boolean quitafterplaying; // quit after playing a demo from cmdline
|
||||||
boolean deferstart; // don't start playing demo right away
|
boolean deferstart; // don't start playing demo right away
|
||||||
|
boolean netgame; // multiplayer netgame
|
||||||
|
|
||||||
tic_t savebutton; // Used to determine when the local player can choose to save the replay while the race is still going
|
tic_t savebutton; // Used to determine when the local player can choose to save the replay while the race is still going
|
||||||
enum {
|
enum {
|
||||||
|
|
|
||||||
|
|
@ -2560,7 +2560,7 @@ mapthing_t *G_FindRaceStart(INT32 playernum)
|
||||||
if (j == i)
|
if (j == i)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (netgame && cv_kartusepwrlv.value)
|
if ((netgame || (demo.playback && demo.netgame)) && cv_kartusepwrlv.value)
|
||||||
{
|
{
|
||||||
if (clientpowerlevels[j][PWRLV_RACE] == clientpowerlevels[i][PWRLV_RACE])
|
if (clientpowerlevels[j][PWRLV_RACE] == clientpowerlevels[i][PWRLV_RACE])
|
||||||
num++;
|
num++;
|
||||||
|
|
@ -2581,7 +2581,7 @@ mapthing_t *G_FindRaceStart(INT32 playernum)
|
||||||
pos++;
|
pos++;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (netgame && cv_kartusepwrlv.value)
|
if ((netgame || (demo.playback && demo.netgame)) && cv_kartusepwrlv.value)
|
||||||
{
|
{
|
||||||
if (clientpowerlevels[i][PWRLV_RACE] > clientpowerlevels[playernum][PWRLV_RACE])
|
if (clientpowerlevels[i][PWRLV_RACE] > clientpowerlevels[playernum][PWRLV_RACE])
|
||||||
pos++;
|
pos++;
|
||||||
|
|
@ -3121,7 +3121,7 @@ boolean G_GametypeHasTeams(void)
|
||||||
//
|
//
|
||||||
boolean G_GametypeHasSpectators(void)
|
boolean G_GametypeHasSpectators(void)
|
||||||
{
|
{
|
||||||
return (netgame || (multiplayer && demo.playback));
|
return (netgame || (multiplayer && demo.netgame));
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
||||||
10
src/info.c
10
src/info.c
|
|
@ -4068,13 +4068,13 @@ state_t states[NUMSTATES] =
|
||||||
|
|
||||||
{SPR_NULL, FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMICON
|
{SPR_NULL, FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMICON
|
||||||
|
|
||||||
{SPR_ICAP, FF_ADD|0, -1, {A_SpawnItemCapsuleParts}, 0, 0, S_NULL}, // S_ITEMCAPSULE
|
{SPR_ICAP, FF_ADD|0, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMCAPSULE
|
||||||
{SPR_ICAP, FF_PAPERSPRITE|1, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMCAPSULE_TOP_SIDE
|
{SPR_ICAP, FF_PAPERSPRITE|1, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMCAPSULE_TOP_SIDE
|
||||||
{SPR_ICAP, FF_VERTICALFLIP|FF_PAPERSPRITE|1, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMCAPSULE_BOTTOM_SIDE_AIR
|
{SPR_ICAP, FF_VERTICALFLIP|FF_PAPERSPRITE|1, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMCAPSULE_BOTTOM_SIDE_AIR
|
||||||
{SPR_ICAP, FF_PAPERSPRITE|2, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMCAPSULE_BOTTOM_SIDE_GROUND
|
{SPR_ICAP, FF_PAPERSPRITE|2, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMCAPSULE_BOTTOM_SIDE_GROUND
|
||||||
{SPR_ICAP, FF_FLOORSPRITE|3, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMCAPSULE_TOP
|
//{SPR_ICAP, FF_FLOORSPRITE|3, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMCAPSULE_TOP
|
||||||
{SPR_ICAP, FF_FLOORSPRITE|4, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMCAPSULE_BOTTOM
|
//{SPR_ICAP, FF_FLOORSPRITE|4, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMCAPSULE_BOTTOM
|
||||||
{SPR_ICAP, FF_FLOORSPRITE|5, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMCAPSULE_INSIDE
|
//{SPR_ICAP, FF_FLOORSPRITE|5, -1, {NULL}, 0, 0, S_NULL}, // S_ITEMCAPSULE_INSIDE
|
||||||
|
|
||||||
{SPR_SGNS, FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_SIGNSPARK2}, // S_SIGNSPARK1
|
{SPR_SGNS, FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_SIGNSPARK2}, // S_SIGNSPARK1
|
||||||
{SPR_SGNS, FF_FULLBRIGHT|1, 1, {NULL}, 0, 0, S_SIGNSPARK3}, // S_SIGNSPARK2
|
{SPR_SGNS, FF_FULLBRIGHT|1, 1, {NULL}, 0, 0, S_SIGNSPARK3}, // S_SIGNSPARK2
|
||||||
|
|
@ -23094,7 +23094,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
100, // mass
|
100, // mass
|
||||||
0, // damage
|
0, // damage
|
||||||
sfx_None, // activesound
|
sfx_None, // activesound
|
||||||
MF_SLIDEME|MF_SPECIAL|MF_RUNSPAWNFUNC|MF_DONTENCOREMAP, // flags
|
MF_SLIDEME|MF_SPECIAL|MF_DONTENCOREMAP, // flags
|
||||||
S_NULL // raisestate
|
S_NULL // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -287,7 +287,6 @@ enum actionnum
|
||||||
A_REAPERTHINKER,
|
A_REAPERTHINKER,
|
||||||
A_FLAMESHIELDPAPER,
|
A_FLAMESHIELDPAPER,
|
||||||
A_INVINCSPARKLEROTATE,
|
A_INVINCSPARKLEROTATE,
|
||||||
A_SPAWNITEMCAPSULEPARTS,
|
|
||||||
NUMACTIONS
|
NUMACTIONS
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -558,7 +557,6 @@ void A_ReaperThinker();
|
||||||
void A_MementosTPParticles();
|
void A_MementosTPParticles();
|
||||||
void A_FlameShieldPaper();
|
void A_FlameShieldPaper();
|
||||||
void A_InvincSparkleRotate();
|
void A_InvincSparkleRotate();
|
||||||
void A_SpawnItemCapsuleParts();
|
|
||||||
|
|
||||||
extern boolean actionsoverridden[NUMACTIONS];
|
extern boolean actionsoverridden[NUMACTIONS];
|
||||||
|
|
||||||
|
|
@ -4466,9 +4464,9 @@ typedef enum state
|
||||||
S_ITEMCAPSULE_TOP_SIDE,
|
S_ITEMCAPSULE_TOP_SIDE,
|
||||||
S_ITEMCAPSULE_BOTTOM_SIDE_AIR,
|
S_ITEMCAPSULE_BOTTOM_SIDE_AIR,
|
||||||
S_ITEMCAPSULE_BOTTOM_SIDE_GROUND,
|
S_ITEMCAPSULE_BOTTOM_SIDE_GROUND,
|
||||||
S_ITEMCAPSULE_TOP,
|
//S_ITEMCAPSULE_TOP,
|
||||||
S_ITEMCAPSULE_BOTTOM,
|
//S_ITEMCAPSULE_BOTTOM,
|
||||||
S_ITEMCAPSULE_INSIDE,
|
//S_ITEMCAPSULE_INSIDE,
|
||||||
|
|
||||||
// Signpost sparkles
|
// Signpost sparkles
|
||||||
S_SIGNSPARK1,
|
S_SIGNSPARK1,
|
||||||
|
|
|
||||||
69
src/k_kart.c
69
src/k_kart.c
|
|
@ -52,7 +52,7 @@ void K_TimerReset(void)
|
||||||
void K_TimerInit(void)
|
void K_TimerInit(void)
|
||||||
{
|
{
|
||||||
UINT8 i;
|
UINT8 i;
|
||||||
UINT8 numPlayers = 0;
|
UINT8 numPlayers = 0;//, numspec = 0;
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
|
|
@ -63,6 +63,7 @@ void K_TimerInit(void)
|
||||||
|
|
||||||
if (players[i].spectator == true)
|
if (players[i].spectator == true)
|
||||||
{
|
{
|
||||||
|
//numspec++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -98,6 +99,7 @@ void K_TimerInit(void)
|
||||||
|
|
||||||
// NOW you can try to spawn in the Battle capsules, if there's not enough players for a match
|
// NOW you can try to spawn in the Battle capsules, if there's not enough players for a match
|
||||||
K_SpawnBattleCapsules();
|
K_SpawnBattleCapsules();
|
||||||
|
//CONS_Printf("numbulbs set to %d (%d players, %d spectators) on tic %d\n", numbulbs, numPlayers, numspec, leveltime);
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT32 K_GetPlayerDontDrawFlag(player_t *player)
|
UINT32 K_GetPlayerDontDrawFlag(player_t *player)
|
||||||
|
|
@ -2077,6 +2079,18 @@ void K_SpawnInvincibilitySpeedLines(mobj_t *mo)
|
||||||
fast->destscale = 6*((mo->player->invincibilitytimer/TICRATE)*FRACUNIT)/8;
|
fast->destscale = 6*((mo->player->invincibilitytimer/TICRATE)*FRACUNIT)/8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void K_SpawnBumpEffect(mobj_t *mo)
|
||||||
|
{
|
||||||
|
mobj_t *fx = P_SpawnMobj(mo->x, mo->y, mo->z, MT_BUMP);
|
||||||
|
if (mo->eflags & MFE_VERTICALFLIP)
|
||||||
|
fx->eflags |= MFE_VERTICALFLIP;
|
||||||
|
else
|
||||||
|
fx->eflags &= ~MFE_VERTICALFLIP;
|
||||||
|
fx->scale = mo->scale;
|
||||||
|
|
||||||
|
S_StartSound(mo, sfx_s3k49);
|
||||||
|
}
|
||||||
|
|
||||||
static SINT8 K_GlanceAtPlayers(player_t *glancePlayer)
|
static SINT8 K_GlanceAtPlayers(player_t *glancePlayer)
|
||||||
{
|
{
|
||||||
const fixed_t maxdistance = FixedMul(1280 * mapobjectscale, K_GetKartGameSpeedScalar(gamespeed));
|
const fixed_t maxdistance = FixedMul(1280 * mapobjectscale, K_GetKartGameSpeedScalar(gamespeed));
|
||||||
|
|
@ -4508,6 +4522,42 @@ void K_DriftDustHandling(mobj_t *spawner)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void K_Squish(mobj_t *mo)
|
||||||
|
{
|
||||||
|
const fixed_t maxstretch = 4*FRACUNIT;
|
||||||
|
const fixed_t factor = 3 * mo->height / 2;
|
||||||
|
const fixed_t threshold = factor / 6;
|
||||||
|
|
||||||
|
const fixed_t old3dspeed = abs(mo->lastmomz);
|
||||||
|
const fixed_t new3dspeed = abs(mo->momz);
|
||||||
|
|
||||||
|
const fixed_t delta = abs(old3dspeed - new3dspeed);
|
||||||
|
|
||||||
|
if (delta > threshold)
|
||||||
|
{
|
||||||
|
mo->spritexscale =
|
||||||
|
FRACUNIT + FixedDiv(delta, factor);
|
||||||
|
|
||||||
|
if (mo->spritexscale > maxstretch)
|
||||||
|
mo->spritexscale = maxstretch;
|
||||||
|
|
||||||
|
if (abs(new3dspeed) > abs(old3dspeed))
|
||||||
|
{
|
||||||
|
mo->spritexscale =
|
||||||
|
FixedDiv(FRACUNIT, mo->spritexscale);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mo->spritexscale -=
|
||||||
|
(mo->spritexscale - FRACUNIT)
|
||||||
|
/ (mo->spritexscale < FRACUNIT ? 8 : 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
mo->spriteyscale =
|
||||||
|
FixedDiv(FRACUNIT, mo->spritexscale);
|
||||||
|
}
|
||||||
|
|
||||||
static mobj_t *K_FindLastTrailMobj(player_t *player)
|
static mobj_t *K_FindLastTrailMobj(player_t *player)
|
||||||
{
|
{
|
||||||
mobj_t *trail;
|
mobj_t *trail;
|
||||||
|
|
@ -4923,8 +4973,7 @@ static void K_DoHyudoroSteal(player_t *player)
|
||||||
// Has an item
|
// Has an item
|
||||||
&& (players[i].itemtype
|
&& (players[i].itemtype
|
||||||
&& players[i].itemamount
|
&& players[i].itemamount
|
||||||
&& !(players[i].pflags & PF_ITEMOUT)
|
&& !(players[i].pflags & PF_ITEMOUT))
|
||||||
&& !players[i].karthud[khud_itemblink]))
|
|
||||||
{
|
{
|
||||||
playerswappable[numplayers] = i;
|
playerswappable[numplayers] = i;
|
||||||
numplayers++;
|
numplayers++;
|
||||||
|
|
@ -6393,6 +6442,12 @@ void K_KartPlayerHUDUpdate(player_t *player)
|
||||||
else if (player->karthud[khud_fault] > 0 && player->karthud[khud_fault] < 2*TICRATE)
|
else if (player->karthud[khud_fault] > 0 && player->karthud[khud_fault] < 2*TICRATE)
|
||||||
player->karthud[khud_fault]++;
|
player->karthud[khud_fault]++;
|
||||||
|
|
||||||
|
if (player->karthud[khud_itemblink] && player->karthud[khud_itemblink]-- <= 0)
|
||||||
|
{
|
||||||
|
player->karthud[khud_itemblinkmode] = 0;
|
||||||
|
player->karthud[khud_itemblink] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (gametype == GT_RACE)
|
if (gametype == GT_RACE)
|
||||||
{
|
{
|
||||||
// 0 is the fast spin animation, set at 30 tics of ring boost or higher!
|
// 0 is the fast spin animation, set at 30 tics of ring boost or higher!
|
||||||
|
|
@ -6911,13 +6966,6 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
||||||
K_HandleTumbleBounce(player);
|
K_HandleTumbleBounce(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This doesn't go in HUD update because it has potential gameplay ramifications
|
|
||||||
if (player->karthud[khud_itemblink] && player->karthud[khud_itemblink]-- <= 0)
|
|
||||||
{
|
|
||||||
player->karthud[khud_itemblinkmode] = 0;
|
|
||||||
player->karthud[khud_itemblink] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
K_KartPlayerHUDUpdate(player);
|
K_KartPlayerHUDUpdate(player);
|
||||||
|
|
||||||
if (battleovertime.enabled && !(player->pflags & PF_ELIMINATED) && player->bumpers <= 0 && player->karmadelay <= 0)
|
if (battleovertime.enabled && !(player->pflags & PF_ELIMINATED) && player->bumpers <= 0 && player->karmadelay <= 0)
|
||||||
|
|
@ -9440,6 +9488,7 @@ void K_CheckSpectateStatus(void)
|
||||||
{
|
{
|
||||||
if (cv_ingamecap.value && numingame+i >= cv_ingamecap.value) // Hit the in-game player cap while adding people?
|
if (cv_ingamecap.value && numingame+i >= cv_ingamecap.value) // Hit the in-game player cap while adding people?
|
||||||
break;
|
break;
|
||||||
|
//CONS_Printf("player %s is joining on tic %d\n", player_names[respawnlist[i]], leveltime);
|
||||||
P_SpectatorJoinGame(&players[respawnlist[i]]);
|
P_SpectatorJoinGame(&players[respawnlist[i]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ void K_SpawnDriftBoostClip(player_t *player);
|
||||||
void K_SpawnDriftBoostClipSpark(mobj_t *clip);
|
void K_SpawnDriftBoostClipSpark(mobj_t *clip);
|
||||||
void K_SpawnNormalSpeedLines(player_t *player);
|
void K_SpawnNormalSpeedLines(player_t *player);
|
||||||
void K_SpawnInvincibilitySpeedLines(mobj_t *mo);
|
void K_SpawnInvincibilitySpeedLines(mobj_t *mo);
|
||||||
|
void K_SpawnBumpEffect(mobj_t *mo);
|
||||||
void K_KartMoveAnimation(player_t *player);
|
void K_KartMoveAnimation(player_t *player);
|
||||||
void K_KartPlayerHUDUpdate(player_t *player);
|
void K_KartPlayerHUDUpdate(player_t *player);
|
||||||
void K_KartPlayerThink(player_t *player, ticcmd_t *cmd);
|
void K_KartPlayerThink(player_t *player, ticcmd_t *cmd);
|
||||||
|
|
@ -76,6 +77,7 @@ void K_SpawnSparkleTrail(mobj_t *mo);
|
||||||
void K_SpawnWipeoutTrail(mobj_t *mo, boolean offroad);
|
void K_SpawnWipeoutTrail(mobj_t *mo, boolean offroad);
|
||||||
void K_SpawnDraftDust(mobj_t *mo);
|
void K_SpawnDraftDust(mobj_t *mo);
|
||||||
void K_DriftDustHandling(mobj_t *spawner);
|
void K_DriftDustHandling(mobj_t *spawner);
|
||||||
|
void K_Squish(mobj_t *mo);
|
||||||
mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t mapthing, INT32 defaultDir, INT32 altthrow);
|
mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t mapthing, INT32 defaultDir, INT32 altthrow);
|
||||||
void K_PuntMine(mobj_t *mine, mobj_t *punter);
|
void K_PuntMine(mobj_t *mine, mobj_t *punter);
|
||||||
void K_DoSneaker(player_t *player, INT32 type);
|
void K_DoSneaker(player_t *player, INT32 type);
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ SINT8 K_UsingPowerLevels(void)
|
||||||
{
|
{
|
||||||
SINT8 pt = PWRLV_DISABLED;
|
SINT8 pt = PWRLV_DISABLED;
|
||||||
|
|
||||||
if (!cv_kartusepwrlv.value || !netgame || grandprixinfo.gp == true)
|
if (!cv_kartusepwrlv.value || !(netgame || (demo.playback && demo.netgame)) || grandprixinfo.gp == true)
|
||||||
{
|
{
|
||||||
return PWRLV_DISABLED;
|
return PWRLV_DISABLED;
|
||||||
}
|
}
|
||||||
|
|
@ -346,7 +346,7 @@ void K_PlayerForfeit(UINT8 playernum, boolean pointloss)
|
||||||
|
|
||||||
clientpowerlevels[playernum][powertype] += inc;
|
clientpowerlevels[playernum][powertype] += inc;
|
||||||
|
|
||||||
if (playernum == consoleplayer)
|
if (!demo.playback && playernum == consoleplayer)
|
||||||
{
|
{
|
||||||
vspowerlevel[powertype] = clientpowerlevels[playernum][powertype];
|
vspowerlevel[powertype] = clientpowerlevels[playernum][powertype];
|
||||||
if (M_UpdateUnlockablesAndExtraEmblems())
|
if (M_UpdateUnlockablesAndExtraEmblems())
|
||||||
|
|
|
||||||
189
src/p_enemy.c
189
src/p_enemy.c
|
|
@ -321,7 +321,6 @@ void A_ReaperThinker(mobj_t *actor);
|
||||||
void A_MementosTPParticles(mobj_t *actor);
|
void A_MementosTPParticles(mobj_t *actor);
|
||||||
void A_FlameShieldPaper(mobj_t *actor);
|
void A_FlameShieldPaper(mobj_t *actor);
|
||||||
void A_InvincSparkleRotate(mobj_t *actor);
|
void A_InvincSparkleRotate(mobj_t *actor);
|
||||||
void A_SpawnItemCapsuleParts(mobj_t *actor);
|
|
||||||
|
|
||||||
//for p_enemy.c
|
//for p_enemy.c
|
||||||
|
|
||||||
|
|
@ -14652,191 +14651,3 @@ void A_InvincSparkleRotate(mobj_t *actor)
|
||||||
|
|
||||||
actor->angle += ANG1*10*(actor->extravalue2); // Arbitrary value, change this if you want, I suppose.
|
actor->angle += ANG1*10*(actor->extravalue2); // Arbitrary value, change this if you want, I suppose.
|
||||||
}
|
}
|
||||||
|
|
||||||
void P_RefreshItemCapsuleParts(mobj_t *mobj)
|
|
||||||
{
|
|
||||||
UINT8 numNumbers = 0;
|
|
||||||
INT32 count = 0;
|
|
||||||
INT32 itemType = mobj->threshold;
|
|
||||||
mobj_t *part;
|
|
||||||
skincolornum_t color;
|
|
||||||
UINT32 newRenderFlags = 0;
|
|
||||||
boolean colorized;
|
|
||||||
|
|
||||||
if (itemType < 1 || itemType >= NUMKARTITEMS)
|
|
||||||
itemType = KITEM_SAD;
|
|
||||||
|
|
||||||
// update invincibility properties
|
|
||||||
if (itemType == KITEM_INVINCIBILITY)
|
|
||||||
{
|
|
||||||
mobj->renderflags = (mobj->renderflags & ~RF_BRIGHTMASK) | RF_FULLBRIGHT;
|
|
||||||
mobj->colorized = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mobj->renderflags = (mobj->renderflags & ~RF_BRIGHTMASK) | RF_SEMIBRIGHT;
|
|
||||||
mobj->color = SKINCOLOR_NONE;
|
|
||||||
mobj->colorized = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// update cap colors
|
|
||||||
if (itemType == KITEM_SUPERRING)
|
|
||||||
{
|
|
||||||
color = SKINCOLOR_GOLD;
|
|
||||||
newRenderFlags |= RF_SEMIBRIGHT;
|
|
||||||
}
|
|
||||||
else if (mobj->spawnpoint && (mobj->spawnpoint->options & MTF_EXTRA))
|
|
||||||
color = SKINCOLOR_SAPPHIRE;
|
|
||||||
else if (itemType == KITEM_SPB)
|
|
||||||
color = SKINCOLOR_JET;
|
|
||||||
else
|
|
||||||
color = SKINCOLOR_NONE;
|
|
||||||
|
|
||||||
colorized = (color != SKINCOLOR_NONE);
|
|
||||||
part = mobj;
|
|
||||||
while (!P_MobjWasRemoved(part->hnext))
|
|
||||||
{
|
|
||||||
part = part->hnext;
|
|
||||||
part->color = color;
|
|
||||||
part->colorized = colorized;
|
|
||||||
part->renderflags = (part->renderflags & ~RF_BRIGHTMASK) | newRenderFlags;
|
|
||||||
}
|
|
||||||
|
|
||||||
// update inside item frame
|
|
||||||
part = mobj->tracer;
|
|
||||||
if (P_MobjWasRemoved(part))
|
|
||||||
return;
|
|
||||||
|
|
||||||
part->threshold = mobj->threshold;
|
|
||||||
part->movecount = mobj->movecount;
|
|
||||||
|
|
||||||
switch (itemType)
|
|
||||||
{
|
|
||||||
case KITEM_ORBINAUT:
|
|
||||||
part->sprite = SPR_ITMO;
|
|
||||||
part->frame = FF_FULLBRIGHT|FF_PAPERSPRITE|K_GetOrbinautItemFrame(mobj->movecount);
|
|
||||||
break;
|
|
||||||
case KITEM_INVINCIBILITY:
|
|
||||||
part->sprite = SPR_ITMI;
|
|
||||||
part->frame = FF_FULLBRIGHT|FF_PAPERSPRITE|K_GetInvincibilityItemFrame();
|
|
||||||
break;
|
|
||||||
case KITEM_SAD:
|
|
||||||
part->sprite = SPR_ITEM;
|
|
||||||
part->frame = FF_FULLBRIGHT|FF_PAPERSPRITE;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
part->sprite = SPR_ITEM;
|
|
||||||
part->frame = FF_FULLBRIGHT|FF_PAPERSPRITE|(itemType);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// update number frame
|
|
||||||
if (K_GetShieldFromItem(itemType) != KSHIELD_NONE) // shields don't stack, so don't show a number
|
|
||||||
;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
switch (itemType)
|
|
||||||
{
|
|
||||||
case KITEM_ORBINAUT: // only display the number when the sprite no longer changes
|
|
||||||
if (mobj->movecount - 1 > K_GetOrbinautItemFrame(mobj->movecount))
|
|
||||||
count = mobj->movecount;
|
|
||||||
break;
|
|
||||||
case KITEM_SUPERRING: // always display the number, and multiply it by 5
|
|
||||||
count = mobj->movecount * 5;
|
|
||||||
break;
|
|
||||||
case KITEM_SAD: // never display the number
|
|
||||||
case KITEM_SPB:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (mobj->movecount > 1)
|
|
||||||
count = mobj->movecount;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
while (count > 0)
|
|
||||||
{
|
|
||||||
if (P_MobjWasRemoved(part->tracer))
|
|
||||||
{
|
|
||||||
P_SetTarget(&part->tracer, P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_OVERLAY));
|
|
||||||
P_SetTarget(&part->tracer->target, part);
|
|
||||||
P_SetMobjState(part->tracer, S_INVISIBLE);
|
|
||||||
part->tracer->spriteyoffset = 10*FRACUNIT;
|
|
||||||
part->tracer->spritexoffset = 13*numNumbers*FRACUNIT;
|
|
||||||
}
|
|
||||||
part = part->tracer;
|
|
||||||
part->sprite = SPR_ITMN;
|
|
||||||
part->frame = FF_FULLBRIGHT|(count % 10);
|
|
||||||
count /= 10;
|
|
||||||
numNumbers++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// delete any extra overlays (I guess in case the number changes?)
|
|
||||||
if (part->tracer)
|
|
||||||
{
|
|
||||||
P_RemoveMobj(part->tracer);
|
|
||||||
P_SetTarget(&part->tracer, NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#define CAPSULESIDES 5
|
|
||||||
#define ANG_CAPSULE (UINT32_MAX / CAPSULESIDES)
|
|
||||||
#define ROTATIONSPEED (2*ANG2)
|
|
||||||
void A_SpawnItemCapsuleParts(mobj_t *actor)
|
|
||||||
{
|
|
||||||
UINT8 i;
|
|
||||||
mobj_t *part;
|
|
||||||
fixed_t buttScale = 0;
|
|
||||||
statenum_t buttState = S_ITEMCAPSULE_BOTTOM_SIDE_AIR;
|
|
||||||
angle_t spin = ANGLE_MAX - ROTATIONSPEED;
|
|
||||||
|
|
||||||
if (LUA_CallAction(A_SPAWNITEMCAPSULEPARTS, actor))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (P_IsObjectOnGround(actor))
|
|
||||||
{
|
|
||||||
buttScale = 13*FRACUNIT/10;
|
|
||||||
buttState = S_ITEMCAPSULE_BOTTOM_SIDE_GROUND;
|
|
||||||
spin = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// inside item
|
|
||||||
part = P_SpawnMobjFromMobj(actor, 0, 0, 0, MT_ITEMCAPSULE_PART);
|
|
||||||
P_SetTarget(&part->target, actor);
|
|
||||||
P_SetMobjState(part, S_ITEMICON);
|
|
||||||
part->movedir = ROTATIONSPEED; // rotation speed
|
|
||||||
part->extravalue1 = 175*FRACUNIT/100; // relative scale
|
|
||||||
part->flags2 |= MF2_CLASSICPUSH; // classicpush = centered horizontally
|
|
||||||
P_SetTarget(&actor->tracer, part); // pointer to this item, so we can modify its sprite/frame
|
|
||||||
|
|
||||||
// capsule caps
|
|
||||||
part = actor;
|
|
||||||
for (i = 0; i < CAPSULESIDES; i++)
|
|
||||||
{
|
|
||||||
// a bottom side
|
|
||||||
P_SetTarget(&part->hnext, P_SpawnMobjFromMobj(actor, 0, 0, 0, MT_ITEMCAPSULE_PART));
|
|
||||||
P_SetTarget(&part->hnext->hprev, part);
|
|
||||||
part = part->hnext;
|
|
||||||
P_SetTarget(&part->target, actor);
|
|
||||||
P_SetMobjState(part, buttState);
|
|
||||||
part->angle = i * ANG_CAPSULE;
|
|
||||||
part->movedir = spin; // rotation speed
|
|
||||||
part->movefactor = 0; // z offset
|
|
||||||
part->extravalue1 = buttScale; // relative scale
|
|
||||||
|
|
||||||
// a top side
|
|
||||||
P_SetTarget(&part->hnext, P_SpawnMobjFromMobj(actor, 0, 0, 0, MT_ITEMCAPSULE_PART));
|
|
||||||
P_SetTarget(&part->hnext->hprev, part);
|
|
||||||
part = part->hnext;
|
|
||||||
P_SetTarget(&part->target, actor);
|
|
||||||
P_SetMobjState(part, S_ITEMCAPSULE_TOP_SIDE);
|
|
||||||
part->angle = i * ANG_CAPSULE;
|
|
||||||
part->movedir = spin; // rotation speed
|
|
||||||
part->movefactor = actor->info->height - part->info->height; // z offset
|
|
||||||
}
|
|
||||||
|
|
||||||
P_RefreshItemCapsuleParts(actor);
|
|
||||||
}
|
|
||||||
#undef CAPSULESIDES
|
|
||||||
#undef ANG_CAPSULE
|
|
||||||
#undef ROTATIONSPEED
|
|
||||||
|
|
|
||||||
|
|
@ -365,8 +365,6 @@ void P_InternalFlickyBubble(mobj_t *actor);
|
||||||
void P_InternalFlickyFly(mobj_t *actor, fixed_t flyspeed, fixed_t targetdist, fixed_t chasez);
|
void P_InternalFlickyFly(mobj_t *actor, fixed_t flyspeed, fixed_t targetdist, fixed_t chasez);
|
||||||
void P_InternalFlickyHop(mobj_t *actor, fixed_t momz, fixed_t momh, angle_t angle);
|
void P_InternalFlickyHop(mobj_t *actor, fixed_t momz, fixed_t momh, angle_t angle);
|
||||||
|
|
||||||
void P_RefreshItemCapsuleParts(mobj_t *mobj);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// P_MAP
|
// P_MAP
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -3720,14 +3720,7 @@ void P_BouncePlayerMove(mobj_t *mo)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mobj_t *fx = P_SpawnMobj(mo->x, mo->y, mo->z, MT_BUMP);
|
K_SpawnBumpEffect(mo);
|
||||||
if (mo->eflags & MFE_VERTICALFLIP)
|
|
||||||
fx->eflags |= MFE_VERTICALFLIP;
|
|
||||||
else
|
|
||||||
fx->eflags &= ~MFE_VERTICALFLIP;
|
|
||||||
fx->scale = mo->scale;
|
|
||||||
|
|
||||||
S_StartSound(mo, sfx_s3k49);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
P_PlayerHitBounceLine(bestslideline);
|
P_PlayerHitBounceLine(bestslideline);
|
||||||
|
|
|
||||||
253
src/p_mobj.c
253
src/p_mobj.c
|
|
@ -2775,6 +2775,15 @@ void P_PlayerZMovement(mobj_t *mo)
|
||||||
P_CheckMarioBlocks(mo);
|
P_CheckMarioBlocks(mo);
|
||||||
|
|
||||||
mo->momz = 0;
|
mo->momz = 0;
|
||||||
|
P_CheckGravity(mo, true);
|
||||||
|
|
||||||
|
if (abs(mo->momz) < 15 * mapobjectscale)
|
||||||
|
{
|
||||||
|
mo->momz = 15 * mapobjectscale
|
||||||
|
* -(P_MobjFlip(mo));
|
||||||
|
}
|
||||||
|
|
||||||
|
K_SpawnBumpEffect(mo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3511,6 +3520,16 @@ static void P_CheckFloatbobPlatforms(mobj_t *mobj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void P_SquishThink(mobj_t *mobj)
|
||||||
|
{
|
||||||
|
if (!(mobj->eflags & MFE_SLOPELAUNCHED))
|
||||||
|
{
|
||||||
|
K_Squish(mobj);
|
||||||
|
}
|
||||||
|
|
||||||
|
mobj->lastmomz = mobj->momz;
|
||||||
|
}
|
||||||
|
|
||||||
static void P_PlayerMobjThinker(mobj_t *mobj)
|
static void P_PlayerMobjThinker(mobj_t *mobj)
|
||||||
{
|
{
|
||||||
I_Assert(mobj != NULL);
|
I_Assert(mobj != NULL);
|
||||||
|
|
@ -3576,6 +3595,8 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
|
||||||
mobj->eflags &= ~MFE_JUSTHITFLOOR;
|
mobj->eflags &= ~MFE_JUSTHITFLOOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
P_SquishThink(mobj);
|
||||||
|
|
||||||
animonly:
|
animonly:
|
||||||
P_CyclePlayerMobjState(mobj);
|
P_CyclePlayerMobjState(mobj);
|
||||||
}
|
}
|
||||||
|
|
@ -3786,8 +3807,12 @@ static void P_ItemCapsulePartThinker(mobj_t *mobj)
|
||||||
P_SetScale(mobj, mobj->destscale = targetScale);
|
P_SetScale(mobj, mobj->destscale = targetScale);
|
||||||
|
|
||||||
// find z position
|
// find z position
|
||||||
K_GenericExtraFlagsNoZAdjust(mobj, target);
|
if (mobj->flags2 & MF2_CLASSICPUSH) // centered items should not be flipped
|
||||||
if (mobj->flags & MFE_VERTICALFLIP)
|
mobj->renderflags = (mobj->renderflags & ~RF_DONTDRAW) | (target->renderflags & RF_DONTDRAW);
|
||||||
|
else
|
||||||
|
K_GenericExtraFlagsNoZAdjust(mobj, target);
|
||||||
|
|
||||||
|
if (mobj->eflags & MFE_VERTICALFLIP)
|
||||||
z = target->z + target->height - mobj->height - FixedMul(mobj->scale, mobj->movefactor);
|
z = target->z + target->height - mobj->height - FixedMul(mobj->scale, mobj->movefactor);
|
||||||
else
|
else
|
||||||
z = target->z + FixedMul(mobj->scale, mobj->movefactor);
|
z = target->z + FixedMul(mobj->scale, mobj->movefactor);
|
||||||
|
|
@ -3804,6 +3829,193 @@ static void P_ItemCapsulePartThinker(mobj_t *mobj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void P_RefreshItemCapsuleParts(mobj_t *mobj)
|
||||||
|
{
|
||||||
|
UINT8 numNumbers = 0;
|
||||||
|
INT32 count = 0;
|
||||||
|
INT32 itemType = mobj->threshold;
|
||||||
|
mobj_t *part;
|
||||||
|
skincolornum_t color;
|
||||||
|
UINT32 newRenderFlags = 0;
|
||||||
|
boolean colorized;
|
||||||
|
|
||||||
|
if (itemType < 1 || itemType >= NUMKARTITEMS)
|
||||||
|
itemType = KITEM_SAD;
|
||||||
|
|
||||||
|
// update invincibility properties
|
||||||
|
if (itemType == KITEM_INVINCIBILITY)
|
||||||
|
{
|
||||||
|
mobj->renderflags = (mobj->renderflags & ~RF_BRIGHTMASK) | RF_FULLBRIGHT;
|
||||||
|
mobj->colorized = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mobj->renderflags = (mobj->renderflags & ~RF_BRIGHTMASK) | RF_SEMIBRIGHT;
|
||||||
|
mobj->color = SKINCOLOR_NONE;
|
||||||
|
mobj->colorized = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// update cap colors
|
||||||
|
if (itemType == KITEM_SUPERRING)
|
||||||
|
{
|
||||||
|
color = SKINCOLOR_GOLD;
|
||||||
|
newRenderFlags |= RF_SEMIBRIGHT;
|
||||||
|
}
|
||||||
|
else if (mobj->spawnpoint && (mobj->spawnpoint->options & MTF_EXTRA))
|
||||||
|
color = SKINCOLOR_SAPPHIRE;
|
||||||
|
else if (itemType == KITEM_SPB)
|
||||||
|
color = SKINCOLOR_JET;
|
||||||
|
else
|
||||||
|
color = SKINCOLOR_NONE;
|
||||||
|
|
||||||
|
colorized = (color != SKINCOLOR_NONE);
|
||||||
|
part = mobj;
|
||||||
|
while (!P_MobjWasRemoved(part->hnext))
|
||||||
|
{
|
||||||
|
part = part->hnext;
|
||||||
|
part->color = color;
|
||||||
|
part->colorized = colorized;
|
||||||
|
part->renderflags = (part->renderflags & ~RF_BRIGHTMASK) | newRenderFlags;
|
||||||
|
}
|
||||||
|
|
||||||
|
// update inside item frame
|
||||||
|
part = mobj->tracer;
|
||||||
|
if (P_MobjWasRemoved(part))
|
||||||
|
return;
|
||||||
|
|
||||||
|
part->threshold = mobj->threshold;
|
||||||
|
part->movecount = mobj->movecount;
|
||||||
|
|
||||||
|
switch (itemType)
|
||||||
|
{
|
||||||
|
case KITEM_ORBINAUT:
|
||||||
|
part->sprite = SPR_ITMO;
|
||||||
|
part->frame = FF_FULLBRIGHT|FF_PAPERSPRITE|K_GetOrbinautItemFrame(mobj->movecount);
|
||||||
|
break;
|
||||||
|
case KITEM_INVINCIBILITY:
|
||||||
|
part->sprite = SPR_ITMI;
|
||||||
|
part->frame = FF_FULLBRIGHT|FF_PAPERSPRITE|K_GetInvincibilityItemFrame();
|
||||||
|
break;
|
||||||
|
case KITEM_SAD:
|
||||||
|
part->sprite = SPR_ITEM;
|
||||||
|
part->frame = FF_FULLBRIGHT|FF_PAPERSPRITE;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
part->sprite = SPR_ITEM;
|
||||||
|
part->frame = FF_FULLBRIGHT|FF_PAPERSPRITE|(itemType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// update number frame
|
||||||
|
if (K_GetShieldFromItem(itemType) != KSHIELD_NONE) // shields don't stack, so don't show a number
|
||||||
|
;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch (itemType)
|
||||||
|
{
|
||||||
|
case KITEM_ORBINAUT: // only display the number when the sprite no longer changes
|
||||||
|
if (mobj->movecount - 1 > K_GetOrbinautItemFrame(mobj->movecount))
|
||||||
|
count = mobj->movecount;
|
||||||
|
break;
|
||||||
|
case KITEM_SUPERRING: // always display the number, and multiply it by 5
|
||||||
|
count = mobj->movecount * 5;
|
||||||
|
break;
|
||||||
|
case KITEM_SAD: // never display the number
|
||||||
|
case KITEM_SPB:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (mobj->movecount > 1)
|
||||||
|
count = mobj->movecount;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
while (count > 0)
|
||||||
|
{
|
||||||
|
if (P_MobjWasRemoved(part->tracer))
|
||||||
|
{
|
||||||
|
P_SetTarget(&part->tracer, P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_OVERLAY));
|
||||||
|
P_SetTarget(&part->tracer->target, part);
|
||||||
|
P_SetMobjState(part->tracer, S_INVISIBLE);
|
||||||
|
part->tracer->spriteyoffset = 10*FRACUNIT;
|
||||||
|
part->tracer->spritexoffset = 13*numNumbers*FRACUNIT;
|
||||||
|
}
|
||||||
|
part = part->tracer;
|
||||||
|
part->sprite = SPR_ITMN;
|
||||||
|
part->frame = FF_FULLBRIGHT|(count % 10);
|
||||||
|
count /= 10;
|
||||||
|
numNumbers++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// delete any extra overlays (I guess in case the number changes?)
|
||||||
|
if (part->tracer)
|
||||||
|
{
|
||||||
|
P_RemoveMobj(part->tracer);
|
||||||
|
P_SetTarget(&part->tracer, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#define CAPSULESIDES 5
|
||||||
|
#define ANG_CAPSULE (UINT32_MAX / CAPSULESIDES)
|
||||||
|
#define ROTATIONSPEED (2*ANG2)
|
||||||
|
static void P_SpawnItemCapsuleParts(mobj_t *mobj)
|
||||||
|
{
|
||||||
|
UINT8 i;
|
||||||
|
mobj_t *part;
|
||||||
|
fixed_t buttScale = 0;
|
||||||
|
statenum_t buttState = S_ITEMCAPSULE_BOTTOM_SIDE_AIR;
|
||||||
|
angle_t spin = ANGLE_MAX - ROTATIONSPEED;
|
||||||
|
|
||||||
|
if (P_IsObjectOnGround(mobj))
|
||||||
|
{
|
||||||
|
buttScale = 13*FRACUNIT/10;
|
||||||
|
buttState = S_ITEMCAPSULE_BOTTOM_SIDE_GROUND;
|
||||||
|
spin = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// inside item
|
||||||
|
part = P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_ITEMCAPSULE_PART);
|
||||||
|
P_SetTarget(&part->target, mobj);
|
||||||
|
P_SetMobjState(part, S_ITEMICON);
|
||||||
|
part->movedir = ROTATIONSPEED; // rotation speed
|
||||||
|
part->extravalue1 = 175*FRACUNIT/100; // relative scale
|
||||||
|
part->flags2 |= MF2_CLASSICPUSH; // classicpush = centered horizontally
|
||||||
|
part->flags2 &= ~MF2_OBJECTFLIP; // centered item should not be flipped
|
||||||
|
part->eflags &= ~MFE_VERTICALFLIP;
|
||||||
|
P_SetTarget(&mobj->tracer, part); // pointer to this item, so we can modify its sprite/frame
|
||||||
|
|
||||||
|
// capsule caps
|
||||||
|
part = mobj;
|
||||||
|
for (i = 0; i < CAPSULESIDES; i++)
|
||||||
|
{
|
||||||
|
// a bottom side
|
||||||
|
P_SetTarget(&part->hnext, P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_ITEMCAPSULE_PART));
|
||||||
|
P_SetTarget(&part->hnext->hprev, part);
|
||||||
|
part = part->hnext;
|
||||||
|
P_SetTarget(&part->target, mobj);
|
||||||
|
P_SetMobjState(part, buttState);
|
||||||
|
part->angle = i * ANG_CAPSULE;
|
||||||
|
part->movedir = spin; // rotation speed
|
||||||
|
part->movefactor = 0; // z offset
|
||||||
|
part->extravalue1 = buttScale; // relative scale
|
||||||
|
|
||||||
|
// a top side
|
||||||
|
P_SetTarget(&part->hnext, P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_ITEMCAPSULE_PART));
|
||||||
|
P_SetTarget(&part->hnext->hprev, part);
|
||||||
|
part = part->hnext;
|
||||||
|
P_SetTarget(&part->target, mobj);
|
||||||
|
P_SetMobjState(part, S_ITEMCAPSULE_TOP_SIDE);
|
||||||
|
part->angle = i * ANG_CAPSULE;
|
||||||
|
part->movedir = spin; // rotation speed
|
||||||
|
part->movefactor = mobj->info->height - part->info->height; // z offset
|
||||||
|
}
|
||||||
|
|
||||||
|
P_RefreshItemCapsuleParts(mobj);
|
||||||
|
}
|
||||||
|
#undef CAPSULESIDES
|
||||||
|
#undef ANG_CAPSULE
|
||||||
|
#undef ROTATIONSPEED
|
||||||
|
|
||||||
//
|
//
|
||||||
// P_BossTargetPlayer
|
// P_BossTargetPlayer
|
||||||
// If closest is true, find the closest player.
|
// If closest is true, find the closest player.
|
||||||
|
|
@ -6158,6 +6370,14 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
||||||
mobj->z -= (mobj->height - oldHeight);
|
mobj->z -= (mobj->height - oldHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// spawn parts if not done yet
|
||||||
|
// (this SHOULD be done when the capsule is spawned, but gravflip isn't set up at that point)
|
||||||
|
if (!(mobj->flags2 & MF2_JUSTATTACKED))
|
||||||
|
{
|
||||||
|
mobj->flags2 |= MF2_JUSTATTACKED;
|
||||||
|
P_SpawnItemCapsuleParts(mobj);
|
||||||
|
}
|
||||||
|
|
||||||
// update & animate capsule
|
// update & animate capsule
|
||||||
if (!P_MobjWasRemoved(mobj->tracer))
|
if (!P_MobjWasRemoved(mobj->tracer))
|
||||||
{
|
{
|
||||||
|
|
@ -8626,7 +8846,7 @@ void P_MobjThinker(mobj_t *mobj)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mobj->eflags &= ~(MFE_PUSHED|MFE_SPRUNG|MFE_JUSTBOUNCEDWALL|MFE_DAMAGEHITLAG);
|
mobj->eflags &= ~(MFE_PUSHED|MFE_SPRUNG|MFE_JUSTBOUNCEDWALL|MFE_DAMAGEHITLAG|MFE_SLOPELAUNCHED);
|
||||||
|
|
||||||
tmfloorthing = tmhitthing = NULL;
|
tmfloorthing = tmhitthing = NULL;
|
||||||
|
|
||||||
|
|
@ -8815,6 +9035,8 @@ void P_MobjThinker(mobj_t *mobj)
|
||||||
P_ButteredSlope(mobj);
|
P_ButteredSlope(mobj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
P_SquishThink(mobj);
|
||||||
|
|
||||||
if (mobj->flags & (MF_ENEMY|MF_BOSS) && mobj->health
|
if (mobj->flags & (MF_ENEMY|MF_BOSS) && mobj->health
|
||||||
&& P_CheckDeathPitCollide(mobj)) // extra pit check in case these didn't have momz
|
&& P_CheckDeathPitCollide(mobj)) // extra pit check in case these didn't have momz
|
||||||
{
|
{
|
||||||
|
|
@ -9490,8 +9712,6 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
||||||
// SRB2Kart
|
// SRB2Kart
|
||||||
case MT_ITEMCAPSULE:
|
case MT_ITEMCAPSULE:
|
||||||
{
|
{
|
||||||
fixed_t oldHeight = mobj->height;
|
|
||||||
|
|
||||||
// set default item & count
|
// set default item & count
|
||||||
#if 0 // set to 1 to test capsules with random items, e.g. with objectplace
|
#if 0 // set to 1 to test capsules with random items, e.g. with objectplace
|
||||||
if (P_RandomChance(FRACUNIT/3))
|
if (P_RandomChance(FRACUNIT/3))
|
||||||
|
|
@ -9508,17 +9728,10 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
||||||
mobj->movecount = 1;
|
mobj->movecount = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// grounded/aerial properties
|
|
||||||
P_AdjustMobjFloorZ_FFloors(mobj, mobj->subsector->sector, 0);
|
|
||||||
if (!P_IsObjectOnGround(mobj))
|
|
||||||
mobj->flags |= MF_NOGRAVITY;
|
|
||||||
|
|
||||||
// set starting scale
|
// set starting scale
|
||||||
mobj->extravalue1 = mobj->scale; // this acts as the capsule's destscale; we're avoiding P_MobjScaleThink because we want aerial capsules not to scale from their center
|
mobj->extravalue1 = mobj->scale; // this acts as the capsule's destscale; we're avoiding P_MobjScaleThink because we want aerial capsules not to scale from their center
|
||||||
mobj->scalespeed >>= 1;
|
mobj->scalespeed >>= 1;
|
||||||
P_SetScale(mobj, mobj->destscale = mapobjectscale >> 4);
|
P_SetScale(mobj, mobj->destscale = mapobjectscale >> 4);
|
||||||
if (mobj->eflags & MFE_VERTICALFLIP)
|
|
||||||
mobj->z += (oldHeight - mobj->height);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -11788,6 +12001,22 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean
|
||||||
}
|
}
|
||||||
case MT_ITEMCAPSULE:
|
case MT_ITEMCAPSULE:
|
||||||
{
|
{
|
||||||
|
// we have to adjust for reverse gravity early so that the below grounded checks work
|
||||||
|
if (mthing->options & MTF_OBJECTFLIP)
|
||||||
|
{
|
||||||
|
mobj->eflags |= MFE_VERTICALFLIP;
|
||||||
|
mobj->flags2 |= MF2_OBJECTFLIP;
|
||||||
|
mobj->z += FixedMul(mobj->extravalue1, mobj->info->height) - mobj->height;
|
||||||
|
}
|
||||||
|
|
||||||
|
// determine whether this capsule is grounded or aerial
|
||||||
|
if (mobj->subsector->sector->ffloors)
|
||||||
|
P_AdjustMobjFloorZ_FFloors(mobj, mobj->subsector->sector, 0);
|
||||||
|
if (mobj->subsector->polyList)
|
||||||
|
P_AdjustMobjFloorZ_PolyObjs(mobj, mobj->subsector);
|
||||||
|
if (!P_IsObjectOnGround(mobj))
|
||||||
|
mobj->flags |= MF_NOGRAVITY;
|
||||||
|
|
||||||
// Angle = item type
|
// Angle = item type
|
||||||
if (mthing->angle > 0 && mthing->angle < NUMKARTITEMS)
|
if (mthing->angle > 0 && mthing->angle < NUMKARTITEMS)
|
||||||
mobj->threshold = mthing->angle;
|
mobj->threshold = mthing->angle;
|
||||||
|
|
|
||||||
|
|
@ -249,6 +249,8 @@ typedef enum
|
||||||
MFE_JUSTBOUNCEDWALL = 1<<12,
|
MFE_JUSTBOUNCEDWALL = 1<<12,
|
||||||
// SRB2Kart: In damage hitlag (displays different visual efx)
|
// SRB2Kart: In damage hitlag (displays different visual efx)
|
||||||
MFE_DAMAGEHITLAG = 1<<13,
|
MFE_DAMAGEHITLAG = 1<<13,
|
||||||
|
// Slope physics sent you airborne
|
||||||
|
MFE_SLOPELAUNCHED = 1<<14,
|
||||||
// free: to and including 1<<15
|
// free: to and including 1<<15
|
||||||
} mobjeflag_t;
|
} mobjeflag_t;
|
||||||
|
|
||||||
|
|
@ -361,6 +363,7 @@ typedef struct mobj_s
|
||||||
|
|
||||||
fixed_t friction;
|
fixed_t friction;
|
||||||
fixed_t movefactor;
|
fixed_t movefactor;
|
||||||
|
fixed_t lastmomz;
|
||||||
|
|
||||||
INT32 fuse; // Does something in P_MobjThinker on reaching 0.
|
INT32 fuse; // Does something in P_MobjThinker on reaching 0.
|
||||||
fixed_t watertop; // top of the water FOF the mobj is in
|
fixed_t watertop; // top of the water FOF the mobj is in
|
||||||
|
|
|
||||||
|
|
@ -1534,7 +1534,8 @@ typedef enum
|
||||||
MD2_HITLAG = 1<<24,
|
MD2_HITLAG = 1<<24,
|
||||||
MD2_WAYPOINTCAP = 1<<25,
|
MD2_WAYPOINTCAP = 1<<25,
|
||||||
MD2_KITEMCAP = 1<<26,
|
MD2_KITEMCAP = 1<<26,
|
||||||
MD2_ITNEXT = 1<<27
|
MD2_ITNEXT = 1<<27,
|
||||||
|
MD2_LASTMOMZ = 1<<28,
|
||||||
} mobj_diff2_t;
|
} mobj_diff2_t;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
|
@ -1775,6 +1776,8 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type)
|
||||||
diff2 |= MD2_KITEMCAP;
|
diff2 |= MD2_KITEMCAP;
|
||||||
if (mobj->itnext)
|
if (mobj->itnext)
|
||||||
diff2 |= MD2_ITNEXT;
|
diff2 |= MD2_ITNEXT;
|
||||||
|
if (mobj->lastmomz)
|
||||||
|
diff2 |= MD2_LASTMOMZ;
|
||||||
|
|
||||||
if (diff2 != 0)
|
if (diff2 != 0)
|
||||||
diff |= MD_MORE;
|
diff |= MD_MORE;
|
||||||
|
|
@ -1968,6 +1971,10 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type)
|
||||||
{
|
{
|
||||||
WRITEINT32(save_p, mobj->hitlag);
|
WRITEINT32(save_p, mobj->hitlag);
|
||||||
}
|
}
|
||||||
|
if (diff2 & MD2_LASTMOMZ)
|
||||||
|
{
|
||||||
|
WRITEINT32(save_p, mobj->lastmomz);
|
||||||
|
}
|
||||||
|
|
||||||
WRITEUINT32(save_p, mobj->mobjnum);
|
WRITEUINT32(save_p, mobj->mobjnum);
|
||||||
}
|
}
|
||||||
|
|
@ -3062,6 +3069,10 @@ static thinker_t* LoadMobjThinker(actionf_p1 thinker)
|
||||||
{
|
{
|
||||||
mobj->hitlag = READINT32(save_p);
|
mobj->hitlag = READINT32(save_p);
|
||||||
}
|
}
|
||||||
|
if (diff2 & MD2_LASTMOMZ)
|
||||||
|
{
|
||||||
|
mobj->lastmomz = READINT32(save_p);
|
||||||
|
}
|
||||||
|
|
||||||
if (diff & MD_REDFLAG)
|
if (diff & MD_REDFLAG)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -844,6 +844,8 @@ void P_SlopeLaunch(mobj_t *mo)
|
||||||
mo->momy = slopemom.y;
|
mo->momy = slopemom.y;
|
||||||
mo->momz = slopemom.z;
|
mo->momz = slopemom.z;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
mo->eflags |= MFE_SLOPELAUNCHED;
|
||||||
}
|
}
|
||||||
|
|
||||||
//CONS_Printf("Launched off of slope.\n");
|
//CONS_Printf("Launched off of slope.\n");
|
||||||
|
|
|
||||||
16
src/p_user.c
16
src/p_user.c
|
|
@ -1058,6 +1058,9 @@ boolean P_IsLocalPlayer(player_t *player)
|
||||||
{
|
{
|
||||||
UINT8 i;
|
UINT8 i;
|
||||||
|
|
||||||
|
if (demo.playback)
|
||||||
|
return P_IsDisplayPlayer(player);
|
||||||
|
|
||||||
for (i = 0; i <= r_splitscreen; i++) // DON'T skip P1
|
for (i = 0; i <= r_splitscreen; i++) // DON'T skip P1
|
||||||
{
|
{
|
||||||
if (player == &players[g_localplayers[i]])
|
if (player == &players[g_localplayers[i]])
|
||||||
|
|
@ -3864,13 +3867,12 @@ static void P_HandleFollower(player_t *player)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set follower colour
|
// Set follower colour
|
||||||
|
|
||||||
switch (player->followercolor)
|
switch (player->followercolor)
|
||||||
{
|
{
|
||||||
case MAXSKINCOLORS: // "Match"
|
case 255: // "Match" (-1)
|
||||||
color = player->skincolor;
|
color = player->skincolor;
|
||||||
break;
|
break;
|
||||||
case MAXSKINCOLORS+1: // "Opposite"
|
case 254: // "Opposite" (-2)
|
||||||
color = skincolors[player->skincolor].invcolor;
|
color = skincolors[player->skincolor].invcolor;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
@ -3931,9 +3933,10 @@ static void P_HandleFollower(player_t *player)
|
||||||
P_SetFollowerState(player->follower, player->follower->state->nextstate);
|
P_SetFollowerState(player->follower, player->follower->state->nextstate);
|
||||||
|
|
||||||
// move the follower next to us (yes, this is really basic maths but it looks pretty damn clean in practice)!
|
// move the follower next to us (yes, this is really basic maths but it looks pretty damn clean in practice)!
|
||||||
player->follower->momx = (sx - player->follower->x)/fl.horzlag;
|
// 02/09/2021: cast lag to int32 otherwise funny things happen since it was changed to uint32 in the struct
|
||||||
player->follower->momy = (sy - player->follower->y)/fl.horzlag;
|
player->follower->momx = (sx - player->follower->x)/ (INT32)fl.horzlag;
|
||||||
player->follower->momz = (sz - player->follower->z)/fl.vertlag;
|
player->follower->momy = (sy - player->follower->y)/ (INT32)fl.horzlag;
|
||||||
|
player->follower->momz = (sz - player->follower->z)/ (INT32)fl.vertlag;
|
||||||
player->follower->angle = player->mo->angle;
|
player->follower->angle = player->mo->angle;
|
||||||
|
|
||||||
if (player->mo->colorized)
|
if (player->mo->colorized)
|
||||||
|
|
@ -4369,6 +4372,7 @@ void P_PlayerThink(player_t *player)
|
||||||
player->flashing = TICRATE/2 + 1;
|
player->flashing = TICRATE/2 + 1;
|
||||||
/*if (P_SpectatorJoinGame(player))
|
/*if (P_SpectatorJoinGame(player))
|
||||||
return; // player->mo was removed.*/
|
return; // player->mo was removed.*/
|
||||||
|
//CONS_Printf("player %s wants to join on tic %d\n", player_names[player-players], leveltime);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player->respawn.state != RESPAWNST_NONE)
|
if (player->respawn.state != RESPAWNST_NONE)
|
||||||
|
|
|
||||||
|
|
@ -481,7 +481,7 @@ void Y_IntermissionDrawer(void)
|
||||||
else
|
else
|
||||||
hilicol = ((intertype == int_race) ? V_SKYMAP : V_REDMAP);
|
hilicol = ((intertype == int_race) ? V_SKYMAP : V_REDMAP);
|
||||||
|
|
||||||
if (sorttic != -1 && intertic > sorttic && !demo.playback)
|
if (sorttic != -1 && intertic > sorttic && multiplayer)
|
||||||
{
|
{
|
||||||
INT32 count = (intertic - sorttic);
|
INT32 count = (intertic - sorttic);
|
||||||
|
|
||||||
|
|
@ -586,7 +586,7 @@ void Y_IntermissionDrawer(void)
|
||||||
|
|
||||||
y2 = y;
|
y2 = y;
|
||||||
|
|
||||||
if (netgame && playerconsole[data.num[i]] == 0 && server_lagless && !players[data.num[i]].bot)
|
if ((netgame || (demo.playback && demo.netgame)) && playerconsole[data.num[i]] == 0 && server_lagless && !players[data.num[i]].bot)
|
||||||
{
|
{
|
||||||
static int alagles_timer = 0;
|
static int alagles_timer = 0;
|
||||||
patch_t *alagles;
|
patch_t *alagles;
|
||||||
|
|
@ -799,7 +799,7 @@ void Y_Ticker(void)
|
||||||
|
|
||||||
if (intertype == int_race || intertype == int_battle)
|
if (intertype == int_race || intertype == int_battle)
|
||||||
{
|
{
|
||||||
if (!(multiplayer && demo.playback)) // Don't advance to rankings in replays
|
//if (!(multiplayer && demo.playback)) // Don't advance to rankings in replays
|
||||||
{
|
{
|
||||||
if (!data.rankingsmode && (intertic >= sorttic + 8))
|
if (!data.rankingsmode && (intertic >= sorttic + 8))
|
||||||
{
|
{
|
||||||
|
|
@ -868,8 +868,6 @@ void Y_Ticker(void)
|
||||||
endtic = intertic + 3*TICRATE; // 3 second pause after end of tally
|
endtic = intertic + 3*TICRATE; // 3 second pause after end of tally
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!(intertic & 1))
|
|
||||||
S_StartSound(NULL, sfx_ptally); // tally sound effect
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1013,7 +1011,7 @@ static void K_UpdatePowerLevels(void)
|
||||||
data.increase[i] = increment[i];
|
data.increase[i] = increment[i];
|
||||||
clientpowerlevels[i][powertype] += data.increase[i];
|
clientpowerlevels[i][powertype] += data.increase[i];
|
||||||
|
|
||||||
if (i == consoleplayer)
|
if (!demo.playback && i == consoleplayer)
|
||||||
{
|
{
|
||||||
CONS_Debug(DBG_GAMELOGIC, "Player %d is you! Saving...\n", i);
|
CONS_Debug(DBG_GAMELOGIC, "Player %d is you! Saving...\n", i);
|
||||||
vspowerlevel[powertype] = clientpowerlevels[i][powertype];
|
vspowerlevel[powertype] = clientpowerlevels[i][powertype];
|
||||||
|
|
@ -1069,7 +1067,7 @@ void Y_StartIntermission(void)
|
||||||
{
|
{
|
||||||
if (cv_inttime.value == 0)
|
if (cv_inttime.value == 0)
|
||||||
timer = 0;
|
timer = 0;
|
||||||
else if (demo.playback) // Override inttime (which is pulled from the replay anyway
|
else if (demo.playback && !multiplayer) // Override inttime (which is pulled from the replay anyway
|
||||||
timer = 10*TICRATE;
|
timer = 10*TICRATE;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue