mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'master' into shadows-gammaless
This commit is contained in:
commit
e147d41ad4
60 changed files with 3344 additions and 2631 deletions
136
src/d_clisrv.c
136
src/d_clisrv.c
|
|
@ -2550,6 +2550,9 @@ void CL_ClearPlayer(INT32 playernum)
|
|||
|
||||
memset(&players[playernum], 0, sizeof (player_t));
|
||||
|
||||
players[playernum].followerskin = -1; // don't have a ghost follower
|
||||
players[playernum].fakeskin = players[playernum].lastfakeskin = MAXSKINS; // don't avoid eggman
|
||||
|
||||
RemoveAdminPlayer(playernum); // don't stay admin after you're gone
|
||||
}
|
||||
|
||||
|
|
@ -5578,55 +5581,58 @@ static INT32 pingtimeout[MAXPLAYERS];
|
|||
static inline void PingUpdate(void)
|
||||
{
|
||||
INT32 i;
|
||||
boolean laggers[MAXPLAYERS];
|
||||
UINT8 numlaggers = 0;
|
||||
memset(laggers, 0, sizeof(boolean) * MAXPLAYERS);
|
||||
boolean pingkick[MAXPLAYERS];
|
||||
UINT8 nonlaggers = 0;
|
||||
memset(pingkick, 0, sizeof(pingkick));
|
||||
|
||||
netbuffer->packettype = PT_PING;
|
||||
|
||||
//check for ping limit breakage.
|
||||
if (cv_maxping.value)
|
||||
{
|
||||
for (i = 1; i < MAXPLAYERS; i++)
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (playeringame[i]
|
||||
if (!playeringame[i] || P_IsMachineLocalPlayer(&players[i]))
|
||||
{
|
||||
pingtimeout[i] = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((cv_maxping.value)
|
||||
&& (realpingtable[i] / pingmeasurecount > (unsigned)cv_maxping.value))
|
||||
{
|
||||
if (players[i].jointime > 30 * TICRATE)
|
||||
laggers[i] = true;
|
||||
numlaggers++;
|
||||
if (players[i].jointime > 10 * TICRATE)
|
||||
{
|
||||
pingkick[i] = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
pingtimeout[i] = 0;
|
||||
{
|
||||
nonlaggers++;
|
||||
|
||||
// you aren't lagging, but you aren't free yet. In case you'll keep spiking, we just make the timer go back down. (Very unstable net must still get kicked).
|
||||
if (pingtimeout[i] > 0)
|
||||
pingtimeout[i]--;
|
||||
}
|
||||
}
|
||||
|
||||
//kick lagging players... unless everyone but the server's ping sucks.
|
||||
//in that case, it is probably the server's fault.
|
||||
if (numlaggers < D_NumPlayers() - 1)
|
||||
if (nonlaggers > 0)
|
||||
{
|
||||
for (i = 1; i < MAXPLAYERS; i++)
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (playeringame[i] && laggers[i])
|
||||
{
|
||||
pingtimeout[i]++;
|
||||
if (!playeringame[i] || !pingkick[i])
|
||||
continue;
|
||||
|
||||
// Don't kick on ping alone if we haven't reached our threshold yet.
|
||||
if (++pingtimeout[i] < cv_pingtimeout.value)
|
||||
continue;
|
||||
|
||||
// ok your net has been bad for too long, you deserve to die.
|
||||
if (pingtimeout[i] > cv_pingtimeout.value)
|
||||
{
|
||||
pingtimeout[i] = 0;
|
||||
SendKick(i, KICK_MSG_PING_HIGH);
|
||||
}
|
||||
}
|
||||
/*
|
||||
you aren't lagging,
|
||||
but you aren't free yet.
|
||||
In case you'll keep spiking,
|
||||
we just make the timer go back down. (Very unstable net must still get kicked).
|
||||
*/
|
||||
else
|
||||
pingtimeout[i] = (pingtimeout[i] == 0 ? 0 : pingtimeout[i]-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//make the ping packet and clear server data for next one
|
||||
|
|
@ -5805,6 +5811,9 @@ void NetKeepAlive(void)
|
|||
FileSendTicker();
|
||||
}
|
||||
|
||||
// If a tree falls in the forest but nobody is around to hear it, does it make a tic?
|
||||
#define DEDICATEDIDLETIME (10*TICRATE)
|
||||
|
||||
void NetUpdate(void)
|
||||
{
|
||||
static tic_t resptime = 0;
|
||||
|
|
@ -5817,6 +5826,7 @@ void NetUpdate(void)
|
|||
|
||||
if (realtics <= 0) // nothing new to update
|
||||
return;
|
||||
|
||||
if (realtics > 5)
|
||||
{
|
||||
if (server)
|
||||
|
|
@ -5825,6 +5835,55 @@ void NetUpdate(void)
|
|||
realtics = 5;
|
||||
}
|
||||
|
||||
#ifdef DEDICATEDIDLETIME
|
||||
if (server && dedicated && gamestate == GS_LEVEL)
|
||||
{
|
||||
static tic_t dedicatedidle = 0;
|
||||
|
||||
for (i = 1; i < MAXNETNODES; ++i)
|
||||
if (nodeingame[i])
|
||||
{
|
||||
if (dedicatedidle == DEDICATEDIDLETIME)
|
||||
{
|
||||
CONS_Printf("DEDICATED: Awakening from idle (Node %d detected...)\n", i);
|
||||
dedicatedidle = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == MAXNETNODES)
|
||||
{
|
||||
if (leveltime == 2)
|
||||
{
|
||||
// On next tick...
|
||||
dedicatedidle = DEDICATEDIDLETIME-1;
|
||||
}
|
||||
else if (dedicatedidle == DEDICATEDIDLETIME)
|
||||
{
|
||||
if (D_GetExistingTextcmd(gametic, 0) || D_GetExistingTextcmd(gametic+1, 0))
|
||||
{
|
||||
CONS_Printf("DEDICATED: Awakening from idle (Netxcmd detected...)\n");
|
||||
dedicatedidle = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
realtics = 0;
|
||||
}
|
||||
}
|
||||
else if ((dedicatedidle += realtics) >= DEDICATEDIDLETIME)
|
||||
{
|
||||
const char *idlereason = "at round start";
|
||||
if (leveltime > 3)
|
||||
idlereason = va("for %d seconds", dedicatedidle/TICRATE);
|
||||
|
||||
CONS_Printf("DEDICATED: No nodes %s, idling...\n", idlereason);
|
||||
realtics = 0;
|
||||
dedicatedidle = DEDICATEDIDLETIME;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
gametime = nowtime;
|
||||
|
||||
UpdatePingTable();
|
||||
|
|
@ -5862,25 +5921,26 @@ void NetUpdate(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!demo.playback)
|
||||
if (!demo.playback && realtics > 0)
|
||||
{
|
||||
INT32 counts;
|
||||
|
||||
hu_redownloadinggamestate = false;
|
||||
|
||||
firstticstosend = gametic;
|
||||
for (i = 0; i < MAXNETNODES; i++)
|
||||
if (nodeingame[i] && nettics[i] < firstticstosend)
|
||||
{
|
||||
firstticstosend = nettics[i];
|
||||
|
||||
if (maketic + 1 >= nettics[i] + BACKUPTICS)
|
||||
Net_ConnectionTimeout(i);
|
||||
}
|
||||
|
||||
// Don't erase tics not acknowledged
|
||||
counts = realtics;
|
||||
|
||||
firstticstosend = gametic;
|
||||
for (i = 0; i < MAXNETNODES; i++)
|
||||
{
|
||||
if (!nodeingame[i])
|
||||
continue;
|
||||
if (nettics[i] < firstticstosend)
|
||||
firstticstosend = nettics[i];
|
||||
if (maketic + counts >= nettics[i] + (BACKUPTICS - TICRATE))
|
||||
Net_ConnectionTimeout(i);
|
||||
}
|
||||
|
||||
if (maketic + counts >= firstticstosend + BACKUPTICS)
|
||||
counts = firstticstosend+BACKUPTICS-maketic-1;
|
||||
|
||||
|
|
|
|||
21
src/d_main.c
21
src/d_main.c
|
|
@ -1203,8 +1203,7 @@ D_ConvertVersionNumbers (void)
|
|||
void D_SRB2Main(void)
|
||||
{
|
||||
INT32 i, p;
|
||||
|
||||
INT32 pstartmap = 1;
|
||||
INT32 pstartmap = 0;
|
||||
boolean autostart = false;
|
||||
|
||||
/* break the version string into version numbers, for netplay */
|
||||
|
|
@ -1756,12 +1755,15 @@ void D_SRB2Main(void)
|
|||
|
||||
// Has to be done before anything else so skin, color, etc in command buffer has an affect.
|
||||
// ttlprofilen used because it's roughly equivalent in functionality - a QoL aid for quickly getting from startup to action
|
||||
if (!dedicated)
|
||||
{
|
||||
PR_ApplyProfile(cv_ttlprofilen.value, 0);
|
||||
|
||||
for (i = 1; i < cv_splitplayers.value; i++)
|
||||
{
|
||||
PR_ApplyProfile(cv_lastprofile[i].value, i);
|
||||
}
|
||||
}
|
||||
|
||||
if (autostart || netgame)
|
||||
{
|
||||
|
|
@ -1842,8 +1844,13 @@ void D_SRB2Main(void)
|
|||
CV_SetValue(&cv_kartspeed, newskill);
|
||||
}
|
||||
|
||||
if (server && !M_CheckParm("+map"))
|
||||
if (server && (dedicated || !M_CheckParm("+map")))
|
||||
{
|
||||
if (!pstartmap && (pstartmap = G_GetFirstMapOfGametype(gametype)+1) > nummapheaders)
|
||||
{
|
||||
I_Error("Can't get first map of gametype\n");
|
||||
}
|
||||
|
||||
if (M_MapLocked(pstartmap))
|
||||
{
|
||||
G_SetUsedCheats();
|
||||
|
|
@ -1865,14 +1872,6 @@ void D_SRB2Main(void)
|
|||
|
||||
CON_ToggleOff();
|
||||
|
||||
if (dedicated && server)
|
||||
{
|
||||
levelstarttic = gametic;
|
||||
G_SetGamestate(GS_LEVEL);
|
||||
if (!P_LoadLevel(false, false))
|
||||
I_Quit(); // fail so reset game stuff
|
||||
}
|
||||
|
||||
#ifdef HAVE_DISCORDRPC
|
||||
if (! dedicated)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -450,6 +450,8 @@ consvar_t cv_kartdebugdirector = CVAR_INIT ("debugdirector", "Off", CV_CHEAT, CV
|
|||
consvar_t cv_spbtest = CVAR_INIT ("spbtest", "Off", CV_CHEAT|CV_NETVAR, CV_OnOff, NULL);
|
||||
consvar_t cv_gptest = CVAR_INIT ("gptest", "Off", CV_CHEAT|CV_NETVAR, CV_OnOff, NULL);
|
||||
|
||||
consvar_t cv_reducevfx = CVAR_INIT ("reducevfx", "No", CV_SAVE, CV_YesNo, NULL);
|
||||
|
||||
static CV_PossibleValue_t votetime_cons_t[] = {{10, "MIN"}, {3600, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_votetime = CVAR_INIT ("votetime", "20", CV_NETVAR, votetime_cons_t, NULL);
|
||||
|
||||
|
|
@ -801,8 +803,6 @@ void D_RegisterServerCommands(void)
|
|||
CV_RegisterVar(&cv_pingmeasurement);
|
||||
CV_RegisterVar(&cv_showviewpointtext);
|
||||
|
||||
CV_RegisterVar(&cv_director);
|
||||
|
||||
CV_RegisterVar(&cv_schedule);
|
||||
CV_RegisterVar(&cv_automate);
|
||||
CV_RegisterVar(&cv_livestudioaudience);
|
||||
|
|
@ -815,6 +815,23 @@ void D_RegisterServerCommands(void)
|
|||
|
||||
CV_RegisterVar(&cv_discordinvites);
|
||||
RegisterNetXCmd(XD_DISCORD, Got_DiscordInfo);
|
||||
|
||||
COM_AddCommand("numthinkers", Command_Numthinkers_f);
|
||||
COM_AddCommand("countmobjs", Command_CountMobjs_f);
|
||||
|
||||
CV_RegisterVar(&cv_recordmultiplayerdemos);
|
||||
CV_RegisterVar(&cv_netdemosyncquality);
|
||||
|
||||
CV_RegisterVar(&cv_shoutname);
|
||||
CV_RegisterVar(&cv_shoutcolor);
|
||||
CV_RegisterVar(&cv_autoshout);
|
||||
|
||||
#ifdef _DEBUG
|
||||
COM_AddCommand("causecfail", Command_CauseCfail_f);
|
||||
#endif
|
||||
#ifdef LUA_ALLOW_BYTECODE
|
||||
COM_AddCommand("dumplua", Command_Dumplua_f);
|
||||
#endif
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
|
|
@ -838,9 +855,6 @@ void D_RegisterClientCommands(void)
|
|||
if (dedicated)
|
||||
return;
|
||||
|
||||
COM_AddCommand("numthinkers", Command_Numthinkers_f);
|
||||
COM_AddCommand("countmobjs", Command_CountMobjs_f);
|
||||
|
||||
COM_AddCommand("changeteam", Command_Teamchange_f);
|
||||
COM_AddCommand("changeteam2", Command_Teamchange2_f);
|
||||
COM_AddCommand("changeteam3", Command_Teamchange3_f);
|
||||
|
|
@ -936,9 +950,6 @@ void D_RegisterClientCommands(void)
|
|||
|
||||
COM_AddCommand("displayplayer", Command_Displayplayer_f);
|
||||
|
||||
CV_RegisterVar(&cv_recordmultiplayerdemos);
|
||||
CV_RegisterVar(&cv_netdemosyncquality);
|
||||
|
||||
// FIXME: not to be here.. but needs be done for config loading
|
||||
CV_RegisterVar(&cv_globalgamma);
|
||||
CV_RegisterVar(&cv_globalsaturation);
|
||||
|
|
@ -977,10 +988,6 @@ void D_RegisterClientCommands(void)
|
|||
CV_RegisterVar(&cv_chatnotifications);
|
||||
CV_RegisterVar(&cv_chatbacktint);
|
||||
|
||||
CV_RegisterVar(&cv_shoutname);
|
||||
CV_RegisterVar(&cv_shoutcolor);
|
||||
CV_RegisterVar(&cv_autoshout);
|
||||
|
||||
CV_RegisterVar(&cv_songcredits);
|
||||
CV_RegisterVar(&cv_tutorialprompt);
|
||||
CV_RegisterVar(&cv_showfocuslost);
|
||||
|
|
@ -1028,7 +1035,6 @@ void D_RegisterClientCommands(void)
|
|||
// screen.c
|
||||
CV_RegisterVar(&cv_fullscreen);
|
||||
CV_RegisterVar(&cv_renderview);
|
||||
CV_RegisterVar(&cv_renderhitbox);
|
||||
CV_RegisterVar(&cv_vhseffect);
|
||||
CV_RegisterVar(&cv_shittyscreen);
|
||||
CV_RegisterVar(&cv_renderer);
|
||||
|
|
@ -1036,6 +1042,8 @@ void D_RegisterClientCommands(void)
|
|||
CV_RegisterVar(&cv_scr_width);
|
||||
CV_RegisterVar(&cv_scr_height);
|
||||
|
||||
CV_RegisterVar(&cv_director);
|
||||
|
||||
CV_RegisterVar(&cv_soundtest);
|
||||
|
||||
CV_RegisterVar(&cv_invincmusicfade);
|
||||
|
|
@ -1056,7 +1064,7 @@ void D_RegisterClientCommands(void)
|
|||
// CV_RegisterVar(&cv_grid);
|
||||
// CV_RegisterVar(&cv_snapto);
|
||||
|
||||
// add cheat commands
|
||||
// add cheats
|
||||
COM_AddCommand("noclip", Command_CheatNoClip_f);
|
||||
COM_AddCommand("god", Command_CheatGod_f);
|
||||
COM_AddCommand("setrings", Command_Setrings_f);
|
||||
|
|
@ -1071,12 +1079,7 @@ void D_RegisterClientCommands(void)
|
|||
COM_AddCommand("skynum", Command_Skynum_f);
|
||||
COM_AddCommand("weather", Command_Weather_f);
|
||||
COM_AddCommand("grayscale", Command_Grayscale_f);
|
||||
#ifdef _DEBUG
|
||||
COM_AddCommand("causecfail", Command_CauseCfail_f);
|
||||
#endif
|
||||
#ifdef LUA_ALLOW_BYTECODE
|
||||
COM_AddCommand("dumplua", Command_Dumplua_f);
|
||||
#endif
|
||||
CV_RegisterVar(&cv_renderhitbox);
|
||||
|
||||
#ifdef HAVE_DISCORDRPC
|
||||
CV_RegisterVar(&cv_discordrp);
|
||||
|
|
@ -3151,6 +3154,8 @@ static void Command_RandomMap(void)
|
|||
|
||||
static void Command_RestartLevel(void)
|
||||
{
|
||||
boolean newencore = false;
|
||||
|
||||
if (client && !IsPlayerAdmin(consoleplayer))
|
||||
{
|
||||
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
|
||||
|
|
@ -3163,7 +3168,12 @@ static void Command_RestartLevel(void)
|
|||
return;
|
||||
}
|
||||
|
||||
D_MapChange(gamemap, gametype, encoremode, false, 0, false, false);
|
||||
if (cv_kartencore.value != 0)
|
||||
{
|
||||
newencore = (cv_kartencore.value == 1) || encoremode;
|
||||
}
|
||||
|
||||
D_MapChange(gamemap, gametype, newencore, false, 0, false, false);
|
||||
}
|
||||
|
||||
static void Command_Pause(void)
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ extern consvar_t cv_votetime;
|
|||
|
||||
extern consvar_t cv_kartdebugitem, cv_kartdebugamount, cv_kartdebugdistribution, cv_kartdebughuddrop;
|
||||
extern consvar_t cv_kartdebugnodes, cv_kartdebugcolorize, cv_kartdebugdirector;
|
||||
extern consvar_t cv_spbtest, cv_gptest;
|
||||
extern consvar_t cv_spbtest, cv_gptest, cv_reducevfx;
|
||||
extern consvar_t cv_kartdebugwaypoints, cv_kartdebugbotpredict;
|
||||
|
||||
extern consvar_t cv_itemfinder;
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@
|
|||
// Extra abilities/settings for skins (combinable stuff)
|
||||
typedef enum
|
||||
{
|
||||
SF_HIRES = 1, // Draw the sprite at different size?
|
||||
SF_MACHINE = 1<<1, // Beep boop. Are you a robot?
|
||||
SF_MACHINE = 1, // Beep boop. Are you a robot?
|
||||
SF_IRONMAN = 1<<1, // Pick a new skin during POSITION. I main Random!
|
||||
// free up to and including 1<<31
|
||||
} skinflags_t;
|
||||
|
||||
|
|
@ -310,6 +310,8 @@ typedef struct botvars_s
|
|||
UINT8 diffincrease; // In GP: bot difficulty will increase this much next round
|
||||
boolean rival; // If true, they're the GP rival
|
||||
|
||||
// All entries above persist between rounds and must be recorded in demos
|
||||
|
||||
fixed_t rubberband; // Bot rubberband value
|
||||
UINT16 controller; // Special bot controller linedef ID
|
||||
|
||||
|
|
@ -385,6 +387,9 @@ typedef struct player_s
|
|||
INT32 skin;
|
||||
UINT32 availabilities;
|
||||
|
||||
UINT8 fakeskin; // ironman
|
||||
UINT8 lastfakeskin;
|
||||
|
||||
UINT8 kartspeed; // Kart speed stat between 1 and 9
|
||||
UINT8 kartweight; // Kart weight stat between 1 and 9
|
||||
|
||||
|
|
@ -413,6 +418,7 @@ typedef struct player_s
|
|||
UINT8 oldposition; // Used for taunting when you pass someone
|
||||
UINT8 positiondelay; // Used for position number, so it can grow when passing
|
||||
UINT32 distancetofinish;
|
||||
waypoint_t *currentwaypoint;
|
||||
waypoint_t *nextwaypoint;
|
||||
respawnvars_t respawn; // Respawn info
|
||||
tic_t airtime; // Keep track of how long you've been in the air
|
||||
|
|
|
|||
|
|
@ -3095,9 +3095,25 @@ void readcupheader(MYFILE *f, cupheader_t *cup)
|
|||
}
|
||||
else if (fastcmp(word, "BONUSGAME"))
|
||||
{
|
||||
Z_Free(cup->levellist[CUPCACHE_BONUS]);
|
||||
cup->levellist[CUPCACHE_BONUS] = Z_StrDup(word2);
|
||||
cup->cachedlevels[CUPCACHE_BONUS] = NEXTMAP_INVALID;
|
||||
while (cup->numbonus > 0)
|
||||
{
|
||||
cup->numbonus--;
|
||||
Z_Free(cup->levellist[CUPCACHE_BONUS + cup->numbonus]);
|
||||
cup->levellist[CUPCACHE_BONUS + cup->numbonus] = NULL;
|
||||
}
|
||||
|
||||
tmp = strtok(word2,",");
|
||||
do {
|
||||
if (cup->numbonus >= MAXBONUSLIST)
|
||||
{
|
||||
deh_warning("%s Cup: reached max bonus list (%d)\n", cup->name, MAXBONUSLIST);
|
||||
break;
|
||||
}
|
||||
|
||||
cup->levellist[CUPCACHE_BONUS + cup->numbonus] = Z_StrDup(tmp);
|
||||
cup->cachedlevels[CUPCACHE_BONUS + cup->numbonus] = NEXTMAP_INVALID;
|
||||
cup->numbonus++;
|
||||
} while((tmp = strtok(NULL,",")) != NULL);
|
||||
}
|
||||
else if (fastcmp(word, "SPECIALSTAGE"))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3282,6 +3282,10 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
|
|||
//"S_ITEMCAPSULE_BOTTOM",
|
||||
//"S_ITEMCAPSULE_INSIDE",
|
||||
|
||||
"S_MAGICIANBOX",
|
||||
"S_MAGICIANBOXTOP",
|
||||
"S_MAGICIANBOXBOTTOM",
|
||||
|
||||
// Signpost sparkles
|
||||
"S_SIGNSPARK1",
|
||||
"S_SIGNSPARK2",
|
||||
|
|
@ -5284,6 +5288,7 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t
|
|||
"MT_FLOATINGITEM",
|
||||
"MT_ITEMCAPSULE",
|
||||
"MT_ITEMCAPSULE_PART",
|
||||
"MT_MAGICIANBOX",
|
||||
|
||||
"MT_SIGNSPARKLE",
|
||||
|
||||
|
|
@ -6323,8 +6328,8 @@ struct int_const_s const INT_CONST[] = {
|
|||
{"CR_ZOOMTUBE",CR_ZOOMTUBE},
|
||||
|
||||
// Character flags (skinflags_t)
|
||||
{"SF_HIRES",SF_HIRES},
|
||||
{"SF_MACHINE",SF_MACHINE},
|
||||
{"SF_IRONMAN",SF_IRONMAN},
|
||||
|
||||
// Sound flags
|
||||
{"SF_TOTALLYSINGLE",SF_TOTALLYSINGLE},
|
||||
|
|
@ -6691,6 +6696,7 @@ struct int_const_s const INT_CONST[] = {
|
|||
{"V_OVERLAY",V_OVERLAY},
|
||||
{"V_ALLOWLOWERCASE",V_ALLOWLOWERCASE},
|
||||
{"V_FLIP",V_FLIP},
|
||||
{"V_VFLIP",V_VFLIP},
|
||||
{"V_SNAPTOTOP",V_SNAPTOTOP},
|
||||
{"V_SNAPTOBOTTOM",V_SNAPTOBOTTOM},
|
||||
{"V_SNAPTOLEFT",V_SNAPTOLEFT},
|
||||
|
|
@ -6762,7 +6768,7 @@ struct int_const_s const INT_CONST[] = {
|
|||
|
||||
// SRB2Kart
|
||||
// kartitems_t
|
||||
#define FOREACH( name, n ) { #name, KITEM_ ## name }
|
||||
#define FOREACH( name, n ) { TOSTR (KITEM_ ## name), KITEM_ ## name }
|
||||
KART_ITEM_ITERATOR, // Actual items (can be set for k_itemtype)
|
||||
#undef FOREACH
|
||||
{"NUMKARTITEMS",NUMKARTITEMS},
|
||||
|
|
|
|||
|
|
@ -343,8 +343,9 @@ typedef struct
|
|||
// Keep in mind that it may encourage people making overly long cups just because they "can", and would be a waste of memory.
|
||||
#define MAXLEVELLIST 5
|
||||
#define CUPCACHE_BONUS MAXLEVELLIST
|
||||
#define CUPCACHE_SPECIAL MAXLEVELLIST+1
|
||||
#define CUPCACHE_MAX CUPCACHE_SPECIAL+1
|
||||
#define MAXBONUSLIST 2
|
||||
#define CUPCACHE_SPECIAL (CUPCACHE_BONUS+MAXBONUSLIST)
|
||||
#define CUPCACHE_MAX (CUPCACHE_SPECIAL+1)
|
||||
|
||||
typedef struct cupheader_s
|
||||
{
|
||||
|
|
@ -354,6 +355,7 @@ typedef struct cupheader_s
|
|||
char *levellist[CUPCACHE_MAX]; ///< List of levels that belong to this cup
|
||||
INT16 cachedlevels[CUPCACHE_MAX]; ///< IDs in levellist, bonusgame, and specialstage
|
||||
UINT8 numlevels; ///< Number of levels defined in levellist
|
||||
UINT8 numbonus; ///< Number of bonus stages defined
|
||||
UINT8 emeraldnum; ///< ID of Emerald to use for special stage (1-7 for Chaos Emeralds, 8-14 for Super Emeralds, 0 for no emerald)
|
||||
SINT8 unlockrequired; ///< An unlockable is required to select this cup. -1 for no unlocking required.
|
||||
struct cupheader_s *next; ///< Next cup in linked list
|
||||
|
|
|
|||
|
|
@ -2729,7 +2729,7 @@ void F_EndTextPrompt(boolean forceexec, boolean noexec)
|
|||
// \todo net safety, maybe loop all player thinkers?
|
||||
if ((promptwasactive || forceexec) && !noexec && promptpostexectag)
|
||||
{
|
||||
if (tmthing) // edge case where starting an invalid prompt immediately on level load will make P_MapStart fail
|
||||
if (tm.thing) // edge case where starting an invalid prompt immediately on level load will make P_MapStart fail
|
||||
P_LinedefExecute(promptpostexectag, promptmo, NULL);
|
||||
else
|
||||
{
|
||||
|
|
|
|||
1183
src/g_demo.c
1183
src/g_demo.c
File diff suppressed because it is too large
Load diff
28
src/g_demo.h
28
src/g_demo.h
|
|
@ -28,6 +28,13 @@ extern consvar_t cv_recordmultiplayerdemos, cv_netdemosyncquality;
|
|||
|
||||
extern tic_t demostarttime;
|
||||
|
||||
typedef struct democharlist_s {
|
||||
UINT8 mapping; // No, this isn't about levels. It maps to loaded character ID.
|
||||
UINT8 kartspeed;
|
||||
UINT8 kartweight;
|
||||
UINT32 flags;
|
||||
} democharlist_t;
|
||||
|
||||
// Publicly-accessible demo vars
|
||||
struct demovars_s {
|
||||
char titlename[65];
|
||||
|
|
@ -54,6 +61,9 @@ struct demovars_s {
|
|||
|
||||
boolean freecam;
|
||||
|
||||
UINT8 numskins;
|
||||
democharlist_t *skinlist;
|
||||
UINT8 currentskinid[MAXPLAYERS];
|
||||
};
|
||||
|
||||
extern struct demovars_s demo;
|
||||
|
|
@ -102,20 +112,18 @@ UINT8 G_CmpDemoTime(char *oldname, char *newname);
|
|||
typedef enum
|
||||
{
|
||||
GHC_NORMAL = 0,
|
||||
GHC_SUPER,
|
||||
GHC_FIREFLOWER,
|
||||
GHC_INVINCIBLE,
|
||||
GHC_RETURNSKIN // not actually a colour
|
||||
GHC_SUPER
|
||||
} ghostcolor_t;
|
||||
|
||||
extern UINT8 demo_extradata[MAXPLAYERS];
|
||||
extern UINT8 demo_writerng;
|
||||
|
||||
#define DXD_RESPAWN 0x01 // "respawn" command in console
|
||||
#define DXD_SKIN 0x02 // skin changed
|
||||
#define DXD_NAME 0x04 // name changed
|
||||
#define DXD_COLOR 0x08 // color changed
|
||||
#define DXD_PLAYSTATE 0x10 // state changed between playing, spectating, or not in-game
|
||||
#define DXD_PLAYSTATE 0x01 // state changed between playing, spectating, or not in-game
|
||||
#define DXD_RESPAWN 0x02 // "respawn" command in console
|
||||
#define DXD_SKIN 0x04 // skin changed
|
||||
#define DXD_NAME 0x08 // name changed
|
||||
#define DXD_COLOR 0x10 // color changed
|
||||
#define DXD_FOLLOWER 0x20 // follower was changed
|
||||
#define DXD_WEAPONPREF 0x40 // netsynced playsim settings were changed
|
||||
|
||||
|
|
@ -123,6 +131,8 @@ extern UINT8 demo_writerng;
|
|||
#define DXD_PST_SPECTATING 0x02
|
||||
#define DXD_PST_LEFT 0x03
|
||||
|
||||
#define DXD_PST_ISBOT 0x80 // extra flag
|
||||
|
||||
// Record/playback tics
|
||||
void G_ReadDemoExtraData(void);
|
||||
void G_WriteDemoExtraData(void);
|
||||
|
|
@ -155,6 +165,8 @@ typedef struct demoghost {
|
|||
UINT8 *buffer, *p, color;
|
||||
UINT8 fadein;
|
||||
UINT16 version;
|
||||
UINT8 numskins;
|
||||
democharlist_t *skinlist;
|
||||
mobj_t oldmo, *mo;
|
||||
struct demoghost *next;
|
||||
} demoghost;
|
||||
|
|
|
|||
38
src/g_game.c
38
src/g_game.c
|
|
@ -2239,6 +2239,8 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
|||
UINT16 skincolor;
|
||||
INT32 skin;
|
||||
UINT32 availabilities;
|
||||
UINT8 fakeskin;
|
||||
UINT8 lastfakeskin;
|
||||
|
||||
tic_t jointime;
|
||||
|
||||
|
|
@ -2285,9 +2287,21 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
|||
skincolor = players[player].skincolor;
|
||||
skin = players[player].skin;
|
||||
|
||||
// SRB2kart
|
||||
if (betweenmaps)
|
||||
{
|
||||
fakeskin = MAXSKINS;
|
||||
kartspeed = skins[players[player].skin].kartspeed;
|
||||
kartweight = skins[players[player].skin].kartweight;
|
||||
charflags = skins[players[player].skin].flags;
|
||||
}
|
||||
else
|
||||
{
|
||||
fakeskin = players[player].fakeskin;
|
||||
kartspeed = players[player].kartspeed;
|
||||
kartweight = players[player].kartweight;
|
||||
charflags = players[player].charflags;
|
||||
}
|
||||
lastfakeskin = players[player].lastfakeskin;
|
||||
|
||||
followerready = players[player].followerready;
|
||||
followercolor = players[player].followercolor;
|
||||
|
|
@ -2295,8 +2309,6 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
|||
|
||||
availabilities = players[player].availabilities;
|
||||
|
||||
charflags = players[player].charflags;
|
||||
|
||||
followitem = players[player].followitem;
|
||||
|
||||
bot = players[player].bot;
|
||||
|
|
@ -2413,10 +2425,13 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
|||
// save player config truth reborn
|
||||
p->skincolor = skincolor;
|
||||
p->skin = skin;
|
||||
|
||||
p->fakeskin = fakeskin;
|
||||
p->kartspeed = kartspeed;
|
||||
p->kartweight = kartweight;
|
||||
//
|
||||
p->charflags = charflags;
|
||||
p->lastfakeskin = lastfakeskin;
|
||||
|
||||
p->availabilities = availabilities;
|
||||
p->followitem = followitem;
|
||||
|
||||
|
|
@ -2549,7 +2564,7 @@ static boolean G_CheckSpot(INT32 playernum, mapthing_t *mthing)
|
|||
if (!K_CheckPlayersRespawnColliding(playernum, x, y))
|
||||
return false;
|
||||
|
||||
if (!P_CheckPosition(players[playernum].mo, x, y))
|
||||
if (!P_CheckPosition(players[playernum].mo, x, y, NULL))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
|
@ -3732,11 +3747,16 @@ static void G_GetNextMap(void)
|
|||
else
|
||||
{
|
||||
INT32 lastgametype = gametype;
|
||||
// 5 levels, 2 bonus stages: after rounds 2 and 4 (but flexible enough to accomodate other solutions)
|
||||
UINT8 bonusmodulo = (grandprixinfo.cup->numlevels+1)/(grandprixinfo.cup->numbonus+1);
|
||||
UINT8 bonusindex = (grandprixinfo.roundnum / bonusmodulo) - 1;
|
||||
|
||||
// If we're in a GP event, don't immediately follow it up with another.
|
||||
// I also suspect this will not work with online GP so I'm gonna prevent it right now.
|
||||
// The server might have to communicate eventmode (alongside other GP data) in XD_MAP later.
|
||||
if (netgame || grandprixinfo.eventmode != GPEVENT_NONE)
|
||||
if (netgame)
|
||||
;
|
||||
else if (grandprixinfo.eventmode != GPEVENT_NONE)
|
||||
{
|
||||
grandprixinfo.eventmode = GPEVENT_NONE;
|
||||
|
||||
|
|
@ -3774,11 +3794,13 @@ static void G_GetNextMap(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (grandprixinfo.roundnum == (grandprixinfo.cup->numlevels+1)/2) // 3 for a 5-map cup
|
||||
else if ((grandprixinfo.cup->numbonus > 0)
|
||||
&& (grandprixinfo.roundnum % bonusmodulo) == 0
|
||||
&& bonusindex < MAXBONUSLIST)
|
||||
{
|
||||
// todo any other condition?
|
||||
{
|
||||
const INT32 cupLevelNum = grandprixinfo.cup->cachedlevels[CUPCACHE_BONUS];
|
||||
const INT32 cupLevelNum = grandprixinfo.cup->cachedlevels[CUPCACHE_BONUS + bonusindex];
|
||||
if (cupLevelNum < nummapheaders && mapheaderinfo[cupLevelNum]
|
||||
&& mapheaderinfo[cupLevelNum]->typeoflevel & (TOL_BOSS|TOL_BATTLE))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -392,6 +392,7 @@ static const char *gamecontrolname[num_gamecontrols] =
|
|||
"console",
|
||||
"talk",
|
||||
"teamtalk",
|
||||
"rankings",
|
||||
"screenshot",
|
||||
"recordgif",
|
||||
};
|
||||
|
|
@ -528,7 +529,7 @@ void G_DefineDefaultControls(void)
|
|||
gamecontroldefault[gc_up ][0] = KEY_UPARROW;
|
||||
gamecontroldefault[gc_down ][0] = KEY_DOWNARROW;
|
||||
gamecontroldefault[gc_left ][0] = KEY_LEFTARROW;
|
||||
gamecontroldefault[gc_right][0] = KEY_RIGHTARROW;
|
||||
gamecontroldefault[gc_right ][0] = KEY_RIGHTARROW;
|
||||
gamecontroldefault[gc_a ][0] = 'z';
|
||||
gamecontroldefault[gc_b ][0] = 'x';
|
||||
gamecontroldefault[gc_c ][0] = 'c';
|
||||
|
|
@ -537,7 +538,8 @@ void G_DefineDefaultControls(void)
|
|||
gamecontroldefault[gc_z ][0] = 'd';
|
||||
gamecontroldefault[gc_l ][0] = 'q';
|
||||
gamecontroldefault[gc_r ][0] = 'e';
|
||||
gamecontroldefault[gc_start][0] = KEY_ESCAPE; // *
|
||||
gamecontroldefault[gc_start ][0] = KEY_ESCAPE; // *
|
||||
gamecontroldefault[gc_rankings][0] = KEY_TAB;
|
||||
|
||||
// Gamepad controls
|
||||
gamecontroldefault[gc_up ][1] = KEY_HAT1+0; // D-Pad Up
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ typedef enum
|
|||
gc_console,
|
||||
gc_talk,
|
||||
gc_teamtalk,
|
||||
gc_rankings,
|
||||
gc_screenshot,
|
||||
gc_recordgif,
|
||||
|
||||
|
|
|
|||
|
|
@ -188,6 +188,9 @@ void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t p
|
|||
offsetx = (float)(gpatch->leftoffset) * fscalew;
|
||||
|
||||
// top offset
|
||||
if (option & V_VFLIP)
|
||||
offsety = (float)(gpatch->height - gpatch->topoffset) * fscaleh;
|
||||
else
|
||||
offsety = (float)(gpatch->topoffset) * fscaleh;
|
||||
|
||||
cx -= offsetx;
|
||||
|
|
@ -249,8 +252,16 @@ void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t p
|
|||
v[2].s = v[1].s = hwrPatch->max_s;
|
||||
}
|
||||
|
||||
if (option & V_VFLIP)
|
||||
{
|
||||
v[0].t = v[1].t = hwrPatch->max_t;
|
||||
v[2].t = v[3].t = 0.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
v[0].t = v[1].t = 0.0f;
|
||||
v[2].t = v[3].t = hwrPatch->max_t;
|
||||
}
|
||||
|
||||
flags = PF_NoDepthTest;
|
||||
|
||||
|
|
|
|||
|
|
@ -5298,7 +5298,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
flip ^= (1<<rot);
|
||||
}
|
||||
|
||||
if (thing->skin && ((skin_t *)thing->skin)->flags & SF_HIRES)
|
||||
if (thing->skin && ((skin_t *)thing->skin)->highresscale != FRACUNIT)
|
||||
this_scale *= FIXED_TO_FLOAT(((skin_t *)thing->skin)->highresscale);
|
||||
|
||||
spr_width = spritecachedinfo[lumpoff].width;
|
||||
|
|
|
|||
|
|
@ -980,18 +980,27 @@ static void HU_TickSongCredits(void)
|
|||
|
||||
void HU_Ticker(void)
|
||||
{
|
||||
static boolean hu_holdscores = false;
|
||||
|
||||
if (dedicated)
|
||||
return;
|
||||
|
||||
hu_tick++;
|
||||
hu_tick &= 7; // currently only to blink chat input cursor
|
||||
|
||||
/*
|
||||
if (PlayerInputDown(1, gc_scores))
|
||||
hu_showscores = !chat_on;
|
||||
// Rankings
|
||||
if (G_PlayerInputDown(0, gc_rankings, 0))
|
||||
{
|
||||
if (!hu_holdscores)
|
||||
{
|
||||
hu_showscores ^= true;
|
||||
}
|
||||
hu_holdscores = true;
|
||||
}
|
||||
else
|
||||
hu_showscores = false;
|
||||
*/
|
||||
{
|
||||
hu_holdscores = false;
|
||||
}
|
||||
|
||||
hu_keystrokes = false;
|
||||
|
||||
|
|
@ -2066,18 +2075,8 @@ void HU_DrawSongCredits(void)
|
|||
//
|
||||
void HU_Drawer(void)
|
||||
{
|
||||
if (cv_vhseffect.value && (paused || (demo.playback && cv_playbackspeed.value > 1)))
|
||||
V_DrawVhsEffect(demo.rewinding);
|
||||
|
||||
// draw chat string plus cursor
|
||||
if (chat_on)
|
||||
{
|
||||
if (!OLDCHAT)
|
||||
HU_DrawChat();
|
||||
else
|
||||
HU_DrawChat_Old();
|
||||
}
|
||||
else
|
||||
// Closed chat
|
||||
if (!chat_on)
|
||||
{
|
||||
typelines = 1;
|
||||
chat_scrolltime = 0;
|
||||
|
|
@ -2086,15 +2085,8 @@ void HU_Drawer(void)
|
|||
HU_drawMiniChat(); // draw messages in a cool fashion.
|
||||
}
|
||||
|
||||
if (cechotimer)
|
||||
HU_DrawCEcho();
|
||||
|
||||
if (!( Playing() || demo.playback )
|
||||
|| gamestate == GS_INTERMISSION || gamestate == GS_CUTSCENE
|
||||
|| gamestate == GS_CREDITS || gamestate == GS_EVALUATION
|
||||
|| gamestate == GS_ENDING || gamestate == GS_GAMEEND
|
||||
|| gamestate == GS_VOTING || gamestate == GS_WAITINGPLAYERS) // SRB2kart
|
||||
return;
|
||||
if (gamestate != GS_LEVEL)
|
||||
goto drawontop;
|
||||
|
||||
// draw multiplayer rankings
|
||||
if (hu_showscores)
|
||||
|
|
@ -2117,12 +2109,8 @@ void HU_Drawer(void)
|
|||
}
|
||||
}
|
||||
|
||||
if (gamestate != GS_LEVEL)
|
||||
return;
|
||||
|
||||
// draw song credits
|
||||
if (cv_songcredits.value && !( hu_showscores && (netgame || multiplayer) ))
|
||||
HU_DrawSongCredits();
|
||||
if (cv_vhseffect.value && (paused || (demo.playback && cv_playbackspeed.value > 1)))
|
||||
V_DrawVhsEffect(demo.rewinding);
|
||||
|
||||
// draw desynch text
|
||||
if (hu_redownloadinggamestate)
|
||||
|
|
@ -2138,20 +2126,22 @@ void HU_Drawer(void)
|
|||
V_DrawCenteredString(BASEVIDWIDTH/2, 180, V_YELLOWMAP | V_ALLOWLOWERCASE, resynch_text);
|
||||
}
|
||||
|
||||
if (modeattacking && pausedelay > 0 && !pausebreakkey)
|
||||
drawontop:
|
||||
// Opened chat
|
||||
if (chat_on)
|
||||
{
|
||||
INT32 strength = ((pausedelay - 1 - NEWTICRATE/2)*10)/(NEWTICRATE/3);
|
||||
INT32 x = BASEVIDWIDTH/2, y = BASEVIDHEIGHT/2; // obviously incorrect values while we scrap hudinfo
|
||||
|
||||
V_DrawThinString(x, y,
|
||||
((leveltime & 4) ? V_SKYMAP : V_BLUEMAP),
|
||||
"HOLD TO RETRY...");
|
||||
|
||||
if (strength > 9)
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 0);
|
||||
else if (strength > 0)
|
||||
V_DrawFadeScreen(0, strength);
|
||||
if (!OLDCHAT)
|
||||
HU_DrawChat();
|
||||
else
|
||||
HU_DrawChat_Old();
|
||||
}
|
||||
|
||||
if (cechotimer)
|
||||
HU_DrawCEcho();
|
||||
|
||||
// draw song credits
|
||||
if (cv_songcredits.value && !( hu_showscores && (netgame || multiplayer) ))
|
||||
HU_DrawSongCredits();
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
|
|
|
|||
34
src/info.c
34
src/info.c
|
|
@ -543,6 +543,9 @@ char sprnames[NUMSPRITES + 1][5] =
|
|||
"KINF", // Invincibility flash
|
||||
"INVI", // Invincibility speedlines
|
||||
"ICAP", // Item capsules
|
||||
"MGBX", // Heavy Magician transform box
|
||||
"MGBT", // Heavy Magician transform box top
|
||||
"MGBB", // Heavy Magician transform box bottom
|
||||
|
||||
"WIPD", // Wipeout dust trail
|
||||
"DRIF", // Drift Sparks
|
||||
|
|
@ -3891,6 +3894,10 @@ state_t states[NUMSTATES] =
|
|||
//{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_MGBX, FF_PAPERSPRITE|0, -1, {NULL}, 0, 0, S_NULL}, // S_MAGICIANBOX
|
||||
{SPR_MGBT, FF_FLOORSPRITE|0, -1, {NULL}, 0, 0, S_NULL}, // S_MAGICIANBOX_TOP
|
||||
{SPR_MGBB, FF_FLOORSPRITE|0, -1, {NULL}, 0, 0, S_NULL}, // S_MAGICIANBOX_BOTTOM
|
||||
|
||||
{SPR_SGNS, FF_ADD|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_SIGNSPARK2}, // S_SIGNSPARK1
|
||||
{SPR_SGNS, FF_ADD|FF_FULLBRIGHT|1, 1, {NULL}, 0, 0, S_SIGNSPARK3}, // S_SIGNSPARK2
|
||||
{SPR_SGNS, FF_ADD|FF_FULLBRIGHT|2, 1, {NULL}, 0, 0, S_SIGNSPARK4}, // S_SIGNSPARK3
|
||||
|
|
@ -22398,6 +22405,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_MAGICIANBOX
|
||||
-1, // doomednum
|
||||
S_MAGICIANBOX, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
0, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
S_NULL, // painstate
|
||||
0, // painchance
|
||||
sfx_None, // painsound
|
||||
S_NULL, // meleestate
|
||||
S_NULL, // missilestate
|
||||
S_NULL, // deathstate
|
||||
S_NULL, // xdeathstate
|
||||
sfx_None, // deathsound
|
||||
0, // speed
|
||||
20*FRACUNIT, // radius
|
||||
20*FRACUNIT, // height
|
||||
0, // display offset
|
||||
100, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPTHING|MF_NOCLIPHEIGHT, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_SIGNSPARKLE
|
||||
-1, // doomednum
|
||||
S_SIGNSPARK1, // spawnstate
|
||||
|
|
|
|||
|
|
@ -1089,6 +1089,9 @@ typedef enum sprite
|
|||
SPR_KINF, // Invincibility flash
|
||||
SPR_INVI, // Invincibility speedlines
|
||||
SPR_ICAP, // Item capsules
|
||||
SPR_MGBX, // Heavy Magician transform box
|
||||
SPR_MGBT, // Heavy Magician transform box top
|
||||
SPR_MGBB, // Heavy Magician transform box bottom
|
||||
|
||||
SPR_WIPD, // Wipeout dust trail
|
||||
SPR_DRIF, // Drift Sparks
|
||||
|
|
@ -4295,6 +4298,10 @@ typedef enum state
|
|||
//S_ITEMCAPSULE_BOTTOM,
|
||||
//S_ITEMCAPSULE_INSIDE,
|
||||
|
||||
S_MAGICIANBOX,
|
||||
S_MAGICIANBOX_TOP,
|
||||
S_MAGICIANBOX_BOTTOM,
|
||||
|
||||
// Signpost sparkles
|
||||
S_SIGNSPARK1,
|
||||
S_SIGNSPARK2,
|
||||
|
|
@ -6333,6 +6340,7 @@ typedef enum mobj_type
|
|||
MT_FLOATINGITEM,
|
||||
MT_ITEMCAPSULE,
|
||||
MT_ITEMCAPSULE_PART,
|
||||
MT_MAGICIANBOX,
|
||||
|
||||
MT_SIGNSPARKLE,
|
||||
|
||||
|
|
|
|||
|
|
@ -655,12 +655,12 @@ boolean K_BubbleShieldCollide(mobj_t *t1, mobj_t *t2)
|
|||
{
|
||||
// Counter desyncs
|
||||
/*mobj_t *oldthing = thing;
|
||||
mobj_t *oldtmthing = tmthing;
|
||||
mobj_t *oldtm.thing = tm.thing;
|
||||
|
||||
P_Thrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y), 4*thing->scale);
|
||||
P_Thrust(tm.thing, R_PointToAngle2(thing->x, thing->y, tm.thing->x, tm.thing->y), 4*thing->scale);
|
||||
|
||||
thing = oldthing;
|
||||
P_SetTarget(&tmthing, oldtmthing);*/
|
||||
P_SetTarget(&tm.thing, oldtm.thing);*/
|
||||
|
||||
if (P_PlayerInPain(t2->player)
|
||||
|| t2->player->flashing || t2->player->hyudorotimer
|
||||
|
|
|
|||
44
src/k_hud.c
44
src/k_hud.c
|
|
@ -1574,8 +1574,8 @@ static fixed_t K_DrawKartPositionNumPatch(UINT8 num, UINT8 *color, fixed_t x, fi
|
|||
overlayFlags[1] = V_SUBTRACT;
|
||||
}
|
||||
|
||||
w = kp_positionnum[num][0][splitIndex]->width * scale;
|
||||
h = kp_positionnum[num][0][splitIndex]->height * scale;
|
||||
w = SHORT(kp_positionnum[num][0][splitIndex]->width) * scale;
|
||||
h = SHORT(kp_positionnum[num][0][splitIndex]->height) * scale;
|
||||
|
||||
if (flags & V_SNAPTORIGHT)
|
||||
{
|
||||
|
|
@ -1597,7 +1597,12 @@ static fixed_t K_DrawKartPositionNumPatch(UINT8 num, UINT8 *color, fixed_t x, fi
|
|||
);
|
||||
}
|
||||
|
||||
return (x - w);
|
||||
if (!(flags & V_SNAPTORIGHT))
|
||||
{
|
||||
x -= w;
|
||||
}
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
static void K_DrawKartPositionNum(INT32 num)
|
||||
|
|
@ -1745,7 +1750,10 @@ static boolean K_drawKartPositionFaces(void)
|
|||
boolean completed[MAXPLAYERS];
|
||||
INT32 rankplayer[MAXPLAYERS];
|
||||
INT32 bumperx, emeraldx, numplayersingame = 0;
|
||||
INT32 xoff, yoff, flipflag = 0;
|
||||
UINT8 workingskin;
|
||||
UINT8 *colormap;
|
||||
UINT32 skinflags;
|
||||
|
||||
ranklines = 0;
|
||||
memset(completed, 0, sizeof (completed));
|
||||
|
|
@ -1830,15 +1838,36 @@ static boolean K_drawKartPositionFaces(void)
|
|||
bumperx = FACE_X+19;
|
||||
emeraldx = FACE_X+16;
|
||||
|
||||
skinflags = (demo.playback)
|
||||
? demo.skinlist[demo.currentskinid[rankplayer[i]]].flags
|
||||
: skins[players[rankplayer[i]].skin].flags;
|
||||
|
||||
// Flip SF_IRONMAN portraits, but only if they're transformed
|
||||
if (skinflags & SF_IRONMAN
|
||||
&& !(players[rankplayer[i]].charflags & SF_IRONMAN) )
|
||||
{
|
||||
flipflag = V_FLIP|V_VFLIP; // blonic flip
|
||||
xoff = yoff = 16;
|
||||
} else
|
||||
{
|
||||
flipflag = 0;
|
||||
xoff = yoff = 0;
|
||||
}
|
||||
|
||||
if (players[rankplayer[i]].mo->color)
|
||||
{
|
||||
colormap = R_GetTranslationColormap(players[rankplayer[i]].skin, players[rankplayer[i]].mo->color, GTC_CACHE);
|
||||
if ((skin_t*)players[rankplayer[i]].mo->skin)
|
||||
workingskin = (skin_t*)players[rankplayer[i]].mo->skin - skins;
|
||||
else
|
||||
workingskin = players[rankplayer[i]].skin;
|
||||
|
||||
colormap = R_GetTranslationColormap(workingskin, players[rankplayer[i]].mo->color, GTC_CACHE);
|
||||
if (players[rankplayer[i]].mo->colorized)
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, players[rankplayer[i]].mo->color, GTC_CACHE);
|
||||
else
|
||||
colormap = R_GetTranslationColormap(players[rankplayer[i]].skin, players[rankplayer[i]].mo->color, GTC_CACHE);
|
||||
colormap = R_GetTranslationColormap(workingskin, players[rankplayer[i]].mo->color, GTC_CACHE);
|
||||
|
||||
V_DrawMappedPatch(FACE_X, Y, V_HUDTRANS|V_SLIDEIN|V_SNAPTOLEFT, faceprefix[players[rankplayer[i]].skin][FACE_RANK], colormap);
|
||||
V_DrawMappedPatch(FACE_X + xoff, Y + yoff, V_HUDTRANS|V_SLIDEIN|V_SNAPTOLEFT|flipflag, faceprefix[workingskin][FACE_RANK], colormap);
|
||||
|
||||
if (LUA_HudEnabled(hud_battlebumpers))
|
||||
{
|
||||
|
|
@ -4634,7 +4663,8 @@ static void K_DrawWaypointDebugger(void)
|
|||
if (stplyr != &players[displayplayers[0]]) // only for p1
|
||||
return;
|
||||
|
||||
V_DrawString(8, 166, 0, va("'Best' Waypoint ID: %d", K_GetWaypointID(stplyr->nextwaypoint)));
|
||||
V_DrawString(8, 156, 0, va("Current Waypoint ID: %d", K_GetWaypointID(stplyr->currentwaypoint)));
|
||||
V_DrawString(8, 166, 0, va("Next Waypoint ID: %d", K_GetWaypointID(stplyr->nextwaypoint)));
|
||||
V_DrawString(8, 176, 0, va("Finishline Distance: %d", stplyr->distancetofinish));
|
||||
|
||||
if (numstarposts > 0)
|
||||
|
|
|
|||
384
src/k_kart.c
384
src/k_kart.c
|
|
@ -195,6 +195,22 @@ UINT32 K_GetPlayerDontDrawFlag(player_t *player)
|
|||
return flag;
|
||||
}
|
||||
|
||||
void K_ReduceVFX(mobj_t *mo, player_t *owner)
|
||||
{
|
||||
if (cv_reducevfx.value == 0)
|
||||
{
|
||||
// Leave the visuals alone.
|
||||
return;
|
||||
}
|
||||
|
||||
mo->renderflags |= RF_DONTDRAW;
|
||||
|
||||
if (owner != NULL)
|
||||
{
|
||||
mo->renderflags &= ~K_GetPlayerDontDrawFlag(owner);
|
||||
}
|
||||
}
|
||||
|
||||
player_t *K_GetItemBoxPlayer(mobj_t *mobj)
|
||||
{
|
||||
fixed_t closest = INT32_MAX;
|
||||
|
|
@ -334,6 +350,8 @@ void K_RegisterKartStuff(void)
|
|||
CV_RegisterVar(&cv_kartdebugdirector);
|
||||
CV_RegisterVar(&cv_spbtest);
|
||||
CV_RegisterVar(&cv_gptest);
|
||||
|
||||
CV_RegisterVar(&cv_reducevfx);
|
||||
}
|
||||
|
||||
//}
|
||||
|
|
@ -2432,6 +2450,8 @@ spawn_brake_dust
|
|||
|
||||
P_SetScale(spark, (spark->destscale =
|
||||
FixedMul(scale, spark->scale)));
|
||||
|
||||
K_ReduceVFX(spark, master->player);
|
||||
}
|
||||
|
||||
static void K_SpawnBrakeVisuals(player_t *player)
|
||||
|
|
@ -2474,7 +2494,7 @@ static void K_SpawnBrakeVisuals(player_t *player)
|
|||
}
|
||||
|
||||
if (leveltime % 4 == 0)
|
||||
S_StartSound(player->mo, sfx_s3k67);
|
||||
S_ReducedVFXSound(player->mo, sfx_s3k67, player);
|
||||
|
||||
/* vertical shaking, scales with speed */
|
||||
player->mo->spriteyoffset = P_RandomFlip(2 * scale);
|
||||
|
|
@ -2507,6 +2527,8 @@ void K_SpawnDriftBoostClip(player_t *player)
|
|||
P_InstaThrust(clip, player->mo->angle +
|
||||
P_RandomFlip(P_RandomRange(PR_DECORATION, FRACUNIT/2, FRACUNIT)),
|
||||
FixedMul(scale, player->speed));
|
||||
|
||||
K_ReduceVFX(clip, player);
|
||||
}
|
||||
|
||||
void K_SpawnDriftBoostClipSpark(mobj_t *clip)
|
||||
|
|
@ -2557,6 +2579,7 @@ static void K_SpawnGenericSpeedLines(player_t *player, boolean top)
|
|||
}
|
||||
|
||||
K_MatchGenericExtraFlags(fast, player->mo);
|
||||
K_ReduceVFX(fast, player);
|
||||
|
||||
if (top)
|
||||
{
|
||||
|
|
@ -2619,6 +2642,7 @@ void K_SpawnInvincibilitySpeedLines(mobj_t *mo)
|
|||
fast->momz = 3*P_GetMobjZMovement(mo)/4;
|
||||
|
||||
K_MatchGenericExtraFlags(fast, mo);
|
||||
K_ReduceVFX(fast, mo->player);
|
||||
|
||||
fast->color = mo->color;
|
||||
fast->colorized = true;
|
||||
|
|
@ -2717,6 +2741,47 @@ void K_SpawnBumpEffect(mobj_t *mo)
|
|||
S_StartSound(mo, sfx_s3k49);
|
||||
}
|
||||
|
||||
void K_SpawnMagicianParticles(mobj_t *mo, int spread)
|
||||
{
|
||||
INT32 i;
|
||||
mobj_t *target = mo->target;
|
||||
|
||||
if (P_MobjWasRemoved(target))
|
||||
target = mo;
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
fixed_t hmomentum = P_RandomRange(PR_DECORATION, spread * -1, spread) * mo->scale;
|
||||
fixed_t vmomentum = P_RandomRange(PR_DECORATION, spread * -1, spread) * mo->scale;
|
||||
UINT16 color = P_RandomKey(PR_DECORATION, numskincolors);
|
||||
|
||||
fixed_t ang = FixedAngle(P_RandomRange(PR_DECORATION, 0, 359)*FRACUNIT);
|
||||
SINT8 flip = 1;
|
||||
|
||||
mobj_t *dust;
|
||||
|
||||
if (i & 1)
|
||||
ang -= ANGLE_90;
|
||||
else
|
||||
ang += ANGLE_90;
|
||||
|
||||
dust = P_SpawnMobjFromMobj(mo,
|
||||
FixedMul(mo->radius, FINECOSINE(ang >> ANGLETOFINESHIFT)),
|
||||
FixedMul(mo->radius, FINESINE(ang >> ANGLETOFINESHIFT)),
|
||||
target->height, (i%3 == 0) ? MT_SIGNSPARKLE : MT_SPINDASHDUST
|
||||
);
|
||||
flip = P_MobjFlip(dust);
|
||||
|
||||
dust->momx = target->momx + FixedMul(hmomentum, FINECOSINE(ang >> ANGLETOFINESHIFT));
|
||||
dust->momy = target->momy + FixedMul(hmomentum, FINESINE(ang >> ANGLETOFINESHIFT));
|
||||
dust->momz = vmomentum * flip;
|
||||
dust->scale = dust->scale*4;
|
||||
dust->frame |= FF_SUBTRACT|FF_TRANS90;
|
||||
dust->color = color;
|
||||
dust->colorized = true;
|
||||
}
|
||||
}
|
||||
|
||||
static SINT8 K_GlanceAtPlayers(player_t *glancePlayer)
|
||||
{
|
||||
const fixed_t maxdistance = FixedMul(1280 * mapobjectscale, K_GetKartGameSpeedScalar(gamespeed));
|
||||
|
|
@ -3445,6 +3510,8 @@ boolean K_WaterRun(mobj_t *mobj)
|
|||
|
||||
case MT_PLAYER:
|
||||
{
|
||||
fixed_t minspeed = 0;
|
||||
|
||||
if (mobj->player == NULL)
|
||||
{
|
||||
return false;
|
||||
|
|
@ -3455,11 +3522,18 @@ boolean K_WaterRun(mobj_t *mobj)
|
|||
return K_IsHoldingDownTop(mobj->player) == false;
|
||||
}
|
||||
|
||||
minspeed = 2 * K_GetKartSpeed(mobj->player, false, false); // 200%
|
||||
|
||||
if (mobj->player->speed < minspeed / 5) // 40%
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mobj->player->invincibilitytimer
|
||||
|| mobj->player->sneakertimer
|
||||
|| mobj->player->tiregrease
|
||||
|| mobj->player->flamedash
|
||||
|| mobj->player->speed > 2 * K_GetKartSpeed(mobj->player, false, false))
|
||||
|| mobj->player->speed > minspeed)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
@ -3617,6 +3691,7 @@ void K_SpawnWaterRunParticles(mobj_t *mobj)
|
|||
water->momz = mobj->momz;
|
||||
P_SetScale(water, trailScale);
|
||||
P_SetMobjState(water, curUnderlayFrame);
|
||||
K_ReduceVFX(water, mobj->player);
|
||||
|
||||
// overlay
|
||||
water = P_SpawnMobj(x1, y1,
|
||||
|
|
@ -3628,6 +3703,7 @@ void K_SpawnWaterRunParticles(mobj_t *mobj)
|
|||
water->momz = mobj->momz;
|
||||
P_SetScale(water, trailScale);
|
||||
P_SetMobjState(water, curOverlayFrame);
|
||||
K_ReduceVFX(water, mobj->player);
|
||||
|
||||
// Right
|
||||
// Underlay
|
||||
|
|
@ -3640,6 +3716,7 @@ void K_SpawnWaterRunParticles(mobj_t *mobj)
|
|||
water->momz = mobj->momz;
|
||||
P_SetScale(water, trailScale);
|
||||
P_SetMobjState(water, curUnderlayFrame);
|
||||
K_ReduceVFX(water, mobj->player);
|
||||
|
||||
// Overlay
|
||||
water = P_SpawnMobj(x2, y2,
|
||||
|
|
@ -3651,11 +3728,12 @@ void K_SpawnWaterRunParticles(mobj_t *mobj)
|
|||
water->momz = mobj->momz;
|
||||
P_SetScale(water, trailScale);
|
||||
P_SetMobjState(water, curOverlayFrame);
|
||||
K_ReduceVFX(water, mobj->player);
|
||||
|
||||
if (!S_SoundPlaying(mobj, sfx_s3kdbs))
|
||||
{
|
||||
const INT32 volume = (min(trailScale, FRACUNIT) * 255) / FRACUNIT;
|
||||
S_StartSoundAtVolume(mobj, sfx_s3kdbs, volume);
|
||||
S_ReducedVFXSoundAtVolume(mobj, sfx_s3kdbs, volume, mobj->player);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3664,7 +3742,7 @@ void K_SpawnWaterRunParticles(mobj_t *mobj)
|
|||
{
|
||||
if (P_RandomChance(PR_BUBBLE, FRACUNIT/2) && leveltime % TICRATE == 0)
|
||||
{
|
||||
S_StartSound(mobj, sfx_floush);
|
||||
S_ReducedVFXSound(mobj, sfx_floush, mobj->player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -5403,6 +5481,7 @@ static void K_SpawnDriftElectricity(player_t *player)
|
|||
spark->momz = mo->momz;
|
||||
spark->color = color;
|
||||
K_GenericExtraFlagsNoZAdjust(spark, mo);
|
||||
K_ReduceVFX(spark, player);
|
||||
|
||||
spark->spritexscale += scalefactor/3;
|
||||
spark->spriteyscale += scalefactor/8;
|
||||
|
|
@ -5452,10 +5531,11 @@ void K_SpawnDriftElectricSparks(player_t *player, int color, boolean shockwave)
|
|||
spark->frame |= FF_ADD;
|
||||
|
||||
sparkangle += ANGLE_90;
|
||||
K_ReduceVFX(spark, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
S_StartSound(mo, sfx_s3k45);
|
||||
S_ReducedVFXSound(mo, sfx_s3k45, player);
|
||||
}
|
||||
|
||||
static void K_SpawnDriftSparks(player_t *player)
|
||||
|
|
@ -5602,6 +5682,7 @@ static void K_SpawnDriftSparks(player_t *player)
|
|||
spark->tics += trail;
|
||||
|
||||
K_MatchGenericExtraFlags(spark, player->mo);
|
||||
K_ReduceVFX(spark, player);
|
||||
}
|
||||
|
||||
if (player->driftcharge >= dsthree)
|
||||
|
|
@ -8839,6 +8920,7 @@ void K_KartPlayerAfterThink(player_t *player)
|
|||
--------------------------------------------------*/
|
||||
static waypoint_t *K_GetPlayerNextWaypoint(player_t *player)
|
||||
{
|
||||
waypoint_t *finishline = K_GetFinishLineWaypoint();
|
||||
waypoint_t *bestwaypoint = NULL;
|
||||
|
||||
if ((player != NULL) && (player->mo != NULL) && (P_MobjWasRemoved(player->mo) == false))
|
||||
|
|
@ -8846,7 +8928,8 @@ static waypoint_t *K_GetPlayerNextWaypoint(player_t *player)
|
|||
waypoint_t *waypoint = K_GetBestWaypointForMobj(player->mo);
|
||||
boolean updaterespawn = false;
|
||||
|
||||
bestwaypoint = waypoint;
|
||||
// Our current waypoint.
|
||||
player->currentwaypoint = bestwaypoint = waypoint;
|
||||
|
||||
// check the waypoint's location in relation to the player
|
||||
// If it's generally in front, it's fine, otherwise, use the best next/previous waypoint.
|
||||
|
|
@ -8854,13 +8937,12 @@ static waypoint_t *K_GetPlayerNextWaypoint(player_t *player)
|
|||
// Otherwise it breaks the distance calculations.
|
||||
if (waypoint != NULL)
|
||||
{
|
||||
boolean finishlinehack = false;
|
||||
angle_t playerangle = player->mo->angle;
|
||||
angle_t momangle = K_MomentumAngle(player->mo);
|
||||
angle_t angletowaypoint =
|
||||
R_PointToAngle2(player->mo->x, player->mo->y, waypoint->mobj->x, waypoint->mobj->y);
|
||||
angle_t angledelta = ANGLE_MAX;
|
||||
angle_t momdelta = ANGLE_MAX;
|
||||
angle_t angledelta = ANGLE_180;
|
||||
angle_t momdelta = ANGLE_180;
|
||||
|
||||
angledelta = playerangle - angletowaypoint;
|
||||
if (angledelta > ANGLE_180)
|
||||
|
|
@ -8874,36 +8956,17 @@ static waypoint_t *K_GetPlayerNextWaypoint(player_t *player)
|
|||
momdelta = InvAngle(momdelta);
|
||||
}
|
||||
|
||||
if (bestwaypoint == K_GetFinishLineWaypoint())
|
||||
{
|
||||
waypoint_t *nextwaypoint = waypoint->nextwaypoints[0];
|
||||
angle_t angletonextwaypoint =
|
||||
R_PointToAngle2(waypoint->mobj->x, waypoint->mobj->y, nextwaypoint->mobj->x, nextwaypoint->mobj->y);
|
||||
|
||||
// facing towards the finishline
|
||||
if (AngleDelta(angletonextwaypoint, angletowaypoint) <= ANGLE_90)
|
||||
{
|
||||
finishlinehack = true;
|
||||
}
|
||||
}
|
||||
|
||||
// We're using a lot of angle calculations here, because only using facing angle or only using momentum angle both have downsides.
|
||||
// nextwaypoints will be picked if you're facing OR moving forward.
|
||||
// prevwaypoints will be picked if you're facing AND moving backward.
|
||||
if ((angledelta > ANGLE_45 || momdelta > ANGLE_45)
|
||||
&& (finishlinehack == false))
|
||||
#if 0
|
||||
if (angledelta > ANGLE_45 || momdelta > ANGLE_45)
|
||||
#endif
|
||||
{
|
||||
angle_t nextbestdelta = angledelta;
|
||||
angle_t nextbestmomdelta = momdelta;
|
||||
angle_t nextbestdelta = ANGLE_90;
|
||||
angle_t nextbestmomdelta = ANGLE_90;
|
||||
size_t i = 0U;
|
||||
|
||||
if (K_PlayerUsesBotMovement(player))
|
||||
{
|
||||
// Try to force bots to use a next waypoint
|
||||
nextbestdelta = ANGLE_MAX;
|
||||
nextbestmomdelta = ANGLE_MAX;
|
||||
}
|
||||
|
||||
if ((waypoint->nextwaypoints != NULL) && (waypoint->numnextwaypoints > 0U))
|
||||
{
|
||||
for (i = 0U; i < waypoint->numnextwaypoints; i++)
|
||||
|
|
@ -8945,11 +9008,20 @@ static waypoint_t *K_GetPlayerNextWaypoint(player_t *player)
|
|||
|
||||
if (angledelta < nextbestdelta || momdelta < nextbestmomdelta)
|
||||
{
|
||||
if (P_TraceBlockingLines(player->mo, waypoint->nextwaypoints[i]->mobj) == false)
|
||||
// Wanted to use a next waypoint, so remove WRONG WAY flag.
|
||||
// Done here instead of when set, because of finish line
|
||||
// hacks meaning we might not actually use this one, but
|
||||
// we still want to acknowledge we're facing the right way.
|
||||
player->pflags &= ~PF_WRONGWAY;
|
||||
|
||||
if (waypoint->nextwaypoints[i] != finishline) // Allow finish line.
|
||||
{
|
||||
if (P_TraceWaypointTraversal(player->mo, waypoint->nextwaypoints[i]->mobj) == false)
|
||||
{
|
||||
// Save sight checks when all of the other checks pass, so we only do it if we have to
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
bestwaypoint = waypoint->nextwaypoints[i];
|
||||
|
||||
|
|
@ -8962,8 +9034,6 @@ static waypoint_t *K_GetPlayerNextWaypoint(player_t *player)
|
|||
nextbestmomdelta = momdelta;
|
||||
}
|
||||
|
||||
// Remove wrong way flag if we're using nextwaypoints
|
||||
player->pflags &= ~PF_WRONGWAY;
|
||||
updaterespawn = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -8997,7 +9067,7 @@ static waypoint_t *K_GetPlayerNextWaypoint(player_t *player)
|
|||
|
||||
if (angledelta < nextbestdelta && momdelta < nextbestmomdelta)
|
||||
{
|
||||
if (P_TraceBlockingLines(player->mo, waypoint->prevwaypoints[i]->mobj) == false)
|
||||
if (P_TraceWaypointTraversal(player->mo, waypoint->prevwaypoints[i]->mobj) == false)
|
||||
{
|
||||
// Save sight checks when all of the other checks pass, so we only do it if we have to
|
||||
continue;
|
||||
|
|
@ -9037,69 +9107,6 @@ static waypoint_t *K_GetPlayerNextWaypoint(player_t *player)
|
|||
return bestwaypoint;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static boolean K_PlayerCloserToNextWaypoints(waypoint_t *const waypoint, player_t *const player)
|
||||
{
|
||||
boolean nextiscloser = true;
|
||||
|
||||
if ((waypoint != NULL) && (player != NULL) && (player->mo != NULL))
|
||||
{
|
||||
size_t i = 0U;
|
||||
waypoint_t *currentwpcheck = NULL;
|
||||
angle_t angletoplayer = ANGLE_MAX;
|
||||
angle_t currentanglecheck = ANGLE_MAX;
|
||||
angle_t bestangle = ANGLE_MAX;
|
||||
|
||||
angletoplayer = R_PointToAngle2(waypoint->mobj->x, waypoint->mobj->y,
|
||||
player->mo->x, player->mo->y);
|
||||
|
||||
for (i = 0U; i < waypoint->numnextwaypoints; i++)
|
||||
{
|
||||
currentwpcheck = waypoint->nextwaypoints[i];
|
||||
currentanglecheck = R_PointToAngle2(
|
||||
waypoint->mobj->x, waypoint->mobj->y, currentwpcheck->mobj->x, currentwpcheck->mobj->y);
|
||||
|
||||
// Get delta angle
|
||||
currentanglecheck = currentanglecheck - angletoplayer;
|
||||
|
||||
if (currentanglecheck > ANGLE_180)
|
||||
{
|
||||
currentanglecheck = InvAngle(currentanglecheck);
|
||||
}
|
||||
|
||||
if (currentanglecheck < bestangle)
|
||||
{
|
||||
bestangle = currentanglecheck;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0U; i < waypoint->numprevwaypoints; i++)
|
||||
{
|
||||
currentwpcheck = waypoint->prevwaypoints[i];
|
||||
currentanglecheck = R_PointToAngle2(
|
||||
waypoint->mobj->x, waypoint->mobj->y, currentwpcheck->mobj->x, currentwpcheck->mobj->y);
|
||||
|
||||
// Get delta angle
|
||||
currentanglecheck = currentanglecheck - angletoplayer;
|
||||
|
||||
if (currentanglecheck > ANGLE_180)
|
||||
{
|
||||
currentanglecheck = InvAngle(currentanglecheck);
|
||||
}
|
||||
|
||||
if (currentanglecheck < bestangle)
|
||||
{
|
||||
bestangle = currentanglecheck;
|
||||
nextiscloser = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nextiscloser;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*--------------------------------------------------
|
||||
void K_UpdateDistanceFromFinishLine(player_t *const player)
|
||||
|
||||
|
|
@ -9141,7 +9148,7 @@ void K_UpdateDistanceFromFinishLine(player_t *const player)
|
|||
// Player has finished, we don't need to calculate this
|
||||
player->distancetofinish = 0U;
|
||||
}
|
||||
else if ((player->nextwaypoint != NULL) && (finishline != NULL))
|
||||
else if ((player->currentwaypoint != NULL) && (player->nextwaypoint != NULL) && (finishline != NULL))
|
||||
{
|
||||
const boolean useshortcuts = false;
|
||||
const boolean huntbackwards = false;
|
||||
|
|
@ -9155,17 +9162,139 @@ void K_UpdateDistanceFromFinishLine(player_t *const player)
|
|||
// Using shortcuts won't find a path, so distance won't be updated until the player gets back on track
|
||||
if (pathfindsuccess == true)
|
||||
{
|
||||
// Add euclidean distance to the next waypoint to the distancetofinish
|
||||
UINT32 adddist;
|
||||
fixed_t disttowaypoint =
|
||||
const boolean pathBackwardsReverse = ((player->pflags & PF_WRONGWAY) == 0);
|
||||
boolean pathBackwardsSuccess = false;
|
||||
path_t pathBackwards = {0};
|
||||
|
||||
fixed_t disttonext = 0;
|
||||
UINT32 traveldist = 0;
|
||||
UINT32 adddist = 0;
|
||||
|
||||
disttonext =
|
||||
P_AproxDistance(
|
||||
(player->mo->x >> FRACBITS) - (player->nextwaypoint->mobj->x >> FRACBITS),
|
||||
(player->mo->y >> FRACBITS) - (player->nextwaypoint->mobj->y >> FRACBITS));
|
||||
disttowaypoint = P_AproxDistance(disttowaypoint, (player->mo->z >> FRACBITS) - (player->nextwaypoint->mobj->z >> FRACBITS));
|
||||
disttonext = P_AproxDistance(disttonext, (player->mo->z >> FRACBITS) - (player->nextwaypoint->mobj->z >> FRACBITS));
|
||||
|
||||
traveldist = ((UINT32)disttonext) * 2;
|
||||
pathBackwardsSuccess =
|
||||
K_PathfindThruCircuit(player->nextwaypoint, traveldist, &pathBackwards, false, pathBackwardsReverse);
|
||||
|
||||
if (pathBackwardsSuccess == true)
|
||||
{
|
||||
if (pathBackwards.numnodes > 1)
|
||||
{
|
||||
// Find the closest segment, and add the distance to reach it.
|
||||
vector3_t point;
|
||||
size_t i;
|
||||
|
||||
vector3_t best;
|
||||
fixed_t bestPoint = INT32_MAX;
|
||||
fixed_t bestDist = INT32_MAX;
|
||||
UINT32 bestGScore = UINT32_MAX;
|
||||
|
||||
point.x = player->mo->x;
|
||||
point.y = player->mo->y;
|
||||
point.z = player->mo->z;
|
||||
|
||||
best.x = point.x;
|
||||
best.y = point.y;
|
||||
best.z = point.z;
|
||||
|
||||
for (i = 1; i < pathBackwards.numnodes; i++)
|
||||
{
|
||||
vector3_t line[2];
|
||||
vector3_t result;
|
||||
|
||||
waypoint_t *pwp = (waypoint_t *)pathBackwards.array[i - 1].nodedata;
|
||||
waypoint_t *wp = (waypoint_t *)pathBackwards.array[i].nodedata;
|
||||
|
||||
fixed_t pDist = 0;
|
||||
UINT32 g = pathBackwards.array[i - 1].gscore;
|
||||
|
||||
line[0].x = pwp->mobj->x;
|
||||
line[0].y = pwp->mobj->y;
|
||||
line[0].z = pwp->mobj->z;
|
||||
|
||||
line[1].x = wp->mobj->x;
|
||||
line[1].y = wp->mobj->y;
|
||||
line[1].z = wp->mobj->z;
|
||||
|
||||
P_ClosestPointOnLine3D(&point, line, &result);
|
||||
|
||||
pDist = P_AproxDistance(point.x - result.x, point.y - result.y);
|
||||
pDist = P_AproxDistance(pDist, point.z - result.z);
|
||||
|
||||
if (pDist < bestPoint)
|
||||
{
|
||||
FV3_Copy(&best, &result);
|
||||
|
||||
bestPoint = pDist;
|
||||
|
||||
bestDist =
|
||||
P_AproxDistance(
|
||||
(result.x >> FRACBITS) - (line[0].x >> FRACBITS),
|
||||
(result.y >> FRACBITS) - (line[0].y >> FRACBITS));
|
||||
bestDist = P_AproxDistance(bestDist, (result.z >> FRACBITS) - (line[0].z >> FRACBITS));
|
||||
|
||||
bestGScore = g + ((UINT32)bestDist);
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (cv_kartdebugwaypoints.value)
|
||||
{
|
||||
mobj_t *debugmobj = P_SpawnMobj(best.x, best.y, best.z, MT_SPARK);
|
||||
P_SetMobjState(debugmobj, S_WAYPOINTORB);
|
||||
|
||||
debugmobj->frame &= ~FF_TRANSMASK;
|
||||
debugmobj->frame |= FF_FULLBRIGHT; //FF_TRANS20
|
||||
|
||||
debugmobj->tics = 1;
|
||||
debugmobj->color = SKINCOLOR_BANANA;
|
||||
}
|
||||
#endif
|
||||
|
||||
adddist = bestGScore;
|
||||
}
|
||||
/*
|
||||
else
|
||||
{
|
||||
// Only one point to work with, so just add your euclidean distance to that.
|
||||
waypoint_t *wp = (waypoint_t *)pathBackwards.array[0].nodedata;
|
||||
fixed_t disttowaypoint =
|
||||
P_AproxDistance(
|
||||
(player->mo->x >> FRACBITS) - (wp->mobj->x >> FRACBITS),
|
||||
(player->mo->y >> FRACBITS) - (wp->mobj->y >> FRACBITS));
|
||||
disttowaypoint = P_AproxDistance(disttowaypoint, (player->mo->z >> FRACBITS) - (wp->mobj->z >> FRACBITS));
|
||||
|
||||
adddist = (UINT32)disttowaypoint;
|
||||
}
|
||||
*/
|
||||
}
|
||||
/*
|
||||
else
|
||||
{
|
||||
// Fallback to adding euclidean distance to the next waypoint to the distancetofinish
|
||||
adddist = (UINT32)disttonext;
|
||||
}
|
||||
*/
|
||||
|
||||
if (pathBackwardsReverse == false)
|
||||
{
|
||||
if (pathtofinish.totaldist > adddist)
|
||||
{
|
||||
player->distancetofinish = pathtofinish.totaldist - adddist;
|
||||
}
|
||||
else
|
||||
{
|
||||
player->distancetofinish = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player->distancetofinish = pathtofinish.totaldist + adddist;
|
||||
}
|
||||
Z_Free(pathtofinish.array);
|
||||
|
||||
// distancetofinish is currently a flat distance to the finish line, but in order to be fully
|
||||
|
|
@ -9175,21 +9304,7 @@ void K_UpdateDistanceFromFinishLine(player_t *const player)
|
|||
if ((mapheaderinfo[gamemap - 1]->levelflags & LF_SECTIONRACE) == 0U)
|
||||
{
|
||||
const UINT8 numfulllapsleft = ((UINT8)numlaps - player->laps);
|
||||
|
||||
player->distancetofinish += numfulllapsleft * K_GetCircuitLength();
|
||||
|
||||
#if 0
|
||||
// An additional HACK, to fix looking backwards towards the finish line
|
||||
// If the player's next waypoint is the finishline and the angle distance from player to
|
||||
// connectin waypoints implies they're closer to a next waypoint, add a full track distance
|
||||
if (player->nextwaypoint == finishline)
|
||||
{
|
||||
if (K_PlayerCloserToNextWaypoints(player->nextwaypoint, player) == true)
|
||||
{
|
||||
player->distancetofinish += K_GetCircuitLength();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -9866,10 +9981,17 @@ void K_KartUpdatePosition(player_t *player)
|
|||
|
||||
if (position != oldposition) // Changed places?
|
||||
{
|
||||
if (position < oldposition && P_IsDisplayPlayer(player) == true)
|
||||
if (player->positiondelay <= 0 && position < oldposition && P_IsDisplayPlayer(player) == true)
|
||||
{
|
||||
// Play sound when getting closer to 1st.
|
||||
S_StartSound(player->mo, sfx_mbs41);
|
||||
UINT32 soundpos = (max(0, position - 1) * MAXPLAYERS)/realplayers; // always 1-15 despite there being 16 players at max...
|
||||
#if MAXPLAYERS > 16
|
||||
if (soundpos < 15)
|
||||
{
|
||||
soundpos = 15;
|
||||
}
|
||||
#endif
|
||||
S_ReducedVFXSound(player->mo, sfx_pass02 + soundpos, NULL); // ...which is why we can start at index 2 for a lower general pitch
|
||||
}
|
||||
|
||||
player->positiondelay = POS_DELAY_TIME + 4; // Position number growth
|
||||
|
|
@ -10027,11 +10149,12 @@ void K_KartEbrakeVisuals(player_t *p)
|
|||
wave->momy = p->mo->momy;
|
||||
wave->momz = p->mo->momz;
|
||||
wave->standingslope = p->mo->standingslope;
|
||||
K_ReduceVFX(wave, p);
|
||||
}
|
||||
|
||||
// sound
|
||||
if (!S_SoundPlaying(p->mo, sfx_s3kd9s))
|
||||
S_StartSound(p->mo, sfx_s3kd9s);
|
||||
S_ReducedVFXSound(p->mo, sfx_s3kd9s, p);
|
||||
|
||||
// HOLD! bubble.
|
||||
if (!p->ebrakefor)
|
||||
|
|
@ -10053,6 +10176,7 @@ void K_KartEbrakeVisuals(player_t *p)
|
|||
p->mo->hprev->angle = p->mo->angle;
|
||||
p->mo->hprev->fuse = TICRATE/2; // When we leave spindash for any reason, make sure this bubble goes away soon after.
|
||||
K_FlipFromObject(p->mo->hprev, p->mo);
|
||||
K_ReduceVFX(p->mo->hprev, p);
|
||||
p->mo->hprev->sprzoff = p->mo->sprzoff;
|
||||
}
|
||||
|
||||
|
|
@ -10066,6 +10190,7 @@ void K_KartEbrakeVisuals(player_t *p)
|
|||
spdl->colorized = true;
|
||||
spdl->color = SKINCOLOR_WHITE;
|
||||
K_MatchGenericExtraFlags(spdl, p->mo);
|
||||
K_ReduceVFX(spdl, p);
|
||||
P_SetScale(spdl, p->mo->scale);
|
||||
|
||||
// squish the player a little bit.
|
||||
|
|
@ -10165,6 +10290,8 @@ static void K_KartSpindashDust(mobj_t *parent)
|
|||
dust->momx = FixedMul(hmomentum, FINECOSINE(ang >> ANGLETOFINESHIFT));
|
||||
dust->momy = FixedMul(hmomentum, FINESINE(ang >> ANGLETOFINESHIFT));
|
||||
dust->momz = vmomentum * flip;
|
||||
|
||||
//K_ReduceVFX(dust, parent->player);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -10189,6 +10316,7 @@ static void K_KartSpindashWind(mobj_t *parent)
|
|||
wind->momz = 3 * P_GetMobjZMovement(parent) / 4;
|
||||
|
||||
K_MatchGenericExtraFlags(wind, parent);
|
||||
K_ReduceVFX(wind, parent->player);
|
||||
}
|
||||
|
||||
// Time after which you get a thrust for releasing spindash
|
||||
|
|
@ -10234,13 +10362,14 @@ static void K_KartSpindash(player_t *player)
|
|||
P_SetTarget(&grease->target, player->mo);
|
||||
grease->angle = K_MomentumAngle(player->mo);
|
||||
grease->extravalue1 = i;
|
||||
K_ReduceVFX(grease, player);
|
||||
}
|
||||
}
|
||||
|
||||
player->tiregrease = 2*TICRATE;
|
||||
|
||||
player->spindash = 0;
|
||||
S_StartSound(player->mo, sfx_s23c);
|
||||
S_ReducedVFXSound(player->mo, sfx_s23c, player);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -10277,7 +10406,7 @@ static void K_KartSpindash(player_t *player)
|
|||
if (player->speed == 0 && player->steering != 0 && leveltime % 8 == 0)
|
||||
{
|
||||
// Rubber burn turn sfx
|
||||
S_StartSound(player->mo, sfx_ruburn);
|
||||
S_ReducedVFXSound(player->mo, sfx_ruburn, player);
|
||||
}
|
||||
|
||||
if (player->speed < 6*player->mo->scale)
|
||||
|
|
@ -10319,7 +10448,7 @@ static void K_KartSpindash(player_t *player)
|
|||
{
|
||||
if (spawnOldEffect == true)
|
||||
K_SpawnDashDustRelease(player);
|
||||
S_StartSound(player->mo, sfx_s3kab);
|
||||
S_ReducedVFXSound(player->mo, sfx_s3kab, player);
|
||||
}
|
||||
}
|
||||
else if (chargetime < -TICRATE)
|
||||
|
|
@ -10331,7 +10460,7 @@ static void K_KartSpindash(player_t *player)
|
|||
else
|
||||
{
|
||||
if (leveltime % 4 == 0)
|
||||
S_StartSound(player->mo, sfx_kc2b);
|
||||
S_ReducedVFXSound(player->mo, sfx_kc2b, player);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -10362,6 +10491,9 @@ boolean K_FastFallBounce(player_t *player)
|
|||
}
|
||||
}
|
||||
|
||||
if (player->mo->eflags & MFE_UNDERWATER)
|
||||
bounce = (117 * bounce) / 200;
|
||||
|
||||
S_StartSound(player->mo, sfx_ffbonc);
|
||||
player->mo->momz = bounce * P_MobjFlip(player->mo);
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,10 @@ boolean K_DuelItemAlwaysSpawns(mapthing_t *mt);
|
|||
|
||||
void K_TimerReset(void);
|
||||
void K_TimerInit(void);
|
||||
|
||||
UINT32 K_GetPlayerDontDrawFlag(player_t *player);
|
||||
void K_ReduceVFX(mobj_t *mo, player_t *owner);
|
||||
|
||||
boolean K_IsPlayerLosing(player_t *player);
|
||||
fixed_t K_GetKartGameSpeedScalar(SINT8 value);
|
||||
|
||||
|
|
@ -110,6 +113,7 @@ void K_SpawnBoostTrail(player_t *player);
|
|||
void K_SpawnSparkleTrail(mobj_t *mo);
|
||||
void K_SpawnWipeoutTrail(mobj_t *mo);
|
||||
void K_SpawnDraftDust(mobj_t *mo);
|
||||
void K_SpawnMagicianParticles(mobj_t *mo, int spread);
|
||||
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, angle_t angleOffset);
|
||||
|
|
|
|||
|
|
@ -653,6 +653,9 @@ menuitem_t OPTIONS_ProfileControls[] = {
|
|||
{IT_CONTROL, "OPEN TEAM CHAT", "Do we even have team gamemodes?",
|
||||
NULL, {.routine = M_ProfileSetControl}, gc_teamtalk, 0},
|
||||
|
||||
{IT_CONTROL, "SHOW RANKINGS", "Show mid-game rankings.",
|
||||
NULL, {.routine = M_ProfileSetControl}, gc_rankings, 0},
|
||||
|
||||
{IT_CONTROL, "OPEN CONSOLE", "Opens the developer options console.",
|
||||
NULL, {.routine = M_ProfileSetControl}, gc_console, 0},
|
||||
|
||||
|
|
|
|||
|
|
@ -1250,7 +1250,7 @@ static boolean M_DrawCharacterSprite(INT16 x, INT16 y, INT16 skin, boolean charf
|
|||
addflags ^= V_FLIP; // This sprite is left/right flipped!
|
||||
}
|
||||
|
||||
if (skins[skin].flags & SF_HIRES)
|
||||
if (skins[skin].highresscale != FRACUNIT)
|
||||
{
|
||||
V_DrawFixedPatch(x<<FRACBITS,
|
||||
y<<FRACBITS,
|
||||
|
|
|
|||
|
|
@ -327,8 +327,8 @@ void PR_LoadProfiles(void)
|
|||
{
|
||||
profilesList[i] = Z_Malloc(sizeof(profile_t), PU_STATIC, NULL);
|
||||
|
||||
// Version.
|
||||
profilesList[i]->version = version;
|
||||
// Version. (We always update this on successful forward step)
|
||||
profilesList[i]->version = PROFILEVER;
|
||||
|
||||
// Names.
|
||||
READSTRINGN(save_p, profilesList[i]->profilename, PROFILENAMELEN);
|
||||
|
|
@ -382,6 +382,18 @@ void PR_LoadProfiles(void)
|
|||
// Controls.
|
||||
for (j = 0; j < num_gamecontrols; j++)
|
||||
{
|
||||
#ifdef DEVELOP
|
||||
// Profile update 1-->2: Add gc_rankings.
|
||||
if (j == gc_rankings && version < 2)
|
||||
{
|
||||
for (k = 0; k < MAXINPUTMAPPING; k++)
|
||||
{
|
||||
profilesList[i]->controls[j][k] = gamecontroldefault[j][k];
|
||||
}
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
for (k = 0; k < MAXINPUTMAPPING; k++)
|
||||
{
|
||||
profilesList[i]->controls[j][k] = READINT32(save_p);
|
||||
|
|
@ -449,8 +461,9 @@ void PR_ApplyProfile(UINT8 profilenum, UINT8 playernum)
|
|||
profile_t *p = PR_GetProfile(profilenum);
|
||||
|
||||
// this CAN happen!!
|
||||
if (p == NULL)
|
||||
if (dedicated || p == NULL)
|
||||
{
|
||||
if (!dedicated)
|
||||
CONS_Printf("Profile '%d' could not be loaded as it does not exist. Guest Profile will be loaded instead.\n", profilenum);
|
||||
profilenum = 0; // make sure to set this so that the cvar is set properly.
|
||||
p = PR_GetProfile(profilenum);
|
||||
|
|
@ -481,8 +494,9 @@ void PR_ApplyProfilePretend(UINT8 profilenum, UINT8 playernum)
|
|||
profile_t *p = PR_GetProfile(profilenum);
|
||||
|
||||
// this CAN happen!!
|
||||
if (p == NULL)
|
||||
if (dedicated || p == NULL)
|
||||
{
|
||||
if (!dedicated)
|
||||
CONS_Printf("Profile '%d' could not be loaded as it does not exist. Guest Profile will be loaded instead.\n", profilenum);
|
||||
profilenum = 0; // make sure to set this so that the cvar is set properly.
|
||||
p = PR_GetProfile(profilenum);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
#define SKINNAMESIZE 16
|
||||
|
||||
#define PROFILENAMELEN 6
|
||||
#define PROFILEVER 1
|
||||
#define PROFILEVER 2
|
||||
#define MAXPROFILES 16
|
||||
#define PROFILESFILE "ringprofiles.prf"
|
||||
#define PROFILE_GUEST 0
|
||||
|
|
|
|||
|
|
@ -559,8 +559,8 @@ void K_ProcessTerrainEffect(mobj_t *mo)
|
|||
{
|
||||
/* use a shorter sound if not two tics have passed
|
||||
* since the last step */
|
||||
S_StartSound(mo, player->stairjank
|
||||
>= 16 ? sfx_s23b : sfx_s268);
|
||||
S_ReducedVFXSound(mo, player->stairjank
|
||||
>= 16 ? sfx_s23b : sfx_s268, NULL);
|
||||
|
||||
if (player->stairjank == 0)
|
||||
{
|
||||
|
|
@ -569,6 +569,7 @@ void K_ProcessTerrainEffect(mobj_t *mo)
|
|||
spark->fuse = 9;
|
||||
spark->cusval = K_StairJankFlip(ANGLE_90);
|
||||
P_SetTarget(&spark->target, mo);
|
||||
K_ReduceVFX(spark, player);
|
||||
}
|
||||
|
||||
player->stairjank = 17;
|
||||
|
|
|
|||
|
|
@ -361,7 +361,7 @@ waypoint_t *K_GetBestWaypointForMobj(mobj_t *const mobj)
|
|||
// remember: huge radius
|
||||
if (closestdist <= rad && checkdist <= rad && finishline != NULL)
|
||||
{
|
||||
if (!P_TraceBlockingLines(mobj, checkwaypoint->mobj))
|
||||
if (!P_TraceBlockingLines(mobj, checkwaypoint->mobj)) // Intentionally not P_TraceWaypointTraversal
|
||||
{
|
||||
// Save sight checks when all of the other checks pass, so we only do it if we have to
|
||||
continue;
|
||||
|
|
@ -379,7 +379,7 @@ waypoint_t *K_GetBestWaypointForMobj(mobj_t *const mobj)
|
|||
}
|
||||
else if (checkdist < closestdist && bestfindist == INT32_MAX)
|
||||
{
|
||||
if (!P_TraceBlockingLines(mobj, checkwaypoint->mobj))
|
||||
if (!P_TraceBlockingLines(mobj, checkwaypoint->mobj)) // Intentionally not P_TraceWaypointTraversal
|
||||
{
|
||||
// Save sight checks when all of the other checks pass, so we only do it if we have to
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -999,108 +999,108 @@ static int lib_pRemoveFloorSpriteSlope(lua_State *L)
|
|||
static int lib_pRailThinker(lua_State *L)
|
||||
{
|
||||
mobj_t *mobj = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
mobj_t *ptmthing = tmthing;
|
||||
tm_t ptm = tm;
|
||||
NOHUD
|
||||
INLEVEL
|
||||
if (!mobj)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
lua_pushboolean(L, P_RailThinker(mobj));
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
P_RestoreTMStruct(ptm);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_pXYMovement(lua_State *L)
|
||||
{
|
||||
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
mobj_t *ptmthing = tmthing;
|
||||
tm_t ptm = tm;
|
||||
NOHUD
|
||||
INLEVEL
|
||||
if (!actor)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
P_XYMovement(actor);
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
P_RestoreTMStruct(ptm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_pRingXYMovement(lua_State *L)
|
||||
{
|
||||
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
mobj_t *ptmthing = tmthing;
|
||||
tm_t ptm = tm;
|
||||
NOHUD
|
||||
INLEVEL
|
||||
if (!actor)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
P_RingXYMovement(actor);
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
P_RestoreTMStruct(ptm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_pSceneryXYMovement(lua_State *L)
|
||||
{
|
||||
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
mobj_t *ptmthing = tmthing;
|
||||
tm_t ptm = tm;
|
||||
NOHUD
|
||||
INLEVEL
|
||||
if (!actor)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
P_SceneryXYMovement(actor);
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
P_RestoreTMStruct(ptm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_pZMovement(lua_State *L)
|
||||
{
|
||||
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
mobj_t *ptmthing = tmthing;
|
||||
tm_t ptm = tm;
|
||||
NOHUD
|
||||
INLEVEL
|
||||
if (!actor)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
lua_pushboolean(L, P_ZMovement(actor));
|
||||
P_CheckPosition(actor, actor->x, actor->y);
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
P_CheckPosition(actor, actor->x, actor->y, NULL);
|
||||
P_RestoreTMStruct(ptm);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_pRingZMovement(lua_State *L)
|
||||
{
|
||||
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
mobj_t *ptmthing = tmthing;
|
||||
tm_t ptm = tm;
|
||||
NOHUD
|
||||
INLEVEL
|
||||
if (!actor)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
P_RingZMovement(actor);
|
||||
P_CheckPosition(actor, actor->x, actor->y);
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
P_CheckPosition(actor, actor->x, actor->y, NULL);
|
||||
P_RestoreTMStruct(ptm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_pSceneryZMovement(lua_State *L)
|
||||
{
|
||||
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
mobj_t *ptmthing = tmthing;
|
||||
tm_t ptm = tm;
|
||||
NOHUD
|
||||
INLEVEL
|
||||
if (!actor)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
lua_pushboolean(L, P_SceneryZMovement(actor));
|
||||
P_CheckPosition(actor, actor->x, actor->y);
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
P_CheckPosition(actor, actor->x, actor->y, NULL);
|
||||
P_RestoreTMStruct(ptm);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_pPlayerZMovement(lua_State *L)
|
||||
{
|
||||
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
mobj_t *ptmthing = tmthing;
|
||||
tm_t ptm = tm;
|
||||
NOHUD
|
||||
INLEVEL
|
||||
if (!actor)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
P_PlayerZMovement(actor);
|
||||
P_CheckPosition(actor, actor->x, actor->y);
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
P_CheckPosition(actor, actor->x, actor->y, NULL);
|
||||
P_RestoreTMStruct(ptm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1302,13 +1302,13 @@ static int lib_pGivePlayerLives(lua_State *L)
|
|||
static int lib_pMovePlayer(lua_State *L)
|
||||
{
|
||||
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||
mobj_t *ptmthing = tmthing;
|
||||
tm_t ptm = tm;
|
||||
NOHUD
|
||||
INLEVEL
|
||||
if (!player)
|
||||
return LUA_ErrInvalid(L, "player_t");
|
||||
P_MovePlayer(player);
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
P_RestoreTMStruct(ptm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1380,7 +1380,7 @@ static int lib_pNukeEnemies(lua_State *L)
|
|||
|
||||
static int lib_pCheckPosition(lua_State *L)
|
||||
{
|
||||
mobj_t *ptmthing = tmthing;
|
||||
tm_t ptm = tm;
|
||||
mobj_t *thing = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
fixed_t x = luaL_checkfixed(L, 2);
|
||||
fixed_t y = luaL_checkfixed(L, 3);
|
||||
|
|
@ -1388,15 +1388,15 @@ static int lib_pCheckPosition(lua_State *L)
|
|||
INLEVEL
|
||||
if (!thing)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
lua_pushboolean(L, P_CheckPosition(thing, x, y));
|
||||
LUA_PushUserdata(L, tmthing, META_MOBJ);
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
lua_pushboolean(L, P_CheckPosition(thing, x, y, NULL));
|
||||
LUA_PushUserdata(L, tm.thing, META_MOBJ);
|
||||
P_RestoreTMStruct(ptm);
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int lib_pTryMove(lua_State *L)
|
||||
{
|
||||
mobj_t *ptmthing = tmthing;
|
||||
tm_t ptm = tm;
|
||||
mobj_t *thing = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
fixed_t x = luaL_checkfixed(L, 2);
|
||||
fixed_t y = luaL_checkfixed(L, 3);
|
||||
|
|
@ -1405,15 +1405,15 @@ static int lib_pTryMove(lua_State *L)
|
|||
INLEVEL
|
||||
if (!thing)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
lua_pushboolean(L, P_TryMove(thing, x, y, allowdropoff));
|
||||
LUA_PushUserdata(L, tmthing, META_MOBJ);
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
lua_pushboolean(L, P_TryMove(thing, x, y, allowdropoff, NULL));
|
||||
LUA_PushUserdata(L, tm.thing, META_MOBJ);
|
||||
P_RestoreTMStruct(ptm);
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int lib_pMove(lua_State *L)
|
||||
{
|
||||
mobj_t *ptmthing = tmthing;
|
||||
tm_t ptm = tm;
|
||||
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
fixed_t speed = luaL_checkfixed(L, 2);
|
||||
NOHUD
|
||||
|
|
@ -1421,14 +1421,14 @@ static int lib_pMove(lua_State *L)
|
|||
if (!actor)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
lua_pushboolean(L, P_Move(actor, speed));
|
||||
LUA_PushUserdata(L, tmthing, META_MOBJ);
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
LUA_PushUserdata(L, tm.thing, META_MOBJ);
|
||||
P_RestoreTMStruct(ptm);
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int lib_pTeleportMove(lua_State *L)
|
||||
{
|
||||
mobj_t *ptmthing = tmthing;
|
||||
tm_t ptm = tm;
|
||||
mobj_t *thing = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
fixed_t x = luaL_checkfixed(L, 2);
|
||||
fixed_t y = luaL_checkfixed(L, 3);
|
||||
|
|
@ -1439,14 +1439,14 @@ static int lib_pTeleportMove(lua_State *L)
|
|||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
LUA_Deprecated(L, "P_TeleportMove", "P_SetOrigin\" or \"P_MoveOrigin");
|
||||
lua_pushboolean(L, P_MoveOrigin(thing, x, y, z));
|
||||
LUA_PushUserdata(L, tmthing, META_MOBJ);
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
LUA_PushUserdata(L, tm.thing, META_MOBJ);
|
||||
P_RestoreTMStruct(ptm);
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int lib_pSetOrigin(lua_State *L)
|
||||
{
|
||||
mobj_t *ptmthing = tmthing;
|
||||
tm_t ptm = tm;
|
||||
mobj_t *thing = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
fixed_t x = luaL_checkfixed(L, 2);
|
||||
fixed_t y = luaL_checkfixed(L, 3);
|
||||
|
|
@ -1456,14 +1456,14 @@ static int lib_pSetOrigin(lua_State *L)
|
|||
if (!thing)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
lua_pushboolean(L, P_SetOrigin(thing, x, y, z));
|
||||
LUA_PushUserdata(L, tmthing, META_MOBJ);
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
LUA_PushUserdata(L, tm.thing, META_MOBJ);
|
||||
P_RestoreTMStruct(ptm);
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int lib_pMoveOrigin(lua_State *L)
|
||||
{
|
||||
mobj_t *ptmthing = tmthing;
|
||||
tm_t ptm = tm;
|
||||
mobj_t *thing = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
fixed_t x = luaL_checkfixed(L, 2);
|
||||
fixed_t y = luaL_checkfixed(L, 3);
|
||||
|
|
@ -1473,8 +1473,8 @@ static int lib_pMoveOrigin(lua_State *L)
|
|||
if (!thing)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
lua_pushboolean(L, P_MoveOrigin(thing, x, y, z));
|
||||
LUA_PushUserdata(L, tmthing, META_MOBJ);
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
LUA_PushUserdata(L, tm.thing, META_MOBJ);
|
||||
P_RestoreTMStruct(ptm);
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
|
@ -1520,23 +1520,31 @@ static int lib_pSetRoll(lua_State *L)
|
|||
|
||||
static int lib_pSlideMove(lua_State *L)
|
||||
{
|
||||
/*
|
||||
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
NOHUD
|
||||
INLEVEL
|
||||
if (!mo)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
P_SlideMove(mo);
|
||||
*/
|
||||
LUA_UsageWarning(L, "FIXME: P_SlideMove needs updated to use result from P_TryMove");
|
||||
(void)L;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_pBounceMove(lua_State *L)
|
||||
{
|
||||
/*
|
||||
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
NOHUD
|
||||
INLEVEL
|
||||
if (!mo)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
P_BounceMove(mo);
|
||||
*/
|
||||
LUA_UsageWarning(L, "FIXME: P_BounceMove needs updated to use result from P_TryMove");
|
||||
(void)L;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -722,7 +722,7 @@ static int sector_set(lua_State *L)
|
|||
return luaL_error(L, "sector_t field " LUA_QS " cannot be set.", sector_opt[field]);
|
||||
case sector_floorheight: { // floorheight
|
||||
boolean flag;
|
||||
mobj_t *ptmthing = tmthing;
|
||||
tm_t ptm = tm;
|
||||
fixed_t lastpos = sector->floorheight;
|
||||
sector->floorheight = luaL_checkfixed(L, 3);
|
||||
flag = P_CheckSector(sector, true);
|
||||
|
|
@ -731,12 +731,12 @@ static int sector_set(lua_State *L)
|
|||
sector->floorheight = lastpos;
|
||||
P_CheckSector(sector, true);
|
||||
}
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
P_RestoreTMStruct(ptm);
|
||||
break;
|
||||
}
|
||||
case sector_ceilingheight: { // ceilingheight
|
||||
boolean flag;
|
||||
mobj_t *ptmthing = tmthing;
|
||||
tm_t ptm = tm;
|
||||
fixed_t lastpos = sector->ceilingheight;
|
||||
sector->ceilingheight = luaL_checkfixed(L, 3);
|
||||
flag = P_CheckSector(sector, true);
|
||||
|
|
@ -745,7 +745,7 @@ static int sector_set(lua_State *L)
|
|||
sector->ceilingheight = lastpos;
|
||||
P_CheckSector(sector, true);
|
||||
}
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
P_RestoreTMStruct(ptm);
|
||||
break;
|
||||
}
|
||||
case sector_floorpic:
|
||||
|
|
@ -2127,7 +2127,7 @@ static int ffloor_set(lua_State *L)
|
|||
case ffloor_topheight: { // topheight
|
||||
boolean flag;
|
||||
fixed_t lastpos = *ffloor->topheight;
|
||||
mobj_t *ptmthing = tmthing;
|
||||
tm_t ptm = tm;
|
||||
sector_t *sector = §ors[ffloor->secnum];
|
||||
sector->ceilingheight = luaL_checkfixed(L, 3);
|
||||
flag = P_CheckSector(sector, true);
|
||||
|
|
@ -2136,7 +2136,7 @@ static int ffloor_set(lua_State *L)
|
|||
*ffloor->topheight = lastpos;
|
||||
P_CheckSector(sector, true);
|
||||
}
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
P_RestoreTMStruct(ptm);
|
||||
break;
|
||||
}
|
||||
case ffloor_toppic:
|
||||
|
|
@ -2148,7 +2148,7 @@ static int ffloor_set(lua_State *L)
|
|||
case ffloor_bottomheight: { // bottomheight
|
||||
boolean flag;
|
||||
fixed_t lastpos = *ffloor->bottomheight;
|
||||
mobj_t *ptmthing = tmthing;
|
||||
tm_t ptm = tm;
|
||||
sector_t *sector = §ors[ffloor->secnum];
|
||||
sector->floorheight = luaL_checkfixed(L, 3);
|
||||
flag = P_CheckSector(sector, true);
|
||||
|
|
@ -2157,7 +2157,7 @@ static int ffloor_set(lua_State *L)
|
|||
*ffloor->bottomheight = lastpos;
|
||||
P_CheckSector(sector, true);
|
||||
}
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
P_RestoreTMStruct(ptm);
|
||||
break;
|
||||
}
|
||||
case ffloor_bottompic:
|
||||
|
|
|
|||
|
|
@ -515,14 +515,14 @@ static int mobj_set(lua_State *L)
|
|||
case mobj_z:
|
||||
{
|
||||
// z doesn't cross sector bounds so it's okay.
|
||||
mobj_t *ptmthing = tmthing;
|
||||
tm_t ptm = tm;
|
||||
mo->z = luaL_checkfixed(L, 3);
|
||||
P_CheckPosition(mo, mo->x, mo->y);
|
||||
mo->floorz = tmfloorz;
|
||||
mo->ceilingz = tmceilingz;
|
||||
mo->floorrover = tmfloorrover;
|
||||
mo->ceilingrover = tmceilingrover;
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
P_CheckPosition(mo, mo->x, mo->y, NULL);
|
||||
mo->floorz = tm.floorz;
|
||||
mo->ceilingz = tm.ceilingz;
|
||||
mo->floorrover = tm.floorrover;
|
||||
mo->ceilingrover = tm.ceilingrover;
|
||||
P_RestoreTMStruct(ptm);
|
||||
break;
|
||||
}
|
||||
case mobj_snext:
|
||||
|
|
@ -583,30 +583,30 @@ static int mobj_set(lua_State *L)
|
|||
return NOSET;
|
||||
case mobj_radius:
|
||||
{
|
||||
mobj_t *ptmthing = tmthing;
|
||||
tm_t ptm = tm;
|
||||
mo->radius = luaL_checkfixed(L, 3);
|
||||
if (mo->radius < 0)
|
||||
mo->radius = 0;
|
||||
P_CheckPosition(mo, mo->x, mo->y);
|
||||
mo->floorz = tmfloorz;
|
||||
mo->ceilingz = tmceilingz;
|
||||
mo->floorrover = tmfloorrover;
|
||||
mo->ceilingrover = tmceilingrover;
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
P_CheckPosition(mo, mo->x, mo->y, NULL);
|
||||
mo->floorz = tm.floorz;
|
||||
mo->ceilingz = tm.ceilingz;
|
||||
mo->floorrover = tm.floorrover;
|
||||
mo->ceilingrover = tm.ceilingrover;
|
||||
P_RestoreTMStruct(ptm);
|
||||
break;
|
||||
}
|
||||
case mobj_height:
|
||||
{
|
||||
mobj_t *ptmthing = tmthing;
|
||||
tm_t ptm = tm;
|
||||
mo->height = luaL_checkfixed(L, 3);
|
||||
if (mo->height < 0)
|
||||
mo->height = 0;
|
||||
P_CheckPosition(mo, mo->x, mo->y);
|
||||
mo->floorz = tmfloorz;
|
||||
mo->ceilingz = tmceilingz;
|
||||
mo->floorrover = tmfloorrover;
|
||||
mo->ceilingrover = tmceilingrover;
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
P_CheckPosition(mo, mo->x, mo->y, NULL);
|
||||
mo->floorz = tm.floorz;
|
||||
mo->ceilingz = tm.ceilingz;
|
||||
mo->floorrover = tm.floorrover;
|
||||
mo->ceilingrover = tm.ceilingrover;
|
||||
P_RestoreTMStruct(ptm);
|
||||
break;
|
||||
}
|
||||
case mobj_momx:
|
||||
|
|
|
|||
|
|
@ -410,6 +410,10 @@ static int player_get(lua_State *L)
|
|||
lua_pushinteger(L, plr->skin);
|
||||
else if (fastcmp(field,"availabilities"))
|
||||
lua_pushinteger(L, plr->availabilities);
|
||||
else if (fastcmp(field,"fakeskin"))
|
||||
lua_pushinteger(L, plr->fakeskin);
|
||||
else if (fastcmp(field,"lastfakeskin"))
|
||||
lua_pushinteger(L, plr->lastfakeskin);
|
||||
else if (fastcmp(field,"score"))
|
||||
lua_pushinteger(L, plr->score);
|
||||
// SRB2kart
|
||||
|
|
@ -575,6 +579,10 @@ static int player_set(lua_State *L)
|
|||
return NOSET;
|
||||
else if (fastcmp(field,"availabilities"))
|
||||
return NOSET;
|
||||
else if (fastcmp(field,"fakeskin"))
|
||||
return NOSET;
|
||||
else if (fastcmp(field,"lastfakeskin"))
|
||||
return NOSET;
|
||||
else if (fastcmp(field,"score"))
|
||||
plr->score = luaL_checkinteger(L, 3);
|
||||
// SRB2kart
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ typedef enum
|
|||
|
||||
PR_PLAYERSTARTS, // Player starts
|
||||
PR_VOICES, // Player voice sounds
|
||||
PR_RANDOMSKIN, // Random skin select from Heavy Magician(?)
|
||||
|
||||
PR_RULESCRAMBLE, // Rule scrambing events
|
||||
|
||||
|
|
|
|||
|
|
@ -358,9 +358,9 @@ void Obj_OrbinautJawzMoveHeld(player_t *player)
|
|||
cur->momy = FixedMul(FINESINE(cur->angle >> ANGLETOFINESHIFT), orbinaut_shield_dist(cur));
|
||||
cur->flags &= ~MF_NOCLIPTHING;
|
||||
|
||||
if (!P_TryMove(cur, player->mo->x + cur->momx, player->mo->y + cur->momy, true))
|
||||
if (!P_TryMove(cur, player->mo->x + cur->momx, player->mo->y + cur->momy, true, NULL))
|
||||
{
|
||||
P_SlideMove(cur);
|
||||
P_SlideMove(cur, NULL);
|
||||
}
|
||||
|
||||
if (P_IsObjectOnGround(player->mo))
|
||||
|
|
|
|||
|
|
@ -541,12 +541,12 @@ boolean P_Move(mobj_t *actor, fixed_t speed)
|
|||
if (actor->type == MT_SKIM && !P_WaterInSector(actor, tryx, tryy)) // bail out if sector lacks water
|
||||
return false;
|
||||
|
||||
if (!P_TryMove(actor, tryx, tryy, false))
|
||||
if (!P_TryMove(actor, tryx, tryy, false, NULL))
|
||||
{
|
||||
if (actor->flags & MF_FLOAT && floatok)
|
||||
if (actor->flags & MF_FLOAT && tm.floatok)
|
||||
{
|
||||
// must adjust height
|
||||
if (actor->z < tmfloorz)
|
||||
if (actor->z < tm.floorz)
|
||||
actor->z += FixedMul(FLOATSPEED, actor->scale);
|
||||
else
|
||||
actor->z -= FixedMul(FLOATSPEED, actor->scale);
|
||||
|
|
@ -1074,7 +1074,7 @@ void A_FaceStabRev(mobj_t *actor)
|
|||
}
|
||||
else
|
||||
{
|
||||
P_TryMove(actor, actor->x - P_ReturnThrustX(actor, actor->angle, 2<<FRACBITS), actor->y - P_ReturnThrustY(actor, actor->angle, 2<<FRACBITS), false);
|
||||
P_TryMove(actor, actor->x - P_ReturnThrustX(actor, actor->angle, 2<<FRACBITS), actor->y - P_ReturnThrustY(actor, actor->angle, 2<<FRACBITS), false, NULL);
|
||||
P_FaceStabFlume(actor);
|
||||
}
|
||||
}
|
||||
|
|
@ -1126,7 +1126,7 @@ void A_FaceStabHurl(mobj_t *actor)
|
|||
if (P_TryMove(actor,
|
||||
actor->x + P_ReturnThrustX(actor, dirang, actor->extravalue2<<FRACBITS),
|
||||
actor->y + P_ReturnThrustY(actor, dirang, actor->extravalue2<<FRACBITS),
|
||||
false))
|
||||
false, NULL))
|
||||
{
|
||||
// Do the spear damage.
|
||||
#define NUMSTEPS 3
|
||||
|
|
@ -1196,7 +1196,7 @@ void A_FaceStabMiss(mobj_t *actor)
|
|||
if (actor->extravalue2 <= 0 || !P_TryMove(actor,
|
||||
actor->x + P_ReturnThrustX(actor, actor->angle, actor->extravalue2<<FRACBITS),
|
||||
actor->y + P_ReturnThrustY(actor, actor->angle, actor->extravalue2<<FRACBITS),
|
||||
false))
|
||||
false, NULL))
|
||||
{
|
||||
actor->extravalue2 = 0;
|
||||
P_SetMobjState(actor, locvar2);
|
||||
|
|
@ -1821,7 +1821,7 @@ void A_CrushstaceanWalk(mobj_t *actor)
|
|||
if (!P_TryMove(actor,
|
||||
actor->x + P_ReturnThrustX(actor, ang, locvar1*actor->scale),
|
||||
actor->y + P_ReturnThrustY(actor, ang, locvar1*actor->scale),
|
||||
false)
|
||||
false, NULL)
|
||||
|| (actor->reactiontime-- <= 0))
|
||||
{
|
||||
actor->flags2 ^= MF2_AMBUSH;
|
||||
|
|
@ -2000,7 +2000,7 @@ void A_CrushclawLaunch(mobj_t *actor)
|
|||
if (!P_TryMove(actor,
|
||||
actor->target->x + P_ReturnThrustX(actor, actor->target->angle, actor->extravalue2*actor->scale),
|
||||
actor->target->y + P_ReturnThrustY(actor, actor->target->angle, actor->extravalue2*actor->scale),
|
||||
true)
|
||||
true, NULL)
|
||||
&& !locvar1)
|
||||
{
|
||||
actor->extravalue1 = 0;
|
||||
|
|
@ -2946,9 +2946,9 @@ void A_Boss1Laser(mobj_t *actor)
|
|||
{
|
||||
fixed_t distx = P_ReturnThrustX(point, point->angle, point->radius);
|
||||
fixed_t disty = P_ReturnThrustY(point, point->angle, point->radius);
|
||||
if (P_TryMove(point, point->x + distx, point->y + disty, false) // prevents the sprite from clipping into the wall or dangling off ledges
|
||||
&& P_TryMove(point, point->x - 2*distx, point->y - 2*disty, false)
|
||||
&& P_TryMove(point, point->x + distx, point->y + disty, false))
|
||||
if (P_TryMove(point, point->x + distx, point->y + disty, false, NULL) // prevents the sprite from clipping into the wall or dangling off ledges
|
||||
&& P_TryMove(point, point->x - 2*distx, point->y - 2*disty, false, NULL)
|
||||
&& P_TryMove(point, point->x + distx, point->y + disty, false, NULL))
|
||||
{
|
||||
if (point->info->seesound)
|
||||
S_StartSound(point, point->info->seesound);
|
||||
|
|
@ -3012,7 +3012,7 @@ void A_FocusTarget(mobj_t *actor)
|
|||
{
|
||||
actor->momx = 0, actor->momy = 0, actor->momz = 0;
|
||||
actor->z = actor->target->z + (actor->target->height>>1);
|
||||
P_TryMove(actor, actor->target->x, actor->target->y, true);
|
||||
P_TryMove(actor, actor->target->x, actor->target->y, true, NULL);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
@ -3168,7 +3168,7 @@ void A_SkullAttack(mobj_t *actor)
|
|||
if (P_CheckMove(actor,\
|
||||
P_ReturnThrustX(actor, testang, dist + 2*actor->radius),\
|
||||
P_ReturnThrustY(actor, testang, dist + 2*actor->radius),\
|
||||
true)) break;
|
||||
true, NULL)) break;
|
||||
|
||||
if (P_RandomChance(PR_UNDEFINED, FRACUNIT/2)) // port priority 2?
|
||||
{
|
||||
|
|
@ -3829,12 +3829,13 @@ void A_AttractChase(mobj_t *actor)
|
|||
|
||||
// Base add is 3 tics for 9,9, adds 1 tic for each point closer to the 1,1 end
|
||||
actor->target->player->ringboost += K_GetKartRingPower(actor->target->player, true) + 3;
|
||||
S_StartSound(actor->target, sfx_s1b5);
|
||||
S_ReducedVFXSound(actor->target, sfx_s1b5, NULL);
|
||||
|
||||
sparkle = P_SpawnMobj(actor->target->x, actor->target->y, actor->target->z, MT_RINGSPARKS);
|
||||
P_SetTarget(&sparkle->target, actor->target);
|
||||
sparkle->angle = (actor->target->angle + (offset>>1)) + (offset * actor->target->player->sparkleanim);
|
||||
actor->target->player->sparkleanim = (actor->target->player->sparkleanim+1) % 20;
|
||||
K_ReduceVFX(sparkle, actor->target->player);
|
||||
|
||||
P_KillMobj(actor, actor->target, actor->target, DMG_NORMAL);
|
||||
return;
|
||||
|
|
@ -4483,13 +4484,13 @@ void A_MinusDigging(mobj_t *actor)
|
|||
par = P_SpawnMobj(actor->x, actor->y, mz, MT_MINUSDIRT);
|
||||
if (actor->eflags & MFE_VERTICALFLIP)
|
||||
par->eflags |= MFE_VERTICALFLIP;
|
||||
P_TryMove(par, x, y, false);
|
||||
P_TryMove(par, x, y, false, NULL);
|
||||
|
||||
// If close enough, prepare to attack
|
||||
if (P_AproxDistance(actor->x - actor->target->x, actor->y - actor->target->y) < actor->radius*2)
|
||||
{
|
||||
P_SetMobjState(actor, actor->info->meleestate);
|
||||
P_TryMove(actor, actor->target->x, actor->target->y, false);
|
||||
P_TryMove(actor, actor->target->x, actor->target->y, false, NULL);
|
||||
S_StartSound(actor, actor->info->attacksound);
|
||||
|
||||
// Spawn growing dirt pile.
|
||||
|
|
@ -4532,7 +4533,7 @@ void A_MinusDigging(mobj_t *actor)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (P_TryMove(actor->tracer, actor->x, actor->y, false))
|
||||
if (P_TryMove(actor->tracer, actor->x, actor->y, false, NULL))
|
||||
actor->tracer->z = mz;
|
||||
else
|
||||
P_SetTarget(&actor->tracer, NULL);
|
||||
|
|
@ -5702,7 +5703,7 @@ void A_MixUp(mobj_t *actor)
|
|||
players[i].mo->floorz = P_GetFloorZ(players[i].mo, players[i].mo->subsector->sector, players[i].mo->x, players[i].mo->y, NULL);
|
||||
players[i].mo->ceilingz = P_GetCeilingZ(players[i].mo, players[i].mo->subsector->sector, players[i].mo->x, players[i].mo->y, NULL);
|
||||
|
||||
P_CheckPosition(players[i].mo, players[i].mo->x, players[i].mo->y);
|
||||
P_CheckPosition(players[i].mo, players[i].mo->x, players[i].mo->y, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -6470,7 +6471,7 @@ void A_GuardChase(mobj_t *actor)
|
|||
&& !P_TryMove(actor,
|
||||
actor->x + P_ReturnThrustX(actor, actor->angle, speed),
|
||||
actor->y + P_ReturnThrustY(actor, actor->angle, speed),
|
||||
false)
|
||||
false, NULL)
|
||||
&& speed > 0) // can't be the same check as previous so that P_TryMove gets to happen.
|
||||
{
|
||||
INT32 direction = actor->spawnpoint ? actor->spawnpoint->args[0] : TMGD_BACK;
|
||||
|
|
@ -9273,7 +9274,7 @@ void A_SpikeRetract(mobj_t *actor)
|
|||
actor->flags &= ~MF_NOCLIPTHING;
|
||||
}
|
||||
if (actor->flags & MF_SOLID)
|
||||
P_CheckPosition(actor, actor->x, actor->y);
|
||||
P_CheckPosition(actor, actor->x, actor->y, NULL);
|
||||
}
|
||||
|
||||
// Function: A_InfoState
|
||||
|
|
@ -10421,13 +10422,13 @@ void A_FlickyCenter(mobj_t *actor)
|
|||
{
|
||||
actor->extravalue2 = 1;
|
||||
P_SetOrigin(actor, actor->target->x, actor->target->y, actor->target->z);
|
||||
tmthing = NULL;
|
||||
P_SetTarget(&tm.thing, NULL);
|
||||
}
|
||||
else if(actor->extravalue2)
|
||||
{
|
||||
actor->extravalue2 = 0;
|
||||
P_SetOrigin(actor, originx, originy, originz);
|
||||
tmthing = NULL;
|
||||
P_SetTarget(&tm.thing, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -11511,7 +11512,7 @@ void A_DoNPCSkid(mobj_t *actor)
|
|||
locvar2 = FRACUNIT/2;
|
||||
|
||||
if ((FixedHypot(actor->momx, actor->momy) < locvar2)
|
||||
|| !P_TryMove(actor, actor->x + actor->momx, actor->y + actor->momy, false))
|
||||
|| !P_TryMove(actor, actor->x + actor->momx, actor->y + actor->momy, false, NULL))
|
||||
{
|
||||
actor->momx = actor->momy = 0;
|
||||
P_SetMobjState(actor, locvar1);
|
||||
|
|
@ -12286,7 +12287,7 @@ static void P_SnapperLegPlace(mobj_t *mo)
|
|||
INT32 necklen = (32*(mo->info->reactiontime - mo->reactiontime))/mo->info->reactiontime; // Not in FU
|
||||
|
||||
seg->z = mo->z + ((mo->eflags & MFE_VERTICALFLIP) ? (((mo->height<<1)/3) - seg->height) : mo->height/3);
|
||||
P_TryMove(seg, mo->x + FixedMul(c, rad) + necklen*c, mo->y + FixedMul(s, rad) + necklen*s, true);
|
||||
P_TryMove(seg, mo->x + FixedMul(c, rad) + necklen*c, mo->y + FixedMul(s, rad) + necklen*s, true, NULL);
|
||||
seg->angle = a;
|
||||
|
||||
// Move as many legs as available.
|
||||
|
|
@ -12307,7 +12308,7 @@ static void P_SnapperLegPlace(mobj_t *mo)
|
|||
x = c*o2 + s*o1;
|
||||
y = s*o2 - c*o1;
|
||||
seg->z = mo->z + (((mo->eflags & MFE_VERTICALFLIP) ? (mo->height - seg->height) : 0));
|
||||
P_TryMove(seg, mo->x + x, mo->y + y, true);
|
||||
P_TryMove(seg, mo->x + x, mo->y + y, true, NULL);
|
||||
P_SetMobjState(seg, seg->info->raisestate);
|
||||
}
|
||||
else
|
||||
|
|
@ -12442,7 +12443,7 @@ void A_SnapperThinker(mobj_t *actor)
|
|||
c = FINECOSINE(fa);
|
||||
s = FINESINE(fa);
|
||||
|
||||
P_TryMove(actor, actor->x + c*speed, actor->y + s*speed, false);
|
||||
P_TryMove(actor, actor->x + c*speed, actor->y + s*speed, false, NULL);
|
||||
|
||||
// The snapper spawns dust if going fast!
|
||||
if (actor->reactiontime < 4)
|
||||
|
|
|
|||
|
|
@ -381,25 +381,48 @@ void P_InternalFlickyHop(mobj_t *actor, fixed_t momz, fixed_t momh, angle_t angl
|
|||
// P_MAP
|
||||
//
|
||||
|
||||
// If "floatok" true, move would be ok
|
||||
// if within "tmfloorz - tmceilingz".
|
||||
extern boolean floatok;
|
||||
extern fixed_t tmfloorz;
|
||||
extern fixed_t tmceilingz;
|
||||
extern ffloor_t *tmfloorrover, *tmceilingrover;
|
||||
extern mobj_t *tmfloorthing, *tmhitthing, *tmthing;
|
||||
typedef struct tm_s
|
||||
{
|
||||
mobj_t *thing;
|
||||
fixed_t x, y;
|
||||
fixed_t bbox[4];
|
||||
INT32 flags;
|
||||
|
||||
precipmobj_t *precipthing;
|
||||
fixed_t precipbbox[4];
|
||||
|
||||
// If "floatok" true, move would be ok
|
||||
// if within "tm.floorz - tm.ceilingz".
|
||||
boolean floatok;
|
||||
|
||||
fixed_t floorz, ceilingz;
|
||||
fixed_t dropoffz, drpoffceilz; // drop-off floor/ceiling heights
|
||||
mobj_t *floorthing; // the thing corresponding to tm.floorz or NULL if tm.floorz is from a sector
|
||||
mobj_t *hitthing; // the solid thing you bumped into (for collisions)
|
||||
ffloor_t *floorrover, *ceilingrover;
|
||||
pslope_t *floorslope, *ceilingslope;
|
||||
INT32 floorpic, ceilingpic;
|
||||
fixed_t floorstep, ceilingstep;
|
||||
|
||||
// keep track of the line that lowers the ceiling,
|
||||
// so missiles don't explode against sky hack walls
|
||||
line_t *ceilingline;
|
||||
|
||||
// set by PIT_CheckLine() for any line that stopped the PIT_CheckLine()
|
||||
// that is, for any line which is 'solid'
|
||||
line_t *blockingline;
|
||||
} tm_t;
|
||||
|
||||
extern tm_t tm;
|
||||
|
||||
void P_RestoreTMStruct(tm_t tmrestore);
|
||||
|
||||
extern camera_t *mapcampointer;
|
||||
extern fixed_t tmx;
|
||||
extern fixed_t tmy;
|
||||
extern pslope_t *tmfloorslope, *tmceilingslope;
|
||||
extern INT32 tmfloorpic, tmceilingpic;
|
||||
|
||||
/* cphipps 2004/08/30 */
|
||||
extern void P_MapStart(void);
|
||||
extern void P_MapEnd(void);
|
||||
|
||||
extern line_t *ceilingline;
|
||||
extern line_t *blockingline;
|
||||
extern msecnode_t *sector_list;
|
||||
|
||||
extern mprecipsecnode_t *precipsector_list;
|
||||
|
|
@ -408,23 +431,32 @@ void P_UnsetThingPosition(mobj_t *thing);
|
|||
void P_SetThingPosition(mobj_t *thing);
|
||||
void P_SetUnderlayPosition(mobj_t *thing);
|
||||
|
||||
typedef struct TryMoveResult_s
|
||||
{
|
||||
boolean success;
|
||||
line_t *line;
|
||||
mobj_t *mo;
|
||||
} TryMoveResult_t;
|
||||
|
||||
boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y, TryMoveResult_t *result);
|
||||
boolean P_CheckMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff, TryMoveResult_t *result);
|
||||
boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff, TryMoveResult_t *result);
|
||||
boolean P_SceneryTryMove(mobj_t *thing, fixed_t x, fixed_t y, TryMoveResult_t *result);
|
||||
|
||||
boolean P_IsLineBlocking(const line_t *ld, const mobj_t *thing);
|
||||
boolean P_IsLineTripWire(const line_t *ld);
|
||||
boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y);
|
||||
boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam);
|
||||
boolean P_CheckMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff);
|
||||
fixed_t P_BaseStepUp(void);
|
||||
fixed_t P_GetThingStepUp(mobj_t *thing, fixed_t destX, fixed_t destY);
|
||||
boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff);
|
||||
boolean P_Move(mobj_t *actor, fixed_t speed);
|
||||
boolean P_SetOrigin(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z);
|
||||
boolean P_MoveOrigin(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z);
|
||||
void P_SlideMove(mobj_t *mo);
|
||||
void P_BouncePlayerMove(mobj_t *mo);
|
||||
void P_BounceMove(mobj_t *mo);
|
||||
void P_SlideMove(mobj_t *mo, TryMoveResult_t *result);
|
||||
void P_BounceMove(mobj_t *mo, TryMoveResult_t *result);
|
||||
boolean P_CheckSight(mobj_t *t1, mobj_t *t2);
|
||||
boolean P_TraceBlockingLines(mobj_t *t1, mobj_t *t2);
|
||||
boolean P_TraceBotTraversal(mobj_t *t1, mobj_t *t2);
|
||||
boolean P_TraceWaypointTraversal(mobj_t *t1, mobj_t *t2);
|
||||
void P_CheckHoopPosition(mobj_t *hoopthing, fixed_t x, fixed_t y, fixed_t z, fixed_t radius);
|
||||
|
||||
boolean P_CheckSector(sector_t *sector, boolean crunch);
|
||||
|
|
|
|||
1854
src/p_map.c
1854
src/p_map.c
File diff suppressed because it is too large
Load diff
|
|
@ -379,8 +379,8 @@ void P_CameraLineOpening(line_t *linedef)
|
|||
}
|
||||
else
|
||||
{
|
||||
frontfloor = P_CameraGetFloorZ (mapcampointer, front, tmx, tmy, linedef);
|
||||
frontceiling = P_CameraGetCeilingZ(mapcampointer, front, tmx, tmy, linedef);
|
||||
frontfloor = P_CameraGetFloorZ (mapcampointer, front, tm.x, tm.y, linedef);
|
||||
frontceiling = P_CameraGetCeilingZ(mapcampointer, front, tm.x, tm.y, linedef);
|
||||
}
|
||||
|
||||
if (back->camsec >= 0)
|
||||
|
|
@ -397,8 +397,8 @@ void P_CameraLineOpening(line_t *linedef)
|
|||
}
|
||||
else
|
||||
{
|
||||
backfloor = P_CameraGetFloorZ(mapcampointer, back, tmx, tmy, linedef);
|
||||
backceiling = P_CameraGetCeilingZ(mapcampointer, back, tmx, tmy, linedef);
|
||||
backfloor = P_CameraGetFloorZ(mapcampointer, back, tm.x, tm.y, linedef);
|
||||
backceiling = P_CameraGetCeilingZ(mapcampointer, back, tm.x, tm.y, linedef);
|
||||
}
|
||||
|
||||
{
|
||||
|
|
@ -440,8 +440,8 @@ void P_CameraLineOpening(line_t *linedef)
|
|||
if (!(rover->fofflags & FOF_BLOCKOTHERS) || !(rover->fofflags & FOF_RENDERALL) || !(rover->fofflags & FOF_EXISTS) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA))
|
||||
continue;
|
||||
|
||||
topheight = P_CameraGetFOFTopZ(mapcampointer, front, rover, tmx, tmy, linedef);
|
||||
bottomheight = P_CameraGetFOFBottomZ(mapcampointer, front, rover, tmx, tmy, linedef);
|
||||
topheight = P_CameraGetFOFTopZ(mapcampointer, front, rover, tm.x, tm.y, linedef);
|
||||
bottomheight = P_CameraGetFOFBottomZ(mapcampointer, front, rover, tm.x, tm.y, linedef);
|
||||
|
||||
delta1 = abs(mapcampointer->z - (bottomheight + ((topheight - bottomheight)/2)));
|
||||
delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2)));
|
||||
|
|
@ -464,8 +464,8 @@ void P_CameraLineOpening(line_t *linedef)
|
|||
if (!(rover->fofflags & FOF_BLOCKOTHERS) || !(rover->fofflags & FOF_RENDERALL) || !(rover->fofflags & FOF_EXISTS) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA))
|
||||
continue;
|
||||
|
||||
topheight = P_CameraGetFOFTopZ(mapcampointer, back, rover, tmx, tmy, linedef);
|
||||
bottomheight = P_CameraGetFOFBottomZ(mapcampointer, back, rover, tmx, tmy, linedef);
|
||||
topheight = P_CameraGetFOFTopZ(mapcampointer, back, rover, tm.x, tm.y, linedef);
|
||||
bottomheight = P_CameraGetFOFBottomZ(mapcampointer, back, rover, tm.x, tm.y, linedef);
|
||||
|
||||
delta1 = abs(mapcampointer->z - (bottomheight + ((topheight - bottomheight)/2)));
|
||||
delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2)));
|
||||
|
|
@ -614,7 +614,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
|||
return;
|
||||
}
|
||||
|
||||
P_ClosestPointOnLine(tmx, tmy, linedef, &cross);
|
||||
P_ClosestPointOnLine(tm.x, tm.y, linedef, &cross);
|
||||
|
||||
// Treat polyobjects kind of like 3D Floors
|
||||
if (linedef->polyobj && (linedef->polyobj->flags & POF_TESTHEIGHT))
|
||||
|
|
@ -656,8 +656,8 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
|||
fixed_t height[2];
|
||||
const sector_t * sector[2] = { front, back };
|
||||
|
||||
height[FRONT] = P_GetCeilingZ(mobj, front, tmx, tmy, linedef);
|
||||
height[BACK] = P_GetCeilingZ(mobj, back, tmx, tmy, linedef);
|
||||
height[FRONT] = P_GetCeilingZ(mobj, front, tm.x, tm.y, linedef);
|
||||
height[BACK] = P_GetCeilingZ(mobj, back, tm.x, tm.y, linedef);
|
||||
|
||||
hi = ( height[0] < height[1] );
|
||||
lo = ! hi;
|
||||
|
|
@ -676,8 +676,8 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
|||
openceilingdrop = ( topedge[hi] - topedge[lo] );
|
||||
}
|
||||
|
||||
height[FRONT] = P_GetFloorZ(mobj, front, tmx, tmy, linedef);
|
||||
height[BACK] = P_GetFloorZ(mobj, back, tmx, tmy, linedef);
|
||||
height[FRONT] = P_GetFloorZ(mobj, front, tm.x, tm.y, linedef);
|
||||
height[BACK] = P_GetFloorZ(mobj, back, tm.x, tm.y, linedef);
|
||||
|
||||
hi = ( height[0] < height[1] );
|
||||
lo = ! hi;
|
||||
|
|
@ -818,8 +818,8 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
|||
|| (rover->fofflags & FOF_BLOCKOTHERS && !mobj->player)))
|
||||
continue;
|
||||
|
||||
topheight = P_GetFOFTopZ(mobj, front, rover, tmx, tmy, linedef);
|
||||
bottomheight = P_GetFOFBottomZ(mobj, front, rover, tmx, tmy, linedef);
|
||||
topheight = P_GetFOFTopZ(mobj, front, rover, tm.x, tm.y, linedef);
|
||||
bottomheight = P_GetFOFBottomZ(mobj, front, rover, tm.x, tm.y, linedef);
|
||||
|
||||
delta1 = abs(mobj->z - (bottomheight + ((topheight - bottomheight)/2)));
|
||||
delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2)));
|
||||
|
|
@ -862,8 +862,8 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
|||
|| (rover->fofflags & FOF_BLOCKOTHERS && !mobj->player)))
|
||||
continue;
|
||||
|
||||
topheight = P_GetFOFTopZ(mobj, back, rover, tmx, tmy, linedef);
|
||||
bottomheight = P_GetFOFBottomZ(mobj, back, rover, tmx, tmy, linedef);
|
||||
topheight = P_GetFOFTopZ(mobj, back, rover, tm.x, tm.y, linedef);
|
||||
bottomheight = P_GetFOFBottomZ(mobj, back, rover, tm.x, tm.y, linedef);
|
||||
|
||||
delta1 = abs(mobj->z - (bottomheight + ((topheight - bottomheight)/2)));
|
||||
delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2)));
|
||||
|
|
@ -1596,16 +1596,16 @@ boolean P_RadiusLinesCheck(fixed_t radius, fixed_t x, fixed_t y,
|
|||
INT32 xl, xh, yl, yh;
|
||||
INT32 bx, by;
|
||||
|
||||
tmbbox[BOXTOP] = y + radius;
|
||||
tmbbox[BOXBOTTOM] = y - radius;
|
||||
tmbbox[BOXRIGHT] = x + radius;
|
||||
tmbbox[BOXLEFT] = x - radius;
|
||||
tm.bbox[BOXTOP] = y + radius;
|
||||
tm.bbox[BOXBOTTOM] = y - radius;
|
||||
tm.bbox[BOXRIGHT] = x + radius;
|
||||
tm.bbox[BOXLEFT] = x - radius;
|
||||
|
||||
// check lines
|
||||
xl = (unsigned)(tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT;
|
||||
xh = (unsigned)(tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT;
|
||||
yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
|
||||
yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
|
||||
xl = (unsigned)(tm.bbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT;
|
||||
xh = (unsigned)(tm.bbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT;
|
||||
yl = (unsigned)(tm.bbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
|
||||
yh = (unsigned)(tm.bbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
|
||||
|
||||
for (bx = xl; bx <= xh; bx++)
|
||||
for (by = yl; by <= yh; by++)
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ line_t * P_FindNearestLine(const fixed_t x, const fixed_t y, const sector_t *, c
|
|||
void P_UnsetPrecipThingPosition(precipmobj_t *thing);
|
||||
void P_SetPrecipitationThingPosition(precipmobj_t *thing);
|
||||
void P_CreatePrecipSecNodeList(precipmobj_t *thing, fixed_t x,fixed_t y);
|
||||
boolean P_SceneryTryMove(mobj_t *thing, fixed_t x, fixed_t y);
|
||||
void P_HitSpecialLines(mobj_t *thing, fixed_t x, fixed_t y, fixed_t momx, fixed_t momy);
|
||||
|
||||
boolean P_GetMidtextureTopBottom(line_t *linedef, fixed_t x, fixed_t y, fixed_t *return_top, fixed_t *return_bottom);
|
||||
|
|
@ -85,8 +84,6 @@ boolean P_BlockThingsIterator(INT32 x, INT32 y, BlockItReturn_t(*func)(mobj_t *)
|
|||
|
||||
extern divline_t trace;
|
||||
|
||||
extern fixed_t tmbbox[4]; // p_map.c
|
||||
|
||||
// call your user function for each line of the blockmap in the
|
||||
// bbox defined by the radius
|
||||
//boolean P_RadiusLinesCheck(fixed_t radius, fixed_t x, fixed_t y,
|
||||
|
|
|
|||
233
src/p_mobj.c
233
src/p_mobj.c
|
|
@ -1491,12 +1491,12 @@ bustupdone:
|
|||
//
|
||||
static boolean P_CheckSkyHit(mobj_t *mo)
|
||||
{
|
||||
if (ceilingline && ceilingline->backsector
|
||||
&& ceilingline->backsector->ceilingpic == skyflatnum
|
||||
&& ceilingline->frontsector
|
||||
&& ceilingline->frontsector->ceilingpic == skyflatnum
|
||||
&& (mo->z >= ceilingline->frontsector->ceilingheight
|
||||
|| mo->z >= ceilingline->backsector->ceilingheight))
|
||||
if (tm.ceilingline && tm.ceilingline->backsector
|
||||
&& tm.ceilingline->backsector->ceilingpic == skyflatnum
|
||||
&& tm.ceilingline->frontsector
|
||||
&& tm.ceilingline->frontsector->ceilingpic == skyflatnum
|
||||
&& (mo->z >= tm.ceilingline->frontsector->ceilingheight
|
||||
|| mo->z >= tm.ceilingline->backsector->ceilingheight))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1513,6 +1513,7 @@ void P_XYMovement(mobj_t *mo)
|
|||
pslope_t *oldslope = NULL;
|
||||
vector3_t slopemom = {0,0,0};
|
||||
fixed_t predictedz = 0;
|
||||
TryMoveResult_t result = {0};
|
||||
|
||||
I_Assert(mo != NULL);
|
||||
I_Assert(!P_MobjWasRemoved(mo));
|
||||
|
|
@ -1595,13 +1596,13 @@ void P_XYMovement(mobj_t *mo)
|
|||
}
|
||||
//}
|
||||
|
||||
if (!P_TryMove(mo, mo->x + xmove, mo->y + ymove, true)
|
||||
if (!P_TryMove(mo, mo->x + xmove, mo->y + ymove, true, &result)
|
||||
&& !(P_MobjWasRemoved(mo) || mo->eflags & MFE_SPRUNG))
|
||||
{
|
||||
// blocked move
|
||||
moved = false;
|
||||
|
||||
if (LUA_HookMobjMoveBlocked(mo, tmhitthing, blockingline))
|
||||
if (LUA_HookMobjMoveBlocked(mo, tm.hitthing, tm.blockingline))
|
||||
{
|
||||
if (P_MobjWasRemoved(mo))
|
||||
return;
|
||||
|
|
@ -1626,7 +1627,7 @@ void P_XYMovement(mobj_t *mo)
|
|||
// draw damage on wall
|
||||
//SPLAT TEST ----------------------------------------------------------
|
||||
#ifdef WALLSPLATS
|
||||
if (blockingline && mo->type != MT_REDRING && mo->type != MT_FIREBALL
|
||||
if (tm.blockingline && mo->type != MT_REDRING && mo->type != MT_FIREBALL
|
||||
&& !(mo->flags2 & (MF2_AUTOMATIC|MF2_RAILRING|MF2_BOUNCERING|MF2_EXPLOSION|MF2_SCATTER)))
|
||||
// set by last P_TryMove() that failed
|
||||
{
|
||||
|
|
@ -1634,13 +1635,13 @@ void P_XYMovement(mobj_t *mo)
|
|||
divline_t misl;
|
||||
fixed_t frac;
|
||||
|
||||
P_MakeDivline(blockingline, &divl);
|
||||
P_MakeDivline(tm.blockingline, &divl);
|
||||
misl.x = mo->x;
|
||||
misl.y = mo->y;
|
||||
misl.dx = mo->momx;
|
||||
misl.dy = mo->momy;
|
||||
frac = P_InterceptVector(&divl, &misl);
|
||||
R_AddWallSplat(blockingline, P_PointOnLineSide(mo->x,mo->y,blockingline),
|
||||
R_AddWallSplat(tm.blockingline, P_PointOnLineSide(mo->x,mo->y,tm.blockingline),
|
||||
"A_DMG3", mo->z, frac, SPLATDRAWMODE_SHADE);
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1691,7 +1692,7 @@ void P_XYMovement(mobj_t *mo)
|
|||
|
||||
walltransferred = true;
|
||||
|
||||
P_SlideMove(mo);
|
||||
P_SlideMove(mo, &result);
|
||||
|
||||
xmove = ymove = 0;
|
||||
|
||||
|
|
@ -1726,14 +1727,14 @@ void P_XYMovement(mobj_t *mo)
|
|||
}
|
||||
else if (mo->flags & MF_SLIDEME)
|
||||
{
|
||||
P_SlideMove(mo);
|
||||
P_SlideMove(mo, &result);
|
||||
if (P_MobjWasRemoved(mo))
|
||||
return;
|
||||
xmove = ymove = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
P_BounceMove(mo);
|
||||
P_BounceMove(mo, &result);
|
||||
if (P_MobjWasRemoved(mo))
|
||||
return;
|
||||
xmove = ymove = 0;
|
||||
|
|
@ -1895,16 +1896,19 @@ void P_XYMovement(mobj_t *mo)
|
|||
|
||||
void P_RingXYMovement(mobj_t *mo)
|
||||
{
|
||||
TryMoveResult_t result = {0};
|
||||
|
||||
I_Assert(mo != NULL);
|
||||
I_Assert(!P_MobjWasRemoved(mo));
|
||||
|
||||
if (!P_SceneryTryMove(mo, mo->x + mo->momx, mo->y + mo->momy))
|
||||
P_BounceMove(mo);
|
||||
if (!P_SceneryTryMove(mo, mo->x + mo->momx, mo->y + mo->momy, &result))
|
||||
P_BounceMove(mo, &result);
|
||||
}
|
||||
|
||||
void P_SceneryXYMovement(mobj_t *mo)
|
||||
{
|
||||
fixed_t oldx, oldy; // reducing bobbing/momentum on ice when up against walls
|
||||
TryMoveResult_t result = {0};
|
||||
|
||||
I_Assert(mo != NULL);
|
||||
I_Assert(!P_MobjWasRemoved(mo));
|
||||
|
|
@ -1912,8 +1916,8 @@ void P_SceneryXYMovement(mobj_t *mo)
|
|||
oldx = mo->x;
|
||||
oldy = mo->y;
|
||||
|
||||
if (!P_SceneryTryMove(mo, mo->x + mo->momx, mo->y + mo->momy))
|
||||
P_BounceMove(mo);
|
||||
if (!P_SceneryTryMove(mo, mo->x + mo->momx, mo->y + mo->momy, &result))
|
||||
P_BounceMove(mo, &result);
|
||||
|
||||
if (P_MobjWasRemoved(mo))
|
||||
return;
|
||||
|
|
@ -2367,15 +2371,15 @@ boolean P_ZMovement(mobj_t *mo)
|
|||
return true;
|
||||
}
|
||||
|
||||
P_CheckPosition(mo, mo->x, mo->y); // Sets mo->standingslope correctly
|
||||
P_CheckPosition(mo, mo->x, mo->y, NULL); // Sets mo->standingslope correctly
|
||||
if (P_MobjWasRemoved(mo)) // mobjs can be removed by P_CheckPosition -- Monster Iestyn 31/07/21
|
||||
return false;
|
||||
|
||||
K_UpdateMobjTerrain(mo, ((mo->eflags & MFE_VERTICALFLIP) ? tmceilingpic : tmfloorpic));
|
||||
K_UpdateMobjTerrain(mo, ((mo->eflags & MFE_VERTICALFLIP) ? tm.ceilingpic : tm.floorpic));
|
||||
|
||||
if (((mo->eflags & MFE_VERTICALFLIP) ? tmceilingslope : tmfloorslope) && (mo->type != MT_STEAM))
|
||||
if (((mo->eflags & MFE_VERTICALFLIP) ? tm.ceilingslope : tm.floorslope) && (mo->type != MT_STEAM))
|
||||
{
|
||||
mo->standingslope = (mo->eflags & MFE_VERTICALFLIP) ? tmceilingslope : tmfloorslope;
|
||||
mo->standingslope = (mo->eflags & MFE_VERTICALFLIP) ? tm.ceilingslope : tm.floorslope;
|
||||
P_SetPitchRollFromSlope(mo, mo->standingslope);
|
||||
P_ReverseQuantizeMomentumToSlope(&mom, mo->standingslope);
|
||||
}
|
||||
|
|
@ -2591,11 +2595,11 @@ boolean P_ZMovement(mobj_t *mo)
|
|||
}
|
||||
}
|
||||
else
|
||||
mom.z = (tmfloorthing ? tmfloorthing->momz : 0);
|
||||
mom.z = (tm.floorthing ? tm.floorthing->momz : 0);
|
||||
|
||||
}
|
||||
else if (tmfloorthing)
|
||||
mom.z = tmfloorthing->momz;
|
||||
else if (tm.floorthing)
|
||||
mom.z = tm.floorthing->momz;
|
||||
|
||||
if (mo->standingslope) { // MT_STEAM will never have a standingslope, see above.
|
||||
P_QuantizeMomentumToSlope(&mom, mo->standingslope);
|
||||
|
|
@ -2834,7 +2838,7 @@ void P_PlayerZMovement(mobj_t *mo)
|
|||
mo->z = mo->floorz;
|
||||
}
|
||||
|
||||
K_UpdateMobjTerrain(mo, (mo->eflags & MFE_VERTICALFLIP ? tmceilingpic : tmfloorpic));
|
||||
K_UpdateMobjTerrain(mo, (mo->eflags & MFE_VERTICALFLIP ? tm.ceilingpic : tm.floorpic));
|
||||
|
||||
// Get up if you fell.
|
||||
if (mo->player->panim == PA_HURT && mo->player->spinouttimer == 0 && mo->player->tumbleBounces == 0)
|
||||
|
|
@ -2842,10 +2846,10 @@ void P_PlayerZMovement(mobj_t *mo)
|
|||
P_SetPlayerMobjState(mo, S_KART_STILL);
|
||||
}
|
||||
|
||||
if (!mo->standingslope && (mo->eflags & MFE_VERTICALFLIP ? tmceilingslope : tmfloorslope))
|
||||
if (!mo->standingslope && (mo->eflags & MFE_VERTICALFLIP ? tm.ceilingslope : tm.floorslope))
|
||||
{
|
||||
// Handle landing on slope during Z movement
|
||||
P_HandleSlopeLanding(mo, (mo->eflags & MFE_VERTICALFLIP ? tmceilingslope : tmfloorslope));
|
||||
P_HandleSlopeLanding(mo, (mo->eflags & MFE_VERTICALFLIP ? tm.ceilingslope : tm.floorslope));
|
||||
}
|
||||
|
||||
if (P_MobjFlip(mo) * mo->momz < 0) // falling
|
||||
|
|
@ -2860,12 +2864,12 @@ void P_PlayerZMovement(mobj_t *mo)
|
|||
|
||||
if (clipmomz)
|
||||
{
|
||||
mo->momz = (tmfloorthing ? tmfloorthing->momz : 0);
|
||||
mo->momz = (tm.floorthing ? tm.floorthing->momz : 0);
|
||||
}
|
||||
}
|
||||
else if (tmfloorthing)
|
||||
else if (tm.floorthing)
|
||||
{
|
||||
mo->momz = tmfloorthing->momz;
|
||||
mo->momz = tm.floorthing->momz;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -2985,7 +2989,7 @@ boolean P_SceneryZMovement(mobj_t *mo)
|
|||
if (!(mo->flags & MF_SLIDEME) && (mo->z <= mo->floorz || mo->z+mo->height >= mo->ceilingz))
|
||||
{
|
||||
// set standingslope
|
||||
P_TryMove(mo, mo->x, mo->y, true);
|
||||
P_TryMove(mo, mo->x, mo->y, true, NULL);
|
||||
mo->momz = -mo->momz;
|
||||
if (mo->standingslope)
|
||||
{
|
||||
|
|
@ -3083,9 +3087,9 @@ boolean P_SceneryZMovement(mobj_t *mo)
|
|||
{
|
||||
mo->eflags |= MFE_JUSTHITFLOOR; // Spin Attack
|
||||
|
||||
if (tmfloorthing)
|
||||
mo->momz = tmfloorthing->momz;
|
||||
else if (!tmfloorthing)
|
||||
if (tm.floorthing)
|
||||
mo->momz = tm.floorthing->momz;
|
||||
else if (!tm.floorthing)
|
||||
mo->momz = 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -3218,14 +3222,15 @@ boolean P_CanRunOnWater(mobj_t *mobj, ffloor_t *rover)
|
|||
// We start water run IF we can step onto it!
|
||||
if (surfDiff <= maxStep && surfDiff >= 0)
|
||||
{
|
||||
if (ourZAng < 0)
|
||||
pslope_t *groundSlope = (flip ? mobj->subsector->sector->c_slope : mobj->subsector->sector->f_slope);
|
||||
if (groundSlope != NULL && groundSlope->zangle != 0)
|
||||
{
|
||||
fixed_t floorheight = flip ? P_GetSectorCeilingZAt(mobj->subsector->sector, mobj->x, mobj->y) : P_GetSectorFloorZAt(mobj->subsector->sector, mobj->x, mobj->y);
|
||||
fixed_t floorDiff = flip ? (floorheight - mobjbottom) : (mobjbottom - floorheight);
|
||||
if (floorDiff <= maxStep && floorDiff >= -maxStep)
|
||||
{
|
||||
// ... but NOT if going down and real floor is in range.
|
||||
// FIXME: Count solid FOFs in this check
|
||||
// ... but NOT if downward-sloping real floor is in range.
|
||||
// FIXME: Count solid FOFs in these checks
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -3801,8 +3806,8 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
|
|||
}
|
||||
|
||||
thiscam->subsector = R_PointInSubsector(thiscam->x, thiscam->y);
|
||||
thiscam->floorz = tmfloorz;
|
||||
thiscam->ceilingz = tmceilingz;
|
||||
thiscam->floorz = tm.floorz;
|
||||
thiscam->ceilingz = tm.ceilingz;
|
||||
|
||||
if (thiscam->momz || player->mo->pmomz)
|
||||
{
|
||||
|
|
@ -3959,9 +3964,9 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
|
|||
mobj->y += mobj->momy;
|
||||
mobj->z += mobj->momz;
|
||||
P_SetThingPosition(mobj);
|
||||
P_CheckPosition(mobj, mobj->x, mobj->y);
|
||||
mobj->floorz = tmfloorz;
|
||||
mobj->ceilingz = tmceilingz;
|
||||
P_CheckPosition(mobj, mobj->x, mobj->y, NULL);
|
||||
mobj->floorz = tm.floorz;
|
||||
mobj->ceilingz = tm.ceilingz;
|
||||
goto animonly;
|
||||
}
|
||||
|
||||
|
|
@ -3976,7 +3981,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
|
|||
return;
|
||||
}
|
||||
else
|
||||
P_TryMove(mobj, mobj->x, mobj->y, true);
|
||||
P_TryMove(mobj, mobj->x, mobj->y, true, NULL);
|
||||
|
||||
P_CheckCrumblingPlatforms(mobj);
|
||||
|
||||
|
|
@ -3991,7 +3996,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
|
|||
|| P_IsObjectInGoop(mobj))
|
||||
{
|
||||
P_PlayerZMovement(mobj);
|
||||
P_CheckPosition(mobj, mobj->x, mobj->y); // Need this to pick up objects!
|
||||
P_CheckPosition(mobj, mobj->x, mobj->y, NULL); // Need this to pick up objects!
|
||||
|
||||
if (P_MobjWasRemoved(mobj))
|
||||
return;
|
||||
|
|
@ -4181,7 +4186,7 @@ static void P_RingThinker(mobj_t *mobj)
|
|||
if (mobj->momz)
|
||||
{
|
||||
P_RingZMovement(mobj);
|
||||
P_CheckPosition(mobj, mobj->x, mobj->y); // Need this to pick up objects!
|
||||
P_CheckPosition(mobj, mobj->x, mobj->y, NULL); // Need this to pick up objects!
|
||||
|
||||
if (P_MobjWasRemoved(mobj))
|
||||
return;
|
||||
|
|
@ -5330,7 +5335,7 @@ void P_RunOverlays(void)
|
|||
P_SetUnderlayPosition(mo);
|
||||
else
|
||||
P_SetThingPosition(mo);
|
||||
P_CheckPosition(mo, mo->x, mo->y);
|
||||
P_CheckPosition(mo, mo->x, mo->y, NULL);
|
||||
}
|
||||
P_SetTarget(&overlaycap, NULL);
|
||||
}
|
||||
|
|
@ -7403,6 +7408,8 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
K_ReduceVFX(mobj, mobj->target->player);
|
||||
break;
|
||||
}
|
||||
case MT_BOOSTFLAME:
|
||||
|
|
@ -7491,6 +7498,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
S_StartSound(mobj, sfx_cdfm17);
|
||||
|
||||
K_MatchGenericExtraFlags(mobj, mobj->target);
|
||||
K_ReduceVFX(mobj, mobj->target->player);
|
||||
if (leveltime & 1)
|
||||
mobj->renderflags |= RF_DONTDRAW;
|
||||
}
|
||||
|
|
@ -7693,7 +7701,112 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
else
|
||||
mobj->renderflags = (mobj->renderflags & ~RF_TRANSMASK)|(trans << RF_TRANSSHIFT);
|
||||
}
|
||||
|
||||
K_ReduceVFX(mobj, mobj->target->player);
|
||||
break;
|
||||
case MT_MAGICIANBOX:
|
||||
{
|
||||
fixed_t destx, desty;
|
||||
fixed_t zoff = 0;
|
||||
|
||||
// EV1: rotation rate
|
||||
// EV2: lifetime
|
||||
// cusval: responsible for disappear FX (should only happen once)
|
||||
|
||||
// S_MAGICANBOX: sides, starting angle is set in the spawner (SetRandomFakePlayerSkin)
|
||||
// S_MAGICIANBOX_TOP, S_MAGICIANBOX_BOTTOM: splats with their own offset sprite sets
|
||||
|
||||
mobj->extravalue2--;
|
||||
|
||||
if (mobj->extravalue2 == 0)
|
||||
{
|
||||
P_RemoveMobj(mobj);
|
||||
break;
|
||||
}
|
||||
else if (mobj->extravalue2 < TICRATE/3)
|
||||
{
|
||||
P_SetTarget(&mobj->target, NULL);
|
||||
if (mobj->extravalue2 & 1)
|
||||
mobj->renderflags |= RF_DONTDRAW;
|
||||
else
|
||||
mobj->renderflags &= ~RF_DONTDRAW;
|
||||
}
|
||||
else if (mobj->extravalue2 == TICRATE/3 && !P_MobjWasRemoved(mobj->target))
|
||||
{
|
||||
mobj->momx = mobj->target->momx;
|
||||
mobj->momy = mobj->target->momy;
|
||||
mobj->momz = mobj->target->momz;
|
||||
|
||||
if (mobj->state == &states[S_MAGICIANBOX]) // sides
|
||||
P_Thrust(mobj, mobj->angle + ANGLE_90, 32*mapobjectscale);
|
||||
|
||||
mobj->flags &= ~MF_NOGRAVITY;
|
||||
mobj->momz += 10*mapobjectscale;
|
||||
if (mobj->state == &states[S_MAGICIANBOX_BOTTOM])
|
||||
mobj->momz *= -1;
|
||||
|
||||
if (!mobj->cusval) // Some stuff should only occur once per box
|
||||
return true;
|
||||
|
||||
S_StartSound(mobj, sfx_kc2e);
|
||||
S_StartSound(mobj, sfx_s3k9f);
|
||||
|
||||
if (mobj->target->player->hyudorotimer)
|
||||
{
|
||||
P_RemoveMobj(mobj);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
K_SpawnMagicianParticles(mobj, 5);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if (mobj->target && !P_MobjWasRemoved(mobj->target))
|
||||
{
|
||||
mobj->renderflags &= ~RF_DONTDRAW;
|
||||
mobj->renderflags |= (mobj->target->renderflags & RF_DONTDRAW);
|
||||
// NB: This depends on order of thinker execution!
|
||||
// SetRandomFakePlayerSkin (r_skins.c) sets cusval on the bottom (last) side (i=5).
|
||||
// This writes to the player's visibility only after every other side has ticked and inherited it.
|
||||
if (mobj->cusval)
|
||||
mobj->target->renderflags |= RF_DONTDRAW;
|
||||
}
|
||||
|
||||
if (P_MobjWasRemoved(mobj->target) || !mobj->target->health || !mobj->target->player) {
|
||||
mobj->extravalue2 = min(mobj->extravalue2, TICRATE/3);
|
||||
return true;
|
||||
}
|
||||
|
||||
mobj->extravalue1 += 1;
|
||||
|
||||
mobj->angle += ANG1*mobj->extravalue1;
|
||||
mobj->scale = mobj->target->scale;
|
||||
|
||||
destx = mobj->target->x;
|
||||
desty = mobj->target->y;
|
||||
|
||||
if (mobj->state == &states[S_MAGICIANBOX]) // sides
|
||||
{
|
||||
destx += FixedMul(mobj->radius*2, FINECOSINE((mobj->angle+ANGLE_90) >> ANGLETOFINESHIFT));
|
||||
desty += FixedMul(mobj->radius*2, FINESINE((mobj->angle+ANGLE_90) >> ANGLETOFINESHIFT));
|
||||
}
|
||||
else if (mobj->state == &states[S_MAGICIANBOX_TOP]) // top
|
||||
{
|
||||
zoff = mobj->radius*4;
|
||||
}
|
||||
|
||||
if (mobj->flags2 & MF2_AMBUSH)
|
||||
{
|
||||
P_SetOrigin(mobj, destx, desty, mobj->target->z + zoff);
|
||||
mobj->flags2 &= ~MF2_AMBUSH;
|
||||
}
|
||||
else
|
||||
{
|
||||
P_MoveOrigin(mobj, destx, desty, mobj->target->z + zoff);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MT_LIGHTNINGSHIELD:
|
||||
{
|
||||
fixed_t destx, desty;
|
||||
|
|
@ -8408,7 +8521,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
|
||||
mobj->movecount += mobj->lastlook;
|
||||
|
||||
if (!(P_TryMove(mobj->tracer, mobj->x + ((mobj->extravalue1<<FRACBITS) * mobj->movecount), mobj->y + ((mobj->extravalue2<<FRACBITS) * mobj->movecount), true))
|
||||
if (!(P_TryMove(mobj->tracer, mobj->x + ((mobj->extravalue1<<FRACBITS) * mobj->movecount), mobj->y + ((mobj->extravalue2<<FRACBITS) * mobj->movecount), true, NULL))
|
||||
|| (mobj->movecount >= 16) // maximum travel time
|
||||
|| (mobj->tracer->z <= mobj->tracer->floorz) // Through the floor
|
||||
|| ((mobj->tracer->z + mobj->tracer->height) >= mobj->tracer->ceilingz)) // Through the ceiling
|
||||
|
|
@ -9451,7 +9564,9 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
|
||||
mobj->eflags &= ~(MFE_PUSHED|MFE_SPRUNG|MFE_JUSTBOUNCEDWALL|MFE_DAMAGEHITLAG|MFE_SLOPELAUNCHED);
|
||||
|
||||
tmfloorthing = tmhitthing = NULL;
|
||||
// sal: what the hell? is there any reason this isn't done, like, literally ANYWHERE else?
|
||||
P_SetTarget(&tm.floorthing, NULL);
|
||||
P_SetTarget(&tm.hitthing, NULL);
|
||||
|
||||
// Sector flag MSF_TRIGGERLINE_MOBJ allows ANY mobj to trigger a linedef exec
|
||||
P_CheckMobjTrigger(mobj, false);
|
||||
|
|
@ -9607,7 +9722,7 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
{
|
||||
if (!P_ZMovement(mobj))
|
||||
return; // mobj was removed
|
||||
P_CheckPosition(mobj, mobj->x, mobj->y); // Need this to pick up objects!
|
||||
P_CheckPosition(mobj, mobj->x, mobj->y, NULL); // Need this to pick up objects!
|
||||
if (P_MobjWasRemoved(mobj))
|
||||
return;
|
||||
}
|
||||
|
|
@ -9631,7 +9746,7 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
|| mobj->type == MT_JAWZ
|
||||
|| (mobj->type == MT_DROPTARGET && mobj->reactiontime))
|
||||
{
|
||||
P_TryMove(mobj, mobj->x, mobj->y, true); // Sets mo->standingslope correctly
|
||||
P_TryMove(mobj, mobj->x, mobj->y, true, NULL); // Sets mo->standingslope correctly
|
||||
|
||||
if (P_MobjWasRemoved(mobj)) // anything that calls checkposition can be lethal
|
||||
return;
|
||||
|
|
@ -9729,7 +9844,7 @@ boolean P_RailThinker(mobj_t *mobj)
|
|||
{
|
||||
if (!P_ZMovement(mobj))
|
||||
return true; // mobj was removed
|
||||
//P_CheckPosition(mobj, mobj->x, mobj->y);
|
||||
//P_CheckPosition(mobj, mobj->x, mobj->y, NULL);
|
||||
}
|
||||
|
||||
return P_MobjWasRemoved(mobj) || (x == mobj->x && y == mobj->y && z == mobj->z);
|
||||
|
|
@ -9745,7 +9860,7 @@ void P_PushableThinker(mobj_t *mobj)
|
|||
|
||||
// it has to be pushable RIGHT NOW for this part to happen
|
||||
if (mobj->flags & MF_PUSHABLE && !(mobj->momx || mobj->momy))
|
||||
P_TryMove(mobj, mobj->x, mobj->y, true);
|
||||
P_TryMove(mobj, mobj->x, mobj->y, true, NULL);
|
||||
|
||||
if (mobj->fuse == 1) // it would explode in the MobjThinker code
|
||||
{
|
||||
|
|
@ -9806,13 +9921,13 @@ void P_SceneryThinker(mobj_t *mobj)
|
|||
{
|
||||
if (!P_SceneryZMovement(mobj))
|
||||
return; // mobj was removed
|
||||
P_CheckPosition(mobj, mobj->x, mobj->y); // Need this to pick up objects!
|
||||
P_CheckPosition(mobj, mobj->x, mobj->y, NULL); // Need this to pick up objects!
|
||||
if (P_MobjWasRemoved(mobj))
|
||||
return;
|
||||
mobj->floorz = tmfloorz;
|
||||
mobj->ceilingz = tmceilingz;
|
||||
mobj->floorrover = tmfloorrover;
|
||||
mobj->ceilingrover = tmceilingrover;
|
||||
mobj->floorz = tm.floorz;
|
||||
mobj->ceilingz = tm.ceilingz;
|
||||
mobj->floorrover = tm.floorrover;
|
||||
mobj->ceilingrover = tm.ceilingrover;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -13348,7 +13463,7 @@ boolean P_CheckMissileSpawn(mobj_t *th)
|
|||
th->z += th->momz>>1;
|
||||
}
|
||||
|
||||
if (!P_TryMove(th, th->x, th->y, true))
|
||||
if (!P_TryMove(th, th->x, th->y, true, NULL))
|
||||
{
|
||||
P_ExplodeMissile(th);
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -762,7 +762,7 @@ static void Polyobj_removeFromBlockmap(polyobj_t *po)
|
|||
// Movement functions
|
||||
|
||||
// A version of Lee's routine from p_maputl.c that accepts an mobj pointer
|
||||
// argument instead of using tmthing. Returns true if the line isn't contacted
|
||||
// argument instead of using tm.thing. Returns true if the line isn't contacted
|
||||
// and false otherwise.
|
||||
static inline boolean Polyobj_untouched(line_t *ld, mobj_t *mo)
|
||||
{
|
||||
|
|
@ -805,11 +805,11 @@ static void Polyobj_pushThing(polyobj_t *po, line_t *line, mobj_t *mo)
|
|||
// if object doesn't fit at desired location, possibly hurt it
|
||||
if (po->damage && (mo->flags & MF_SHOOTABLE))
|
||||
{
|
||||
P_CheckPosition(mo, mo->x + momx, mo->y + momy);
|
||||
mo->floorz = tmfloorz;
|
||||
mo->ceilingz = tmceilingz;
|
||||
mo->floorrover = tmfloorrover;
|
||||
mo->ceilingrover = tmceilingrover;
|
||||
P_CheckPosition(mo, mo->x + momx, mo->y + momy, NULL);
|
||||
mo->floorz = tm.floorz;
|
||||
mo->ceilingz = tm.ceilingz;
|
||||
mo->floorrover = tm.floorrover;
|
||||
mo->ceilingrover = tm.ceilingrover;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -851,7 +851,7 @@ static void Polyobj_slideThing(mobj_t *mo, fixed_t dx, fixed_t dy)
|
|||
|
||||
mo->player->onconveyor = 1;
|
||||
} else
|
||||
P_TryMove(mo, mo->x+dx, mo->y+dy, true);
|
||||
P_TryMove(mo, mo->x+dx, mo->y+dy, true, NULL);
|
||||
}
|
||||
|
||||
// Causes objects resting on top of the polyobject to 'ride' with its movement.
|
||||
|
|
|
|||
|
|
@ -151,6 +151,8 @@ static void P_NetArchivePlayers(void)
|
|||
WRITEUINT8(save_p, players[i].skincolor);
|
||||
WRITEINT32(save_p, players[i].skin);
|
||||
WRITEUINT32(save_p, players[i].availabilities);
|
||||
WRITEUINT8(save_p, players[i].fakeskin);
|
||||
WRITEUINT8(save_p, players[i].lastfakeskin);
|
||||
WRITEUINT32(save_p, players[i].score);
|
||||
WRITESINT8(save_p, players[i].lives);
|
||||
WRITESINT8(save_p, players[i].xtralife);
|
||||
|
|
@ -249,6 +251,7 @@ static void P_NetArchivePlayers(void)
|
|||
WRITEUINT8(save_p, players[i].oldposition);
|
||||
WRITEUINT8(save_p, players[i].positiondelay);
|
||||
WRITEUINT32(save_p, players[i].distancetofinish);
|
||||
WRITEUINT32(save_p, K_GetWaypointHeapIndex(players[i].currentwaypoint));
|
||||
WRITEUINT32(save_p, K_GetWaypointHeapIndex(players[i].nextwaypoint));
|
||||
WRITEUINT32(save_p, players[i].airtime);
|
||||
WRITEUINT8(save_p, players[i].startboost);
|
||||
|
|
@ -470,6 +473,8 @@ static void P_NetUnArchivePlayers(void)
|
|||
players[i].skincolor = READUINT8(save_p);
|
||||
players[i].skin = READINT32(save_p);
|
||||
players[i].availabilities = READUINT32(save_p);
|
||||
players[i].fakeskin = READUINT8(save_p);
|
||||
players[i].lastfakeskin = READUINT8(save_p);
|
||||
players[i].score = READUINT32(save_p);
|
||||
players[i].lives = READSINT8(save_p);
|
||||
players[i].xtralife = READSINT8(save_p); // Ring Extra Life counter
|
||||
|
|
@ -548,6 +553,7 @@ static void P_NetUnArchivePlayers(void)
|
|||
players[i].oldposition = READUINT8(save_p);
|
||||
players[i].positiondelay = READUINT8(save_p);
|
||||
players[i].distancetofinish = READUINT32(save_p);
|
||||
players[i].currentwaypoint = (waypoint_t *)(size_t)READUINT32(save_p);
|
||||
players[i].nextwaypoint = (waypoint_t *)(size_t)READUINT32(save_p);
|
||||
players[i].airtime = READUINT32(save_p);
|
||||
players[i].startboost = READUINT8(save_p);
|
||||
|
|
@ -4422,6 +4428,15 @@ static void P_RelinkPointers(void)
|
|||
if (!P_SetTarget(&mobj->player->follower, P_FindNewPosition(temp)))
|
||||
CONS_Debug(DBG_GAMELOGIC, "follower not found on %d\n", mobj->type);
|
||||
}
|
||||
if (mobj->player->currentwaypoint)
|
||||
{
|
||||
temp = (UINT32)(size_t)mobj->player->currentwaypoint;
|
||||
mobj->player->currentwaypoint = K_GetWaypointFromIndex(temp);
|
||||
if (mobj->player->currentwaypoint == NULL)
|
||||
{
|
||||
CONS_Debug(DBG_GAMELOGIC, "currentwaypoint not found on %d\n", mobj->type);
|
||||
}
|
||||
}
|
||||
if (mobj->player->nextwaypoint)
|
||||
{
|
||||
temp = (UINT32)(size_t)mobj->player->nextwaypoint;
|
||||
|
|
|
|||
|
|
@ -7465,7 +7465,7 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
|
|||
|
||||
P_ResetTubeWaypoints();
|
||||
|
||||
P_MapStart(); // tmthing can be used starting from this point
|
||||
P_MapStart(); // tm.thing can be used starting from this point
|
||||
|
||||
// init anything that P_SpawnSlopes/P_LoadThings needs to know
|
||||
P_InitSpecials();
|
||||
|
|
@ -7570,7 +7570,7 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
|
|||
|
||||
P_RunCachedActions();
|
||||
|
||||
P_MapEnd(); // tmthing is no longer needed from this point onwards
|
||||
P_MapEnd(); // tm.thing is no longer needed from this point onwards
|
||||
|
||||
// Took me 3 hours to figure out why my progression kept on getting overwritten with the titlemap...
|
||||
if (!titlemapinaction)
|
||||
|
|
@ -7629,9 +7629,9 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
|
|||
G_CopyTiccmd(&players[i].cmd, &netcmds[buf][i], 1);
|
||||
}
|
||||
P_PreTicker(2);
|
||||
P_MapStart(); // just in case MapLoad modifies tmthing
|
||||
P_MapStart(); // just in case MapLoad modifies tm.thing
|
||||
LUA_HookInt(gamemap, HOOK(MapLoad));
|
||||
P_MapEnd(); // just in case MapLoad modifies tmthing
|
||||
P_MapEnd(); // just in case MapLoad modifies tm.thing
|
||||
}
|
||||
|
||||
K_TimerReset();
|
||||
|
|
|
|||
957
src/p_sight.c
957
src/p_sight.c
File diff suppressed because it is too large
Load diff
11
src/p_spec.c
11
src/p_spec.c
|
|
@ -1928,6 +1928,17 @@ static void K_HandleLapIncrement(player_t *player)
|
|||
P_DoPlayerExit(player);
|
||||
P_SetupSignExit(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT32 skinflags = (demo.playback)
|
||||
? demo.skinlist[demo.currentskinid[(player-players)]].flags
|
||||
: skins[player->skin].flags;
|
||||
if (skinflags & SF_IRONMAN)
|
||||
{
|
||||
SetRandomFakePlayerSkin(player, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (player->laps > player->latestlap)
|
||||
{
|
||||
|
|
|
|||
33
src/p_user.c
33
src/p_user.c
|
|
@ -1237,6 +1237,8 @@ mobj_t *P_SpawnGhostMobj(mobj_t *mobj)
|
|||
ghost->old_pitch = mobj->old_pitch2;
|
||||
ghost->old_roll = mobj->old_roll2;
|
||||
|
||||
K_ReduceVFX(ghost, mobj->player);
|
||||
|
||||
return ghost;
|
||||
}
|
||||
|
||||
|
|
@ -1264,6 +1266,8 @@ void P_DoPlayerExit(player_t *player)
|
|||
|
||||
if (!player->spectator)
|
||||
{
|
||||
ClearFakePlayerSkin(player);
|
||||
|
||||
if ((gametyperules & GTR_CIRCUIT)) // If in Race Mode, allow
|
||||
{
|
||||
K_KartUpdatePosition(player);
|
||||
|
|
@ -4168,6 +4172,35 @@ void P_PlayerThink(player_t *player)
|
|||
player->stairjank--;
|
||||
}
|
||||
|
||||
// Random skin / "ironman"
|
||||
{
|
||||
UINT32 skinflags = (demo.playback)
|
||||
? demo.skinlist[demo.currentskinid[playeri]].flags
|
||||
: skins[player->skin].flags;
|
||||
|
||||
if (skinflags & SF_IRONMAN) // we are Heavy Magician
|
||||
{
|
||||
if (player->charflags & SF_IRONMAN) // no fakeskin yet
|
||||
{
|
||||
if (leveltime >= starttime && !player->exiting)
|
||||
{
|
||||
if (player->fakeskin != MAXSKINS)
|
||||
{
|
||||
SetFakePlayerSkin(player, player->fakeskin);
|
||||
}
|
||||
else if (!(gametyperules & GTR_CIRCUIT))
|
||||
{
|
||||
SetRandomFakePlayerSkin(player, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (player->exiting) // wearing a fakeskin, but need to display signpost postrace etc
|
||||
{
|
||||
ClearFakePlayerSkin(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
K_KartPlayerThink(player, cmd); // SRB2kart
|
||||
|
||||
DoABarrelRoll(player);
|
||||
|
|
|
|||
|
|
@ -180,6 +180,8 @@ consvar_t cv_maxportals = CVAR_INIT ("maxportals", "2", CV_SAVE, maxportals_cons
|
|||
|
||||
consvar_t cv_renderstats = CVAR_INIT ("renderstats", "Off", 0, CV_OnOff, NULL);
|
||||
|
||||
consvar_t cv_drawpickups = CVAR_INIT ("drawpickups", "Yes", CV_CHEAT, CV_YesNo, NULL);
|
||||
|
||||
void SplitScreen_OnChange(void)
|
||||
{
|
||||
UINT8 i;
|
||||
|
|
@ -1646,4 +1648,6 @@ void R_RegisterEngineStuff(void)
|
|||
|
||||
// Frame interpolation/uncapped
|
||||
CV_RegisterVar(&cv_fpscap);
|
||||
|
||||
CV_RegisterVar(&cv_drawpickups);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,6 +117,7 @@ extern consvar_t cv_drawdist, cv_drawdist_precip;
|
|||
extern consvar_t cv_fov[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_skybox;
|
||||
extern consvar_t cv_tailspickup;
|
||||
extern consvar_t cv_drawpickups;
|
||||
|
||||
// Called by startup code.
|
||||
void R_Init(void);
|
||||
|
|
|
|||
134
src/r_skins.c
134
src/r_skins.c
|
|
@ -27,6 +27,8 @@
|
|||
#include "p_local.h"
|
||||
#include "dehacked.h" // get_number (for thok)
|
||||
#include "m_cond.h"
|
||||
#include "k_kart.h"
|
||||
#include "m_random.h"
|
||||
#if 0
|
||||
#include "k_kart.h" // K_KartResetPlayerColor
|
||||
#endif
|
||||
|
|
@ -334,6 +336,136 @@ void SetPlayerSkinByNum(INT32 playernum, INT32 skinnum)
|
|||
SetPlayerSkinByNum(playernum, 0); // not found, put in the default skin
|
||||
}
|
||||
|
||||
// Set mo skin but not player_t skin, for ironman
|
||||
void SetFakePlayerSkin(player_t* player, INT32 skinid)
|
||||
{
|
||||
if (player->fakeskin != skinid)
|
||||
{
|
||||
if (player->fakeskin != MAXSKINS)
|
||||
player->lastfakeskin = player->fakeskin;
|
||||
player->fakeskin = skinid;
|
||||
}
|
||||
|
||||
if (demo.playback)
|
||||
{
|
||||
player->kartspeed = demo.skinlist[skinid].kartspeed;
|
||||
player->kartweight = demo.skinlist[skinid].kartweight;
|
||||
player->charflags = demo.skinlist[skinid].flags;
|
||||
skinid = demo.skinlist[skinid].mapping;
|
||||
}
|
||||
else
|
||||
{
|
||||
player->kartspeed = skins[skinid].kartspeed;
|
||||
player->kartweight = skins[skinid].kartweight;
|
||||
player->charflags = skins[skinid].flags;
|
||||
}
|
||||
|
||||
player->mo->skin = &skins[skinid];
|
||||
}
|
||||
|
||||
// Loudly rerandomize
|
||||
void SetRandomFakePlayerSkin(player_t* player, boolean fast)
|
||||
{
|
||||
INT32 i;
|
||||
UINT8 usableskins = 0, maxskinpick;
|
||||
UINT8 grabskins[MAXSKINS];
|
||||
|
||||
maxskinpick = (demo.playback ? demo.numskins : numskins);
|
||||
|
||||
for (i = 0; i < maxskinpick; i++)
|
||||
{
|
||||
if (i == player->lastfakeskin)
|
||||
continue;
|
||||
if (demo.playback)
|
||||
{
|
||||
if (demo.skinlist[i].flags & SF_IRONMAN)
|
||||
continue;
|
||||
}
|
||||
else if (skins[i].flags & SF_IRONMAN)
|
||||
continue;
|
||||
/*if (K_SkinLocked(i))
|
||||
continue;*/
|
||||
grabskins[usableskins++] = i;
|
||||
}
|
||||
|
||||
i = grabskins[P_RandomKey(PR_RANDOMSKIN, usableskins)];
|
||||
|
||||
SetFakePlayerSkin(player, i);
|
||||
|
||||
if (player->mo)
|
||||
{
|
||||
S_StartSound(player->mo, sfx_kc33);
|
||||
S_StartSound(player->mo, sfx_cdfm44);
|
||||
|
||||
mobj_t *parent = player->mo;
|
||||
fixed_t baseangle = P_RandomRange(PR_DECORATION, 0, 359);
|
||||
INT32 j;
|
||||
|
||||
for (j = 0; j < 6; j++) // 0-3 = sides, 4 = top, 5 = bottom
|
||||
{
|
||||
mobj_t *box = P_SpawnMobjFromMobj(parent, 0, 0, 0, MT_MAGICIANBOX);
|
||||
P_SetTarget(&box->target, parent);
|
||||
box->angle = FixedAngle((baseangle + j*90) * FRACUNIT);
|
||||
box->flags2 |= MF2_AMBUSH;
|
||||
if (fast)
|
||||
{
|
||||
box->extravalue1 = 10; // Rotation rate
|
||||
box->extravalue2 = 5*TICRATE/4; // Lifetime
|
||||
}
|
||||
else
|
||||
{
|
||||
box->extravalue1 = 1;
|
||||
box->extravalue2 = 3*TICRATE/2;
|
||||
}
|
||||
|
||||
// cusval controls behavior that should run only once, like disappear FX and RF_DONTDRAW handling.
|
||||
// NB: Order of thinker execution matters here!
|
||||
// We want the other sides to inherit the player's "existing" RF_DONTDRAW before the last side writes to it.
|
||||
// See the MT_MAGICIANBOX thinker in p_mobj.c.
|
||||
if (j == 5)
|
||||
box->cusval = 1;
|
||||
else
|
||||
box->cusval = 0;
|
||||
|
||||
if (j > 3)
|
||||
{
|
||||
P_SetMobjState(box, (j == 4) ? S_MAGICIANBOX_TOP : S_MAGICIANBOX_BOTTOM);
|
||||
box->renderflags |= RF_NOSPLATBILLBOARD;
|
||||
box->angle = FixedAngle(baseangle*FRACUNIT);
|
||||
}
|
||||
}
|
||||
|
||||
K_SpawnMagicianParticles(player->mo, 10);
|
||||
}
|
||||
}
|
||||
|
||||
// Return to base skin from an SF_IRONMAN randomization
|
||||
void ClearFakePlayerSkin(player_t* player)
|
||||
{
|
||||
UINT8 skinid;
|
||||
UINT32 flags;
|
||||
|
||||
if (demo.playback)
|
||||
{
|
||||
skinid = demo.currentskinid[(player-players)];
|
||||
flags = demo.skinlist[skinid].flags;
|
||||
}
|
||||
else
|
||||
{
|
||||
skinid = player->skin;
|
||||
flags = skins[player->skin].flags;
|
||||
}
|
||||
|
||||
if ((flags & SF_IRONMAN) && !P_MobjWasRemoved(player->mo))
|
||||
{
|
||||
SetFakePlayerSkin(player, skinid);
|
||||
S_StartSound(player->mo, sfx_s3k9f);
|
||||
K_SpawnMagicianParticles(player->mo, 5);
|
||||
}
|
||||
|
||||
player->fakeskin = MAXSKINS;
|
||||
}
|
||||
|
||||
//
|
||||
// Add skins from a pwad, each skin preceded by 'S_SKIN' marker
|
||||
//
|
||||
|
|
@ -482,8 +614,8 @@ static boolean R_ProcessPatchableFields(skin_t *skin, char *stoken, char *value)
|
|||
// parameters for individual character flags
|
||||
// these are uppercase so they can be concatenated with SF_
|
||||
// 1, true, yes are all valid values
|
||||
GETFLAG(HIRES)
|
||||
GETFLAG(MACHINE)
|
||||
GETFLAG(IRONMAN)
|
||||
#undef GETFLAG
|
||||
|
||||
else // let's check if it's a sound, otherwise error out
|
||||
|
|
|
|||
|
|
@ -81,6 +81,9 @@ void R_InitSkins(void);
|
|||
|
||||
void SetPlayerSkin(INT32 playernum,const char *skinname);
|
||||
void SetPlayerSkinByNum(INT32 playernum,INT32 skinnum); // Tails 03-16-2002
|
||||
void SetFakePlayerSkin(player_t* player, INT32 skinnum);
|
||||
void SetRandomFakePlayerSkin(player_t* player, boolean fast);
|
||||
void ClearFakePlayerSkin(player_t* player);
|
||||
boolean R_SkinUsable(INT32 playernum, INT32 skinnum);
|
||||
UINT32 R_GetSkinAvailabilities(void);
|
||||
INT32 R_SkinAvailable(const char *name);
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ void R_DrawFloorSplat(vissprite_t *spr)
|
|||
splat.height = spr->patch->height;
|
||||
splat.scale = mobj->scale;
|
||||
|
||||
if (mobj->skin && ((skin_t *)mobj->skin)->flags & SF_HIRES)
|
||||
if (mobj->skin && ((skin_t *)mobj->skin)->highresscale != FRACUNIT)
|
||||
splat.scale = FixedMul(splat.scale, ((skin_t *)mobj->skin)->highresscale);
|
||||
|
||||
if (spr->rotateflags & SRF_3D || renderflags & RF_NOSPLATBILLBOARD)
|
||||
|
|
|
|||
|
|
@ -945,7 +945,7 @@ static void R_DrawVisSprite(vissprite_t *vis)
|
|||
frac = vis->startfrac;
|
||||
windowtop = windowbottom = sprbotscreen = INT32_MAX;
|
||||
|
||||
if (!(vis->cut & SC_PRECIP) && vis->mobj->skin && ((skin_t *)vis->mobj->skin)->flags & SF_HIRES)
|
||||
if (!(vis->cut & SC_PRECIP) && vis->mobj->skin && ((skin_t *)vis->mobj->skin)->highresscale != FRACUNIT)
|
||||
this_scale = FixedMul(this_scale, ((skin_t *)vis->mobj->skin)->highresscale);
|
||||
|
||||
if (this_scale <= 0)
|
||||
|
|
@ -1410,7 +1410,7 @@ static void R_ProjectDropShadow(
|
|||
shadow->gzt = groundz + patch->height * shadowyscale / 2;
|
||||
shadow->gz = shadow->gzt - patch->height * shadowyscale;
|
||||
shadow->texturemid = FixedMul(interp.scale, FixedDiv(shadow->gzt - viewz, shadowyscale));
|
||||
if (thing->skin && ((skin_t *)thing->skin)->flags & SF_HIRES)
|
||||
if (thing->skin && ((skin_t *)thing->skin)->highresscale != FRACUNIT)
|
||||
shadow->texturemid = FixedMul(shadow->texturemid, ((skin_t *)thing->skin)->highresscale);
|
||||
shadow->scalestep = 0;
|
||||
shadow->shear.tan = shadowskew; // repurposed variable
|
||||
|
|
@ -1797,7 +1797,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
|
||||
I_Assert(lump < max_spritelumps);
|
||||
|
||||
if (thing->skin && ((skin_t *)thing->skin)->flags & SF_HIRES)
|
||||
if (thing->skin && ((skin_t *)thing->skin)->highresscale != FRACUNIT)
|
||||
this_scale = FixedMul(this_scale, ((skin_t *)thing->skin)->highresscale);
|
||||
|
||||
spr_width = spritecachedinfo[lump].width;
|
||||
|
|
@ -3443,6 +3443,26 @@ boolean R_ThingVisible (mobj_t *thing)
|
|||
if (thing->sprite == SPR_NULL)
|
||||
return false;
|
||||
|
||||
if (!cv_drawpickups.value)
|
||||
{
|
||||
switch (thing->type)
|
||||
{
|
||||
case MT_RING:
|
||||
case MT_FLINGRING:
|
||||
case MT_BLUESPHERE:
|
||||
case MT_RANDOMITEM:
|
||||
case MT_SPHEREBOX:
|
||||
case MT_ITEMCAPSULE:
|
||||
case MT_ITEMCAPSULE_PART:
|
||||
case MT_BATTLECAPSULE:
|
||||
case MT_BATTLECAPSULE_PIECE:
|
||||
return false;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (r_viewmobj && (thing == r_viewmobj || (r_viewmobj->player && r_viewmobj->player->followmobj == thing)))
|
||||
return false;
|
||||
|
||||
|
|
|
|||
|
|
@ -732,6 +732,27 @@ void S_StartSound(const void *origin, sfxenum_t sfx_id)
|
|||
S_StartSoundAtVolume(origin, sfx_id, 255);
|
||||
}
|
||||
|
||||
void S_ReducedVFXSoundAtVolume(const void *origin, sfxenum_t sfx_id, INT32 volume, void *owner)
|
||||
{
|
||||
if (S_SoundDisabled())
|
||||
return;
|
||||
|
||||
if (cv_reducevfx.value == 1)
|
||||
{
|
||||
if (owner == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (P_IsDisplayPlayer((player_t *)owner) == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
S_StartSoundAtVolume(origin, sfx_id, volume);
|
||||
}
|
||||
|
||||
void S_StopSound(void *origin)
|
||||
{
|
||||
INT32 cnum;
|
||||
|
|
|
|||
|
|
@ -139,6 +139,10 @@ void S_StartSound(const void *origin, sfxenum_t sound_id);
|
|||
// Will start a sound at a given volume.
|
||||
void S_StartSoundAtVolume(const void *origin, sfxenum_t sound_id, INT32 volume);
|
||||
|
||||
// Will start a sound, but only if VFX reduce is off or the owner isn't a display player.
|
||||
void S_ReducedVFXSoundAtVolume(const void *origin, sfxenum_t sfx_id, INT32 volume, void *owner);
|
||||
#define S_ReducedVFXSound(a, b, c) S_ReducedVFXSoundAtVolume(a, b, 255, c)
|
||||
|
||||
// Stop sound for thing at <origin>
|
||||
void S_StopSound(void *origin);
|
||||
|
||||
|
|
|
|||
18
src/sounds.c
18
src/sounds.c
|
|
@ -1130,6 +1130,24 @@ sfxinfo_t S_sfx[NUMSFX] =
|
|||
{"gate04", false, 32, 64, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"gate05", false, 32, 64, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
|
||||
// Passing sounds
|
||||
{"pass01", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass02", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass03", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass04", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass05", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass06", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass07", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass08", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass09", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass10", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass11", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass12", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass13", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass14", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass15", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"pass16", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
|
||||
// SRB2Kart - Engine sounds
|
||||
// Engine class A
|
||||
{"krta00", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
|
|
|
|||
18
src/sounds.h
18
src/sounds.h
|
|
@ -1195,6 +1195,24 @@ typedef enum
|
|||
sfx_gate04,
|
||||
sfx_gate05,
|
||||
|
||||
// Passing sounds
|
||||
sfx_pass01,
|
||||
sfx_pass02,
|
||||
sfx_pass03,
|
||||
sfx_pass04,
|
||||
sfx_pass05,
|
||||
sfx_pass06,
|
||||
sfx_pass07,
|
||||
sfx_pass08,
|
||||
sfx_pass09,
|
||||
sfx_pass10,
|
||||
sfx_pass11,
|
||||
sfx_pass12,
|
||||
sfx_pass13,
|
||||
sfx_pass14,
|
||||
sfx_pass15,
|
||||
sfx_pass16,
|
||||
|
||||
// Next up: UNIQUE ENGINE SOUNDS! Hoooooo boy...
|
||||
// Engine class A - Low Speed, Low Weight
|
||||
sfx_krta00,
|
||||
|
|
|
|||
|
|
@ -619,10 +619,6 @@ void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vsca
|
|||
colfrac = FixedDiv(FRACUNIT, fdup);
|
||||
rowfrac = FixedDiv(FRACUNIT, vdup);
|
||||
|
||||
// So it turns out offsets aren't scaled in V_NOSCALESTART unless V_OFFSET is applied ...poo, that's terrible
|
||||
// For now let's just at least give V_OFFSET the ability to support V_FLIP
|
||||
// I'll probably make a better fix for 2.2 where I don't have to worry about breaking existing support for stuff
|
||||
// -- Monster Iestyn 29/10/18
|
||||
{
|
||||
fixed_t offsetx = 0, offsety = 0;
|
||||
|
||||
|
|
@ -633,7 +629,9 @@ void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vsca
|
|||
offsetx = FixedMul(patch->leftoffset<<FRACBITS, pscale);
|
||||
|
||||
// top offset
|
||||
// TODO: make some kind of vertical version of V_FLIP, maybe by deprecating V_OFFSET in future?!?
|
||||
if (scrn & V_VFLIP)
|
||||
offsety = FixedMul((patch->height - patch->topoffset)<<FRACBITS, vscale) + 1;
|
||||
else
|
||||
offsety = FixedMul(patch->topoffset<<FRACBITS, vscale);
|
||||
|
||||
// Subtract the offsets from x/y positions
|
||||
|
|
@ -641,7 +639,7 @@ void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vsca
|
|||
y -= offsety;
|
||||
}
|
||||
|
||||
desttop = screens[scrn&V_PARAMMASK];
|
||||
desttop = screens[scrn&V_SCREENMASK];
|
||||
|
||||
if (!desttop)
|
||||
return;
|
||||
|
|
@ -700,6 +698,7 @@ void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vsca
|
|||
if (x+offx >= vid.width) // don't draw off the right of the screen (WRAP PREVENTION)
|
||||
break;
|
||||
}
|
||||
|
||||
column = (const column_t *)((const UINT8 *)(patch->columns) + (patch->columnofs[col>>FRACBITS]));
|
||||
|
||||
while (column->topdelta != 0xff)
|
||||
|
|
@ -709,17 +708,31 @@ void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vsca
|
|||
topdelta += prevdelta;
|
||||
prevdelta = topdelta;
|
||||
source = (const UINT8 *)(column) + 3;
|
||||
|
||||
dest = desttop;
|
||||
if (scrn & V_FLIP)
|
||||
dest = deststart + (destend - desttop);
|
||||
dest = deststart + (destend - dest);
|
||||
dest += FixedInt(FixedMul(topdelta<<FRACBITS,vdup))*vid.width;
|
||||
|
||||
for (ofs = 0; dest < deststop && (ofs>>FRACBITS) < column->length; ofs += rowfrac)
|
||||
if (scrn & V_VFLIP)
|
||||
{
|
||||
if (dest >= screens[scrn&V_PARAMMASK]) // don't draw off the top of the screen (CRASH PREVENTION)
|
||||
for (ofs = (column->length << FRACBITS)-1; dest < deststop && ofs >= 0; ofs -= rowfrac)
|
||||
{
|
||||
if (dest >= screens[scrn&V_SCREENMASK]) // don't draw off the top of the screen (CRASH PREVENTION)
|
||||
*dest = patchdrawfunc(dest, source, ofs);
|
||||
dest += vid.width;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (ofs = 0; dest < deststop && ofs < (column->length << FRACBITS); ofs += rowfrac)
|
||||
{
|
||||
if (dest >= screens[scrn&V_SCREENMASK]) // don't draw off the top of the screen (CRASH PREVENTION)
|
||||
*dest = patchdrawfunc(dest, source, ofs);
|
||||
dest += vid.width;
|
||||
}
|
||||
}
|
||||
|
||||
column = (const column_t *)((const UINT8 *)column + column->length + 4);
|
||||
}
|
||||
}
|
||||
|
|
@ -778,7 +791,7 @@ void V_DrawCroppedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_
|
|||
y -= FixedMul(patch->topoffset<<FRACBITS, pscale);
|
||||
x -= FixedMul(patch->leftoffset<<FRACBITS, pscale);
|
||||
|
||||
desttop = screens[scrn&V_PARAMMASK];
|
||||
desttop = screens[scrn&V_SCREENMASK];
|
||||
|
||||
if (!desttop)
|
||||
return;
|
||||
|
|
@ -830,7 +843,7 @@ void V_DrawCroppedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_
|
|||
|
||||
for (; dest < deststop && (ofs>>FRACBITS) < column->length && (((ofs>>FRACBITS) - sy) + topdelta) < h; ofs += rowfrac)
|
||||
{
|
||||
if (dest >= screens[scrn&V_PARAMMASK]) // don't draw off the top of the screen (CRASH PREVENTION)
|
||||
if (dest >= screens[scrn&V_SCREENMASK]) // don't draw off the top of the screen (CRASH PREVENTION)
|
||||
*dest = patchdrawfunc(dest, source, ofs);
|
||||
dest += vid.width;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,11 +82,14 @@ void V_CubeApply(RGBA_t *input);
|
|||
#define V_GetColor(color) (pLocalPalette[color&0xFF])
|
||||
#define V_GetMasterColor(color) (pMasterPalette[color&0xFF])
|
||||
|
||||
// Bottom 8 bits are used for parameter (screen or character)
|
||||
// Bottom 8 bits are used for parameter (character)
|
||||
#define V_PARAMMASK 0x000000FF
|
||||
|
||||
// strings/characters only
|
||||
#define V_STRINGDANCE 0x00000002
|
||||
// Bottom bit is used for screen (patches)
|
||||
#define V_SCREENMASK 0x0000000F
|
||||
|
||||
#define V_STRINGDANCE 0x00000002 // (strings/characters only) funny undertale
|
||||
#define V_VFLIP 0x00000010 // (patches only) Vertical flip
|
||||
|
||||
// flags hacked in scrn (not supported by all functions (see src))
|
||||
// patch scaling uses bits 9 and 10
|
||||
|
|
|
|||
22
src/w_wad.c
22
src/w_wad.c
|
|
@ -1070,16 +1070,11 @@ UINT16 W_CheckNumForMapPwad(const char *name, UINT32 hash, UINT16 wad, UINT16 st
|
|||
UINT16 W_CheckNumForNamePwad(const char *name, UINT16 wad, UINT16 startlump)
|
||||
{
|
||||
UINT16 i;
|
||||
static char uname[8 + 1];
|
||||
UINT32 hash;
|
||||
UINT32 hash = quickncasehash(name, 8);
|
||||
|
||||
if (!TestValidLump(wad,0))
|
||||
return INT16_MAX;
|
||||
|
||||
strlcpy(uname, name, sizeof uname);
|
||||
strupr(uname);
|
||||
hash = quickncasehash(uname, 8);
|
||||
|
||||
//
|
||||
// scan forward
|
||||
// start at 'startlump', useful parameter when there are multiple
|
||||
|
|
@ -1092,7 +1087,7 @@ UINT16 W_CheckNumForNamePwad(const char *name, UINT16 wad, UINT16 startlump)
|
|||
{
|
||||
if (lump_p->hash != hash)
|
||||
continue;
|
||||
if (strncmp(lump_p->name, uname, sizeof(uname) - 1))
|
||||
if (strncasecmp(lump_p->name, name, 8))
|
||||
continue;
|
||||
return i;
|
||||
}
|
||||
|
|
@ -1111,16 +1106,11 @@ UINT16 W_CheckNumForNamePwad(const char *name, UINT16 wad, UINT16 startlump)
|
|||
UINT16 W_CheckNumForLongNamePwad(const char *name, UINT16 wad, UINT16 startlump)
|
||||
{
|
||||
UINT16 i;
|
||||
static char uname[256 + 1];
|
||||
UINT32 hash;
|
||||
UINT32 hash = quickncasehash(name, 8); // Not a mistake, legacy system for short lumpnames
|
||||
|
||||
if (!TestValidLump(wad,0))
|
||||
return INT16_MAX;
|
||||
|
||||
strlcpy(uname, name, sizeof uname);
|
||||
strupr(uname);
|
||||
hash = quickncasehash(uname, 8); // Not a mistake, legacy system for short lumpnames
|
||||
|
||||
//
|
||||
// scan forward
|
||||
// start at 'startlump', useful parameter when there are multiple
|
||||
|
|
@ -1133,7 +1123,7 @@ UINT16 W_CheckNumForLongNamePwad(const char *name, UINT16 wad, UINT16 startlump)
|
|||
{
|
||||
if (lump_p->hash != hash)
|
||||
continue;
|
||||
if (strcmp(lump_p->longname, uname))
|
||||
if (strcasecmp(lump_p->longname, name))
|
||||
continue;
|
||||
return i;
|
||||
}
|
||||
|
|
@ -1227,7 +1217,7 @@ lumpnum_t W_CheckNumForName(const char *name)
|
|||
{
|
||||
if (!lumpnumcache[i & (LUMPNUMCACHESIZE - 1)].lumpname[8]
|
||||
&& lumpnumcache[i & (LUMPNUMCACHESIZE - 1)].lumphash == hash
|
||||
&& strncmp(lumpnumcache[i & (LUMPNUMCACHESIZE - 1)].lumpname, name, 8) == 0)
|
||||
&& strncasecmp(lumpnumcache[i & (LUMPNUMCACHESIZE - 1)].lumpname, name, 8) == 0)
|
||||
{
|
||||
lumpnumcacheindex = i & (LUMPNUMCACHESIZE - 1);
|
||||
return lumpnumcache[lumpnumcacheindex].lumpnum;
|
||||
|
|
@ -1282,7 +1272,7 @@ lumpnum_t W_CheckNumForLongName(const char *name)
|
|||
for (i = lumpnumcacheindex + LUMPNUMCACHESIZE; i > lumpnumcacheindex; i--)
|
||||
{
|
||||
if (lumpnumcache[i & (LUMPNUMCACHESIZE - 1)].lumphash == hash
|
||||
&& strcmp(lumpnumcache[i & (LUMPNUMCACHESIZE - 1)].lumpname, name) == 0)
|
||||
&& strcasecmp(lumpnumcache[i & (LUMPNUMCACHESIZE - 1)].lumpname, name) == 0)
|
||||
{
|
||||
lumpnumcacheindex = i & (LUMPNUMCACHESIZE - 1);
|
||||
return lumpnumcache[lumpnumcacheindex].lumpnum;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue