mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-03-26 12:51:28 +00:00
Merge branch 'master' into dust-kart
This commit is contained in:
commit
2adbcd6dfd
30 changed files with 1001 additions and 792 deletions
|
@ -1319,7 +1319,7 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime)
|
|||
else
|
||||
netbuffer->u.serverinfo.iszone = 0;
|
||||
|
||||
netbuffer->u.serverinfo.actnum = mapheaderinfo[gamemap-1]->actnum;
|
||||
netbuffer->u.serverinfo.actnum = 0; //mapheaderinfo[gamemap-1]->actnum
|
||||
|
||||
p = PutFileNeeded();
|
||||
|
||||
|
@ -1636,15 +1636,16 @@ static void CL_LoadReceivedSavegame(void)
|
|||
|
||||
if (P_LoadNetGame())
|
||||
{
|
||||
const INT32 actnum = mapheaderinfo[gamemap-1]->actnum;
|
||||
CONS_Printf(M_GetText("Map is now \"%s"), G_BuildMapName(gamemap));
|
||||
if (strcmp(mapheaderinfo[gamemap-1]->lvlttl, ""))
|
||||
if (strlen(mapheaderinfo[gamemap-1]->lvlttl) > 0)
|
||||
{
|
||||
CONS_Printf(": %s", mapheaderinfo[gamemap-1]->lvlttl);
|
||||
if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE))
|
||||
if (strlen(mapheaderinfo[gamemap-1]->zonttl) > 0)
|
||||
CONS_Printf(" %s", mapheaderinfo[gamemap-1]->zonttl);
|
||||
else if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE))
|
||||
CONS_Printf(M_GetText(" ZONE"));
|
||||
if (actnum > 0)
|
||||
CONS_Printf(" %2d", actnum);
|
||||
if (strlen(mapheaderinfo[gamemap-1]->actnum) > 0)
|
||||
CONS_Printf(" %s", mapheaderinfo[gamemap-1]->actnum);
|
||||
}
|
||||
CONS_Printf("\"\n");
|
||||
}
|
||||
|
|
|
@ -4523,10 +4523,20 @@ static void Command_Showmap_f(void)
|
|||
{
|
||||
if (gamestate == GS_LEVEL)
|
||||
{
|
||||
if (mapheaderinfo[gamemap-1]->actnum)
|
||||
CONS_Printf("%s (%d): %s %d\n", G_BuildMapName(gamemap), gamemap, mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->actnum);
|
||||
if (strlen(mapheaderinfo[gamemap-1]->zonttl) > 0)
|
||||
{
|
||||
if (strlen(mapheaderinfo[gamemap-1]->actnum) > 0)
|
||||
CONS_Printf("%s (%d): %s %s %s\n", G_BuildMapName(gamemap), gamemap, mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->zonttl, mapheaderinfo[gamemap-1]->actnum);
|
||||
else
|
||||
CONS_Printf("%s (%d): %s %s\n", G_BuildMapName(gamemap), gamemap, mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->zonttl);
|
||||
}
|
||||
else
|
||||
CONS_Printf("%s (%d): %s\n", G_BuildMapName(gamemap), gamemap, mapheaderinfo[gamemap-1]->lvlttl);
|
||||
{
|
||||
if (strlen(mapheaderinfo[gamemap-1]->actnum) > 0)
|
||||
CONS_Printf("%s (%d): %s %s\n", G_BuildMapName(gamemap), gamemap, mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->actnum);
|
||||
else
|
||||
CONS_Printf("%s (%d): %s\n", G_BuildMapName(gamemap), gamemap, mapheaderinfo[gamemap-1]->lvlttl);
|
||||
}
|
||||
}
|
||||
else
|
||||
CONS_Printf(M_GetText("You must be in a level to use this.\n"));
|
||||
|
|
|
@ -246,7 +246,8 @@ typedef enum
|
|||
k_throwdir, // Held dir of controls; 1 = forward, 0 = none, -1 = backward (was "player->heldDir")
|
||||
k_lapanimation, // Used to make a swoopy lap lakitu, maybe other effects in the future
|
||||
k_cardanimation, // Used to determine the position of some full-screen Battle Mode graphics
|
||||
k_sounds, // Used this to stop and then force music restores as it hits zero
|
||||
k_voices, // Used to stop the player saying more voices than it should
|
||||
k_tauntvoices, // Used to specifically stop taunt voice spam
|
||||
|
||||
k_boosting, // Determines if you're currently shroom-boosting
|
||||
k_floorboost, // Prevents Mushroom sounds for a breif duration when triggered by a floor panel
|
||||
|
@ -260,6 +261,7 @@ typedef enum
|
|||
k_boostcharge, // Charge-up for boosting at the start of the race, or when Lakitu drops you
|
||||
k_jmp, // In Mario Kart, letting go of the jump button stops the drift
|
||||
k_offroad, // In Super Mario Kart, going offroad has lee-way of about 1 second before you start losing speed
|
||||
k_brakestop, // Wait until you've made a complete stop for a few tics before letting brake go in reverse.
|
||||
|
||||
k_itemroulette, // Used for the roulette when deciding what item to give you (was "pw_kartitem")
|
||||
k_roulettetype, // Used for the roulette, for deciding type (currently only used for Battle, to give you better items from Karma items)
|
||||
|
@ -278,6 +280,7 @@ typedef enum
|
|||
k_spinouttimer, // Spin-out from a banana peel or oil slick (was "pw_bananacam")
|
||||
k_laserwisptimer, // The duration and relative angle of the laser
|
||||
k_justbumped, // Prevent players from endlessly bumping into each other
|
||||
k_deathsentence, // 30 seconds to live... (Blue Shell murder timer (not actually 30 sec, I just couldn't help the FF reference :p))
|
||||
k_poweritemtimer, // Battle mode, how long before you're allowed another power item (Star, Megashroom)
|
||||
k_comebacktimer, // Battle mode, how long before you become a bomb after death
|
||||
|
||||
|
|
|
@ -25,18 +25,13 @@
|
|||
typedef enum
|
||||
{
|
||||
BT_ACCELERATE = 1, // Accelerate
|
||||
BT_DRIFT = 1<<2, // Drift (direction is cmd->angleturn)
|
||||
BT_DRIFT = 1<<2, // Drift (direction is cmd->driftturn)
|
||||
BT_BRAKE = 1<<3, // Brake
|
||||
BT_ATTACK = 1<<4, // Use Item
|
||||
BT_FORWARD = 1<<5, // Aim Item Forward
|
||||
BT_BACKWARD = 1<<6, // Aim Item Backward
|
||||
//BT_SPECTATE = 1<<7, // Toggle Spectate
|
||||
|
||||
// Want more button space? Help get rid of this hack :V
|
||||
BT_DRIFTLEFT = 1<<7, // Drift left hack
|
||||
BT_DRIFTRIGHT = 1<<8, // Drift right hack
|
||||
|
||||
// free: 1<<9 to 1<<12
|
||||
// free: 1<<7 to 1<<12
|
||||
|
||||
// Lua garbage
|
||||
BT_CUSTOM1 = 1<<13,
|
||||
|
@ -64,6 +59,7 @@ typedef struct
|
|||
INT16 angleturn; // <<16 for angle delta - saved as 1 byte into demos
|
||||
INT16 aiming; // vertical aiming, see G_BuildTicCmd
|
||||
UINT16 buttons;
|
||||
INT16 driftturn; // SRB2Kart: Used for getting drift turn speed
|
||||
} ATTRPACK ticcmd_t;
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
|
|
|
@ -1136,10 +1136,12 @@ static void readlevelheader(MYFILE *f, INT32 num)
|
|||
}
|
||||
else if (fastcmp(word, "ACT"))
|
||||
{
|
||||
if (i >= 0 && i < 20) // 0 for no act number, TTL1 through TTL19
|
||||
/*if (i >= 0 && i < 20) // 0 for no act number, TTL1 through TTL19
|
||||
mapheaderinfo[num-1]->actnum = (UINT8)i;
|
||||
else
|
||||
deh_warning("Level header %d: invalid act number %d", num, i);
|
||||
deh_warning("Level header %d: invalid act number %d", num, i);*/
|
||||
deh_strlcpy(mapheaderinfo[num-1]->actnum, word2,
|
||||
sizeof(mapheaderinfo[num-1]->actnum), va("Level header %d: actnum", num));
|
||||
}
|
||||
else if (fastcmp(word, "NEXTLEVEL"))
|
||||
{
|
||||
|
@ -7305,9 +7307,13 @@ static const char *const MOBJEFLAG_LIST[] = {
|
|||
"JUSTSTEPPEDDOWN", // used for ramp sectors
|
||||
"VERTICALFLIP", // Vertically flip sprite/allow upside-down physics
|
||||
"GOOWATER", // Goo water
|
||||
"\x01", // free: 1<<7 (name un-matchable)
|
||||
"JUSTBOUNCEDWALL", // SRB2Kart: Mobj already bounced off a wall this tic
|
||||
"SPRUNG", // Mobj was already sprung this tic
|
||||
"APPLYPMOMZ", // Platform movement
|
||||
"DRAWONLYFORP1", // SRB2Kart: Splitscreen sprite draw flags
|
||||
"DRAWONLYFORP2",
|
||||
"DRAWONLYFORP3",
|
||||
"DRAWONLYFORP4",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -7549,7 +7555,8 @@ static const char *const KARTSTUFF_LIST[] = {
|
|||
"THROWDIR",
|
||||
"LAPANIMATION",
|
||||
"CARDANIMATION",
|
||||
"SOUNDS",
|
||||
"VOICES",
|
||||
"TAUNTVOICES",
|
||||
|
||||
"BOOSTING",
|
||||
"FLOORBOOST",
|
||||
|
@ -7563,8 +7570,10 @@ static const char *const KARTSTUFF_LIST[] = {
|
|||
"BOOSTCHARGE",
|
||||
"JMP",
|
||||
"OFFROAD",
|
||||
"BRAKESTOP",
|
||||
|
||||
"ITEMROULETTE",
|
||||
"ROULETTETYPE",
|
||||
"ITEMCLOSE",
|
||||
|
||||
"MAGNETTIMER",
|
||||
|
@ -7579,6 +7588,7 @@ static const char *const KARTSTUFF_LIST[] = {
|
|||
"SPINOUTTIMER",
|
||||
"LASERWISPTIMER",
|
||||
"JUSTBUMPED",
|
||||
"DEATHSENTENCE",
|
||||
"POWERITEMTIMER",
|
||||
"COMEBACKTIMER",
|
||||
|
||||
|
@ -8028,9 +8038,6 @@ struct {
|
|||
{"BT_ATTACK",BT_ATTACK},
|
||||
{"BT_FORWARD",BT_FORWARD},
|
||||
{"BT_BACKWARD",BT_BACKWARD},
|
||||
//{"BT_SPECTATE",BT_SPECTATE},
|
||||
{"BT_DRIFTLEFT",BT_DRIFTLEFT},
|
||||
{"BT_DRIFTRIGHT",BT_DRIFTRIGHT},
|
||||
{"BT_CUSTOM1",BT_CUSTOM1}, // Lua customizable
|
||||
{"BT_CUSTOM2",BT_CUSTOM2}, // Lua customizable
|
||||
{"BT_CUSTOM3",BT_CUSTOM3}, // Lua customizable
|
||||
|
|
|
@ -220,7 +220,7 @@ typedef struct
|
|||
char lvlttl[22]; ///< Level name without "Zone". (21 character limit instead of 32, 21 characters can display on screen max anyway)
|
||||
char subttl[33]; ///< Subtitle for level
|
||||
char zonttl[22]; ///< "ZONE" replacement name
|
||||
UINT8 actnum; ///< Act number or 0 for none.
|
||||
char actnum[3]; ///< SRB2Kart: Now a 2 character long string.
|
||||
UINT16 typeoflevel; ///< Combination of typeoflevel flags.
|
||||
INT16 nextlevel; ///< Map number of next level, or 1100-1102 to end.
|
||||
char musname[7]; ///< Music track to play. "" for no music.
|
||||
|
@ -445,6 +445,10 @@ extern boolean franticitems;
|
|||
extern boolean mirrormode;
|
||||
extern boolean comeback;
|
||||
|
||||
extern tic_t lightningcooldown;
|
||||
extern tic_t blueshellincoming;
|
||||
extern UINT8 blueshellplayer;
|
||||
|
||||
extern boolean legitimateexit;
|
||||
extern boolean comebackshowninfo;
|
||||
extern tic_t curlap, bestlap;
|
||||
|
|
202
src/g_game.c
202
src/g_game.c
|
@ -252,6 +252,11 @@ INT16 votelevels[4]; // Levels that were rolled by the host
|
|||
SINT8 votes[MAXPLAYERS]; // Each player's vote
|
||||
SINT8 pickedvote; // What vote the host rolls
|
||||
|
||||
// Server-sided variables
|
||||
tic_t lightningcooldown; // Cooldown before any more lightning/blue shell is awarded
|
||||
tic_t blueshellincoming; // Timer before blue shell hits, can switch targets at this point
|
||||
UINT8 blueshellplayer; // Player num that used the last blue shell
|
||||
|
||||
// Client-sided variables (NEVER use in anything that needs to be synced with other players)
|
||||
boolean legitimateexit; // Did this client actually finish the match?
|
||||
boolean comebackshowninfo; // Have you already seen the "ATTACK OR PROTECT" message?
|
||||
|
@ -1150,16 +1155,15 @@ angle_t localangle, localangle2, localangle3, localangle4;
|
|||
boolean camspin, camspin2, camspin3, camspin4;
|
||||
|
||||
static fixed_t forwardmove[2] = {25<<FRACBITS>>16, 50<<FRACBITS>>16};
|
||||
static fixed_t sidemove[2] = {25<<FRACBITS>>16, 50<<FRACBITS>>16}; // faster!
|
||||
static fixed_t sidemove[2] = {2<<FRACBITS>>16, 4<<FRACBITS>>16};
|
||||
static fixed_t angleturn[3] = {400, 800, 200}; // + slow turn
|
||||
|
||||
void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
||||
{
|
||||
boolean forcestrafe = false;
|
||||
INT32 laim, th, tspeed, forward, side, axis; //i
|
||||
const INT32 speed = 1;
|
||||
// these ones used for multiple conditions
|
||||
boolean turnleft, turnright, invertmouse, mouseaiming, lookaxis, analog, analogjoystickmove, gamepadjoystickmove, kbl, rd;
|
||||
boolean turnleft, turnright, invertmouse, mouseaiming, lookaxis, analogjoystickmove, gamepadjoystickmove, kbl, rd;
|
||||
player_t *player;
|
||||
camera_t *thiscam;
|
||||
angle_t lang;
|
||||
|
@ -1231,7 +1235,6 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
lookaxis = cv_lookaxis2.value;
|
||||
analogjoystickmove = cv_usejoystick2.value && !Joystick2.bGamepadStyle;
|
||||
gamepadjoystickmove = cv_usejoystick2.value && Joystick2.bGamepadStyle;
|
||||
analog = cv_analog2.value;
|
||||
break;
|
||||
case 3:
|
||||
mouseaiming = false;
|
||||
|
@ -1239,7 +1242,6 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
lookaxis = cv_lookaxis3.value;
|
||||
analogjoystickmove = cv_usejoystick3.value && !Joystick3.bGamepadStyle;
|
||||
gamepadjoystickmove = cv_usejoystick3.value && Joystick3.bGamepadStyle;
|
||||
analog = cv_analog3.value;
|
||||
break;
|
||||
case 4:
|
||||
mouseaiming = false;
|
||||
|
@ -1247,7 +1249,6 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
lookaxis = cv_lookaxis4.value;
|
||||
analogjoystickmove = cv_usejoystick4.value && !Joystick4.bGamepadStyle;
|
||||
gamepadjoystickmove = cv_usejoystick4.value && Joystick4.bGamepadStyle;
|
||||
analog = cv_analog4.value;
|
||||
break;
|
||||
case 1:
|
||||
default:
|
||||
|
@ -1256,7 +1257,6 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
lookaxis = cv_lookaxis.value;
|
||||
analogjoystickmove = cv_usejoystick.value && !Joystick.bGamepadStyle;
|
||||
gamepadjoystickmove = cv_usejoystick.value && Joystick.bGamepadStyle;
|
||||
analog = cv_analog.value;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1292,49 +1292,66 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
else
|
||||
tspeed = speed;
|
||||
|
||||
cmd->driftturn = 0;
|
||||
|
||||
// let movement keys cancel each other out
|
||||
if (analog) // Analog
|
||||
if (turnright && !(turnleft))
|
||||
{
|
||||
if (turnright)
|
||||
cmd->angleturn = (INT16)(cmd->angleturn - angleturn[tspeed]);
|
||||
if (turnleft)
|
||||
cmd->angleturn = (INT16)(cmd->angleturn + angleturn[tspeed]);
|
||||
cmd->angleturn = (INT16)(cmd->angleturn - angleturn[tspeed]);
|
||||
cmd->driftturn = (INT16)(cmd->driftturn - angleturn[tspeed]);
|
||||
}
|
||||
else if (turnleft && !(turnright))
|
||||
{
|
||||
cmd->angleturn = (INT16)(cmd->angleturn + angleturn[tspeed]);
|
||||
cmd->driftturn = (INT16)(cmd->driftturn + angleturn[tspeed]);
|
||||
}
|
||||
|
||||
if (analog || twodlevel
|
||||
|| (player->mo && (player->mo->flags2 & MF2_TWOD))
|
||||
|| (!demoplayback && (player->climbing
|
||||
|| (player->pflags & PF_NIGHTSMODE)
|
||||
|| (player->pflags & PF_SLIDING)
|
||||
|| (player->pflags & PF_FORCESTRAFE)))) // Analog
|
||||
forcestrafe = true;
|
||||
if (analogjoystickmove && axis != 0)
|
||||
{
|
||||
// JOYAXISRANGE should be 1023 (divide by 1024)
|
||||
cmd->angleturn = (INT16)(cmd->angleturn - ((axis * angleturn[1]) >> 10)); // ANALOG!
|
||||
cmd->driftturn = (INT16)(cmd->driftturn - ((axis * angleturn[1]) >> 10));
|
||||
}
|
||||
|
||||
if (forcestrafe) // Analog
|
||||
// Specator mouse turning
|
||||
if (player->spectator)
|
||||
{
|
||||
cmd->angleturn = (INT16)(cmd->angleturn - (mousex*(mirrormode ? -1 : 1)*8));
|
||||
cmd->driftturn = (INT16)(cmd->driftturn - (mousex*(mirrormode ? -1 : 1)*8));
|
||||
}
|
||||
|
||||
// Bounce pad strafing
|
||||
if (!demoplayback && ((player->pflags & PF_FORCESTRAFE) || (player->kartstuff[k_feather] & 2)))
|
||||
{
|
||||
if (turnright)
|
||||
side += sidemove[speed];
|
||||
side += sidemove[1];
|
||||
if (turnleft)
|
||||
side -= sidemove[speed];
|
||||
|
||||
side -= sidemove[1];
|
||||
if (analogjoystickmove && axis != 0)
|
||||
{
|
||||
// JOYAXISRANGE is supposed to be 1023 (divide by 1024)
|
||||
side += ((axis * sidemove[1]) >> 10);
|
||||
side += ((axis * sidemove[0]) >> 10);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (turnright && !(turnleft))
|
||||
cmd->angleturn = (INT16)(cmd->angleturn - angleturn[tspeed]);
|
||||
else if (turnleft && !(turnright))
|
||||
cmd->angleturn = (INT16)(cmd->angleturn + angleturn[tspeed]);
|
||||
|
||||
if (analogjoystickmove && axis != 0)
|
||||
{
|
||||
// JOYAXISRANGE should be 1023 (divide by 1024)
|
||||
cmd->angleturn = (INT16)(cmd->angleturn - ((axis * angleturn[1]) >> 10)); // ANALOG!
|
||||
}
|
||||
}
|
||||
//{ SRB2kart - Drift support
|
||||
// limit turning to angleturn[1] to stop mouselook letting you look too fast
|
||||
if (cmd->angleturn > angleturn[1])
|
||||
cmd->angleturn = angleturn[1];
|
||||
else if (cmd->angleturn < -angleturn[1])
|
||||
cmd->angleturn = -angleturn[1];
|
||||
|
||||
if (cmd->driftturn > angleturn[1])
|
||||
cmd->driftturn = angleturn[1];
|
||||
else if (cmd->driftturn < -angleturn[1])
|
||||
cmd->driftturn = -angleturn[1];
|
||||
|
||||
if (player->mo)
|
||||
cmd->angleturn = K_GetKartTurnValue(player, cmd->angleturn);
|
||||
|
||||
// SRB2kart - no additional angle if not moving
|
||||
if ((player->mo && player->speed > 0) || (leveltime > 140 && cmd->buttons & BT_ACCELERATE && cmd->buttons & BT_BRAKE) || (player->spectator || objectplacing))
|
||||
lang += (cmd->angleturn<<16);
|
||||
|
||||
if (player->spectator || objectplacing) // SRB2Kart: spectators need special controls
|
||||
{
|
||||
|
@ -1392,7 +1409,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
if (InputDown(gc_fire, ssplayer) || (cv_usejoystick.value && axis > 0))
|
||||
cmd->buttons |= BT_ATTACK;
|
||||
|
||||
// drift button
|
||||
// drift with any button/key
|
||||
axis = JoyAxis(AXISDRIFT, ssplayer);
|
||||
if (InputDown(gc_drift, ssplayer) || (cv_usejoystick.value && axis > 0))
|
||||
cmd->buttons |= BT_DRIFT;
|
||||
|
@ -1405,6 +1422,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
if (InputDown(gc_custom3, ssplayer))
|
||||
cmd->buttons |= BT_CUSTOM3;
|
||||
|
||||
// Reset camera
|
||||
if (InputDown(gc_camreset, ssplayer))
|
||||
{
|
||||
if (thiscam->chase && !rd)
|
||||
|
@ -1414,7 +1432,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
else
|
||||
rd = false;
|
||||
|
||||
// player aiming shit, ahhhh...
|
||||
// spectator aiming shit, ahhhh...
|
||||
{
|
||||
INT32 player_invert = invertmouse ? -1 : 1;
|
||||
INT32 screen_invert =
|
||||
|
@ -1463,15 +1481,13 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
cmd->aiming = G_ClipAimingPitch(&laim);
|
||||
}
|
||||
|
||||
if (player->spectator)
|
||||
cmd->angleturn = (INT16)(cmd->angleturn - (mousex*(mirrormode ? -1 : 1)*8));
|
||||
|
||||
mousex = mousey = mlooky = 0;
|
||||
|
||||
if (forward > MAXPLMOVE)
|
||||
forward = MAXPLMOVE;
|
||||
else if (forward < -MAXPLMOVE)
|
||||
forward = -MAXPLMOVE;
|
||||
|
||||
if (side > MAXPLMOVE)
|
||||
side = MAXPLMOVE;
|
||||
else if (side < -MAXPLMOVE)
|
||||
|
@ -1479,86 +1495,20 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
|
||||
// No additional acceleration when moving forward/backward and strafing simultaneously.
|
||||
// do this AFTER we cap to MAXPLMOVE so people can't find ways to cheese around this.
|
||||
if (!forcestrafe && forward && side)
|
||||
// SRB2Kart: We don't need this; we WANT bounce strafing to plain stack on top of normal movement.
|
||||
/*if (!bouncestrafe && forward && side)
|
||||
{
|
||||
forward = FixedMul(forward, 3*FRACUNIT/4);
|
||||
side = FixedMul(side, 3*FRACUNIT/4);
|
||||
}
|
||||
}*/
|
||||
|
||||
//Silly hack to make 2d mode *somewhat* playable with no chasecam.
|
||||
if ((twodlevel || (player->mo && player->mo->flags2 & MF2_TWOD)) && !thiscam->chase)
|
||||
{
|
||||
INT32 temp = forward;
|
||||
forward = side;
|
||||
side = temp;
|
||||
}
|
||||
|
||||
if (cmd->buttons & BT_BRAKE && !forward) // Sal: If you're not accelerating, but going forward, then you should just lose your momentum. Request from Sev
|
||||
{
|
||||
cmd->forwardmove = (SINT8)(cmd->forwardmove / 2);
|
||||
cmd->sidemove = (SINT8)(cmd->sidemove / 2);
|
||||
}
|
||||
else
|
||||
if (forward || side)
|
||||
{
|
||||
cmd->forwardmove = (SINT8)(cmd->forwardmove + forward);
|
||||
if (mirrormode)
|
||||
cmd->sidemove = (SINT8)(cmd->sidemove - side);
|
||||
else
|
||||
cmd->sidemove = (SINT8)(cmd->sidemove + side);
|
||||
cmd->sidemove = (SINT8)(cmd->sidemove + side);
|
||||
}
|
||||
|
||||
if (ssplayer == 2 && player->bot == 1) {
|
||||
if (!player->powers[pw_tailsfly] && (cmd->forwardmove || cmd->sidemove || cmd->buttons))
|
||||
{
|
||||
player->bot = 2; // A player-controlled bot. Returns to AI when it respawns.
|
||||
//CV_SetValue(&cv_analog2, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
G_CopyTiccmd(cmd, I_BaseTiccmd2(), 1); // empty, or external driver
|
||||
B_BuildTiccmd(player, cmd);
|
||||
}
|
||||
}
|
||||
|
||||
//{ SRB2kart - Drift support
|
||||
axis = JoyAxis(AXISTURN, ssplayer);
|
||||
if (mirrormode)
|
||||
axis = -axis;
|
||||
|
||||
// TODO: Remove this hack please :(
|
||||
if (cmd->angleturn > 0) // Drifting to the left
|
||||
cmd->buttons |= BT_DRIFTLEFT;
|
||||
else
|
||||
cmd->buttons &= ~BT_DRIFTLEFT;
|
||||
|
||||
if (cmd->angleturn < 0) // Drifting to the right
|
||||
cmd->buttons |= BT_DRIFTRIGHT;
|
||||
else
|
||||
cmd->buttons &= ~BT_DRIFTRIGHT;
|
||||
//}
|
||||
|
||||
if (analog) {
|
||||
cmd->angleturn = (INT16)(thiscam->angle >> 16);
|
||||
if (player->awayviewtics)
|
||||
cmd->angleturn = (INT16)(player->awayviewmobj->angle >> 16);
|
||||
}
|
||||
else
|
||||
{
|
||||
// limit turning to angleturn[1] to stop mouselook letting you look too fast
|
||||
if (cmd->angleturn > angleturn[1])
|
||||
cmd->angleturn = angleturn[1];
|
||||
else if (cmd->angleturn < -angleturn[1])
|
||||
cmd->angleturn = -angleturn[1];
|
||||
|
||||
if (player->mo)
|
||||
cmd->angleturn = K_GetKartTurnValue(player, cmd->angleturn);
|
||||
|
||||
// SRB2kart - no additional angle if not moving
|
||||
if ((player->mo && player->speed > 0) || (leveltime > 140 && cmd->buttons & BT_ACCELERATE && cmd->buttons & BT_BRAKE) || (player->spectator || objectplacing))
|
||||
lang += (cmd->angleturn<<16);
|
||||
|
||||
cmd->angleturn = (INT16)(lang >> 16);
|
||||
}
|
||||
cmd->angleturn = (INT16)(lang >> 16);
|
||||
|
||||
if (!hu_stopped)
|
||||
{
|
||||
|
@ -4149,10 +4099,10 @@ char *G_BuildMapTitle(INT32 mapnum)
|
|||
{
|
||||
size_t len = 1;
|
||||
const char *zonetext = NULL;
|
||||
const INT32 actnum = mapheaderinfo[mapnum-1]->actnum;
|
||||
const char *actnum = NULL;
|
||||
|
||||
len += strlen(mapheaderinfo[mapnum-1]->lvlttl);
|
||||
if (strcmp(mapheaderinfo[mapnum-1]->zonttl, ""))
|
||||
if (strlen(mapheaderinfo[mapnum-1]->zonttl) > 0)
|
||||
{
|
||||
zonetext = M_GetText(mapheaderinfo[mapnum-1]->zonttl);
|
||||
len += strlen(zonetext) + 1; // ' ' + zonetext
|
||||
|
@ -4162,14 +4112,17 @@ char *G_BuildMapTitle(INT32 mapnum)
|
|||
zonetext = M_GetText("ZONE");
|
||||
len += strlen(zonetext) + 1; // ' ' + zonetext
|
||||
}
|
||||
if (actnum > 0)
|
||||
len += 1 + 11; // ' ' + INT32
|
||||
if (strlen(mapheaderinfo[mapnum-1]->actnum) > 0)
|
||||
{
|
||||
actnum = M_GetText(mapheaderinfo[mapnum-1]->actnum);
|
||||
len += strlen(actnum) + 1; // ' ' + actnum
|
||||
}
|
||||
|
||||
title = Z_Malloc(len, PU_STATIC, NULL);
|
||||
|
||||
sprintf(title, "%s", mapheaderinfo[mapnum-1]->lvlttl);
|
||||
if (zonetext) sprintf(title + strlen(title), " %s", zonetext);
|
||||
if (actnum > 0) sprintf(title + strlen(title), " %d", actnum);
|
||||
if (actnum) sprintf(title + strlen(title), " %s", actnum);
|
||||
}
|
||||
|
||||
return title;
|
||||
|
@ -4194,6 +4147,7 @@ char *G_BuildMapTitle(INT32 mapnum)
|
|||
#define ZT_ANGLE 0x04
|
||||
#define ZT_BUTTONS 0x08
|
||||
#define ZT_AIMING 0x10
|
||||
#define ZT_DRIFT 0x20
|
||||
#define DEMOMARKER 0x80 // demoend
|
||||
|
||||
static ticcmd_t oldcmd;
|
||||
|
@ -4251,6 +4205,7 @@ ticcmd_t *G_MoveTiccmd(ticcmd_t* dest, const ticcmd_t* src, const size_t n)
|
|||
dest[i].angleturn = SHORT(src[i].angleturn);
|
||||
dest[i].aiming = (INT16)SHORT(src[i].aiming);
|
||||
dest[i].buttons = (UINT16)SHORT(src[i].buttons);
|
||||
dest[i].driftturn = (INT16)SHORT(src[i].driftturn);
|
||||
}
|
||||
return dest;
|
||||
}
|
||||
|
@ -4274,6 +4229,8 @@ void G_ReadDemoTiccmd(ticcmd_t *cmd, INT32 playernum)
|
|||
oldcmd.buttons = (oldcmd.buttons & (BT_FORWARD|BT_BACKWARD)) | (READUINT16(demo_p) & ~(BT_FORWARD|BT_BACKWARD));
|
||||
if (ziptic & ZT_AIMING)
|
||||
oldcmd.aiming = READINT16(demo_p);
|
||||
if (ziptic & ZT_DRIFT)
|
||||
oldcmd.driftturn = READINT16(demo_p);
|
||||
|
||||
G_CopyTiccmd(cmd, &oldcmd, 1);
|
||||
|
||||
|
@ -4330,6 +4287,13 @@ void G_WriteDemoTiccmd(ticcmd_t *cmd, INT32 playernum)
|
|||
ziptic |= ZT_AIMING;
|
||||
}
|
||||
|
||||
if (cmd->driftturn != oldcmd.driftturn)
|
||||
{
|
||||
WRITEINT16(demo_p,cmd->driftturn);
|
||||
oldcmd.driftturn = cmd->driftturn;
|
||||
ziptic |= ZT_DRIFT;
|
||||
}
|
||||
|
||||
*ziptic_p = ziptic;
|
||||
|
||||
// attention here for the ticcmd size!
|
||||
|
@ -4702,6 +4666,8 @@ void G_GhostTicker(void)
|
|||
g->p += 2;
|
||||
if (ziptic & ZT_AIMING)
|
||||
g->p += 2;
|
||||
if (ziptic & ZT_DRIFT)
|
||||
g->p += 2;
|
||||
|
||||
// Grab ghost data.
|
||||
ziptic = READUINT8(g->p);
|
||||
|
|
|
@ -15241,7 +15241,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
100, // mass
|
||||
1, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags
|
||||
MF_NOBLOCKMAP|MF_NOCLIPHEIGHT|MF_NOCLIPTHING|MF_NOGRAVITY|MF_SCENERY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
|
833
src/k_kart.c
833
src/k_kart.c
File diff suppressed because it is too large
Load diff
|
@ -1185,7 +1185,7 @@ static int mapheaderinfo_get(lua_State *L)
|
|||
else if (fastcmp(field,"zonttl"))
|
||||
lua_pushstring(L, header->zonttl);
|
||||
else if (fastcmp(field,"actnum"))
|
||||
lua_pushinteger(L, header->actnum);
|
||||
lua_pushstring(L, header->actnum);
|
||||
else if (fastcmp(field,"typeoflevel"))
|
||||
lua_pushinteger(L, header->typeoflevel);
|
||||
else if (fastcmp(field,"nextlevel"))
|
||||
|
|
|
@ -733,6 +733,8 @@ static int ticcmd_get(lua_State *L)
|
|||
lua_pushinteger(L, cmd->aiming);
|
||||
else if (fastcmp(field,"buttons"))
|
||||
lua_pushinteger(L, cmd->buttons);
|
||||
else if (fastcmp(field,"driftturn"))
|
||||
lua_pushinteger(L, cmd->driftturn);
|
||||
else
|
||||
return NOFIELD;
|
||||
|
||||
|
@ -759,6 +761,8 @@ static int ticcmd_set(lua_State *L)
|
|||
cmd->aiming = (INT16)luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"buttons"))
|
||||
cmd->buttons = (UINT16)luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"driftturn"))
|
||||
cmd->driftturn = (INT16)luaL_checkinteger(L, 3);
|
||||
else
|
||||
return NOFIELD;
|
||||
|
||||
|
|
22
src/m_menu.c
22
src/m_menu.c
|
@ -3371,17 +3371,17 @@ static void M_DrawPauseMenu(void)
|
|||
// Draw any and all emblems at the top.
|
||||
M_DrawMapEmblems(gamemap, 272, 28);
|
||||
|
||||
if (mapheaderinfo[gamemap-1]->zonttl)
|
||||
if (strlen(mapheaderinfo[gamemap-1]->zonttl) > 0)
|
||||
{
|
||||
if (mapheaderinfo[gamemap-1]->actnum != 0)
|
||||
V_DrawString(40, 28, V_YELLOWMAP, va("%s %s %d", mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->zonttl, mapheaderinfo[gamemap-1]->actnum));
|
||||
if (strlen(mapheaderinfo[gamemap-1]->actnum) > 0)
|
||||
V_DrawString(40, 28, V_YELLOWMAP, va("%s %s %s", mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->zonttl, mapheaderinfo[gamemap-1]->actnum));
|
||||
else
|
||||
V_DrawString(40, 28, V_YELLOWMAP, va("%s %s", mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->zonttl));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mapheaderinfo[gamemap-1]->actnum != 0)
|
||||
V_DrawString(40, 28, V_YELLOWMAP, va("%s %d", mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->actnum));
|
||||
if (strlen(mapheaderinfo[gamemap-1]->actnum) > 0)
|
||||
V_DrawString(40, 28, V_YELLOWMAP, va("%s %s", mapheaderinfo[gamemap-1]->lvlttl, mapheaderinfo[gamemap-1]->actnum));
|
||||
else
|
||||
V_DrawString(40, 28, V_YELLOWMAP, mapheaderinfo[gamemap-1]->lvlttl);
|
||||
}
|
||||
|
@ -4896,7 +4896,7 @@ static void M_ReadSavegameInfo(UINT32 slot)
|
|||
else
|
||||
{
|
||||
strcpy(savegameinfo[slot].levelname, mapheaderinfo[(fake-1) & 8191]->lvlttl);
|
||||
savegameinfo[slot].actnum = mapheaderinfo[(fake-1) & 8191]->actnum;
|
||||
savegameinfo[slot].actnum = 0; //mapheaderinfo[(fake-1) & 8191]->actnum
|
||||
}
|
||||
|
||||
#ifdef SAVEGAMES_OTHERVERSIONS
|
||||
|
@ -5347,17 +5347,17 @@ static void M_DrawStatsMaps(int location)
|
|||
mnum = statsMapList[i];
|
||||
M_DrawMapEmblems(mnum+1, 292, y);
|
||||
|
||||
if (mapheaderinfo[mnum]->zonttl)
|
||||
if (strlen(mapheaderinfo[gamemap-1]->zonttl) > 0)
|
||||
{
|
||||
if (mapheaderinfo[mnum]->actnum != 0)
|
||||
V_DrawString(20, y, V_YELLOWMAP, va("%s %s %d", mapheaderinfo[mnum]->lvlttl, mapheaderinfo[mnum]->zonttl, mapheaderinfo[mnum]->actnum));
|
||||
if (strlen(mapheaderinfo[gamemap-1]->actnum) > 0)
|
||||
V_DrawString(20, y, V_YELLOWMAP, va("%s %s %s", mapheaderinfo[mnum]->lvlttl, mapheaderinfo[mnum]->zonttl, mapheaderinfo[mnum]->actnum));
|
||||
else
|
||||
V_DrawString(20, y, V_YELLOWMAP, va("%s %s", mapheaderinfo[mnum]->lvlttl, mapheaderinfo[mnum]->zonttl));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mapheaderinfo[mnum]->actnum != 0)
|
||||
V_DrawString(20, y, V_YELLOWMAP, va("%s %d", mapheaderinfo[mnum]->lvlttl, mapheaderinfo[mnum]->actnum));
|
||||
if (strlen(mapheaderinfo[gamemap-1]->actnum) > 0)
|
||||
V_DrawString(20, y, V_YELLOWMAP, va("%s %s", mapheaderinfo[mnum]->lvlttl, mapheaderinfo[mnum]->actnum));
|
||||
else
|
||||
V_DrawString(20, y, V_YELLOWMAP, mapheaderinfo[mnum]->lvlttl);
|
||||
}
|
||||
|
|
|
@ -679,9 +679,9 @@ static void M_PNGText(png_structp png_ptr, png_infop png_info_ptr, PNG_CONST png
|
|||
if (gamestate == GS_LEVEL && mapheaderinfo[gamemap-1]->lvlttl[0] != '\0')
|
||||
snprintf(lvlttltext, 48, "%s%s%s",
|
||||
mapheaderinfo[gamemap-1]->lvlttl,
|
||||
(strlen(mapheaderinfo[gamemap-1]->zonttl) > 0) ? mapheaderinfo[gamemap-1]->zonttl : // SRB2kart
|
||||
(strlen(mapheaderinfo[gamemap-1]->zonttl) > 0) ? va(" %s",mapheaderinfo[gamemap-1]->zonttl) : // SRB2kart
|
||||
((mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE) ? "" : " ZONE"),
|
||||
(mapheaderinfo[gamemap-1]->actnum > 0) ? va(" %d",mapheaderinfo[gamemap-1]->actnum) : "");
|
||||
(strlen(mapheaderinfo[gamemap-1]->actnum) > 0) ? va(" %s",mapheaderinfo[gamemap-1]->actnum) : "");
|
||||
else
|
||||
snprintf(lvlttltext, 48, "Unknown");
|
||||
|
||||
|
|
|
@ -3127,8 +3127,10 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
|||
player->kartstuff[k_mushroomtimer] = 0;
|
||||
|
||||
// Thunder
|
||||
if (damage == 64 && player != source->player)
|
||||
if (damage == 64)
|
||||
{
|
||||
if (player == source->player)
|
||||
return false;
|
||||
// Don't flip out while super!
|
||||
if (!player->kartstuff[k_startimer] && player->kartstuff[k_growshrinktimer] <= 0)
|
||||
{
|
||||
|
@ -3148,20 +3150,18 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
|||
P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_LIGHTNING);
|
||||
return true;
|
||||
}
|
||||
else if (damage == 64 && player == source->player)
|
||||
return false;
|
||||
|
||||
// Blue Thunder
|
||||
if (damage == 65 && player->kartstuff[k_position] == 1)
|
||||
if (damage == 65)
|
||||
{
|
||||
if (player == source->player)
|
||||
return false;
|
||||
// Just need to do this now! Being thrown upwards is done by the explosion.
|
||||
P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_BLUELIGHTNING);
|
||||
blueexplode = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_BLUEEXPLOSION);
|
||||
P_SetTarget(&blueexplode->target, source);
|
||||
return true;
|
||||
}
|
||||
else if (damage == 65 && player->kartstuff[k_position] > 1)
|
||||
return false;
|
||||
//}
|
||||
|
||||
// Sudden-Death mode
|
||||
|
|
|
@ -3886,6 +3886,12 @@ void P_BounceMove(mobj_t *mo)
|
|||
//INT32 hitcount;
|
||||
fixed_t mmomx = 0, mmomy = 0;
|
||||
|
||||
if (mo->eflags & MFE_JUSTBOUNCEDWALL)
|
||||
{
|
||||
P_SlideMove(mo, true);
|
||||
return;
|
||||
}
|
||||
|
||||
slidemo = mo;
|
||||
//hitcount = 0;
|
||||
|
||||
|
@ -4018,7 +4024,8 @@ bounceback:
|
|||
}
|
||||
}
|
||||
|
||||
P_HitBounceLine(bestslideline); // clip the moves
|
||||
P_HitBounceLine(bestslideline);
|
||||
mo->eflags |= MFE_JUSTBOUNCEDWALL;
|
||||
|
||||
mo->momx = tmxmove;
|
||||
mo->momy = tmymove;
|
||||
|
|
97
src/p_mobj.c
97
src/p_mobj.c
|
@ -2891,6 +2891,12 @@ static void P_PlayerZMovement(mobj_t *mo)
|
|||
mo->momx = mo->momx/2;
|
||||
mo->momy = mo->momy/2;
|
||||
}
|
||||
|
||||
if (mo->player->cmd.buttons & BT_BRAKE && !(mo->player->cmd.forwardmove)) // FURTHER slowdown if you're braking.
|
||||
{
|
||||
mo->momx = mo->momx/2;
|
||||
mo->momy = mo->momy/2;
|
||||
}
|
||||
}
|
||||
|
||||
if (mo->health)
|
||||
|
@ -6258,6 +6264,26 @@ void P_RunShadows(void)
|
|||
else
|
||||
mobj->flags2 &= ~MF2_DONTDRAW;
|
||||
|
||||
if (mobj->target->eflags & MFE_DRAWONLYFORP1) // groooooaann...
|
||||
mobj->eflags |= MFE_DRAWONLYFORP1;
|
||||
else
|
||||
mobj->eflags &= ~MFE_DRAWONLYFORP1;
|
||||
|
||||
if (mobj->target->eflags & MFE_DRAWONLYFORP2)
|
||||
mobj->eflags |= MFE_DRAWONLYFORP2;
|
||||
else
|
||||
mobj->eflags &= ~MFE_DRAWONLYFORP2;
|
||||
|
||||
if (mobj->target->eflags & MFE_DRAWONLYFORP3)
|
||||
mobj->eflags |= MFE_DRAWONLYFORP3;
|
||||
else
|
||||
mobj->eflags &= ~MFE_DRAWONLYFORP3;
|
||||
|
||||
if (mobj->target->eflags & MFE_DRAWONLYFORP4)
|
||||
mobj->eflags |= MFE_DRAWONLYFORP4;
|
||||
else
|
||||
mobj->eflags &= ~MFE_DRAWONLYFORP4;
|
||||
|
||||
// First scale to the same radius
|
||||
P_SetScale(mobj, FixedDiv(mobj->target->radius, mobj->info->radius));
|
||||
|
||||
|
@ -6407,7 +6433,7 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
P_SetTarget(&mobj->tracer, NULL);
|
||||
|
||||
mobj->flags2 &= ~MF2_PUSHED;
|
||||
mobj->eflags &= ~MFE_SPRUNG;
|
||||
mobj->eflags &= ~(MFE_SPRUNG|MFE_JUSTBOUNCEDWALL);
|
||||
|
||||
tmfloorthing = tmhitthing = NULL;
|
||||
|
||||
|
@ -6559,7 +6585,7 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
if (G_BattleGametype() && mobj->target->player->kartstuff[k_balloon] <= 0)
|
||||
kartspeed = 1;
|
||||
|
||||
dsone = 26*4 + kartspeed*2 + (9 - mobj->target->player->kartweight);
|
||||
dsone = (26*4 + kartspeed*2 + (9 - mobj->target->player->kartweight))*8;
|
||||
dstwo = dsone*2;
|
||||
|
||||
if (mobj->target->player->kartstuff[k_driftcharge] < dsone)
|
||||
|
@ -6570,27 +6596,46 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
|
||||
if (mobj->target->player->kartstuff[k_bootimer] > 0)
|
||||
{
|
||||
if ((mobj->target->player == &players[displayplayer]
|
||||
|| (splitscreen && mobj->target->player == &players[secondarydisplayplayer])
|
||||
|| (splitscreen > 1 && mobj->target->player == &players[thirddisplayplayer])
|
||||
|| (splitscreen > 2 && mobj->target->player == &players[fourthdisplayplayer]))
|
||||
|| (!(mobj->target->player == &players[displayplayer]
|
||||
|| (splitscreen && mobj->target->player == &players[secondarydisplayplayer])
|
||||
|| (splitscreen > 1 && mobj->target->player == &players[thirddisplayplayer])
|
||||
|| (splitscreen > 2 && mobj->target->player == &players[fourthdisplayplayer]))
|
||||
&& (mobj->target->player->kartstuff[k_bootimer] < 1*TICRATE/2 || mobj->target->player->kartstuff[k_bootimer] > bootime-(1*TICRATE/2))))
|
||||
if (splitscreen)
|
||||
{
|
||||
if (leveltime & 1)
|
||||
mobj->flags2 |= MF2_DONTDRAW;
|
||||
else
|
||||
mobj->flags2 &= ~MF2_DONTDRAW;
|
||||
|
||||
if (mobj->target->player->kartstuff[k_bootimer] >= (1*TICRATE/2) && mobj->target->player->kartstuff[k_bootimer] <= bootime-(1*TICRATE/2))
|
||||
{
|
||||
if (mobj->target->player == &players[secondarydisplayplayer])
|
||||
mobj->eflags |= MFE_DRAWONLYFORP2;
|
||||
else if (mobj->target->player == &players[thirddisplayplayer] && splitscreen > 1)
|
||||
mobj->eflags |= MFE_DRAWONLYFORP3;
|
||||
else if (mobj->target->player == &players[fourthdisplayplayer] && splitscreen > 2)
|
||||
mobj->eflags |= MFE_DRAWONLYFORP4;
|
||||
else
|
||||
mobj->eflags |= MFE_DRAWONLYFORP1;
|
||||
}
|
||||
else
|
||||
mobj->eflags &= ~(MFE_DRAWONLYFORP1|MFE_DRAWONLYFORP2|MFE_DRAWONLYFORP3|MFE_DRAWONLYFORP4);
|
||||
}
|
||||
else
|
||||
mobj->flags2 |= MF2_DONTDRAW;
|
||||
{
|
||||
if (mobj->target->player == &players[displayplayer]
|
||||
|| (mobj->target->player != &players[displayplayer]
|
||||
&& (mobj->target->player->kartstuff[k_bootimer] < (1*TICRATE/2) || mobj->target->player->kartstuff[k_bootimer] > bootime-(1*TICRATE/2))))
|
||||
{
|
||||
if (leveltime & 1)
|
||||
mobj->flags2 |= MF2_DONTDRAW;
|
||||
else
|
||||
mobj->flags2 &= ~MF2_DONTDRAW;
|
||||
}
|
||||
else
|
||||
mobj->flags2 |= MF2_DONTDRAW;
|
||||
}
|
||||
}
|
||||
else if (mobj->target->player->kartstuff[k_bootimer] == 0)
|
||||
{
|
||||
mobj->flags2 &= ~MF2_DONTDRAW;
|
||||
mobj->eflags &= ~(MFE_DRAWONLYFORP1|MFE_DRAWONLYFORP2|MFE_DRAWONLYFORP3|MFE_DRAWONLYFORP4);
|
||||
}
|
||||
|
||||
// Actor's distance from its Target, or Radius.
|
||||
|
@ -6785,7 +6830,7 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
}
|
||||
break;
|
||||
case MT_BATTLEBALLOON:
|
||||
if (mobj->health > 0 && mobj->target && mobj->target->player && mobj->target->player->mo
|
||||
if (mobj->health > 0 && mobj->target && mobj->target->player
|
||||
&& mobj->target->player->health > 0 && !mobj->target->player->spectator)
|
||||
{
|
||||
fixed_t rad = 32*mobj->target->scale;
|
||||
|
@ -6816,6 +6861,26 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
offz = mobj->target->height / 5;
|
||||
}
|
||||
|
||||
if (mobj->target->eflags & MFE_DRAWONLYFORP1) // groooooaann...
|
||||
mobj->eflags |= MFE_DRAWONLYFORP1;
|
||||
else
|
||||
mobj->eflags &= ~MFE_DRAWONLYFORP1;
|
||||
|
||||
if (mobj->target->eflags & MFE_DRAWONLYFORP2)
|
||||
mobj->eflags |= MFE_DRAWONLYFORP2;
|
||||
else
|
||||
mobj->eflags &= ~MFE_DRAWONLYFORP2;
|
||||
|
||||
if (mobj->target->eflags & MFE_DRAWONLYFORP3)
|
||||
mobj->eflags |= MFE_DRAWONLYFORP3;
|
||||
else
|
||||
mobj->eflags &= ~MFE_DRAWONLYFORP3;
|
||||
|
||||
if (mobj->target->eflags & MFE_DRAWONLYFORP4)
|
||||
mobj->eflags |= MFE_DRAWONLYFORP4;
|
||||
else
|
||||
mobj->eflags &= ~MFE_DRAWONLYFORP4;
|
||||
|
||||
if (mobj->target->flags2 & MF2_DONTDRAW)
|
||||
mobj->flags2 |= MF2_DONTDRAW;
|
||||
else
|
||||
|
@ -6925,6 +6990,9 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
else if (mobj->target->player->kartstuff[k_banana]) P_SetMobjState(mobj, S_PLAYERARROW_BANANA);
|
||||
else if (mobj->target->player->kartstuff[k_greenshell]) P_SetMobjState(mobj, S_PLAYERARROW_GREENSHELL);
|
||||
else if (mobj->target->player->kartstuff[k_mushroom]) P_SetMobjState(mobj, S_PLAYERARROW_MUSHROOM);
|
||||
else if (mobj->target->player->kartstuff[k_mushroom]
|
||||
&& mobj->target->player->kartstuff[k_mushroomtimer] > 1
|
||||
&& !(leveltime & 1)) P_SetMobjState(mobj, S_PLAYERARROW_EMPTY); // S_INVISIBLE
|
||||
else P_SetMobjState(mobj, S_PLAYERARROW); // S_INVISIBLE
|
||||
|
||||
scale += FixedMul(FixedDiv(abs(P_AproxDistance(players[displayplayer].mo->x-mobj->target->x,
|
||||
|
@ -9176,7 +9244,8 @@ void P_SpawnPrecipitation(void)
|
|||
subsector_t *precipsector = NULL;
|
||||
precipmobj_t *rainmo = NULL;
|
||||
|
||||
if (dedicated || !cv_precipdensity.value || curWeather == PRECIP_NONE)
|
||||
if (dedicated || !cv_precipdensity.value || curWeather == PRECIP_NONE
|
||||
|| netgame) // SRB2Kart
|
||||
return;
|
||||
|
||||
// Use the blockmap to narrow down our placing patterns
|
||||
|
|
|
@ -233,11 +233,17 @@ typedef enum
|
|||
MFE_VERTICALFLIP = 1<<5,
|
||||
// Goo water
|
||||
MFE_GOOWATER = 1<<6,
|
||||
// free: to and including 1<<7
|
||||
// SRB2Kart: The mobj just hit & bounced off a wall, this is cleared on next frame
|
||||
MFE_JUSTBOUNCEDWALL = 1<<7,
|
||||
// Mobj was already sprung this tic
|
||||
MFE_SPRUNG = 1<<8,
|
||||
// Platform movement
|
||||
MFE_APPLYPMOMZ = 1<<9,
|
||||
// SRB2Kart: Splitscreen sprite display; very wasteful but I couldn't think of another way to do it...
|
||||
MFE_DRAWONLYFORP1 = 1<<10,
|
||||
MFE_DRAWONLYFORP2 = 1<<11,
|
||||
MFE_DRAWONLYFORP3 = 1<<12,
|
||||
MFE_DRAWONLYFORP4 = 1<<13,
|
||||
// free: to and including 1<<15
|
||||
} mobjeflag_t;
|
||||
|
||||
|
|
|
@ -3248,11 +3248,16 @@ static void P_NetArchiveMisc(void)
|
|||
WRITEUINT32(save_p, hidetime);
|
||||
|
||||
// SRB2kart
|
||||
WRITEINT32(save_p, numgotboxes);
|
||||
|
||||
WRITEUINT8(save_p, gamespeed);
|
||||
WRITEUINT8(save_p, mirrormode);
|
||||
WRITEUINT8(save_p, franticitems);
|
||||
WRITEUINT8(save_p, comeback);
|
||||
WRITEINT32(save_p, numgotboxes); // Probably shouldn't need nummapboxes
|
||||
|
||||
WRITEUINT32(save_p, lightningcooldown);
|
||||
WRITEUINT32(save_p, blueshellincoming);
|
||||
WRITEUINT8(save_p, blueshellplayer);
|
||||
|
||||
// Is it paused?
|
||||
if (paused)
|
||||
|
@ -3340,11 +3345,16 @@ static inline boolean P_NetUnArchiveMisc(void)
|
|||
hidetime = READUINT32(save_p);
|
||||
|
||||
// SRB2kart
|
||||
numgotboxes = READINT32(save_p);
|
||||
|
||||
gamespeed = READUINT8(save_p);
|
||||
mirrormode = (boolean)READUINT8(save_p);
|
||||
franticitems = (boolean)READUINT8(save_p);
|
||||
comeback = (boolean)READUINT8(save_p);
|
||||
numgotboxes = READINT32(save_p);
|
||||
|
||||
lightningcooldown = READUINT32(save_p);
|
||||
blueshellincoming = READUINT32(save_p);
|
||||
blueshellplayer = READUINT8(save_p);
|
||||
|
||||
// Is it paused?
|
||||
if (READUINT8(save_p) == 0x2f)
|
||||
|
|
|
@ -179,8 +179,8 @@ static void P_ClearSingleMapHeaderInfo(INT16 i)
|
|||
mapheaderinfo[num]->subttl[0] = '\0';
|
||||
DEH_WriteUndoline("ZONETITLE", mapheaderinfo[num]->zonttl, UNDO_NONE); // SRB2kart
|
||||
mapheaderinfo[num]->zonttl[0] = '\0';
|
||||
DEH_WriteUndoline("ACT", va("%d", mapheaderinfo[num]->actnum), UNDO_NONE);
|
||||
mapheaderinfo[num]->actnum = 0;
|
||||
DEH_WriteUndoline("ACT", mapheaderinfo[num]->actnum, UNDO_NONE); // SRB2kart
|
||||
mapheaderinfo[num]->actnum[0] = '\0';
|
||||
DEH_WriteUndoline("TYPEOFLEVEL", va("%d", mapheaderinfo[num]->typeoflevel), UNDO_NONE);
|
||||
mapheaderinfo[num]->typeoflevel = 0;
|
||||
DEH_WriteUndoline("NEXTLEVEL", va("%d", mapheaderinfo[num]->nextlevel), UNDO_NONE);
|
||||
|
@ -2674,19 +2674,19 @@ boolean P_SetupLevel(boolean skipprecip)
|
|||
}
|
||||
|
||||
// Print "SPEEDING OFF TO [ZONE] [ACT 1]..."
|
||||
if (rendermode != render_none)
|
||||
/*if (rendermode != render_none)
|
||||
{
|
||||
// Don't include these in the fade!
|
||||
char tx[64];
|
||||
V_DrawSmallString(1, 191, V_ALLOWLOWERCASE, M_GetText("Speeding off to..."));
|
||||
snprintf(tx, 63, "%s%s%s",
|
||||
mapheaderinfo[gamemap-1]->lvlttl,
|
||||
(strlen(mapheaderinfo[gamemap-1]->zonttl) > 0) ? mapheaderinfo[gamemap-1]->zonttl : // SRB2kart
|
||||
(strlen(mapheaderinfo[gamemap-1]->zonttl) > 0) ? va(" %s",mapheaderinfo[gamemap-1]->zonttl) : // SRB2kart
|
||||
((mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE) ? "" : " ZONE"),
|
||||
(mapheaderinfo[gamemap-1]->actnum > 0) ? va(", Act %d",mapheaderinfo[gamemap-1]->actnum) : "");
|
||||
(strlen(mapheaderinfo[gamemap-1]->actnum) > 0) ? va(", Act %s",mapheaderinfo[gamemap-1]->actnum) : "");
|
||||
V_DrawSmallString(1, 195, V_ALLOWLOWERCASE, tx);
|
||||
I_UpdateNoVsync();
|
||||
}
|
||||
}*/
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
LUA_InvalidateLevel();
|
||||
|
@ -3003,6 +3003,10 @@ boolean P_SetupLevel(boolean skipprecip)
|
|||
comeback = cv_kartcomeback.value;
|
||||
}
|
||||
|
||||
lightningcooldown = 0;
|
||||
blueshellincoming = 0;
|
||||
blueshellplayer = 0;
|
||||
|
||||
// clear special respawning que
|
||||
iquehead = iquetail = 0;
|
||||
|
||||
|
@ -3039,7 +3043,7 @@ boolean P_SetupLevel(boolean skipprecip)
|
|||
if (!(netgame || multiplayer || demoplayback || demorecording || metalrecording || modeattacking || players[consoleplayer].lives <= 0)
|
||||
&& (!modifiedgame || savemoddata) && cursaveslot >= 0 && !ultimatemode
|
||||
&& !(mapheaderinfo[gamemap-1]->menuflags & LF2_HIDEINMENU)
|
||||
&& (!G_IsSpecialStage(gamemap)) && gamemap != lastmapsaved && (mapheaderinfo[gamemap-1]->actnum < 2 || gamecomplete))
|
||||
&& (!G_IsSpecialStage(gamemap)) && gamemap != lastmapsaved && (/*mapheaderinfo[gamemap-1]->actnum < 2 ||*/ gamecomplete))
|
||||
G_SaveGame((UINT32)cursaveslot);
|
||||
|
||||
if (savedata.lives > 0)
|
||||
|
|
|
@ -4210,7 +4210,9 @@ DoneSection2:
|
|||
if (P_IsLocalPlayer(player))
|
||||
{
|
||||
// SRB2kart 200117
|
||||
if (!splitscreen)
|
||||
if (splitscreen)
|
||||
S_ChangeMusicInternal("karwin", true);
|
||||
else
|
||||
{
|
||||
if (player->kartstuff[k_position] == 1)
|
||||
S_ChangeMusicInternal("karwin", true);
|
||||
|
@ -4219,8 +4221,6 @@ DoneSection2:
|
|||
else
|
||||
S_ChangeMusicInternal("karok", true);
|
||||
}
|
||||
else
|
||||
S_ChangeMusicInternal("karok", true);
|
||||
}
|
||||
|
||||
if (player->kartstuff[k_position] == 1)
|
||||
|
|
32
src/p_tick.c
32
src/p_tick.c
|
@ -677,6 +677,38 @@ void P_Ticker(boolean run)
|
|||
if (countdown2)
|
||||
countdown2--;
|
||||
|
||||
if (blueshellincoming && --blueshellincoming <= 0)
|
||||
{
|
||||
UINT8 best = 0;
|
||||
SINT8 hurtthisguy = -1;
|
||||
|
||||
blueshellincoming = 0;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i] || players[i].spectator)
|
||||
continue;
|
||||
|
||||
if (!players[i].mo)
|
||||
continue;
|
||||
|
||||
if (players[i].exiting)
|
||||
continue;
|
||||
|
||||
if (best <= 0 || players[i].kartstuff[k_position] < best)
|
||||
{
|
||||
best = players[i].kartstuff[k_position];
|
||||
hurtthisguy = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (hurtthisguy != -1)
|
||||
players[hurtthisguy].kartstuff[k_deathsentence] = TICRATE+1;
|
||||
}
|
||||
|
||||
if (lightningcooldown)
|
||||
lightningcooldown--;
|
||||
|
||||
if (quake.time)
|
||||
{
|
||||
fixed_t ir = quake.intensity>>1;
|
||||
|
|
244
src/p_user.c
244
src/p_user.c
|
@ -1165,7 +1165,22 @@ void P_RestoreMusic(player_t *player)
|
|||
S_SpeedMusic(1.0f);
|
||||
|
||||
// SRB2kart - We have some different powers than vanilla, some of which tweak the music.
|
||||
if (!player->exiting)
|
||||
if (splitscreen != 0 && G_RaceGametype()
|
||||
&& (players[consoleplayer].exiting
|
||||
|| players[secondarydisplayplayer].exiting
|
||||
|| players[thirddisplayplayer].exiting
|
||||
|| players[fourthdisplayplayer].exiting))
|
||||
S_ChangeMusicInternal("karwin", true);
|
||||
else if (splitscreen == 0 && G_RaceGametype() && player->exiting)
|
||||
{
|
||||
if (player->kartstuff[k_position] == 1)
|
||||
S_ChangeMusicInternal("karwin", true);
|
||||
else if (K_IsPlayerLosing(player))
|
||||
S_ChangeMusicInternal("karlos", true);
|
||||
else
|
||||
S_ChangeMusicInternal("karok", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Item - Mega Mushroom
|
||||
if (player->kartstuff[k_growshrinktimer] > 1 && player->playerstate == PST_LIVE)
|
||||
|
@ -1176,7 +1191,7 @@ void P_RestoreMusic(player_t *player)
|
|||
else if (leveltime > 157)
|
||||
{
|
||||
// Event - Final Lap
|
||||
if (player->laps == (UINT8)(cv_numlaps.value - 1))
|
||||
if (G_RaceGametype() && player->laps >= (UINT8)(cv_numlaps.value - 1))
|
||||
S_SpeedMusic(1.2f);
|
||||
S_ChangeMusic(mapmusname, mapmusflags, true);
|
||||
}
|
||||
|
@ -1674,14 +1689,14 @@ void P_DoPlayerExit(player_t *player)
|
|||
else if (!countdown)
|
||||
countdown = cv_countdowntime.value*TICRATE + 1; // Use cv_countdowntime
|
||||
|
||||
/*
|
||||
|
||||
if (circuitmap)
|
||||
{
|
||||
if (player->kartstuff[k_position] <= 3)
|
||||
S_StartSound(player->mo, sfx_kwin);
|
||||
else
|
||||
if (K_IsPlayerLosing(player))
|
||||
S_StartSound(player->mo, sfx_klose);
|
||||
}*/
|
||||
else
|
||||
S_StartSound(player->mo, sfx_kwin);
|
||||
}
|
||||
|
||||
if (P_IsLocalPlayer(player) && cv_inttime.value > 0)
|
||||
{
|
||||
|
@ -4670,7 +4685,6 @@ static void P_3dMovement(player_t *player)
|
|||
angle_t movepushangle, movepushsideangle; // Analog
|
||||
//INT32 topspeed, acceleration, thrustfactor;
|
||||
fixed_t movepushforward = 0, movepushside = 0;
|
||||
INT32 mforward = 0, mbackward = 0;
|
||||
angle_t dangle; // replaces old quadrants bits
|
||||
//boolean dangleflip = false; // SRB2kart - toaster
|
||||
//fixed_t normalspd = FixedMul(player->normalspeed, player->mo->scale);
|
||||
|
@ -4758,12 +4772,6 @@ static void P_3dMovement(player_t *player)
|
|||
//dangleflip = true;
|
||||
}
|
||||
|
||||
// now use it to determine direction!
|
||||
if (dangle <= ANGLE_45) // angles 0-45 or 315-360
|
||||
mforward = 1; // going forwards
|
||||
else if (dangle >= ANGLE_135) // angles 135-225
|
||||
mbackward = 1; // going backwards
|
||||
|
||||
// anything else will leave both at 0, so no need to do anything else
|
||||
|
||||
//{ SRB2kart 220217 - Toaster Code for misplaced thrust
|
||||
|
@ -4789,104 +4797,13 @@ static void P_3dMovement(player_t *player)
|
|||
cmd->forwardmove = 0;
|
||||
|
||||
// Do not let the player control movement if not onground.
|
||||
onground = P_IsObjectOnGround(player->mo);
|
||||
|
||||
// SRB2Kart: shhhhhhh don't question me, feather and speed bumps are supposed to control like you're on the ground :p
|
||||
if (player->kartstuff[k_feather] & 2)
|
||||
onground = true;
|
||||
// SRB2Kart: feather and speed bumps are supposed to control like you're on the ground
|
||||
onground = (P_IsObjectOnGround(player->mo) || (player->kartstuff[k_feather] & 2));
|
||||
|
||||
player->aiming = cmd->aiming<<FRACBITS;
|
||||
|
||||
// Set the player speeds.
|
||||
/*if (player->pflags & PF_SLIDING)
|
||||
{
|
||||
normalspd = FixedMul(36<<FRACBITS, player->mo->scale);
|
||||
thrustfactor = 5;
|
||||
acceleration = 96 + (FixedDiv(player->speed, player->mo->scale)>>FRACBITS) * 40;
|
||||
topspeed = normalspd;
|
||||
}
|
||||
else if (player->bot)
|
||||
{ // Bot steals player 1's stats
|
||||
normalspd = FixedMul(players[consoleplayer].normalspeed, player->mo->scale);
|
||||
thrustfactor = players[consoleplayer].thrustfactor;
|
||||
acceleration = players[consoleplayer].accelstart + (FixedDiv(player->speed, player->mo->scale)>>FRACBITS) * players[consoleplayer].acceleration;
|
||||
|
||||
if (player->powers[pw_tailsfly])
|
||||
topspeed = normalspd/2;
|
||||
else if (player->mo->eflags & (MFE_UNDERWATER|MFE_GOOWATER))
|
||||
{
|
||||
topspeed = normalspd/2;
|
||||
acceleration = 2*acceleration/3;
|
||||
}
|
||||
else
|
||||
topspeed = normalspd;
|
||||
}
|
||||
else if (player->powers[pw_super] || player->powers[pw_sneakers] || player->kartstuff[k_startimer] || player->kartstuff[k_mushroomtimer])
|
||||
{
|
||||
if (player->powers[pw_sneakers] && (player->kartstuff[k_growshrinktimer] > 0 || player->kartstuff[k_mushroomtimer] > 0 || player->kartstuff[k_startimer] > 0))
|
||||
thrustfactor = player->thrustfactor*3;
|
||||
else
|
||||
thrustfactor = player->thrustfactor*2;
|
||||
acceleration = player->accelstart/2 + (FixedDiv(player->speed, player->mo->scale)>>FRACBITS) * player->acceleration/2;
|
||||
|
||||
|
||||
if (player->powers[pw_tailsfly])
|
||||
topspeed = normalspd;
|
||||
else if (player->mo->eflags & (MFE_UNDERWATER|MFE_GOOWATER))
|
||||
{
|
||||
topspeed = normalspd;
|
||||
acceleration = 2*acceleration/3;
|
||||
}
|
||||
|
||||
if (cmd->forwardmove < 0)
|
||||
topspeed = 5<<16;
|
||||
else
|
||||
topspeed = (normalspd * 3)/2; //> 60<<16 ? 60<<16 : normalspd * 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
thrustfactor = player->thrustfactor;
|
||||
acceleration = player->accelstart + (FixedDiv(player->speed, player->mo->scale)>>FRACBITS) * player->acceleration;
|
||||
|
||||
|
||||
if (player->powers[pw_tailsfly])
|
||||
topspeed = normalspd/2;
|
||||
else if (player->mo->eflags & (MFE_UNDERWATER|MFE_GOOWATER))
|
||||
{
|
||||
topspeed = normalspd/2;
|
||||
acceleration = 2*acceleration/3;
|
||||
}
|
||||
if (cmd->forwardmove < 0)
|
||||
topspeed = 5<<16;
|
||||
else
|
||||
topspeed = normalspd;
|
||||
}
|
||||
|
||||
// Better maneuverability while flying
|
||||
//if(player->powers[pw_tailsfly])
|
||||
//{
|
||||
// thrustfactor = player->thrustfactor*2;
|
||||
// acceleration = player->accelstart + (FixedDiv(player->speed, player->mo->scale)>>FRACBITS) * player->acceleration;
|
||||
//}
|
||||
|
||||
if (player->mo->movefactor != FRACUNIT) // Friction-scaled acceleration...
|
||||
acceleration = FixedMul(acceleration<<FRACBITS, player->mo->movefactor)>>FRACBITS;
|
||||
*/
|
||||
|
||||
// Forward movement
|
||||
if (player->climbing)
|
||||
{
|
||||
if (cmd->forwardmove)
|
||||
{
|
||||
P_SetObjectMomZ(player->mo, FixedDiv(cmd->forwardmove*FRACUNIT, 10*FRACUNIT), false);
|
||||
if (player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]))
|
||||
player->mo->momz *= 2;
|
||||
}
|
||||
}
|
||||
else if (!analogmove
|
||||
//&& cmd->forwardmove != 0
|
||||
&& !(player->pflags & PF_GLIDING || player->exiting
|
||||
|| (P_PlayerInPain(player) && !onground)))
|
||||
if (!(player->exiting || (P_PlayerInPain(player) && !onground)))
|
||||
{
|
||||
//movepushforward = cmd->forwardmove * (thrustfactor * acceleration);
|
||||
movepushforward = K_3dKartMovement(player, onground, cmd->forwardmove);
|
||||
|
@ -4895,25 +4812,14 @@ static void P_3dMovement(player_t *player)
|
|||
if (!onground)
|
||||
movepushforward >>= 2; // proper air movement
|
||||
|
||||
// Allow a bit of movement while spinning
|
||||
if (player->pflags & PF_SPINNING)
|
||||
{
|
||||
if ((mforward && cmd->forwardmove > 0) || (mbackward && cmd->forwardmove < 0))
|
||||
movepushforward = 0;
|
||||
else if (!(player->pflags & PF_STARTDASH))
|
||||
movepushforward = FixedDiv(movepushforward, 16*FRACUNIT);
|
||||
else
|
||||
movepushforward = 0;
|
||||
}
|
||||
|
||||
// don't need to account for scale here with kart accel code
|
||||
//movepushforward = FixedMul(movepushforward, player->mo->scale);
|
||||
|
||||
if (player->mo->movefactor != FRACUNIT) // Friction-scaled acceleration...
|
||||
movepushforward = FixedMul(movepushforward, player->mo->movefactor);
|
||||
|
||||
//if (mforward && cmd->forwardmove < 0) // SRB2kart - braking isn't instant
|
||||
// movepushforward /= 32;
|
||||
if (cmd->buttons & BT_BRAKE && !cmd->forwardmove) // SRB2kart - braking isn't instant
|
||||
movepushforward /= 64;
|
||||
|
||||
#ifdef ESLOPE
|
||||
totalthrust.x += P_ReturnThrustX(player->mo, movepushangle, movepushforward);
|
||||
|
@ -4926,91 +4832,14 @@ static void P_3dMovement(player_t *player)
|
|||
{
|
||||
K_MomentumToFacing(player);
|
||||
}
|
||||
|
||||
// Sideways movement
|
||||
if (player->climbing)
|
||||
if (cmd->sidemove != 0 && !(player->exiting || (P_PlayerInPain(player))))
|
||||
{
|
||||
if (player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]))
|
||||
P_InstaThrust(player->mo, player->mo->angle-ANGLE_90, FixedMul(FixedDiv(cmd->sidemove*FRACUNIT, 5*FRACUNIT), player->mo->scale));
|
||||
else
|
||||
P_InstaThrust(player->mo, player->mo->angle-ANGLE_90, FixedMul(FixedDiv(cmd->sidemove*FRACUNIT, 10*FRACUNIT), player->mo->scale));
|
||||
}
|
||||
// Analog movement control
|
||||
else if (analogmove)
|
||||
{
|
||||
if (!(player->pflags & PF_GLIDING || player->exiting || P_PlayerInPain(player)))
|
||||
{
|
||||
angle_t controldirection;
|
||||
|
||||
// Calculate the angle at which the controls are pointing
|
||||
// to figure out the proper mforward and mbackward.
|
||||
// (Why was it so complicated before? ~Red)
|
||||
controldirection = R_PointToAngle2(0, 0, cmd->forwardmove*FRACUNIT, -cmd->sidemove*FRACUNIT)+movepushangle;
|
||||
|
||||
//movepushforward = max(abs(cmd->sidemove), abs(cmd->forwardmove)) * (thrustfactor * acceleration);
|
||||
movepushforward = K_3dKartMovement(player, onground, max(abs(cmd->sidemove), abs(cmd->forwardmove)));
|
||||
|
||||
// allow very small movement while in air for gameplay
|
||||
if (!onground)
|
||||
movepushforward >>= 2; // proper air movement
|
||||
|
||||
// Allow a bit of movement while spinning
|
||||
if (player->pflags & PF_SPINNING)
|
||||
{
|
||||
// Stupid little movement prohibitor hack
|
||||
// that REALLY shouldn't belong in analog code.
|
||||
if ((mforward && cmd->forwardmove > 0) || (mbackward && cmd->forwardmove < 0))
|
||||
movepushforward = 0;
|
||||
else if (!(player->pflags & PF_STARTDASH))
|
||||
movepushforward = FixedDiv(movepushforward, 16*FRACUNIT);
|
||||
else
|
||||
movepushforward = 0;
|
||||
}
|
||||
|
||||
movepushsideangle = controldirection;
|
||||
|
||||
// don't need to account for scale here with kart accel code
|
||||
//movepushforward = FixedMul(movepushforward, player->mo->scale);
|
||||
|
||||
//if (mforward && cmd->forwardmove < 0) // SRB2kart - braking isn't instant
|
||||
// movepushforward /= 32;
|
||||
|
||||
#ifdef ESLOPE
|
||||
totalthrust.x += P_ReturnThrustX(player->mo, controldirection, movepushforward);
|
||||
totalthrust.y += P_ReturnThrustY(player->mo, controldirection, movepushforward);
|
||||
#else
|
||||
P_Thrust(player->mo, controldirection, movepushforward);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (cmd->sidemove && !(player->pflags & PF_GLIDING) && !player->exiting && !P_PlayerInPain(player))
|
||||
{
|
||||
//movepushside = cmd->sidemove * (thrustfactor * acceleration);
|
||||
if (cmd->sidemove > 0)
|
||||
movepushside = K_3dKartMovement(player, onground, 50);
|
||||
movepushside = (cmd->sidemove * FRACUNIT/128) + FixedDiv(player->speed, K_GetKartSpeed(player, true));
|
||||
else
|
||||
movepushside = -(K_3dKartMovement(player, onground, 50));
|
||||
|
||||
if (!onground)
|
||||
{
|
||||
movepushside >>= 2;
|
||||
|
||||
// Reduce movepushslide even more if over "max" flight speed
|
||||
if (player->powers[pw_tailsfly] && player->speed > K_GetKartSpeed(player, true)) //topspeed)
|
||||
movepushside >>= 2;
|
||||
}
|
||||
|
||||
// Allow a bit of movement while spinning
|
||||
if (player->pflags & PF_SPINNING)
|
||||
{
|
||||
if (!(player->pflags & PF_STARTDASH))
|
||||
movepushside = FixedDiv(movepushside,16*FRACUNIT);
|
||||
else
|
||||
movepushside = 0;
|
||||
}
|
||||
|
||||
// Finally move the player now that his speed/direction has been decided.
|
||||
// don't need to account for scale here with kart accel code
|
||||
//movepushside = FixedMul(movepushside, player->mo->scale);
|
||||
movepushside = (cmd->sidemove * FRACUNIT/128) - FixedDiv(player->speed, K_GetKartSpeed(player, true));
|
||||
|
||||
#ifdef ESLOPE
|
||||
totalthrust.x += P_ReturnThrustX(player->mo, movepushsideangle, movepushside);
|
||||
|
@ -6482,13 +6311,13 @@ void P_ElementalFireTrail(player_t *player)
|
|||
}
|
||||
}
|
||||
|
||||
static void P_SkidStuff(player_t *player)
|
||||
/*static void P_SkidStuff(player_t *player)
|
||||
{
|
||||
fixed_t pmx = player->rmomx + player->cmomx;
|
||||
fixed_t pmy = player->rmomy + player->cmomy;
|
||||
|
||||
// Knuckles glides into the dirt.
|
||||
/* // SRB2kart - don't need
|
||||
// SRB2kart - don't need
|
||||
if (player->pflags & PF_GLIDING && player->skidtime)
|
||||
{
|
||||
// Fell off a ledge...
|
||||
|
@ -6526,7 +6355,7 @@ static void P_SkidStuff(player_t *player)
|
|||
}
|
||||
}
|
||||
// Skidding!
|
||||
else*/if (onground && !(player->mo->eflags & MFE_GOOWATER) && !(player->pflags & (PF_JUMPED|PF_SPINNING|PF_SLIDING)) && !(player->charflags & SF_NOSKID))
|
||||
elseif (onground && !(player->mo->eflags & MFE_GOOWATER) && !(player->pflags & (PF_JUMPED|PF_SPINNING|PF_SLIDING)) && !(player->charflags & SF_NOSKID))
|
||||
{
|
||||
if (player->skidtime)
|
||||
{
|
||||
|
@ -6573,7 +6402,7 @@ static void P_SkidStuff(player_t *player)
|
|||
S_StopSound(player->mo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
//
|
||||
// P_MovePlayer
|
||||
|
@ -6748,7 +6577,7 @@ static void P_MovePlayer(player_t *player)
|
|||
if (maptol & TOL_2D)
|
||||
runspd = FixedMul(runspd, 2*FRACUNIT/3);
|
||||
|
||||
P_SkidStuff(player);
|
||||
//P_SkidStuff(player);
|
||||
|
||||
/////////////////////////
|
||||
// MOVEMENT ANIMATIONS //
|
||||
|
@ -10131,3 +9960,4 @@ void P_PlayerAfterThink(player_t *player)
|
|||
|
||||
K_KartPlayerAfterThink(player);
|
||||
}
|
||||
|
||||
|
|
10
src/r_bsp.c
10
src/r_bsp.c
|
@ -855,7 +855,7 @@ static void R_AddPolyObjects(subsector_t *sub)
|
|||
|
||||
drawseg_t *firstseg;
|
||||
|
||||
static void R_Subsector(size_t num)
|
||||
static void R_Subsector(size_t num, UINT8 ssplayer)
|
||||
{
|
||||
INT32 count, floorlightlevel, ceilinglightlevel, light;
|
||||
seg_t *line;
|
||||
|
@ -1213,7 +1213,7 @@ static void R_Subsector(size_t num)
|
|||
// Either you must pass the fake sector and handle validcount here, on the
|
||||
// real sector, or you must account for the lighting in some other way,
|
||||
// like passing it as an argument.
|
||||
R_AddSprites(sub->sector, (floorlightlevel+ceilinglightlevel)/2);
|
||||
R_AddSprites(sub->sector, (floorlightlevel+ceilinglightlevel)/2, ssplayer);
|
||||
|
||||
firstseg = NULL;
|
||||
|
||||
|
@ -1419,7 +1419,7 @@ INT32 R_GetPlaneLight(sector_t *sector, fixed_t planeheight, boolean underside)
|
|||
//
|
||||
// killough 5/2/98: reformatted, removed tail recursion
|
||||
|
||||
void R_RenderBSPNode(INT32 bspnum)
|
||||
void R_RenderBSPNode(INT32 bspnum, UINT8 ssplayer)
|
||||
{
|
||||
node_t *bsp;
|
||||
INT32 side;
|
||||
|
@ -1430,7 +1430,7 @@ void R_RenderBSPNode(INT32 bspnum)
|
|||
// Decide which side the view point is on.
|
||||
side = R_PointOnSide(viewx, viewy, bsp);
|
||||
// Recursively divide front space.
|
||||
R_RenderBSPNode(bsp->children[side]);
|
||||
R_RenderBSPNode(bsp->children[side], ssplayer);
|
||||
|
||||
// Possibly divide back space.
|
||||
|
||||
|
@ -1448,5 +1448,5 @@ void R_RenderBSPNode(INT32 bspnum)
|
|||
portalcullsector = NULL;
|
||||
}
|
||||
|
||||
R_Subsector(bspnum == -1 ? 0 : bspnum & ~NF_SUBSECTOR);
|
||||
R_Subsector(bspnum == -1 ? 0 : bspnum & ~NF_SUBSECTOR, ssplayer);
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ extern INT32 doorclosed;
|
|||
void R_ClearClipSegs(void);
|
||||
void R_PortalClearClipSegs(INT32 start, INT32 end);
|
||||
void R_ClearDrawSegs(void);
|
||||
void R_RenderBSPNode(INT32 bspnum);
|
||||
void R_RenderBSPNode(INT32 bspnum, UINT8 ssplayer);
|
||||
void R_AddPortal(INT32 line1, INT32 line2, INT32 x1, INT32 x2);
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
|
|
18
src/r_main.c
18
src/r_main.c
|
@ -1335,6 +1335,18 @@ void R_RenderPlayerView(player_t *player)
|
|||
{
|
||||
portal_pair *portal;
|
||||
const boolean skybox = (skyboxmo[0] && cv_skybox.value);
|
||||
UINT8 ssplayer;
|
||||
|
||||
if (player == &players[secondarydisplayplayer] && splitscreen)
|
||||
ssplayer = 2;
|
||||
else if (player == &players[thirddisplayplayer] && splitscreen > 1)
|
||||
ssplayer = 3;
|
||||
else if (player == &players[fourthdisplayplayer] && splitscreen > 2)
|
||||
ssplayer = 4;
|
||||
else if (splitscreen)
|
||||
ssplayer = 1;
|
||||
else
|
||||
ssplayer = 0;
|
||||
|
||||
if (cv_homremoval.value && player == &players[displayplayer]) // if this is display player 1
|
||||
{
|
||||
|
@ -1371,7 +1383,7 @@ void R_RenderPlayerView(player_t *player)
|
|||
R_ClearVisibleFloorSplats();
|
||||
#endif
|
||||
|
||||
R_RenderBSPNode((INT32)numnodes - 1);
|
||||
R_RenderBSPNode((INT32)numnodes - 1, ssplayer);
|
||||
R_ClipSprites();
|
||||
R_DrawPlanes();
|
||||
#ifdef FLOORSPLATS
|
||||
|
@ -1404,7 +1416,7 @@ void R_RenderPlayerView(player_t *player)
|
|||
mytotal = 0;
|
||||
ProfZeroTimer();
|
||||
#endif
|
||||
R_RenderBSPNode((INT32)numnodes - 1);
|
||||
R_RenderBSPNode((INT32)numnodes - 1, ssplayer);
|
||||
R_ClipSprites();
|
||||
#ifdef TIMING
|
||||
RDMSR(0x10, &mycount);
|
||||
|
@ -1429,7 +1441,7 @@ void R_RenderPlayerView(player_t *player)
|
|||
|
||||
validcount++;
|
||||
|
||||
R_RenderBSPNode((INT32)numnodes - 1);
|
||||
R_RenderBSPNode((INT32)numnodes - 1, ssplayer);
|
||||
R_ClipSprites();
|
||||
//R_DrawPlanes();
|
||||
//R_DrawMasked();
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "d_netfil.h" // blargh. for nameonly().
|
||||
#include "m_cheat.h" // objectplace
|
||||
#include "k_kart.h" // SRB2kart
|
||||
#include "p_local.h" // stplyr
|
||||
#ifdef HWRENDER
|
||||
#include "hardware/hw_md2.h"
|
||||
#endif
|
||||
|
@ -1675,7 +1676,7 @@ static void R_ProjectPrecipitationSprite(precipmobj_t *thing)
|
|||
// R_AddSprites
|
||||
// During BSP traversal, this adds sprites by sector.
|
||||
//
|
||||
void R_AddSprites(sector_t *sec, INT32 lightlevel)
|
||||
void R_AddSprites(sector_t *sec, INT32 lightlevel, UINT8 ssplayer)
|
||||
{
|
||||
mobj_t *thing;
|
||||
precipmobj_t *precipthing; // Tails 08-25-2002
|
||||
|
@ -1718,6 +1719,25 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel)
|
|||
if (thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW)
|
||||
continue;
|
||||
|
||||
if (splitscreen)
|
||||
{
|
||||
if (thing->eflags & MFE_DRAWONLYFORP1)
|
||||
if (ssplayer != 1)
|
||||
continue;
|
||||
|
||||
if (thing->eflags & MFE_DRAWONLYFORP2)
|
||||
if (ssplayer != 2)
|
||||
continue;
|
||||
|
||||
if (thing->eflags & MFE_DRAWONLYFORP3 && splitscreen > 1)
|
||||
if (ssplayer != 3)
|
||||
continue;
|
||||
|
||||
if (thing->eflags & MFE_DRAWONLYFORP4 && splitscreen > 2)
|
||||
if (ssplayer != 4)
|
||||
continue;
|
||||
}
|
||||
|
||||
approx_dist = P_AproxDistance(viewx-thing->x, viewy-thing->y);
|
||||
|
||||
if (approx_dist <= limit_dist)
|
||||
|
@ -1728,8 +1748,31 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel)
|
|||
{
|
||||
// Draw everything in sector, no checks
|
||||
for (thing = sec->thinglist; thing; thing = thing->snext)
|
||||
if (!(thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW))
|
||||
R_ProjectSprite(thing);
|
||||
{
|
||||
if (thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW)
|
||||
continue;
|
||||
|
||||
if (splitscreen)
|
||||
{
|
||||
if (thing->eflags & MFE_DRAWONLYFORP1)
|
||||
if (ssplayer != 1)
|
||||
continue;
|
||||
|
||||
if (thing->eflags & MFE_DRAWONLYFORP2)
|
||||
if (ssplayer != 2)
|
||||
continue;
|
||||
|
||||
if (thing->eflags & MFE_DRAWONLYFORP3 && splitscreen > 1)
|
||||
if (ssplayer != 3)
|
||||
continue;
|
||||
|
||||
if (thing->eflags & MFE_DRAWONLYFORP4 && splitscreen > 2)
|
||||
if (ssplayer != 4)
|
||||
continue;
|
||||
}
|
||||
|
||||
R_ProjectSprite(thing);
|
||||
}
|
||||
}
|
||||
|
||||
// Someone seriously wants infinite draw distance for precipitation?
|
||||
|
|
|
@ -55,7 +55,7 @@ void R_DelSpriteDefs(UINT16 wadnum);
|
|||
#endif
|
||||
|
||||
//SoM: 6/5/2000: Light sprites correctly!
|
||||
void R_AddSprites(sector_t *sec, INT32 lightlevel);
|
||||
void R_AddSprites(sector_t *sec, INT32 lightlevel, UINT8 ssplayer);
|
||||
void R_InitSprites(void);
|
||||
void R_ClearSprites(void);
|
||||
void R_ClipSprites(void);
|
||||
|
|
|
@ -77,7 +77,7 @@ static patch_t *race1;
|
|||
static patch_t *race2;
|
||||
static patch_t *race3;
|
||||
static patch_t *racego;
|
||||
static patch_t *ttlnum;
|
||||
//static patch_t *ttlnum;
|
||||
static patch_t *nightslink;
|
||||
static patch_t *count5;
|
||||
static patch_t *count4;
|
||||
|
@ -753,7 +753,7 @@ static void ST_drawLevelTitle(void)
|
|||
char *lvlttl = mapheaderinfo[gamemap-1]->lvlttl;
|
||||
char *subttl = mapheaderinfo[gamemap-1]->subttl;
|
||||
char *zonttl = mapheaderinfo[gamemap-1]->zonttl; // SRB2kart
|
||||
INT32 actnum = mapheaderinfo[gamemap-1]->actnum;
|
||||
char *actnum = mapheaderinfo[gamemap-1]->actnum;
|
||||
INT32 lvlttlxpos;
|
||||
INT32 subttlxpos = BASEVIDWIDTH/2;
|
||||
INT32 ttlnumxpos;
|
||||
|
@ -765,11 +765,8 @@ static void ST_drawLevelTitle(void)
|
|||
if (!(timeinmap > 2 && timeinmap-3 < 110))
|
||||
return;
|
||||
|
||||
if (actnum > 0)
|
||||
{
|
||||
ttlnum = W_CachePatchName(va("TTL%.2d", actnum), PU_CACHE);
|
||||
lvlttlxpos = ((BASEVIDWIDTH/2) - (V_LevelNameWidth(lvlttl)/2)) - SHORT(ttlnum->width);
|
||||
}
|
||||
if (strlen(actnum) > 0)
|
||||
lvlttlxpos = ((BASEVIDWIDTH/2) - (V_LevelNameWidth(lvlttl)/2)) - V_LevelNameWidth(actnum);
|
||||
else
|
||||
lvlttlxpos = ((BASEVIDWIDTH/2) - (V_LevelNameWidth(lvlttl)/2));
|
||||
|
||||
|
@ -801,8 +798,8 @@ static void ST_drawLevelTitle(void)
|
|||
default: zoney = 104; lvlttly = 80; break;
|
||||
}
|
||||
|
||||
if (actnum)
|
||||
V_DrawScaledPatch(ttlnumxpos, zoney, 0, ttlnum);
|
||||
if (strlen(actnum) > 0)
|
||||
V_DrawLevelTitle(ttlnumxpos+12, zoney, 0, actnum);
|
||||
|
||||
V_DrawLevelTitle(lvlttlxpos, lvlttly, 0, lvlttl);
|
||||
|
||||
|
|
|
@ -1774,7 +1774,7 @@ void V_DrawLevelTitle(INT32 x, INT32 y, INT32 option, const char *string)
|
|||
c = toupper(c) - LT_FONTSTART;
|
||||
if (c < 0 || c >= LT_FONTSIZE || !lt_font[c])
|
||||
{
|
||||
cx += 16*dupx;
|
||||
cx += 12*dupx;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1805,7 +1805,7 @@ INT32 V_LevelNameWidth(const char *string)
|
|||
{
|
||||
c = toupper(string[i]) - LT_FONTSTART;
|
||||
if (c < 0 || c >= LT_FONTSIZE || !lt_font[c])
|
||||
w += 16;
|
||||
w += 12;
|
||||
else
|
||||
w += SHORT(lt_font[c]->width);
|
||||
}
|
||||
|
|
113
src/y_inter.c
113
src/y_inter.c
|
@ -38,6 +38,7 @@
|
|||
|
||||
#include "m_random.h" // P_RandomKey
|
||||
#include "g_input.h" // PLAYER1INPUTDOWN
|
||||
#include "k_kart.h" // colortranslations
|
||||
|
||||
#ifdef HWRENDER
|
||||
#include "hardware/hw_main.h"
|
||||
|
@ -197,6 +198,10 @@ static y_voteclient voteclient;
|
|||
static INT32 votetic;
|
||||
static INT32 voteendtic = -1;
|
||||
static patch_t *cursor = NULL;
|
||||
static patch_t *cursor1 = NULL;
|
||||
static patch_t *cursor2 = NULL;
|
||||
static patch_t *cursor3 = NULL;
|
||||
static patch_t *cursor4 = NULL;
|
||||
static patch_t *randomlvl = NULL;
|
||||
|
||||
static void Y_UnloadVoteData(void);
|
||||
|
@ -290,7 +295,7 @@ void Y_IntermissionDrawer(void)
|
|||
V_DrawLevelTitle(data.coop.passedx1, 49, 0, data.coop.passed1);
|
||||
V_DrawLevelTitle(data.coop.passedx2, 49+V_LevelNameHeight(data.coop.passed2)+2, 0, data.coop.passed2);
|
||||
|
||||
if (mapheaderinfo[gamemap-1]->actnum)
|
||||
if (strlen(mapheaderinfo[prevmap]->actnum) > 0)
|
||||
V_DrawScaledPatch(244, 57, 0, data.coop.ttlnum);
|
||||
|
||||
//if (gottimebonus && endtic != -1)
|
||||
|
@ -1122,10 +1127,10 @@ void Y_StartIntermission(void)
|
|||
data.coop.ptotal = W_CachePatchName("YB_TOTAL", PU_STATIC);
|
||||
|
||||
// get act number
|
||||
if (mapheaderinfo[prevmap]->actnum)
|
||||
/*if (mapheaderinfo[prevmap]->actnum)
|
||||
data.coop.ttlnum = W_CachePatchName(va("TTL%.2d", mapheaderinfo[prevmap]->actnum),
|
||||
PU_STATIC);
|
||||
else
|
||||
else*/
|
||||
data.coop.ttlnum = W_CachePatchName("TTL01", PU_STATIC);
|
||||
|
||||
// get background patches
|
||||
|
@ -1154,24 +1159,24 @@ void Y_StartIntermission(void)
|
|||
if (strlen(skins[players[consoleplayer].skin].realname) > 13)
|
||||
{
|
||||
strcpy(data.coop.passed1, "YOU GOT");
|
||||
strcpy(data.coop.passed2, (mapheaderinfo[gamemap-1]->actnum) ? "THROUGH ACT" : "THROUGH THE ACT");
|
||||
strcpy(data.coop.passed2, (strlen(mapheaderinfo[prevmap]->actnum) > 0) ? "THROUGH ACT" : "THROUGH THE ACT");
|
||||
}
|
||||
// long enough that "X GOT" won't fit so use "X PASSED THE ACT"
|
||||
else if (strlen(skins[players[consoleplayer].skin].realname) > 8)
|
||||
{
|
||||
strcpy(data.coop.passed1, skins[players[consoleplayer].skin].realname);
|
||||
strcpy(data.coop.passed2, (mapheaderinfo[gamemap-1]->actnum) ? "PASSED ACT" : "PASSED THE ACT");
|
||||
strcpy(data.coop.passed2, (strlen(mapheaderinfo[prevmap]->actnum) > 0) ? "PASSED ACT" : "PASSED THE ACT");
|
||||
}
|
||||
// length is okay for normal use
|
||||
else
|
||||
{
|
||||
snprintf(data.coop.passed1, sizeof data.coop.passed1, "%s GOT",
|
||||
skins[players[consoleplayer].skin].realname);
|
||||
strcpy(data.coop.passed2, (mapheaderinfo[gamemap-1]->actnum) ? "THROUGH ACT" : "THROUGH THE ACT");
|
||||
strcpy(data.coop.passed2, (strlen(mapheaderinfo[prevmap]->actnum) > 0) ? "THROUGH ACT" : "THROUGH THE ACT");
|
||||
}
|
||||
|
||||
// set X positions
|
||||
if (mapheaderinfo[gamemap-1]->actnum)
|
||||
if (strlen(mapheaderinfo[prevmap]->actnum) > 0)
|
||||
{
|
||||
data.coop.passedx1 = 62 + (176 - V_LevelNameWidth(data.coop.passed1))/2;
|
||||
data.coop.passedx2 = 62 + (176 - V_LevelNameWidth(data.coop.passed2))/2;
|
||||
|
@ -1312,12 +1317,12 @@ void Y_StartIntermission(void)
|
|||
Y_CalculateMatchWinners();
|
||||
|
||||
// set up the levelstring
|
||||
if (mapheaderinfo[prevmap]->zonttl)
|
||||
if (strlen(mapheaderinfo[prevmap]->zonttl) > 0)
|
||||
{
|
||||
if (mapheaderinfo[prevmap]->actnum)
|
||||
if (strlen(mapheaderinfo[prevmap]->actnum) > 0)
|
||||
snprintf(data.match.levelstring,
|
||||
sizeof data.match.levelstring,
|
||||
"%.32s %.32s * %d *",
|
||||
"%.32s %.32s * %s *",
|
||||
mapheaderinfo[prevmap]->lvlttl, mapheaderinfo[prevmap]->zonttl, mapheaderinfo[prevmap]->actnum);
|
||||
else
|
||||
snprintf(data.match.levelstring,
|
||||
|
@ -1327,10 +1332,10 @@ void Y_StartIntermission(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (mapheaderinfo[prevmap]->actnum)
|
||||
if (strlen(mapheaderinfo[prevmap]->actnum) > 0)
|
||||
snprintf(data.match.levelstring,
|
||||
sizeof data.match.levelstring,
|
||||
"%.32s * %d *",
|
||||
"%.32s * %s *",
|
||||
mapheaderinfo[prevmap]->lvlttl, mapheaderinfo[prevmap]->actnum);
|
||||
else
|
||||
snprintf(data.match.levelstring,
|
||||
|
@ -1375,12 +1380,12 @@ void Y_StartIntermission(void)
|
|||
Y_CalculateTournamentPoints();
|
||||
|
||||
// set up the levelstring
|
||||
if (mapheaderinfo[prevmap]->zonttl)
|
||||
if (strlen(mapheaderinfo[prevmap]->zonttl) > 0)
|
||||
{
|
||||
if (mapheaderinfo[prevmap]->actnum)
|
||||
if (strlen(mapheaderinfo[prevmap]->actnum) > 0)
|
||||
snprintf(data.match.levelstring,
|
||||
sizeof data.match.levelstring,
|
||||
"%.32s %.32s * %d *",
|
||||
"%.32s %.32s * %s *",
|
||||
mapheaderinfo[prevmap]->lvlttl, mapheaderinfo[prevmap]->zonttl, mapheaderinfo[prevmap]->actnum);
|
||||
else
|
||||
snprintf(data.match.levelstring,
|
||||
|
@ -1390,10 +1395,10 @@ void Y_StartIntermission(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (mapheaderinfo[prevmap]->actnum)
|
||||
if (strlen(mapheaderinfo[prevmap]->actnum) > 0)
|
||||
snprintf(data.match.levelstring,
|
||||
sizeof data.match.levelstring,
|
||||
"%.32s * %d *",
|
||||
"%.32s * %s *",
|
||||
mapheaderinfo[prevmap]->lvlttl, mapheaderinfo[prevmap]->actnum);
|
||||
else
|
||||
snprintf(data.match.levelstring,
|
||||
|
@ -1420,10 +1425,10 @@ void Y_StartIntermission(void)
|
|||
Y_CalculateMatchWinners();
|
||||
|
||||
// set up the levelstring
|
||||
if (mapheaderinfo[prevmap]->actnum)
|
||||
if (strlen(mapheaderinfo[prevmap]->actnum) > 0)
|
||||
snprintf(data.match.levelstring,
|
||||
sizeof data.match.levelstring,
|
||||
"%.32s * %d *",
|
||||
"%.32s * %s *",
|
||||
mapheaderinfo[prevmap]->lvlttl, mapheaderinfo[prevmap]->actnum);
|
||||
else
|
||||
snprintf(data.match.levelstring,
|
||||
|
@ -1456,10 +1461,10 @@ void Y_StartIntermission(void)
|
|||
Y_CalculateCompetitionWinners();
|
||||
|
||||
// set up the levelstring
|
||||
if (mapheaderinfo[prevmap]->actnum)
|
||||
if (strlen(mapheaderinfo[prevmap]->actnum) > 0)
|
||||
snprintf(data.competition.levelstring,
|
||||
sizeof data.competition.levelstring,
|
||||
"%.32s * %d *",
|
||||
"%.32s * %s *",
|
||||
mapheaderinfo[prevmap]->lvlttl, mapheaderinfo[prevmap]->actnum);
|
||||
else
|
||||
snprintf(data.competition.levelstring,
|
||||
|
@ -2201,33 +2206,53 @@ void Y_VoteDrawer(void)
|
|||
for (j = 0; j <= splitscreen; j++) // another loop for drawing the selection backgrounds in the right order, grumble grumble..
|
||||
{
|
||||
INT32 handy = y;
|
||||
UINT8 *colormap;
|
||||
patch_t *thiscurs;
|
||||
|
||||
if (voteclient.playerinfo[j].selection != i)
|
||||
continue;
|
||||
|
||||
switch (j)
|
||||
if (splitscreen == 0)
|
||||
{
|
||||
case 1:
|
||||
color = 215;
|
||||
break;
|
||||
case 2:
|
||||
color = 127;
|
||||
break;
|
||||
case 3:
|
||||
color = 161;
|
||||
break;
|
||||
default:
|
||||
color = 103;
|
||||
break;
|
||||
thiscurs = cursor;
|
||||
color = colortranslations[players[consoleplayer].skincolor][7];
|
||||
colormap = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (j)
|
||||
{
|
||||
case 1:
|
||||
thiscurs = cursor2;
|
||||
color = colortranslations[players[secondarydisplayplayer].skincolor][7];
|
||||
colormap = R_GetTranslationColormap(-1, players[secondarydisplayplayer].skincolor, GTC_CACHE);
|
||||
break;
|
||||
case 2:
|
||||
thiscurs = cursor3;
|
||||
color = colortranslations[players[thirddisplayplayer].skincolor][7];
|
||||
colormap = R_GetTranslationColormap(-1, players[thirddisplayplayer].skincolor, GTC_CACHE);
|
||||
break;
|
||||
case 3:
|
||||
thiscurs = cursor4;
|
||||
color = colortranslations[players[fourthdisplayplayer].skincolor][7];
|
||||
colormap = R_GetTranslationColormap(-1, players[fourthdisplayplayer].skincolor, GTC_CACHE);
|
||||
break;
|
||||
default:
|
||||
thiscurs = cursor1;
|
||||
color = colortranslations[players[consoleplayer].skincolor][7];
|
||||
colormap = R_GetTranslationColormap(-1, players[consoleplayer].skincolor, GTC_CACHE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
handy += 6*(3-splitscreen) + (13*j);
|
||||
V_DrawScaledPatch(BASEVIDWIDTH-124, handy, V_SNAPTORIGHT, cursor);
|
||||
V_DrawMappedPatch(BASEVIDWIDTH-124, handy, V_SNAPTORIGHT, thiscurs, colormap);
|
||||
|
||||
if (votetic % 5 == 0)
|
||||
V_DrawFill(BASEVIDWIDTH-100-sizeadd, y-sizeadd, 80+(sizeadd*2), 50+(sizeadd*2), 120|V_SNAPTORIGHT);
|
||||
else
|
||||
V_DrawFill(BASEVIDWIDTH-100-sizeadd, y-sizeadd, 80+(sizeadd*2), 50+(sizeadd*2), color|V_SNAPTORIGHT);
|
||||
|
||||
sizeadd--;
|
||||
}
|
||||
|
||||
|
@ -2500,6 +2525,10 @@ void Y_StartVote(void)
|
|||
widebgpatch = W_CachePatchName("INTERSCW", PU_STATIC);
|
||||
bgpatch = W_CachePatchName("INTERSCR", PU_STATIC);
|
||||
cursor = W_CachePatchName("M_CURSOR", PU_STATIC);
|
||||
cursor1 = W_CachePatchName("P1CURSOR", PU_STATIC);
|
||||
cursor2 = W_CachePatchName("P2CURSOR", PU_STATIC);
|
||||
cursor3 = W_CachePatchName("P3CURSOR", PU_STATIC);
|
||||
cursor4 = W_CachePatchName("P4CURSOR", PU_STATIC);
|
||||
randomlvl = W_CachePatchName("RANDOMLV", PU_STATIC);
|
||||
|
||||
timer = cv_votetime.value*TICRATE;
|
||||
|
@ -2525,12 +2554,12 @@ void Y_StartVote(void)
|
|||
lumpnum_t lumpnum;
|
||||
|
||||
// set up the str
|
||||
if (mapheaderinfo[votelevels[i]]->zonttl)
|
||||
if (strlen(mapheaderinfo[votelevels[i]]->zonttl) > 0)
|
||||
{
|
||||
if (mapheaderinfo[votelevels[i]]->actnum)
|
||||
if (strlen(mapheaderinfo[votelevels[i]]->actnum) > 0)
|
||||
snprintf(levelinfo[i].str,
|
||||
sizeof levelinfo[i].str,
|
||||
"%.32s %.32s %d",
|
||||
"%.32s %.32s %s",
|
||||
mapheaderinfo[votelevels[i]]->lvlttl, mapheaderinfo[votelevels[i]]->zonttl, mapheaderinfo[votelevels[i]]->actnum);
|
||||
else
|
||||
snprintf(levelinfo[i].str,
|
||||
|
@ -2540,10 +2569,10 @@ void Y_StartVote(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (mapheaderinfo[votelevels[i]]->actnum)
|
||||
if (strlen(mapheaderinfo[votelevels[i]]->actnum) > 0)
|
||||
snprintf(levelinfo[i].str,
|
||||
sizeof levelinfo[i].str,
|
||||
"%.32s %d",
|
||||
"%.32s %s",
|
||||
mapheaderinfo[votelevels[i]]->lvlttl, mapheaderinfo[votelevels[i]]->actnum);
|
||||
else
|
||||
snprintf(levelinfo[i].str,
|
||||
|
@ -2582,6 +2611,10 @@ static void Y_UnloadVoteData(void)
|
|||
UNLOAD(widebgpatch);
|
||||
UNLOAD(bgpatch);
|
||||
UNLOAD(cursor);
|
||||
UNLOAD(cursor1);
|
||||
UNLOAD(cursor2);
|
||||
UNLOAD(cursor3);
|
||||
UNLOAD(cursor4);
|
||||
UNLOAD(randomlvl);
|
||||
|
||||
UNLOAD(levelinfo[3].pic);
|
||||
|
|
Loading…
Reference in a new issue