From db09f7b3d666ba162feae769467cdb39f8ab9e9d Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 15 Jan 2018 22:31:14 -0500 Subject: [PATCH 01/14] Lots of changes - Menus now have all of the Kart cvars - Removed any cvars that aren't useful for Kart from the menu (they still exist in the console, though) - Removed SP and NiGHTS Mode options from the main menu - "kartcc" is renamed "kartspeed", uses values 0-2 instead of multiples of 50, or the terms "Relaxed", "Standard", and "Turbo" - Many gametype options (game speed, frantic, mirror, & karma comeback) are now changed on map load instead of instantly - New cvar, "kartminimap", for disabling the minimap - The maxplayers cvar now actually matches up with our 16 player limit - Game now keeps track of matches played. Has a condition type associated with it, as well. - Game checks for unlocks and saves gamedata when finishing a match, even in MP - Removed most of the normal emblems, added a single emblem for Green Hills. Didn't know what to do with extra emblems and such so I just left them (FOR NOW c:<) --- src/command.c | 4 +- src/command.h | 2 +- src/d_clisrv.c | 2 +- src/d_netcmd.c | 9 +- src/d_netcmd.h | 3 +- src/dehacked.c | 11 +- src/doomstat.h | 7 + src/g_game.c | 16 +- src/k_kart.c | 66 +++--- src/k_kart.h | 1 - src/lua_baselib.c | 8 - src/m_cond.c | 537 +--------------------------------------------- src/m_cond.h | 1 + src/m_menu.c | 154 ++++++------- src/p_inter.c | 2 +- src/p_mobj.c | 14 +- src/p_setup.c | 11 + src/p_user.c | 18 +- 18 files changed, 189 insertions(+), 677 deletions(-) diff --git a/src/command.c b/src/command.c index 961dbe97..89d09b35 100644 --- a/src/command.c +++ b/src/command.c @@ -66,8 +66,8 @@ CV_PossibleValue_t CV_Natural[] = {{1, "MIN"}, {999999999, "MAX"}, {0, NULL}}; CV_PossibleValue_t karthud_cons_t[] = { {0, "Off"}, {1, "Default"}, {2, "SNES"}, {3, "MK64"}, {0, NULL}}; -CV_PossibleValue_t kartcc_cons_t[] = { - {50, "50cc"}, {100, "100cc"}, {150, "150cc"}, +CV_PossibleValue_t kartspeed_cons_t[] = { + {0, "Relaxed"}, {1, "Standard"}, {2, "Turbo"}, {0, NULL}}; #define COM_BUF_SIZE 8192 // command buffer size diff --git a/src/command.h b/src/command.h index cd2ead99..513883d4 100644 --- a/src/command.h +++ b/src/command.h @@ -128,7 +128,7 @@ extern CV_PossibleValue_t CV_Natural[]; // SRB2kart extern CV_PossibleValue_t karthud_cons_t[]; -extern CV_PossibleValue_t kartcc_cons_t[]; +extern CV_PossibleValue_t kartspeed_cons_t[]; // register a variable for use at the console void CV_RegisterVar(consvar_t *variable); diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 634c6b81..dea76923 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2896,7 +2896,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum) consvar_t cv_allownewplayer = {"allowjoin", "On", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL }; consvar_t cv_joinnextround = {"joinnextround", "Off", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; /// \todo not done -static CV_PossibleValue_t maxplayers_cons_t[] = {{2, "MIN"}, {32, "MAX"}, {0, NULL}}; +static CV_PossibleValue_t maxplayers_cons_t[] = {{2, "MIN"}, {MAXPLAYERS, "MAX"}, {0, NULL}}; consvar_t cv_maxplayers = {"maxplayers", "8", CV_SAVE, maxplayers_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t resynchattempts_cons_t[] = {{0, "MIN"}, {20, "MAX"}, {0, NULL}}; consvar_t cv_resynchattempts = {"resynchattempts", "10", 0, resynchattempts_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL }; diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 11c9acff..ca63df69 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -229,7 +229,7 @@ consvar_t cv_allowteamchange = {"allowteamchange", "Yes", CV_NETVAR, CV_YesNo, N consvar_t cv_startinglives = {"startinglives", "3", CV_NETVAR|CV_CHEAT, startingliveslimit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t respawntime_cons_t[] = {{0, "MIN"}, {30, "MAX"}, {0, NULL}}; -consvar_t cv_respawntime = {"respawndelay", "3", CV_NETVAR|CV_CHEAT, respawntime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_respawntime = {"respawndelay", "1", CV_NETVAR|CV_CHEAT, respawntime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_competitionboxes = {"competitionboxes", "Random", CV_NETVAR|CV_CHEAT, competitionboxes_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -343,10 +343,11 @@ consvar_t cv_lightning = {"lightning", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, consvar_t cv_feather = {"feathers", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_karthud = {"karthud", "Default", CV_SAVE|CV_CALL, karthud_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_kartcheck = {"kartcheck", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_kartminimap = {"kartminimap", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_kartcheck = {"kartcheck", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t kartstarsfx_cons_t[] = {{0, "Music"}, {1, "SMK"}, {0, NULL}}; consvar_t cv_kartstarsfx = {"kartstarsfx", "SMK", CV_SAVE, kartstarsfx_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_kartcc = {"kartcc", "100cc", CV_NETVAR, kartcc_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_kartspeed = {"kartspeed", "Standard", CV_NETVAR, kartspeed_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t kartballoons_cons_t[] = {{1, "MIN"}, {12, "MAX"}, {0, NULL}}; consvar_t cv_kartballoons = {"kartballoons", "3", CV_NETVAR, kartballoons_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_kartfrantic = {"kartfrantic", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -399,7 +400,7 @@ consvar_t cv_timelimit = {"timelimit", "0", CV_NETVAR|CV_CALL|CV_NOINIT, timelim static CV_PossibleValue_t numlaps_cons_t[] = {{0, "MIN"}, {50, "MAX"}, {0, NULL}}; consvar_t cv_numlaps = {"numlaps", "3", CV_NETVAR|CV_CALL|CV_NOINIT, numlaps_cons_t, NumLaps_OnChange, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_usemapnumlaps = {"usemaplaps", "Yes", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_usemapnumlaps = {"usemaplaps", "Yes", CV_NETVAR|CV_CHEAT, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; // log elemental hazards -- not a netvar, is local to current player consvar_t cv_hazardlog = {"hazardlog", "Yes", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 1ffe4e21..66a1d982 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -116,9 +116,10 @@ extern consvar_t cv_blueshell, cv_jaws, cv_fireflower, cv_tripleredshell, cv_lig extern consvar_t cv_feather; extern consvar_t cv_karthud; +extern consvar_t cv_kartminimap; extern consvar_t cv_kartcheck; extern consvar_t cv_kartstarsfx; -extern consvar_t cv_kartcc; +extern consvar_t cv_kartspeed; extern consvar_t cv_kartballoons; extern consvar_t cv_kartfrantic; extern consvar_t cv_kartcomeback; diff --git a/src/dehacked.c b/src/dehacked.c index 93308fda..7d54ce00 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -2477,15 +2477,16 @@ static void readcondition(UINT8 set, UINT32 id, char *word2) return; } - if (fastcmp(params[0], "PLAYTIME")) + if (fastcmp(params[0], "PLAYTIME") + || (++offset && fastcmp(params[0], "MATCHESPLAYED"))) { PARAMCHECK(1); - ty = UC_PLAYTIME; + ty = UC_PLAYTIME + offset; re = atoi(params[1]); } - else if (fastcmp(params[0], "GAMECLEAR") - || (++offset && fastcmp(params[0], "ALLEMERALDS")) - || (++offset && fastcmp(params[0], "ULTIMATECLEAR"))) + else if ((offset=0) || fastcmp(params[0], "GAMECLEAR") + || (++offset && fastcmp(params[0], "ALLEMERALDS")) + || (++offset && fastcmp(params[0], "ULTIMATECLEAR"))) { ty = UC_GAMECLEAR + offset; re = (params[1]) ? atoi(params[1]) : 1; diff --git a/src/doomstat.h b/src/doomstat.h index 0915e138..25fa25a3 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -322,6 +322,7 @@ enum GameType // If you alter this list, update gametype_cons_t in m_menu.c extern tic_t totalplaytime; +extern UINT32 matchesplayed; extern UINT8 stagefailed; @@ -437,6 +438,12 @@ extern INT16 scramblecount; //for CTF team scramble extern INT32 cheats; +// SRB2kart +extern UINT8 gamespeed; +extern boolean franticitems; +extern boolean mirrormode; +extern boolean comeback; + extern tic_t hidetime; extern UINT32 timesBeaten; // # of times the game has been beaten. diff --git a/src/g_game.c b/src/g_game.c index a0a40329..1b958cf2 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -167,6 +167,7 @@ INT32 tokenbits; // Used for setting token bits INT32 sstimer; // Time allotted in the special stage tic_t totalplaytime; +UINT32 matchesplayed; // SRB2Kart boolean gamedataloaded = false; // Time attack data for levels @@ -238,6 +239,12 @@ INT16 scramblecount; //for CTF team scramble INT32 cheats; //for multiplayer cheat commands +// SRB2Kart +UINT8 gamespeed; // Game's current speed (or difficulty, or cc, or etc); 0-2 for relaxed, standard, & turbo +boolean mirrormode; // Mirror Mode currently enabled? +boolean franticitems; // Frantic items currently enabled? +boolean comeback; // Battle Mode's karma comeback is on/off + tic_t hidetime; // Grading @@ -1271,7 +1278,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) axis = JoyAxis(AXISTURN, ssplayer); - if (cv_kartmirror.value) + if (mirrormode) { turnright ^= turnleft; // swap these using three XORs turnleft ^= turnright; @@ -1553,12 +1560,12 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) cmd->forwardmove = (SINT8)(cmd->forwardmove + forward); cmd->sidemove = (SINT8)(cmd->sidemove + side); - if (cv_kartmirror.value) + if (mirrormode) cmd->sidemove = -cmd->sidemove; //{ SRB2kart - Drift support axis = JoyAxis(AXISTURN, ssplayer); - if (cv_kartmirror.value) + if (mirrormode) axis = -axis; if (cmd->angleturn > 0) // Drifting to the left @@ -3343,6 +3350,7 @@ void G_LoadGameData(void) G_ClearRecords(); // main and nights records M_ClearSecrets(); // emblems, unlocks, maps visited, etc totalplaytime = 0; // total play time (separate from all) + matchesplayed = 0; // SRB2Kart: matches played & finished if (M_CheckParm("-nodata")) return; // Don't load. @@ -3372,6 +3380,7 @@ void G_LoadGameData(void) } totalplaytime = READUINT32(save_p); + matchesplayed = READUINT32(save_p); modded = READUINT8(save_p); @@ -3514,6 +3523,7 @@ void G_SaveGameData(void) WRITEUINT32(save_p, 0xFCAFE211); WRITEUINT32(save_p, totalplaytime); + WRITEUINT32(save_p, matchesplayed); btemp = (UINT8)(savemoddata || modifiedgame); WRITEUINT8(save_p, btemp); diff --git a/src/k_kart.c b/src/k_kart.c index 4ceb8b72..082f79ca 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -20,6 +20,13 @@ #include "k_kart.h" #include "f_finale.h" +// SOME IMPORTANT VARIABLES DEFINED IN DOOMDEF.H: +// gamespeed is cc (0 for easy, 1 for normal, 2 for hard) +// franticitems is Frantic Mode items, bool +// mirrormode is Mirror Mode (duh), bool +// comeback is Battle Mode's karma comeback, also bool + + //{ SRB2kart Color Code #define SKIN_RAMP_LENGTH 16 @@ -303,9 +310,10 @@ void K_RegisterKartStuff(void) CV_RegisterVar(&cv_lightning); CV_RegisterVar(&cv_feather); + CV_RegisterVar(&cv_kartminimap); CV_RegisterVar(&cv_kartcheck); CV_RegisterVar(&cv_kartstarsfx); - CV_RegisterVar(&cv_kartcc); + CV_RegisterVar(&cv_kartspeed); CV_RegisterVar(&cv_kartballoons); CV_RegisterVar(&cv_kartfrantic); CV_RegisterVar(&cv_kartcomeback); @@ -318,16 +326,6 @@ void K_RegisterKartStuff(void) //} -UINT8 K_GetKartCC(void) -{ - if (gametype == GT_MATCH) - return 50; - else if (modeattacking) - return 150; - else - return cv_kartcc.value; -} - //{ SRB2kart Roulette Code - Position Based #define NUMKARTITEMS 19 @@ -975,7 +973,7 @@ static INT32 K_KartGetItemOdds(INT32 pos, INT32 itemnum) else newodds = K_KartItemOddsDistance_Retro[itemnum-1][pos]; - if ((cv_kartfrantic.value) && (itemnum == 1 || itemnum == 4 || itemnum == 5 || itemnum == 6 + if (franticitems && (itemnum == 1 || itemnum == 4 || itemnum == 5 || itemnum == 6 || itemnum == 7 || itemnum == 8 || itemnum == 12 || itemnum == 13 || itemnum == 14 || itemnum == 15 || itemnum == 16 || itemnum == 17 || itemnum == 18)) newodds *= 2; @@ -1059,7 +1057,7 @@ static void K_KartItemRouletteByDistance(player_t *player, ticcmd_t *cmd) } else { - if (cv_kartfrantic.value) // Frantic items + if (franticitems) // Frantic items { pdis = (13*pdis/12); // make the distances between everyone artifically higher... //pdis += distvar; // and set everyone back another place! @@ -1466,7 +1464,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (player->kartstuff[k_spinouttimer]) player->kartstuff[k_spinouttimer]--; - else if (!cv_kartcomeback.value) + else if (!comeback) player->kartstuff[k_comebacktimer] = comebacktime; else if (player->kartstuff[k_comebacktimer]) { @@ -1701,12 +1699,12 @@ static fixed_t K_GetKartBoostPower(player_t *player, boolean speed) { // Mushroom if (speed) { - switch (K_GetKartCC()) + switch (gamespeed) { - case 50: + case 0: boostvalue = max(boostvalue, 53740+768); break; - case 150: + case 2: boostvalue = max(boostvalue, 17294+768); break; default: @@ -1731,12 +1729,12 @@ fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower) UINT8 kartspeed = player->kartspeed; fixed_t finalspeed; - switch (K_GetKartCC()) + switch (gamespeed) { - case 50: + case 0: g_cc = 53248 + xspd; // 50cc = 81.25 + 4.69 = 85.94% break; - case 150: + case 2: g_cc = 77824 + xspd; // 150cc = 118.75 + 4.69 = 123.44% break; default: @@ -1946,7 +1944,7 @@ void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we ju if (source->player->kartstuff[k_balloon] <= 0) { source->player->kartstuff[k_comebackpoints] += 2; - if (netgame) + if (netgame && cv_hazardlog.value) CONS_Printf(M_GetText("%s bombed %s!\n"), player_names[source->player-players], player_names[player-players]); if (source->player->kartstuff[k_comebackpoints] >= 3) K_StealBalloon(source->player, player, true); @@ -2020,7 +2018,7 @@ void K_StealBalloon(player_t *player, player_t *victim, boolean force) { if (player->kartstuff[k_balloon] <= 0) CONS_Printf(M_GetText("%s is back in the game!\n"), player_names[player-players]); - else + else if (cv_hazardlog.value) CONS_Printf(M_GetText("%s stole a balloon from %s!\n"), player_names[player-players], player_names[victim-players]); } @@ -2294,12 +2292,12 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map return NULL; // Figure out projectile speed by CC - switch (K_GetKartCC()) + switch (gamespeed) { - case 50: + case 0: PROJSPEED = 68*FRACUNIT; // Avg Speed is 34 break; - case 150: + case 2: PROJSPEED = 96*FRACUNIT; // Avg Speed is 48 break; default: @@ -4879,7 +4877,7 @@ fixed_t K_FindCheckX(fixed_t px, fixed_t py, angle_t ang, fixed_t mx, fixed_t my fixed_t range = RING_DIST/3; angle_t diff; - range *= (K_GetKartCC()/50); + range *= gamespeed+1; dist = abs(R_PointToDist2(px, py, mx, my)); if (dist > range) @@ -4892,7 +4890,7 @@ fixed_t K_FindCheckX(fixed_t px, fixed_t py, angle_t ang, fixed_t mx, fixed_t my else x = (FixedMul(FINETANGENT(((diff+ANGLE_90)>>ANGLETOFINESHIFT) & 4095), 160<>FRACBITS; - if (cv_kartmirror.value) + if (mirrormode) x = 320-x; if (splitscreen > 1) @@ -5018,7 +5016,7 @@ static void K_drawKartMinimap(void) if (splitscreen == 2) splitflags = 0; - if (cv_kartmirror.value) + if (mirrormode) V_DrawSmallScaledPatch(x+(AutomapPic->width/2), y, splitflags|V_FLIP, AutomapPic); else V_DrawSmallScaledPatch(x, y, splitflags, AutomapPic); @@ -5074,7 +5072,7 @@ static void K_drawKartMinimap(void) amxpos = amnumxpos + ((x + AutomapPic->width/4 - (iconprefix[players[i].skin]->width/4))<height/4 - (iconprefix[players[i].skin]->height/4))<width/4 + (iconprefix[players[i].skin]->width/4))<kartstuff[k_balloon] <= 0 && stplyr->kartstuff[k_comebacktimer] && cv_kartcomeback.value) + else if (stplyr->kartstuff[k_balloon] <= 0 && stplyr->kartstuff[k_comebacktimer] && comeback) { INT32 t = stplyr->kartstuff[k_comebacktimer]/TICRATE; INT32 txoff = 0; @@ -5213,7 +5211,7 @@ static void K_drawStartLakitu(void) else adjustY = 200; - if (cv_kartmirror.value) + if (mirrormode) V_DrawSmallScaledPatch(320-LAKI_X, LAKI_Y + adjustY, V_SNAPTOTOP|V_FLIP, localpatch); else V_DrawSmallScaledPatch(LAKI_X, LAKI_Y + adjustY, V_SNAPTOTOP, localpatch); @@ -5286,7 +5284,7 @@ static void K_drawLapLakitu(void) adjustY = 200; } - if (cv_kartmirror.value) + if (mirrormode) V_DrawSmallScaledPatch(320-(LAKI_X+14+(swoopTimer/4)), LAKI_Y + adjustY, V_SNAPTOTOP|V_FLIP, localpatch); else V_DrawSmallScaledPatch(LAKI_X+14+(swoopTimer/4), LAKI_Y + adjustY, V_SNAPTOTOP, localpatch); @@ -5303,7 +5301,7 @@ void K_drawKartHUD(void) && (stplyr->exiting || (stplyr->kartstuff[k_balloon] <= 0 && stplyr->kartstuff[k_comebacktimer] - && cv_kartcomeback.value + && comeback && stplyr->playerstate == PST_LIVE))) { K_drawBattleFullscreen(); @@ -5326,7 +5324,7 @@ void K_drawKartHUD(void) K_drawKartPlayerCheck(); } - if (splitscreen == 0 || splitscreen == 2) + if ((splitscreen == 0 || splitscreen == 2) && cv_kartminimap.value) K_drawKartMinimap(); // If the item window is closing, draw it closing! diff --git a/src/k_kart.h b/src/k_kart.h index 163d8424..9a6c62bb 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -17,7 +17,6 @@ UINT8 K_GetKartColorByName(const char *name); void K_RegisterKartStuff(void); -UINT8 K_GetKartCC(void); void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid); void K_LakituChecker(player_t *player); void K_KartMoveAnimation(player_t *player); diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 1435f224..67fc7ac2 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -1993,13 +1993,6 @@ static int lib_kGetKartColorByName(lua_State *L) return 1; } -static int lib_kGetKartCC(lua_State *L) -{ - //HUDSAFE - lua_pushinteger(L, K_GetKartCC()); - return 1; -} - static int lib_kKartBouncing(lua_State *L) { mobj_t *mobj1 = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); @@ -2336,7 +2329,6 @@ static luaL_Reg lib[] = { // k_kart {"K_GetKartColorByName",lib_kGetKartColorByName}, - {"K_GetKartCC",lib_kGetKartCC}, {"K_KartBouncing",lib_kKartBouncing}, {"K_SpinPlayer",lib_kSpinPlayer}, {"K_SquishPlayer",lib_kSquishPlayer}, diff --git a/src/m_cond.c b/src/m_cond.c index c67930d9..d936c3fe 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -32,532 +32,9 @@ conditionset_t conditionSets[MAXCONDITIONSETS]; // Default Emblem locations emblem_t emblemlocations[MAXEMBLEMS] = { - // GREEN FLOWER 1 - // --- - {0, 8156, 6936, 129, 1, 'A', SKINCOLOR_BLUE, 0, - "Go get your feet wet\n" - "to find this, the first emblem.\n" - "Yes, it's very deep.", 0}, - {0, 3184, 1812, 928, 1, 'B', SKINCOLOR_LAVENDER, 0, - "There are many rings,\n" - "but this one's not what you think.\n" - "There lies the emblem.", 0}, - {0, 9024, 6716, 769, 1, 'C', SKINCOLOR_RED, 0, - "Right next to a lake,\n" - "a ledge has been constructed.\n" - "Near there is the goal.", 0}, - {0, 2080, -384, 512, 1, 'D', SKINCOLOR_ORANGE, 0, - "Streams come to an end\n" - "where they can no longer fall.\n" - "But if you went up...", 0}, - {0, -336, 2064, 195, 1, 'E', SKINCOLOR_NEONGREEN, 0, - "This one's in plain sight.\n" - "Why haven't you claimed it?\n" - "Surely you saw it.", 0}, - - {ET_SCORE, 0,0,0, 1, 'S', SKINCOLOR_BROWN, 125000, "", 0}, - {ET_TIME, 0,0,0, 1, 'T', SKINCOLOR_GREY, 20*TICRATE, "", 0}, - {ET_RINGS, 0,0,0, 1, 'R', SKINCOLOR_GOLD, 200, "", 0}, - - - // GREEN FLOWER 2 - // --- - {0, 2624, -6816, 1332, 2, 'A', SKINCOLOR_BLUE, 0, - "Near the giant lake\n" - "lies a cave with a 1-Up.\n" - "An emblem's there, too!", 0}, - {0, -5728, -2848, 2848, 2, 'B', SKINCOLOR_LAVENDER, 0, - "Near the final lake,\n" - "a higher lake falls on in.\n" - "Three platforms await.", 0}, - {0, 3648, 6464, 2576, 2, 'C', SKINCOLOR_RED, 0, - "Near the level's start,\n" - "a bridge crosses a river.\n" - "What's that river's source?", 0}, - {0, -2032,-10048, 986, 2, 'D', SKINCOLOR_ORANGE, 0, - "Near the level's end,\n" - "another bridge spans a lake.\n" - "What could be under...?", 0}, - {0, -170, 491, 3821, 2, 'E', SKINCOLOR_NEONGREEN, 0, - "An ivied tunnel\n" - "has a corner that's sunlit.\n" - "Go reach for the sky!", 0}, - - {ET_SCORE, 0,0,0, 2, 'S', SKINCOLOR_BROWN, 150000, "", 0}, - {ET_TIME, 0,0,0, 2, 'T', SKINCOLOR_GREY, 40*TICRATE, "", 0}, - {ET_RINGS, 0,0,0, 2, 'R', SKINCOLOR_GOLD, 200, "", 0}, - - - // GREEN FLOWER 3 - // --- - {ET_TIME, 0,0,0, 3, 'T', SKINCOLOR_GREY, 30*TICRATE, "", 0}, - - - // TECHNO HILL 1 - // --- - {0, -5664, -5072, 2396, 4, 'A', SKINCOLOR_BLUE, 0, - "Three pipes reside near\n" - "where our heroes' paths split off.\n" - "You'll have to look up!", 0}, - {0, -784,-13968, 2888, 4, 'B', SKINCOLOR_LAVENDER, 0, - "Climbing yields great range.\n" - "Yet, on a path for climbers,\n" - "flying is the key.", 0}, - {0, 4160, -5824, 3776, 4, 'C', SKINCOLOR_RED, 0, - "That's sure lots of slime.\n" - "Say, do you ever wonder\n" - "what's dumping it all?", 0}, - {0, 6400, -8352, 1764, 4, 'D', SKINCOLOR_ORANGE, 0, - "Spinning through small gaps\n" - "can slip you into a cave.\n" - "In that cave's first stretch...", 0}, - {0, 2848, -9088, 488, 4, 'E', SKINCOLOR_NEONGREEN, 0, - "The slime lake is deep,\n" - "but reaching the floor takes height.\n" - "Scream \"Geronimo!\"...", 0}, - - {ET_SCORE, 0,0,0, 4, 'S', SKINCOLOR_BROWN, 75000, "", 0}, - {ET_TIME, 0,0,0, 4, 'T', SKINCOLOR_GREY, 75*TICRATE, "", 0}, - {ET_RINGS, 0,0,0, 4, 'R', SKINCOLOR_GOLD, 300, "", 0}, - - - // TECHNO HILL 2 - // --- - {0,-19138, -2692, 688, 5, 'A', SKINCOLOR_BLUE, 0, - "Near the first checkpoint,\n" - "a bridge crosses a slime pool.\n" - "(Sensing a pattern?)", 0}, - {0,-13120, 8062, 1248, 5, 'B', SKINCOLOR_LAVENDER, 0, - "Behind the windows,\n" - "near crushers, ever smashing\n" - "a conveyor belt.", 0}, - {0, 580, 4552, 1344, 5, 'C', SKINCOLOR_RED, 0, - "A pipe drops onto\n" - "a half-outdoors conveyor.\n" - "But is it empty?", 0}, - {0, 192, -8768, 24, 5, 'D', SKINCOLOR_ORANGE, 0, - "There is a hallway\n" - "that a button floods with slime.\n" - "Go through it again!", 0}, - {0, -2468,-12128, 1312, 5, 'E', SKINCOLOR_NEONGREEN, 0, - "Jumping on turtles\n" - "will send you springing skyward.\n" - "Now, do that six times...", 0}, - - {ET_SCORE, 0,0,0, 5, 'S', SKINCOLOR_BROWN, 100000, "", 0}, - {ET_TIME, 0,0,0, 5, 'T', SKINCOLOR_GREY, 120*TICRATE, "", 0}, - {ET_RINGS, 0,0,0, 5, 'R', SKINCOLOR_GOLD, 600, "", 0}, - - - // TECHNO HILL 3 - // --- - {ET_TIME, 0,0,0, 6, 'T', SKINCOLOR_GREY, 40*TICRATE, "", 0}, - - - // DEEP SEA 1 - // --- - {0,-16224, -2880, 3530, 7, 'A', SKINCOLOR_BLUE, 0, - "Climb up two maze walls.\n" - "Break the roof, then a corner.\n" - "There, glide, but stay dry.", 0}, - {0, -8224, 896, 1056, 7, 'B', SKINCOLOR_LAVENDER, 0, - "Follow the left path.\n" - "A square green button lurks deep.\n" - "Weight it down, somehow.", 0}, - {0, 4992, -5072, 4136, 7, 'C', SKINCOLOR_RED, 0, - "A certain path holds\n" - "many gargoyle puzzles.\n" - "Victors reach a \"V\".", 0}, - {0, 4576, 5168, 2660, 7, 'D', SKINCOLOR_ORANGE, 0, - "A caved-in hallway?\n" - "The floor falls; the path goes down.\n" - "But those rocks looked weak...", 0}, - {0, 12576, 16096, -992, 7, 'E', SKINCOLOR_NEONGREEN, 0, - "The end is quite dry.\n" - "Some rocks dam the water in.\n" - "Knuckles can fix that...", 0}, - - {ET_SCORE, 0,0,0, 7, 'S', SKINCOLOR_BROWN, 75000, "", 0}, - {ET_TIME, 0,0,0, 7, 'T', SKINCOLOR_GREY, 120*TICRATE, "", 0}, - {ET_RINGS, 0,0,0, 7, 'R', SKINCOLOR_GOLD, 400, "", 0}, - - - // DEEP SEA 2 - // --- - {0,-15040, 6976, 2016, 8, 'A', SKINCOLOR_BLUE, 0, - "A waterfall lands\n" - "near a starpost in a cave.\n" - "It's dark up there, but...", 0}, - {0, 4288, 2912, 544, 8, 'B', SKINCOLOR_LAVENDER, 0, - "So many blocks here!\n" - "Take five; bathe in the fountain.\n" - "Hmmm? A hidden path...?", 0}, - {0, -5696, 16992, 791, 8, 'C', SKINCOLOR_RED, 0, - "An ornate dragon\n" - "faces a secret passage.\n" - "Knuckles! Don't get crushed!", 0}, - {0,-13344, 18688, 1034, 8, 'D', SKINCOLOR_ORANGE, 0, - "In the current maze\n" - "hides a dark room of columns.\n" - "Find it, then look up.", 0}, - {0, 3104, 16192, 2408, 8, 'E', SKINCOLOR_NEONGREEN, 0, - "That same dragon's eye\n" - "hides another secret room.\n" - "There, solve its riddle.", 0}, - - {ET_SCORE, 0,0,0, 8, 'S', SKINCOLOR_BROWN, 50000, "", 0}, - {ET_TIME, 0,0,0, 8, 'T', SKINCOLOR_GREY, 150*TICRATE, "", 0}, - {ET_RINGS, 0,0,0, 8, 'R', SKINCOLOR_GOLD, 250, "", 0}, - - - // DEEP SEA 3 - // --- - {ET_TIME, 0,0,0, 9, 'T', SKINCOLOR_GREY, 90*TICRATE, "", 0}, - - - // CASTLE EGGMAN 1 - // --- - {0, -6176, -5184, -128, 10, 'A', SKINCOLOR_BLUE, 0, - "A drain feeds the lake.\n" - "Water rushes quickly through.\n" - "Go against the flow.", 0}, - {0, 3648,-15296, -992, 10, 'B', SKINCOLOR_LAVENDER, 0, - "The left starting path\n" - "goes atop a large wood deck.\n" - "Checked underneath yet?", 0}, - {0, 11712, 21312, 5472, 10, 'C', SKINCOLOR_RED, 0, - "At last, the castle!\n" - "Hold up! Don't just barge right in!\n" - "What's the facade hold...?", 0}, - {0, 20224, 13344, 3104, 10, 'D', SKINCOLOR_ORANGE, 0, - "The final approach!\n" - "A tower holds the emblem\n" - "near a ring arrow.", 0}, - {0, 9472, -5890, 710, 10, 'E', SKINCOLOR_NEONGREEN, 0, - "The right starting path\n" - "hides this near a canopy,\n" - "high, where two trees meet.", 0}, - - {ET_SCORE, 0,0,0, 10, 'S', SKINCOLOR_BROWN, 50000, "", 0}, - {ET_TIME, 0,0,0, 10, 'T', SKINCOLOR_GREY, 120*TICRATE, "", 0}, - {ET_RINGS, 0,0,0, 10, 'R', SKINCOLOR_GOLD, 200, "", 0}, - - - // CASTLE EGGMAN 2 - // --- - {0, 832,-15168, 7808, 11, 'A', SKINCOLOR_BLUE, 0, - "Find a trick bookcase\n" - "that hides a darkened hallway.\n" - "There, climb a tower.", 0}, - {0,-18460,-22180, 2416, 11, 'B', SKINCOLOR_LAVENDER, 0, - "Down in the dungeon,\n" - "a cracked wall hides secret paths.\n" - "Echidnas only!", 0}, - {0, -6144,-11792, 3232, 11, 'C', SKINCOLOR_RED, 0, - "A room you can flood!\n" - "A brown grate's near its exit.\n" - "Knuckles can break it...", 0}, - {0, 4608, -7024, 4256, 11, 'D', SKINCOLOR_ORANGE, 0, - "Some of these bookshelves\n" - "are not flush against the walls.\n" - "Wonder why that is?", 0}, - {0, 12708,-13536, 4768, 11, 'E', SKINCOLOR_NEONGREEN, 0, - "The ending's towers\n" - "are hiding a small alcove.\n" - "Check around outside.", 0}, - - {ET_SCORE, 0,0,0, 11, 'S', SKINCOLOR_BROWN, 400000, "", 0}, - {ET_TIME, 0,0,0, 11, 'T', SKINCOLOR_GREY, 210*TICRATE, "", 0}, - {ET_RINGS, 0,0,0, 11, 'R', SKINCOLOR_GOLD, 600, "", 0}, - - - // CASTLE EGGMAN 3 - // --- - {ET_TIME, 0,0,0, 12, 'T', SKINCOLOR_GREY, 120*TICRATE, "", 0}, - - - // ARID CANYON 1 - // --- - {0, 3488, 2208, 3072, 13, 'A', SKINCOLOR_BLUE, 0, - "A rather large gap\n" - "must be crossed by way of tram.\n" - "At its end, jump left.", 0}, - {0, -7552, 10464, 4094, 13, 'B', SKINCOLOR_LAVENDER, 0, - "Crushers that go up!\n" - "Mind your step; if they're triggered,\n" - "they'll block this emblem.", 0}, - {0,-12093, 14575, 5752, 13, 'C', SKINCOLOR_RED, 0, - "There's an oil lake\n" - "that you can sink deep into.\n" - "Drain it, and explore.", 0}, - {0, 512, -7136, 4640, 13, 'D', SKINCOLOR_ORANGE, 0, - "Not far from the start,\n" - "if you climb toward the sky,\n" - "the cliffs hide something.", 0}, - {0, 12504, 6848, 3424, 13, 'E', SKINCOLOR_NEONGREEN, 0, - "Right by the exit,\n" - "an emblem lies on a cliff.\n" - "Ride ropes to reach it.", 0}, - - {ET_SCORE, 0,0,0, 13, 'S', SKINCOLOR_BROWN, 50000, "", 0}, - {ET_TIME, 0,0,0, 13, 'T', SKINCOLOR_GREY, 120*TICRATE, "", 0}, - {ET_RINGS, 0,0,0, 13, 'R', SKINCOLOR_GOLD, 300, "", 0}, - - - // RED VOLCANO 1 - // --- - {0,-13184, 11424, 3080, 16, 'A', SKINCOLOR_BLUE, 0, - "Look around the room,\n" - "just before you clear the stage;\n" - "something's hidden there!", 0}, - {0, -2816, 3120, 3044, 16, 'B', SKINCOLOR_LAVENDER, 0, - "Ever look upwards\n" - "when you're traversing across\n" - "collapsing platforms?", 0}, - {0, 6720, 6784, 1452, 16, 'C', SKINCOLOR_RED, 0, - "Check out a corner\n" - "of a lake of magma near\n" - "spinning jets of flame.", 0}, - {0, -5504, 9824, 800, 16, 'D', SKINCOLOR_ORANGE, 0, - "Where once a bridge stood,\n" - "now magma falls from above.\n" - "The bridge dropped something...", 0}, - {0, 8287,-11043, 1328, 16, 'E', SKINCOLOR_NEONGREEN, 0, - "A lake of magma\n" - "ebbs and flows unendingly.\n" - "Wait for its nadir.", 0}, - - {ET_SCORE, 0,0,0, 16, 'S', SKINCOLOR_BROWN, 30000, "", 0}, - {ET_TIME, 0,0,0, 16, 'T', SKINCOLOR_GREY, 120*TICRATE, "", 0}, - {ET_RINGS, 0,0,0, 16, 'R', SKINCOLOR_GOLD, 100, "", 0}, - - - // EGG ROCK 1 - // --- - {0,-10976, -7328, 1584, 22, 'A', SKINCOLOR_BLUE, 0, - "Vanishing platforms,\n" - "then collapsing ones herald\n" - "a last-second jump.", 0}, - {0, -6592,-11200, 2208, 22, 'B', SKINCOLOR_LAVENDER, 0, - "What is this red stuff?\n" - "You can't breathe it in, but look!\n" - "It can't reach up there...", 0}, - {0, 6816, 832, 936, 22, 'C', SKINCOLOR_RED, 0, - "The team's paths diverge.\n" - "Should Tails run the crusher path?\n" - "No! Fly outside it!", 0}, - {0, 6942, -8902, 2080, 22, 'D', SKINCOLOR_ORANGE, 0, - "Don't jump too high here!\n" - "No conveyor will catch you;\n" - "you'd fall to your death.", 0}, - {0, -6432, -6192, 584, 22, 'E', SKINCOLOR_NEONGREEN, 0, - "Conveyors! Magma!\n" - "What an intense room this is!\n" - "But, what brought you here?", 0}, - - {ET_SCORE, 0,0,0, 22, 'S', SKINCOLOR_BROWN, 25000, "", 0}, - {ET_TIME, 0,0,0, 22, 'T', SKINCOLOR_GREY, 120*TICRATE, "", 0}, - {ET_RINGS, 0,0,0, 22, 'R', SKINCOLOR_GOLD, 150, "", 0}, - - - // EGG ROCK 2 - // --- - {0, -6672, 7792, 352, 23, 'A', SKINCOLOR_BLUE, 0, - "Walk on the ceiling;\n" - "resist the urge to flip back!\n" - "Find the cyan path...", 0}, - {0,-12256, 15136, -288, 23, 'B', SKINCOLOR_LAVENDER, 0, - "X marks the spot? Nope!\n" - "Try standing further away\n" - "when the timer flips.", 0}, - {0, 1536, 16224, 1144, 23, 'C', SKINCOLOR_RED, 0, - "There is more than one\n" - "elevator inside the\n" - "elevator shaft...", 0}, - {0,-15968, 14192, 3152, 23, 'D', SKINCOLOR_ORANGE, 0, - "Gears with missing teeth\n" - "can hide a clever secret!\n" - "Think Green Hill Zone boss.", 0}, - {0, 1920, 20608, 1064, 23, 'E', SKINCOLOR_NEONGREEN, 0, - "Just before you reach\n" - "the defective cargo bay,\n" - "fly under a bridge.", 0}, - - {ET_SCORE, 0,0,0, 23, 'S', SKINCOLOR_BROWN, 60000, "", 0}, - {ET_TIME, 0,0,0, 23, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, - {ET_RINGS, 0,0,0, 23, 'R', SKINCOLOR_GOLD, 250, "", 0}, - - - // EGG ROCK 3 - // --- -/* Just in case, I'll leave these here in the source. - {0, 848, -3584, 592, 24, 'A', SKINCOLOR_BLUE, 0, - "[PH] Hiding at the end of the first hallway.", 0}, - {0,-10368, -2816, 144, 24, 'B', SKINCOLOR_LAVENDER, 0, - "Directions are meaningless.", 0}, - {0, -8160, -5952, 560, 24, 'C', SKINCOLOR_RED, 0, - "[PH] In the ceiling of the conveyor belt + laser hallway.", 0}, - {0,-13728,-13728, 1552, 24, 'D', SKINCOLOR_ORANGE, 0, - "[PH] On top of the platform with rows of spikes in reverse gravity.", 0}, - {0,-14944, 768, 1232, 24, 'E', SKINCOLOR_NEONGREEN, 0, - "Follow the leader.", 0}, -*/ - - {ET_SCORE, 0,0,0, 24, 'S', SKINCOLOR_BROWN, 14000, "", 0}, - {ET_TIME, 0,0,0, 24, 'T', SKINCOLOR_GREY, 210*TICRATE, "", 0}, - {ET_RINGS, 0,0,0, 24, 'R', SKINCOLOR_GOLD, 100, "", 0}, - - - // EGG ROCK CORE - // --- - {ET_TIME, 0,0,0, 25, 'T', SKINCOLOR_GREY, 100*TICRATE, "", 0}, - - - // PIPE TOWERS - // --- - {0, 3182, 5040, 3008, 30, 'A', SKINCOLOR_BLUE, 0, - "A pipe in the roof\n" - "eternally drops water.\n" - "Something's stuck up there.", 0}, - {0, -2400, 5984, 2752, 30, 'B', SKINCOLOR_LAVENDER, 0, - "Pushing a red switch\n" - "raises the water level;\n" - "from there, can't miss it.", 0}, - {0, 6112, 7008, 4032, 30, 'C', SKINCOLOR_RED, 0, - "A high-up passage\n" - "hides near the second checkpoint.\n" - "Climb in; then, climb more.", 0}, - {0, 11424, -4832, 1376, 30, 'D', SKINCOLOR_ORANGE, 0, - "The underground room\n" - "with platforms that fall and rise\n" - "only LOOKS empty...", 0}, - {0 , 4960, -6112, 1312, 30, 'E', SKINCOLOR_NEONGREEN, 0, - "This one's straightforward.\n" - "What comes to mind when I say:\n" - "\"WELCOME TO WARP ZONE!\"?", 0}, - - {ET_SCORE, 0,0,0, 30, 'S', SKINCOLOR_BROWN, 75000, "", 0}, - {ET_TIME, 0,0,0, 30, 'T', SKINCOLOR_GREY, 100*TICRATE, "", 0}, - {ET_RINGS, 0,0,0, 30, 'R', SKINCOLOR_GOLD, 300, "", 0}, - - - // AERIAL GARDEN - // --- - {0, 10176,-14304, 1796, 40, 'A', SKINCOLOR_BLUE, 0, - "A central tower,\n" - "one with many waterfalls,\n" - "hides a secret room.", 0}, - {0, 480, 17696, 6496, 40, 'B', SKINCOLOR_LAVENDER, 0, - "Hidden off the path\n" - "lies a skyscraping tower.\n" - "A lake's at the top.", 0}, - {0, -8896, 13248, 3362, 40, 'C', SKINCOLOR_RED, 0, - "Find all four buttons\n" - "that sink when you stand on them.\n" - "They'll open a door...", 0}, - {0, -8896, -9952, 2480, 40, 'D', SKINCOLOR_ORANGE, 0, - "Much like the last one,\n" - "you need to find some switches.\n" - "Only two, this time.", 0}, - {0, 13184, 18880, 6672, 40, 'E', SKINCOLOR_NEONGREEN, 0, - "The inner sanctum!\n" - "Teleport to its switches;\n" - "then, check near the goal.", 0}, - - {ET_SCORE, 0,0,0, 40, 'S', SKINCOLOR_BROWN, 300000, "", 0}, - {ET_TIME, 0,0,0, 40, 'T', SKINCOLOR_GREY, 240*TICRATE, "", 0}, - {ET_RINGS, 0,0,0, 40, 'R', SKINCOLOR_GOLD, 1200, "", 0}, - - - // AZURE TEMPLE - // --- - {0, -2400, 7552, 1120, 41, 'A', SKINCOLOR_BLUE, 0, - "For those who can swim,\n" - "a long tunnel hides rewards.\n" - "Do mind the Buzzes!", 0}, - {0, -64, 14016, 2072, 41, 'B', SKINCOLOR_LAVENDER, 0, - "So many skylights!\n" - "A markedly large one hides\n" - "behind a starpost...", 0}, - {0, 2976, 13920, -32, 41, 'C', SKINCOLOR_RED, 0, - "When you reach gauntlets\n" - "of diagonal fire,\n" - "check out the corners.", 0}, - {0, 2176, 22592, 1376, 41, 'D', SKINCOLOR_ORANGE, 0, - "A room of currents;\n" - "most of them are marked by spikes.\n" - "This one? A corner.", 0}, - {0, -4128, 21344, 1120, 41, 'E', SKINCOLOR_NEONGREEN, 0, - "The only way to hit\n" - "all those gems at once is with\n" - "a radial blast.", 0}, - - {ET_SCORE, 0,0,0, 41, 'S', SKINCOLOR_BROWN, 425000, "", 0}, - {ET_TIME, 0,0,0, 41, 'T', SKINCOLOR_GREY, 240*TICRATE, "", 0}, - {ET_RINGS, 0,0,0, 41, 'R', SKINCOLOR_GOLD, 300, "", 0}, - - - // FLORAL FIELD - // --- - {0, 5394, -996, 160, 50, 'N', SKINCOLOR_ROSEWOOD, 0, "", 0}, - {ET_NGRADE, 0,0,0, 50, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0}, - {ET_NTIME, 0,0,0, 50, 'T', SKINCOLOR_GREY, 40*TICRATE, "", 0}, - - - // TOXIC PLATEAU - // --- - {0, 780, -1664, 32, 51, 'N', SKINCOLOR_ROSEWOOD, 0, "", 0}, - {ET_NGRADE, 0,0,0, 51, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0}, - {ET_NTIME, 0,0,0, 51, 'T', SKINCOLOR_GREY, 50*TICRATE, "", 0}, - - - // FLOODED COVE - // --- - {0, 1824, -1888, 2448, 52, 'N', SKINCOLOR_ROSEWOOD, 0, "", 0}, - {ET_NGRADE, 0,0,0, 52, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0}, - {ET_NTIME, 0,0,0, 52, 'T', SKINCOLOR_GREY, 90*TICRATE, "", 0}, - - - // CAVERN FORTRESS - // --- - {0, -3089, -431, 1328, 53, 'N', SKINCOLOR_ROSEWOOD, 0, "", 0}, - {ET_NGRADE, 0,0,0, 53, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0}, - {ET_NTIME, 0,0,0, 53, 'T', SKINCOLOR_GREY, 75*TICRATE, "", 0}, - - - // DUSTY WASTELAND - // --- - {0, 957, 924, 2956, 54, 'N', SKINCOLOR_ROSEWOOD, 0, "", 0}, - {ET_NGRADE, 0,0,0, 54, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0}, - {ET_NTIME, 0,0,0, 54, 'T', SKINCOLOR_GREY, 65*TICRATE, "", 0}, - - - // MAGMA CAVES - // --- - {0, -2752, 3104, 1800, 55, 'N', SKINCOLOR_ROSEWOOD, 0, "", 0}, - {ET_NGRADE, 0,0,0, 55, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0}, - {ET_NTIME, 0,0,0, 55, 'T', SKINCOLOR_GREY, 80*TICRATE, "", 0}, - - - // EGG SATELLITE - // --- - {0, 5334, -609, 3426, 56, 'N', SKINCOLOR_ROSEWOOD, 0, "", 0}, - {ET_NGRADE, 0,0,0, 56, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0}, - {ET_NTIME, 0,0,0, 56, 'T', SKINCOLOR_GREY, 120*TICRATE, "", 0}, - - - // BLACK HOLE - // --- - {0, 2108, 3776, 32, 57, 'N', SKINCOLOR_ROSEWOOD, 0, "", 0}, - {ET_NGRADE, 0,0,0, 57, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0}, - {ET_NTIME, 0,0,0, 57, 'T', SKINCOLOR_GREY, 150*TICRATE, "", 0}, - - - // SPRING HILL - // --- - {0, -1840, -1024, 1644, 58, 'N', SKINCOLOR_ROSEWOOD, 0, "", 0}, - {ET_NGRADE, 0,0,0, 58, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0}, - {ET_NTIME, 0,0,0, 58, 'T', SKINCOLOR_GREY, 60*TICRATE, "", 0}, + // GREEN HILLS + // 1:30.00 + {ET_TIME, 0,0,0, 1, 'T', SKINCOLOR_GREY, 90*TICRATE, "", 0}, }; // Default Extra Emblems @@ -574,8 +51,8 @@ extraemblem_t extraemblems[MAXEXTRAEMBLEMS] = unlockable_t unlockables[MAXUNLOCKABLES] = { // Name, Objective, Menu Height, ConditionSet, Unlock Type, Variable, NoCecho, NoChecklist - /* 01 */ {"Record Attack", "Complete Greenflower Zone, Act 1", 0, -1, SECRET_RECORDATTACK, 0, true, true, 0}, - /* 02 */ {"NiGHTS Mode", "Complete Floral Field", 0, -1, SECRET_NIGHTSMODE, 0, true, true, 0}, + /* 01 */ {"Record Attack", "", 0, -1, SECRET_RECORDATTACK, 0, true, true, 0}, + /* 02 */ {"NiGHTS Mode", "", 0, -1, SECRET_NIGHTSMODE, 0, true, true, 0}, /* 03 */ {"Play Credits", "Complete 1P Mode", 30, 10, SECRET_CREDITS, 0, true, true, 0}, /* 04 */ {"Sound Test", "Complete 1P Mode", 40, 10, SECRET_SOUNDTEST, 0, false, false, 0}, @@ -602,7 +79,7 @@ unlockable_t unlockables[MAXUNLOCKABLES] = }; // Default number of emblems and extra emblems -INT32 numemblems = 155; +INT32 numemblems = 1; INT32 numextraemblems = 5; // DEFAULT CONDITION SETS FOR SRB2 2.1: @@ -739,6 +216,8 @@ static UINT8 M_CheckCondition(condition_t *cn) { case UC_PLAYTIME: // Requires total playing time >= x return (totalplaytime >= (unsigned)cn->requirement); + case UC_MATCHESPLAYED: // Requires any level completed >= x times + return (matchesplayed >= (unsigned)cn->requirement); case UC_GAMECLEAR: // Requires game beaten >= x times return (timesBeaten >= (unsigned)cn->requirement); case UC_ALLEMERALDS: // Requires game beaten with all 7 emeralds >= x times diff --git a/src/m_cond.h b/src/m_cond.h index e61ff1f7..1f2644c5 100644 --- a/src/m_cond.h +++ b/src/m_cond.h @@ -21,6 +21,7 @@ typedef enum { UC_PLAYTIME, // PLAYTIME [tics] + UC_MATCHESPLAYED, // MATCHESPLAYED [x played] UC_GAMECLEAR, // GAMECLEAR UC_ALLEMERALDS, // ALLEMERALDS UC_ULTIMATECLEAR, // ULTIMATECLEAR diff --git a/src/m_menu.c b/src/m_menu.c index 72605689..4b9ac354 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -238,9 +238,9 @@ menu_t SP_MainDef, MP_MainDef, OP_MainDef; menu_t MISC_ScrambleTeamDef, MISC_ChangeTeamDef; // Single Player -static void M_LoadGame(INT32 choice); +//static void M_LoadGame(INT32 choice); static void M_TimeAttack(INT32 choice); -static void M_NightsAttack(INT32 choice); +//static void M_NightsAttack(INT32 choice); static void M_Statistics(INT32 choice); static void M_HandleStaffReplay(INT32 choice); static void M_ReplayTimeAttack(INT32 choice); @@ -342,7 +342,7 @@ static void M_DrawNightsAttackMenu(void); static void M_DrawSetupChoosePlayerMenu(void); static void M_DrawControl(void); static void M_DrawVideoMode(void); -static void M_DrawMonitorToggles(void); +//static void M_DrawMonitorToggles(void); #ifdef HWRENDER static void M_OGL_DrawFogMenu(void); static void M_OGL_DrawColorMenu(void); @@ -477,7 +477,7 @@ static consvar_t cv_dummystaff = {"dummystaff", "0", CV_HIDEN|CV_CALL, dummystaf static menuitem_t MainMenu[] = { {IT_CALL |IT_STRING, NULL, "Secrets", M_SecretsMenu, 84}, - {IT_CALL |IT_STRING, NULL, "1 Player", M_SinglePlayerMenu, 92}, + {IT_CALL |IT_STRING, NULL, "1 Player", M_SinglePlayerMenu, 92}, {IT_SUBMENU|IT_STRING, NULL, "Multiplayer", &MP_MainDef, 100}, {IT_CALL |IT_STRING, NULL, "Options", M_Options, 108}, {IT_CALL |IT_STRING, NULL, "Quit Game", M_QuitSRB2, 116}, @@ -706,17 +706,17 @@ static menuitem_t SR_EmblemHintMenu[] = // Single Player Main static menuitem_t SP_MainMenu[] = { - {IT_CALL | IT_STRING, NULL, "Start Game", M_LoadGame, 92}, + //{IT_CALL | IT_STRING, NULL, "Start Game", M_LoadGame, 92}, {IT_SECRET, NULL, "Record Attack", M_TimeAttack, 100}, - {IT_SECRET, NULL, "NiGHTS Mode", M_NightsAttack, 108}, - {IT_CALL | IT_STRING | IT_CALL_NOTMODIFIED, NULL, "Statistics", M_Statistics, 116}, + //{IT_SECRET, NULL, "NiGHTS Mode", M_NightsAttack, 108}, + {IT_CALL | IT_STRING | IT_CALL_NOTMODIFIED, NULL, "Statistics", M_Statistics, 108}, }; enum { - sploadgame, + //sploadgame, sprecordattack, - spnightsmode, + //spnightsmode, spstatistics }; @@ -1413,24 +1413,29 @@ static menuitem_t OP_GameOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Show HUD", &cv_showhud, 40}, {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "HUD Visibility", &cv_translucenthud, 50}, - {IT_STRING | IT_CVAR, NULL, "Timer Display", &cv_timetic, 60}, + + {IT_STRING | IT_CVAR, NULL, "Star SFX", &cv_kartstarsfx, 62}, + {IT_STRING | IT_CVAR, NULL, "Speedometer Display", &cv_speedometer, 72}, + {IT_STRING | IT_CVAR, NULL, "Show Minimap", &cv_kartminimap, 82}, + {IT_STRING | IT_CVAR, NULL, "Show \"CHECK\"", &cv_kartcheck, 92}, + #ifdef SEENAMES - {IT_STRING | IT_CVAR, NULL, "HUD Player Names", &cv_seenames, 80}, + {IT_STRING | IT_CVAR, NULL, "HUD Player Names", &cv_seenames, 104}, #endif - {IT_STRING | IT_CVAR, NULL, "Log Hazard Damage", &cv_hazardlog, 90}, + {IT_STRING | IT_CVAR, NULL, "Log Hazard Damage", &cv_hazardlog, 114}, - {IT_STRING | IT_CVAR, NULL, "Console Back Color", &cons_backcolor, 100}, - {IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize,110}, - {IT_STRING | IT_CVAR, NULL, "Uppercase Console", &cv_allcaps, 120}, + {IT_STRING | IT_CVAR, NULL, "Console Back Color", &cons_backcolor, 126}, + {IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize,136}, + {IT_STRING | IT_CVAR, NULL, "Uppercase Console", &cv_allcaps, 146}, - {IT_STRING | IT_CVAR, NULL, "Title Screen Demos", &cv_rollingdemos, 140}, + {IT_STRING | IT_CVAR, NULL, "Title Screen Demos", &cv_rollingdemos, 158}, }; static menuitem_t OP_ServerOptionsMenu[] = { {IT_STRING | IT_SUBMENU, NULL, "General netgame options...", &OP_NetgameOptionsDef, 10}, {IT_STRING | IT_SUBMENU, NULL, "Gametype options...", &OP_GametypeOptionsDef, 20}, - {IT_STRING | IT_SUBMENU, NULL, "Random Monitor Toggles...", &OP_MonitorToggleDef, 30}, + {IT_STRING | IT_SUBMENU, NULL, "Random item toggles...", &OP_MonitorToggleDef, 30}, #ifndef NONET {IT_STRING | IT_CVAR | IT_CV_STRING, @@ -1452,65 +1457,57 @@ static menuitem_t OP_NetgameOptionsMenu[] = { {IT_STRING | IT_CVAR, NULL, "Time Limit", &cv_timelimit, 10}, {IT_STRING | IT_CVAR, NULL, "Point Limit", &cv_pointlimit, 18}, - {IT_STRING | IT_CVAR, NULL, "Overtime Tie-Breaker", &cv_overtime, 26}, - {IT_STRING | IT_CVAR, NULL, "Special Ring Weapons", &cv_specialrings, 42}, - {IT_STRING | IT_CVAR, NULL, "Emeralds", &cv_powerstones, 50}, - {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_matchboxes, 58}, - {IT_STRING | IT_CVAR, NULL, "Item Respawn", &cv_itemrespawn, 66}, - {IT_STRING | IT_CVAR, NULL, "Item Respawn time", &cv_itemrespawntime, 74}, + {IT_STRING | IT_CVAR, NULL, "Frantic Items", &cv_kartfrantic, 34}, - {IT_STRING | IT_CVAR, NULL, "Sudden Death", &cv_suddendeath, 90}, - {IT_STRING | IT_CVAR, NULL, "Player respawn delay", &cv_respawntime, 98}, + {IT_STRING | IT_CVAR, NULL, "Item Respawn", &cv_itemrespawn, 50}, + {IT_STRING | IT_CVAR, NULL, "Item Respawn time", &cv_itemrespawntime, 58}, - {IT_STRING | IT_CVAR, NULL, "Force Skin #", &cv_forceskin, 114}, - {IT_STRING | IT_CVAR, NULL, "Restrict skin changes", &cv_restrictskinchange, 122}, + {IT_STRING | IT_CVAR, NULL, "Player respawn delay", &cv_respawntime, 74}, - {IT_STRING | IT_CVAR, NULL, "Autobalance Teams", &cv_autobalance, 138}, - {IT_STRING | IT_CVAR, NULL, "Scramble Teams on Map Change", &cv_scrambleonchange, 146}, + {IT_STRING | IT_CVAR, NULL, "Force Skin #", &cv_forceskin, 90}, + {IT_STRING | IT_CVAR, NULL, "Restrict skin changes", &cv_restrictskinchange, 98}, + + //{IT_STRING | IT_CVAR, NULL, "Autobalance Teams", &cv_autobalance, 114}, + //{IT_STRING | IT_CVAR, NULL, "Scramble Teams on Map Change", &cv_scrambleonchange, 122}, }; static menuitem_t OP_GametypeOptionsMenu[] = { - // This is Kart, we don't need half this shit! -/* {IT_HEADER, NULL, "CO-OP", NULL, 2}, - {IT_STRING | IT_CVAR, NULL, "Players for exit", &cv_playersforexit, 10}, - {IT_STRING | IT_CVAR, NULL, "Starting Lives", &cv_startinglives, 18}, + {IT_HEADER, NULL, "RACE", NULL, 2}, + {IT_STRING | IT_CVAR, NULL, "Game Speed", &cv_kartspeed, 10}, + {IT_STRING | IT_CVAR, NULL, "Mirror Mode", &cv_kartmirror, 18}, + {IT_STRING | IT_CVAR, NULL, "Number of Laps", &cv_numlaps, 26}, + {IT_STRING | IT_CVAR, NULL, "Use Map Lap Counts", &cv_usemapnumlaps, 34}, - {IT_HEADER, NULL, "COMPETITION", NULL, 34}, - {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_competitionboxes, 42}, - {IT_STRING | IT_CVAR, NULL, "Countdown Time", &cv_countdowntime, 50},*/ - - {IT_HEADER, NULL, "RACE", NULL, 2}, - {IT_STRING | IT_CVAR, NULL, "Number of Laps", &cv_numlaps, 10}, - {IT_STRING | IT_CVAR, NULL, "Use Map Lap Counts", &cv_usemapnumlaps, 18}, - {IT_STRING | IT_CVAR, NULL, "CC", &cv_kartcc, 26}, - - {IT_HEADER, NULL, "BATTLE", NULL, 50}, -/* {IT_STRING | IT_CVAR, NULL, "Scoring Type", &cv_match_scoring, 106}, - - {IT_HEADER, NULL, "TAG", NULL, 122}, - {IT_STRING | IT_CVAR, NULL, "Hide Time", &cv_hidetime, 130}, - - {IT_HEADER, NULL, "CTF", NULL, 146}, - {IT_STRING | IT_CVAR, NULL, "Flag Respawn Time", &cv_flagtime, 154},*/ + {IT_HEADER, NULL, "BATTLE", NULL, 50}, + {IT_STRING | IT_CVAR, NULL, "Starting Balloons", &cv_kartballoons, 58}, + {IT_STRING | IT_CVAR, NULL, "Karma Comeback", &cv_kartcomeback, 66}, }; static menuitem_t OP_MonitorToggleMenu[] = { // Printing handled by drawing function - {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Recycler", &cv_recycler, 20}, - {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Teleporters", &cv_teleporters, 30}, - {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Super Ring", &cv_superring, 40}, - {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Super Sneakers", &cv_supersneakers, 50}, - {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Invincibility", &cv_invincibility, 60}, - {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Jump Shield", &cv_jumpshield, 70}, - {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Elemental Shield", &cv_watershield, 80}, - {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Attraction Shield", &cv_ringshield, 90}, - {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Force Shield", &cv_forceshield, 100}, - {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Armageddon Shield", &cv_bombshield, 110}, - {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "1 Up", &cv_1up, 120}, - {IT_STRING|IT_CVAR|IT_CV_INVISSLIDER, NULL, "Eggman Box", &cv_eggmanbox, 130}, + // Instead of using this for dumb monitors, lets use the new item bools we have :V + {IT_STRING | IT_CVAR, NULL, "Mushrooms", &cv_mushroom, 10}, + {IT_STRING | IT_CVAR, NULL, "Triple Mushrooms", &cv_triplemushroom, 18}, + {IT_STRING | IT_CVAR, NULL, "Mega Mushrooms", &cv_megashroom, 26}, + {IT_STRING | IT_CVAR, NULL, "Golden Mushrooms", &cv_goldshroom, 34}, + {IT_STRING | IT_CVAR, NULL, "Stars", &cv_star, 42}, + {IT_STRING | IT_CVAR, NULL, "Bananas", &cv_banana, 50}, + {IT_STRING | IT_CVAR, NULL, "Triple Bananas", &cv_triplebanana, 58}, + {IT_STRING | IT_CVAR, NULL, "Fake Items", &cv_fakeitem, 66}, + {IT_STRING | IT_CVAR, NULL, "Green Shells", &cv_greenshell, 74}, + {IT_STRING | IT_CVAR, NULL, "Red Shells", &cv_redshell, 82}, + {IT_STRING | IT_CVAR, NULL, "Triple Green Shells", &cv_triplegreenshell, 90}, + {IT_STRING | IT_CVAR, NULL, "Triple Red Shells", &cv_tripleredshell, 98}, + {IT_STRING | IT_CVAR, NULL, "Bob-ombs", &cv_bobomb, 106}, + {IT_STRING | IT_CVAR, NULL, "Fire Flowers", &cv_fireflower, 114}, + {IT_STRING | IT_CVAR, NULL, "Magnets", &cv_magnet, 122}, + {IT_STRING | IT_CVAR, NULL, "Boos", &cv_boo, 130}, + {IT_STRING | IT_CVAR, NULL, "Lightning", &cv_lightning, 138}, + {IT_STRING | IT_CVAR, NULL, "Blue Lightning", &cv_blueshell, 146}, + {IT_STRING | IT_CVAR, NULL, "Feathers", &cv_feather, 154}, }; // ========================================================================== @@ -1834,7 +1831,8 @@ menu_t OP_ServerOptionsDef = DEFAULTMENUSTYLE("M_SERVER", OP_ServerOptionsMenu, menu_t OP_NetgameOptionsDef = DEFAULTMENUSTYLE("M_SERVER", OP_NetgameOptionsMenu, &OP_ServerOptionsDef, 30, 30); menu_t OP_GametypeOptionsDef = DEFAULTMENUSTYLE("M_SERVER", OP_GametypeOptionsMenu, &OP_ServerOptionsDef, 30, 30); -menu_t OP_MonitorToggleDef = +menu_t OP_MonitorToggleDef = DEFAULTMENUSTYLE("M_SERVER", OP_MonitorToggleMenu, &OP_ServerOptionsDef, 30, 30); +/*menu_t OP_MonitorToggleDef = { "M_SERVER", sizeof (OP_MonitorToggleMenu)/sizeof (menuitem_t), @@ -1844,7 +1842,7 @@ menu_t OP_MonitorToggleDef = 30, 30, 0, NULL -}; +};*/ #ifdef HWRENDER menu_t OP_OpenGLOptionsDef = DEFAULTMENUSTYLE("M_VIDEO", OP_OpenGLOptionsMenu, &OP_VideoOptionsDef, 30, 30); @@ -4515,8 +4513,8 @@ static void M_SinglePlayerMenu(INT32 choice) (void)choice; SP_MainMenu[sprecordattack].status = (M_SecretUnlocked(SECRET_RECORDATTACK)) ? IT_CALL|IT_STRING : IT_SECRET; - SP_MainMenu[spnightsmode].status = - (M_SecretUnlocked(SECRET_NIGHTSMODE)) ? IT_CALL|IT_STRING : IT_SECRET; + /*SP_MainMenu[spnightsmode].status = + (M_SecretUnlocked(SECRET_NIGHTSMODE)) ? IT_CALL|IT_STRING : IT_SECRET;*/ M_SetupNextMenu(&SP_MainDef); } @@ -4941,13 +4939,13 @@ static void M_HandleLoadSave(INT32 choice) // // Selected from SRB2 menu // -static void M_LoadGame(INT32 choice) +/*static void M_LoadGame(INT32 choice) { (void)choice; M_ReadSaveStrings(); M_SetupNextMenu(&SP_LoadDef); -} +}*/ // // Used by cheats to force the save menu to a specific spot. @@ -5346,6 +5344,9 @@ static void M_DrawGameStats(void) G_TicsToMinutes(totalplaytime, false), G_TicsToSeconds(totalplaytime))); + V_DrawString(32, 90, V_YELLOWMAP, "Total Matches Played:"); + V_DrawRightAlignedString(BASEVIDWIDTH-32, 100, 0, va("%i", matchesplayed)); + for (i = 0; i < NUMMAPS; i++) { if (!mapheaderinfo[i] || !(mapheaderinfo[i]->menuflags & LF2_RECORDATTACK)) @@ -5376,7 +5377,7 @@ static void M_DrawGameStats(void) } - V_DrawCenteredString(BASEVIDWIDTH/2, 90, 0, "* COMBINED RECORDS *"); + V_DrawCenteredString(BASEVIDWIDTH/2, 120, 0, "* COMBINED RECORDS *"); /*sprintf(beststr, "%u", bestscore); V_DrawString(32, 100, V_YELLOWMAP, "SCORE:"); @@ -5385,10 +5386,10 @@ static void M_DrawGameStats(void) V_DrawRightAlignedString(BASEVIDWIDTH-32, 108, V_REDMAP, va("(%d unfinished)", mapsunfinished[0]));*/ sprintf(beststr, "%i:%02i:%02i.%02i", G_TicsToHours(besttime), G_TicsToMinutes(besttime, false), G_TicsToSeconds(besttime), G_TicsToCentiseconds(besttime)); - V_DrawString(32, 100, V_YELLOWMAP, "TIME:"); - V_DrawRightAlignedString(BASEVIDWIDTH-32, 100, 0, beststr); + V_DrawString(32, 140, V_YELLOWMAP, "TIME:"); + V_DrawRightAlignedString(BASEVIDWIDTH-32, 140, 0, beststr); if (mapsunfinished[1]) - V_DrawRightAlignedString(BASEVIDWIDTH-32, 108, V_REDMAP, va("(%d unfinished)", mapsunfinished[1])); + V_DrawRightAlignedString(BASEVIDWIDTH-32, 148, V_REDMAP, va("(%d unfinished)", mapsunfinished[1])); /*sprintf(beststr, "%u", bestrings); V_DrawString(32, 140, V_YELLOWMAP, "RINGS:"); @@ -5706,7 +5707,7 @@ void M_DrawNightsAttackMenu(void) } // Going to Nights Attack menu... -static void M_NightsAttack(INT32 choice) +/*static void M_NightsAttack(INT32 choice) { (void)choice; @@ -5731,7 +5732,7 @@ static void M_NightsAttack(INT32 choice) G_SetGamestate(GS_TIMEATTACK); S_ChangeMusicInternal("racent", true); -} +}*/ // Player has selected the "START" from the nights attack screen static void M_ChooseNightsAttack(INT32 choice) @@ -7099,6 +7100,7 @@ static void M_EraseDataResponse(INT32 ch) if (erasecontext == 2) { totalplaytime = 0; + matchesplayed = 0; F_StartIntro(); } M_ClearMenus(true); @@ -7780,7 +7782,7 @@ static void M_HandleVideoMode(INT32 ch) // =============== // Monitor Toggles // =============== -static void M_DrawMonitorToggles(void) +/*static void M_DrawMonitorToggles(void) { INT32 i, y; INT32 sum = 0; @@ -7814,7 +7816,7 @@ static void M_DrawMonitorToggles(void) if (cheating) V_DrawCenteredString(BASEVIDWIDTH/2, currentMenu->y, V_REDMAP, "* MODIFIED, CHEATS ENABLED *"); -} +}*/ // ========= // Quit Game diff --git a/src/p_inter.c b/src/p_inter.c index fb036b99..5b3addd5 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -439,7 +439,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) special->tracer->player->kartstuff[k_comebackpoints]++; - if (netgame) + if (netgame && cv_hazardlog.value) CONS_Printf(M_GetText("%s gave an item to %s.\n"), player_names[special->tracer->player-players], player_names[player-players]); if (special->tracer->player->kartstuff[k_comebackpoints] >= 3) diff --git a/src/p_mobj.c b/src/p_mobj.c index 286fa292..9fbf9166 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3603,7 +3603,7 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled || (thiscam == &camera4 && players[fourthdisplayplayer].mo && (players[fourthdisplayplayer].mo->flags2 & MF2_TWOD))) itsatwodlevel = true; - if (cv_kartmirror.value) + if (mirrormode) postimg = postimg_mirror; else if (player->pflags & PF_FLIPCAM && !(player->pflags & PF_NIGHTSMODE) && player->mo->eflags & MFE_VERTICALFLIP) postimg = postimg_flip; @@ -7728,14 +7728,10 @@ void P_MobjThinker(mobj_t *mobj) P_SpawnGhostMobj(mobj); - if (K_GetKartCC() == 50) - { + if (gamespeed == 0) finalspeed = FixedMul(finalspeed, FRACUNIT-FRACUNIT/4); - } - else if (K_GetKartCC() == 150) - { + else if (gamespeed == 2) finalspeed = FixedMul(finalspeed, FRACUNIT+FRACUNIT/4); - } mobj->angle = R_PointToAngle2(mobj->x, mobj->y, mobj->x+mobj->momx, mobj->y+mobj->momy); if (mobj->health <= 5) @@ -7779,12 +7775,12 @@ void P_MobjThinker(mobj_t *mobj) if (leveltime % 7 == 0) S_StartSound(mobj, mobj->info->activesound); - if (K_GetKartCC() == 50) + if (gamespeed == 0) { topspeed = FixedMul(topspeed, FRACUNIT-FRACUNIT/4); distbarrier = FixedMul(distbarrier, FRACUNIT-FRACUNIT/4); } - else if (K_GetKartCC() == 150) + else if (gamespeed == 2) { topspeed = FixedMul(topspeed, FRACUNIT+FRACUNIT/4); distbarrier = FixedMul(distbarrier, FRACUNIT+FRACUNIT/4); diff --git a/src/p_setup.c b/src/p_setup.c index 608f308d..b047258a 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2987,6 +2987,17 @@ boolean P_SetupLevel(boolean skipprecip) CV_SetValue(&cv_analog, false); } + // SRB2Kart: map load variables + if (modeattacking) + gamespeed = 2; + else if (gametype == GT_MATCH) + gamespeed = 0; + else + gamespeed = cv_kartspeed.value; + franticitems = cv_kartfrantic.value; + mirrormode = cv_kartmirror.value; + comeback = cv_kartcomeback.value; + // clear special respawning que iquehead = iquetail = 0; diff --git a/src/p_user.c b/src/p_user.c index 467a5057..4f4907a4 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -43,6 +43,7 @@ // Objectplace #include "m_cheat.h" // SRB2kart +#include "m_cond.h" // M_UpdateUnlockablesAndExtraEmblems #include "k_kart.h" #ifdef HW3SOUND @@ -1644,6 +1645,19 @@ void P_DoPlayerExit(player_t *player) if (player->exiting) return; + // SRB2kart: Increment the "matches played" counter. + // Why here of all places instead of the intermission screen?!? + // To prevent someone from using "exitlevel" to unlock everything! + if (player == &players[consoleplayer] && ((!modifiedgame || savemoddata) && !demoplayback)) // SRB2kart: Unlock stuff in MP + { + matchesplayed++; + if (M_UpdateUnlockablesAndExtraEmblems()) + { + S_StartSound(NULL, sfx_ncitem); + G_SaveGameData(); // only save if unlocked something + } + } + if (gametype == GT_RACE || gametype == GT_COMPETITION) // If in Race Mode, allow { // SRB2kart 120217 @@ -8020,7 +8034,7 @@ static void P_DeathThink(player_t *player) //player->kartstuff[k_lakitu] = 48; // See G_PlayerReborn in g_game.c // SRB2kart - spawn automatically after 1 second - if (player->deadtimer > TICRATE) + if (player->deadtimer > cv_respawntime.value*TICRATE) player->playerstate = PST_REBORN; // Single player auto respawn @@ -9129,7 +9143,7 @@ static void P_CalcPostImg(player_t *player) } #endif - if (cv_kartmirror.value) // srb2kart + if (mirrormode) // srb2kart *type = postimg_mirror; } From 86b5b21c623aacbc82643ef80e640262ed8db0ad Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 16 Jan 2018 00:36:44 -0500 Subject: [PATCH 02/14] Preliminary unlockables Most of the time emblems are just set to 5 minutes so that its possible to actually unlock everything :V --- src/m_cheat.c | 6 +- src/m_cond.c | 183 ++++++++++++++++++++++++-------------------------- 2 files changed, 89 insertions(+), 100 deletions(-) diff --git a/src/m_cheat.c b/src/m_cheat.c index cd08264d..bb7b4a5e 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -84,9 +84,9 @@ static UINT8 cheatf_warp(void) // Temporarily unlock stuff. G_SetGameModified(false); - unlockables[2].unlocked = true; // credits - unlockables[3].unlocked = true; // sound test - unlockables[16].unlocked = true; // level select + unlockables[1].unlocked = true; // credits + unlockables[2].unlocked = true; // sound test + //unlockables[16].unlocked = true; // level select // Refresh secrets menu existing. M_ClearMenus(true); diff --git a/src/m_cond.c b/src/m_cond.c index d936c3fe..bde84431 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -32,125 +32,114 @@ conditionset_t conditionSets[MAXCONDITIONSETS]; // Default Emblem locations emblem_t emblemlocations[MAXEMBLEMS] = { - // GREEN HILLS - // 1:30.00 - {ET_TIME, 0,0,0, 1, 'T', SKINCOLOR_GREY, 90*TICRATE, "", 0}, + // -- GREEN HILLS -- + // Time: 1:30.00 + {ET_TIME, 0,0,0, 1, 'T', SKINCOLOR_GREY, 90*TICRATE, "", 0}, + // -- NORTHERN DISTRICT -- + // Time: x:xx.xx + {ET_TIME, 0,0,0, 2, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, + // -- SUNBEAM PARADISE -- + // Time: 2:00.00 + {ET_TIME, 0,0,0, 3, 'T', SKINCOLOR_GREY, 120*TICRATE, "", 0}, + // -- PIPE SPEEDWAY -- + // Time: x:xx.xx + {ET_TIME, 0,0,0, 4, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, + // -- DARKVILE GARDEN -- + // Time: x:xx.xx + {ET_TIME, 0,0,0, 5, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, + // -- MEGABLOCK CASTLE -- + // Time: x:xx.xx + {ET_TIME, 0,0,0, 6, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, + // -- MIDNIGHT MEADOW -- + // Time: x:xx.xx + {ET_TIME, 0,0,0, 7, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, + // -- HILL TOP -- + // Time: x:xx.xx + {ET_TIME, 0,0,0, 11, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, + // -- SAPPHIRE COAST -- + // Time: x:xx.xx + {ET_TIME, 0,0,0, 13, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, + // -- BLUE MOUNTAIN -- + // Time: x:xx.xx + {ET_TIME, 0,0,0, 15, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, + // -- CASINO RESORT -- + // Time: x:xx.xx + {ET_TIME, 0,0,0, 19, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, + // -- SILVERCLOUD ISLAND -- + // Time: x:xx.xx + {ET_TIME, 0,0,0, 21, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, + // -- CANYON RUSH -- + // Time: x:xx.xx + {ET_TIME, 0,0,0, 25, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, + // -- CLOUD CRADLE K -- + // Time: x:xx.xx + {ET_TIME, 0,0,0, 26, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, + // -- TOXIC PALACE -- + // Time: x:xx.xx + {ET_TIME, 0,0,0, 27, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, + // -- ANCIENT TOMB -- + // Time: x:xx.xx + {ET_TIME, 0,0,0, 30, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, + // -- SUB-ZERO PEAK -- + // Time: x:xx.xx + {ET_TIME, 0,0,0, 31, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, + // -- VIRTUAL HIGHWAY -- + // Time: x:xx.xx + {ET_TIME, 0,0,0, 32, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, + // -- EGGMAN'S NIGHTCLUB -- + // Time: x:xx.xx + {ET_TIME, 0,0,0, 37, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, + // -- GBA RAINBOW ROAD -- + // Time: x:xx.xx + {ET_TIME, 0,0,0, 61, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, + // -- SONIC SPEEDWAY -- + // Time: x:xx.xx + {ET_TIME, 0,0,0, 70, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, + // -- AURORA ATOLL -- + // Time: x:xx.xx + {ET_TIME, 0,0,0, 72, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, + // -- BARREN BADLANDS -- + // Time: 2:30.00 + {ET_TIME, 0,0,0, 79, 'T', SKINCOLOR_GREY, 150*TICRATE, "", 0}, }; // Default Extra Emblems extraemblem_t extraemblems[MAXEXTRAEMBLEMS] = { - {"Game Complete", "Complete 1P Mode", 10, 'X', SKINCOLOR_BLUE, 0}, - {"All Emeralds", "Complete 1P Mode with all Emeralds", 11, 'V', SKINCOLOR_GREY, 0}, - {"Perfect Bonus", "Perfect Bonus on a non-secret stage", 30, 'P', SKINCOLOR_GOLD, 0}, - {"SRB1 Remake", "Complete SRB1 Remake", 21, 'O', SKINCOLOR_ROSEWOOD, 0}, - {"NiGHTS Mastery", "Show your mastery of NiGHTS!", 22, 'W', SKINCOLOR_TEAL, 0}, + {"Experienced Driver", "Play 100 Matches", 10, 'X', SKINCOLOR_BLUE, 0}, }; // Default Unlockables unlockable_t unlockables[MAXUNLOCKABLES] = { // Name, Objective, Menu Height, ConditionSet, Unlock Type, Variable, NoCecho, NoChecklist - /* 01 */ {"Record Attack", "", 0, -1, SECRET_RECORDATTACK, 0, true, true, 0}, - /* 02 */ {"NiGHTS Mode", "", 0, -1, SECRET_NIGHTSMODE, 0, true, true, 0}, + /* 01 */ {"Record Attack", "", 0, -1, SECRET_RECORDATTACK, 0, true, true, 0}, + /* 02 */ {"Play Credits", "", 10, -1, SECRET_CREDITS, 0, true, true, 0}, + /* 03 */ {"Sound Test", "", 20, -1, SECRET_SOUNDTEST, 0, true, true, 0}, - /* 03 */ {"Play Credits", "Complete 1P Mode", 30, 10, SECRET_CREDITS, 0, true, true, 0}, - /* 04 */ {"Sound Test", "Complete 1P Mode", 40, 10, SECRET_SOUNDTEST, 0, false, false, 0}, - - /* 05 */ {"EXTRA LEVELS", "", 60, 0, SECRET_HEADER, 0, true, true, 0}, - - /* 06 */ {"Aerial Garden Zone", "Complete 1P Mode w/ all emeralds", 70, 11, SECRET_WARP, 40, false, false, 0}, - /* 07 */ {"Azure Temple Zone", "Complete Aerial Garden Zone", 80, 20, SECRET_WARP, 41, false, false, 0}, - - /* 08 */ {"BONUS LEVELS", "", 100, 0, SECRET_HEADER, 0, true, true, 0}, - - /* 09 */ {"SRB1 Remake", "Collect 20 Emblems", 130, 40, SECRET_WARP, 101, false, false, 0}, - /* 10 */ {"Mario Koopa Blast", "Collect 60 Emblems", 110, 42, SECRET_WARP, 30, false, false, 0}, - /* 11 */ {"SRB1 Level Select", "Complete SRB1 Remake", 140, 21, SECRET_LEVELSELECT, 2, false, true, 0}, - - /* 12 */ {"Spring Hill Zone", "Collect 100 Emblems", 0, 44, SECRET_NONE, 0, false, false, 0}, - /* 13 */ {"Black Hole", "A Rank in all Special Stages", 0, 50, SECRET_NONE, 0, false, true, 0}, - - /* 14 */ {"Emblem Hints", "Collect 40 Emblems", 0, 41, SECRET_EMBLEMHINTS, 0, false, true, 0}, - /* 15 */ {"Emblem Radar", "Collect 80 Emblems", 0, 43, SECRET_ITEMFINDER, 0, false, true, 0}, - - /* 16 */ {"Pandora's Box", "Collect All Emblems", 0, 45, SECRET_PANDORA, 0, false, false, 0}, - /* 17 */ {"Level Select", "Collect All Emblems", 20, 45, SECRET_LEVELSELECT, 1, false, true, 0}, + /* 04 */ {"SNES Cup", "Collect 5 Emblems", 0, 1, SECRET_NONE, 0, false, false, 0}, + /* 05 */ {"Chaotic Kart Cup", "Collect 15 Emblems", 0, 2, SECRET_NONE, 0, false, false, 0}, }; // Default number of emblems and extra emblems -INT32 numemblems = 1; -INT32 numextraemblems = 5; +INT32 numemblems = 23; +INT32 numextraemblems = 1; -// DEFAULT CONDITION SETS FOR SRB2 2.1: +// DEFAULT CONDITION SETS FOR SRB2KART: void M_SetupDefaultConditionSets(void) { memset(conditionSets, 0, sizeof(conditionSets)); - // -- 1: Complete GFZ1 - M_AddRawCondition(1, 1, UC_MAPBEATEN, 1, 0, 0); + // -- 1: Collect 5 emblems OR play 25 matches + M_AddRawCondition(1, 1, UC_TOTALEMBLEMS, 5, 0, 0); + M_AddRawCondition(1, 2, UC_MATCHESPLAYED, 25, 0, 0); - // -- 2: Complete SS1 - M_AddRawCondition(2, 1, UC_MAPBEATEN, 50, 0, 0); + // -- 2: Collect 15 emblems OR play 50 matches + M_AddRawCondition(2, 1, UC_TOTALEMBLEMS, 15, 0, 0); + M_AddRawCondition(2, 2, UC_MATCHESPLAYED, 50, 0, 0); - // -- 10: Complete the game - M_AddRawCondition(10, 1, UC_GAMECLEAR, 1, 0, 0); - - // -- 11: Complete the game with all emeralds - M_AddRawCondition(11, 1, UC_ALLEMERALDS, 1, 0, 0); - - // -- 20: Beat AGZ - M_AddRawCondition(20, 1, UC_MAPBEATEN, 40, 0, 0); - - // -- 21: Beat SRB1 Remake - M_AddRawCondition(21, 1, UC_MAPBEATEN, 132, 0, 0); - - // -- 22: Beat Black Hole - M_AddRawCondition(22, 1, UC_MAPBEATEN, 57, 0, 0); - - // -- 30: Perfect Bonus - M_AddRawCondition(30, 1, UC_MAPPERFECT, 1, 0, 0); - M_AddRawCondition(30, 2, UC_MAPPERFECT, 2, 0, 0); - M_AddRawCondition(30, 3, UC_MAPPERFECT, 4, 0, 0); - M_AddRawCondition(30, 4, UC_MAPPERFECT, 5, 0, 0); - M_AddRawCondition(30, 5, UC_MAPPERFECT, 7, 0, 0); - M_AddRawCondition(30, 6, UC_MAPPERFECT, 8, 0, 0); - M_AddRawCondition(30, 7, UC_MAPPERFECT, 10, 0, 0); - M_AddRawCondition(30, 8, UC_MAPPERFECT, 11, 0, 0); - M_AddRawCondition(30, 9, UC_MAPPERFECT, 13, 0, 0); - M_AddRawCondition(30, 10, UC_MAPPERFECT, 16, 0, 0); - M_AddRawCondition(30, 11, UC_MAPPERFECT, 22, 0, 0); - M_AddRawCondition(30, 12, UC_MAPPERFECT, 23, 0, 0); - M_AddRawCondition(30, 13, UC_MAPPERFECT, 24, 0, 0); - M_AddRawCondition(30, 14, UC_MAPPERFECT, 40, 0, 0); - M_AddRawCondition(30, 15, UC_MAPPERFECT, 41, 0, 0); - - // -- 40: Find 20 emblems - M_AddRawCondition(40, 1, UC_TOTALEMBLEMS, 20, 0, 0); - - // -- 41: Find 40 emblems - M_AddRawCondition(41, 1, UC_TOTALEMBLEMS, 40, 0, 0); - - // -- 42: Find 60 emblems - M_AddRawCondition(42, 1, UC_TOTALEMBLEMS, 60, 0, 0); - - // -- 43: Find 80 emblems - M_AddRawCondition(43, 1, UC_TOTALEMBLEMS, 80, 0, 0); - - // -- 44: Find 100 emblems - M_AddRawCondition(44, 1, UC_TOTALEMBLEMS, 100, 0, 0); - - // -- 45: Find 160 (all) emblems - M_AddRawCondition(45, 1, UC_TOTALEMBLEMS, 160, 0, 0); - - // -- 50: A rank all NiGHTS special stages - M_AddRawCondition(50, 1, UC_NIGHTSGRADE, GRADE_A, 50, 0); - M_AddRawCondition(50, 1, UC_NIGHTSGRADE, GRADE_A, 51, 0); - M_AddRawCondition(50, 1, UC_NIGHTSGRADE, GRADE_A, 52, 0); - M_AddRawCondition(50, 1, UC_NIGHTSGRADE, GRADE_A, 53, 0); - M_AddRawCondition(50, 1, UC_NIGHTSGRADE, GRADE_A, 54, 0); - M_AddRawCondition(50, 1, UC_NIGHTSGRADE, GRADE_A, 55, 0); - M_AddRawCondition(50, 1, UC_NIGHTSGRADE, GRADE_A, 56, 0); + // -- 10: Play 100 matches + M_AddRawCondition(10, 1, UC_TOTALEMBLEMS, 20, 0, 0); } void M_AddRawCondition(UINT8 set, UINT8 id, conditiontype_t c, INT32 r, INT16 x1, INT16 x2) From b600fae9ba4e604c639df63b6a6d70dba86b751d Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 16 Jan 2018 18:02:16 -0500 Subject: [PATCH 03/14] fut --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index 082f79ca..976a6ab0 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4831,7 +4831,7 @@ static void K_drawKartSpeedometer(void) else if (cv_speedometer.value == 3) { convSpeed = FixedDiv(stplyr->speed, mapheaderinfo[gamemap-1]->mobj_scale)/FRACUNIT; - V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%3d fu/s", convSpeed)); + V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%3d fu/t", convSpeed)); } } From abfefd3d51bc748b62454f6d7a7b59af0c38ebc1 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 16 Jan 2018 21:58:48 -0500 Subject: [PATCH 04/14] No more analog mode It doesn't work well in SRB2Kart :V Also fixed the player setup name field's _ being 8 px too far to the right --- src/d_netcmd.c | 4 ++-- src/m_menu.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index ca63df69..e07cbece 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -833,14 +833,14 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_joyscale4); // Analog Control - CV_RegisterVar(&cv_analog); + /*CV_RegisterVar(&cv_analog); CV_RegisterVar(&cv_analog2); CV_RegisterVar(&cv_analog3); CV_RegisterVar(&cv_analog4); CV_RegisterVar(&cv_useranalog); CV_RegisterVar(&cv_useranalog2); CV_RegisterVar(&cv_useranalog3); - CV_RegisterVar(&cv_useranalog4); + CV_RegisterVar(&cv_useranalog4);*/ // s_sound.c CV_RegisterVar(&cv_soundvolume); diff --git a/src/m_menu.c b/src/m_menu.c index 4b9ac354..e5e0918d 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1064,7 +1064,7 @@ static menuitem_t OP_P1ControlsMenu[] = {IT_STRING | IT_CVAR, NULL, "Camera" , &cv_chasecam , 50}, {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair , 60}, - {IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog, 80}, + //{IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog, 80}, }; static menuitem_t OP_P2ControlsMenu[] = @@ -1076,7 +1076,7 @@ static menuitem_t OP_P2ControlsMenu[] = {IT_STRING | IT_CVAR, NULL, "Camera" , &cv_chasecam2 , 50}, {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair2, 60}, - {IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog2, 70}, + //{IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog2, 70}, }; #ifndef NOFOURPLAYER @@ -1088,7 +1088,7 @@ static menuitem_t OP_P3ControlsMenu[] = {IT_STRING | IT_CVAR, NULL, "Camera" , &cv_chasecam3 , 40}, {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair3, 50}, - {IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog3, 60}, + //{IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog3, 60}, }; static menuitem_t OP_P4ControlsMenu[] = @@ -1099,7 +1099,7 @@ static menuitem_t OP_P4ControlsMenu[] = {IT_STRING | IT_CVAR, NULL, "Camera" , &cv_chasecam4 , 40}, {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair4, 50}, - {IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog4, 60}, + //{IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog4, 60}, }; #endif @@ -6692,7 +6692,7 @@ static void M_DrawSetupMultiPlayerMenu(void) // draw text cursor for name if (!itemOn && skullAnimCounter < 4) // blink cursor - V_DrawCharacter(mx + 48 + V_StringWidth(setupm_name, 0), my, '_',false); + V_DrawCharacter(mx + 40 + V_StringWidth(setupm_name, 0), my, '_',false); // SRB2Kart: draw the stat backer V_DrawFixedPatch((mx+141)< Date: Tue, 16 Jan 2018 22:32:39 -0500 Subject: [PATCH 05/14] Use KARTKREW instead of CONSBACK Less lump redundancy, no longer need the poor downscaled version :V --- src/console.c | 8 ++++---- src/d_main.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/console.c b/src/console.c index 2270c51f..422aded7 100644 --- a/src/console.c +++ b/src/console.c @@ -1230,7 +1230,7 @@ void CONS_Printf(const char *fmt, ...) patch_t *con_backpic; if (con_backpic_lumpnum == UINT32_MAX) - con_backpic_lumpnum = W_GetNumForName("CONSBACK"); + con_backpic_lumpnum = W_GetNumForName("KARTKREW"); // We load the raw lump, even in hardware mode con_backpic = (patch_t*)W_CacheLumpNum(con_backpic_lumpnum, PU_CACHE); @@ -1475,7 +1475,7 @@ static void CON_DrawBackpic(patch_t *pic, INT32 startx, INT32 destwidth) { (void)startx; (void)destwidth; - V_DrawScaledPatch(0, 0, 0, pic); + V_DrawFixedPatch(0, 0, FRACUNIT/2, 0, pic, NULL); } #if 0 @@ -1551,12 +1551,12 @@ static void CON_DrawConsole(void) patch_t *con_backpic; if (con_backpic_lumpnum == UINT32_MAX) - con_backpic_lumpnum = W_GetNumForName("CONSBACK"); + con_backpic_lumpnum = W_GetNumForName("KARTKREW"); con_backpic = (patch_t*)W_CachePatchNum(con_backpic_lumpnum, PU_CACHE); if (rendermode != render_soft) - V_DrawScaledPatch(0, 0, 0, con_backpic); + V_DrawFixedPatch(0, 0, FRACUNIT/2, 0, con_backpic, NULL); else if (rendermode != render_none) CON_DrawBackpic(con_backpic, 0, vid.width); // picture as background diff --git a/src/d_main.c b/src/d_main.c index f94331cd..ebbdc6ba 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -638,7 +638,7 @@ void D_SRB2Loop(void) COM_ImmedExecute("cls;version"); if (rendermode == render_soft) - V_DrawScaledPatch(0, 0, 0, (patch_t *)W_CacheLumpNum(W_GetNumForName("CONSBACK"), PU_CACHE)); + V_DrawFixedPatch(0, 0, FRACUNIT/2, 0, (patch_t *)W_CacheLumpNum(W_GetNumForName("KARTKREW"), PU_CACHE), NULL); I_FinishUpdate(); // page flip or blit buffer for (;;) From 672c4b5298c01d4f69c67ef1f7b560ebcf1a1cf4 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 21 Jan 2018 19:15:26 -0500 Subject: [PATCH 06/14] Record best lap time in Record Attack - Record Attack replays now save best lap time - Removed instances of NiGHTS Attack - Removed a lot of unlockable that have no use in Kart (ultimate mode, perfect bonus, score emblems, etc) - Removed all methods of activating ultimate mode --- src/d_clisrv.c | 3 + src/d_clisrv.h | 1 + src/d_main.c | 4 +- src/d_netcmd.c | 3 +- src/d_player.h | 1 + src/dehacked.c | 50 +++++------ src/doomstat.h | 32 +++---- src/f_finale.c | 4 +- src/g_game.c | 148 +++++++++++++++++++------------ src/g_game.h | 21 ++--- src/hu_stuff.c | 25 +++--- src/hu_stuff.h | 3 +- src/lua_playerlib.c | 4 + src/m_cheat.c | 12 +-- src/m_cond.c | 52 +++++------ src/m_cond.h | 36 ++++---- src/m_menu.c | 211 ++++++++++++++++++++++++-------------------- src/p_saveg.c | 16 ++++ src/p_setup.c | 30 ++----- src/p_spec.c | 4 + src/p_user.c | 39 ++++---- src/y_inter.c | 24 +++-- 22 files changed, 406 insertions(+), 317 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index dea76923..53288db7 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -940,6 +940,7 @@ static inline void resynch_write_others(resynchend_pak *rst) rst->numboxes[i] = 0; rst->totalring[i] = 0; rst->realtime[i] = 0; + rst->laptime[i] = 0; rst->laps[i] = 0; continue; } @@ -951,6 +952,7 @@ static inline void resynch_write_others(resynchend_pak *rst) rst->numboxes[i] = SHORT(players[i].numboxes); rst->totalring[i] = SHORT(players[i].totalring); rst->realtime[i] = (tic_t)LONG(players[i].realtime); + rst->laptime[i] = (tic_t)LONG(players[i].laptime); rst->laps[i] = players[i].laps; } @@ -972,6 +974,7 @@ static inline void resynch_read_others(resynchend_pak *p) players[i].numboxes = SHORT(p->numboxes[i]); players[i].totalring = SHORT(p->totalring[i]); players[i].realtime = (tic_t)LONG(p->realtime[i]); + players[i].laptime = (tic_t)LONG(p->laptime[i]); players[i].laps = p->laps[i]; } } diff --git a/src/d_clisrv.h b/src/d_clisrv.h index 2d49bd61..d298d8a5 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -169,6 +169,7 @@ typedef struct INT16 numboxes[MAXPLAYERS]; INT16 totalring[MAXPLAYERS]; tic_t realtime[MAXPLAYERS]; + tic_t laptime[MAXPLAYERS]; UINT8 laps[MAXPLAYERS]; } ATTRPACK resynchend_pak; diff --git a/src/d_main.c b/src/d_main.c index ebbdc6ba..91b9a248 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1409,11 +1409,11 @@ void D_SRB2Main(void) return; } - if (M_CheckParm("-ultimatemode")) + /*if (M_CheckParm("-ultimatemode")) { autostart = true; ultimatemode = true; - } + }*/ if (autostart || netgame || M_CheckParm("+connect") || M_CheckParm("-connect")) { diff --git a/src/d_netcmd.c b/src/d_netcmd.c index e07cbece..fb518271 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -751,9 +751,8 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_itemfinder); // time attack ghost options are also saved to config - CV_RegisterVar(&cv_ghost_bestscore); CV_RegisterVar(&cv_ghost_besttime); - //CV_RegisterVar(&cv_ghost_bestlap); + CV_RegisterVar(&cv_ghost_bestlap); CV_RegisterVar(&cv_ghost_last); CV_RegisterVar(&cv_ghost_guest); CV_RegisterVar(&cv_ghost_staff); diff --git a/src/d_player.h b/src/d_player.h index ccb428e1..9f8b4e5f 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -463,6 +463,7 @@ typedef struct player_s INT16 numboxes; // Number of item boxes obtained for Race Mode INT16 totalring; // Total number of rings obtained for Race Mode tic_t realtime; // integer replacement for leveltime + tic_t laptime; // SRB2kart: Time spent on current lap, used for Record Attack UINT8 laps; // Number of laps (optional) //////////////////// diff --git a/src/dehacked.c b/src/dehacked.c index 7d54ce00..a7722d90 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -2175,16 +2175,16 @@ static void reademblemdata(MYFILE *f, INT32 num) emblemlocations[num-1].type = ET_GLOBAL; else if (fastcmp(word2, "SKIN")) emblemlocations[num-1].type = ET_SKIN; - else if (fastcmp(word2, "SCORE")) - emblemlocations[num-1].type = ET_SCORE; + /*else if (fastcmp(word2, "SCORE")) + emblemlocations[num-1].type = ET_SCORE;*/ else if (fastcmp(word2, "TIME")) emblemlocations[num-1].type = ET_TIME; - else if (fastcmp(word2, "RINGS")) + /*else if (fastcmp(word2, "RINGS")) emblemlocations[num-1].type = ET_RINGS; else if (fastcmp(word2, "NGRADE")) emblemlocations[num-1].type = ET_NGRADE; else if (fastcmp(word2, "NTIME")) - emblemlocations[num-1].type = ET_NTIME; + emblemlocations[num-1].type = ET_NTIME;*/ else emblemlocations[num-1].type = (UINT8)value; } @@ -2229,24 +2229,24 @@ static void reademblemdata(MYFILE *f, INT32 num) // Default sprite and color definitions for lazy people like me if (!emblemlocations[num-1].sprite) switch (emblemlocations[num-1].type) { - case ET_RINGS: + /*case ET_RINGS: emblemlocations[num-1].sprite = 'R'; break; case ET_SCORE: case ET_NGRADE: - emblemlocations[num-1].sprite = 'S'; break; - case ET_TIME: case ET_NTIME: + emblemlocations[num-1].sprite = 'S'; break;*/ + case ET_TIME: //case ET_NTIME: emblemlocations[num-1].sprite = 'T'; break; default: emblemlocations[num-1].sprite = 'A'; break; } if (!emblemlocations[num-1].color) switch (emblemlocations[num-1].type) { - case ET_RINGS: + /*case ET_RINGS: emblemlocations[num-1].color = SKINCOLOR_GOLD; break; case ET_SCORE: emblemlocations[num-1].color = SKINCOLOR_BROWN; break; case ET_NGRADE: - emblemlocations[num-1].color = SKINCOLOR_TEAL; break; - case ET_TIME: case ET_NTIME: + emblemlocations[num-1].color = SKINCOLOR_TEAL; break;*/ + case ET_TIME: //case ET_NTIME: emblemlocations[num-1].color = SKINCOLOR_GREY; break; default: emblemlocations[num-1].color = SKINCOLOR_BLUE; break; @@ -2485,25 +2485,25 @@ static void readcondition(UINT8 set, UINT32 id, char *word2) re = atoi(params[1]); } else if ((offset=0) || fastcmp(params[0], "GAMECLEAR") - || (++offset && fastcmp(params[0], "ALLEMERALDS")) - || (++offset && fastcmp(params[0], "ULTIMATECLEAR"))) + || (++offset && fastcmp(params[0], "ALLEMERALDS"))) + //|| (++offset && fastcmp(params[0], "ULTIMATECLEAR"))) { ty = UC_GAMECLEAR + offset; re = (params[1]) ? atoi(params[1]) : 1; } - else if ((offset=0) || fastcmp(params[0], "OVERALLSCORE") - || (++offset && fastcmp(params[0], "OVERALLTIME")) - || (++offset && fastcmp(params[0], "OVERALLRINGS"))) + else if ((offset=0) || fastcmp(params[0], "OVERALLTIME")) + //|| (++offset && fastcmp(params[0], "OVERALLSCORE")) + //|| (++offset && fastcmp(params[0], "OVERALLRINGS"))) { PARAMCHECK(1); - ty = UC_OVERALLSCORE + offset; + ty = UC_OVERALLTIME + offset; re = atoi(params[1]); } else if ((offset=0) || fastcmp(params[0], "MAPVISITED") || (++offset && fastcmp(params[0], "MAPBEATEN")) - || (++offset && fastcmp(params[0], "MAPALLEMERALDS")) - || (++offset && fastcmp(params[0], "MAPULTIMATE")) - || (++offset && fastcmp(params[0], "MAPPERFECT"))) + || (++offset && fastcmp(params[0], "MAPALLEMERALDS"))) + //|| (++offset && fastcmp(params[0], "MAPULTIMATE")) + //|| (++offset && fastcmp(params[0], "MAPPERFECT"))) { PARAMCHECK(1); ty = UC_MAPVISITED + offset; @@ -2520,12 +2520,12 @@ static void readcondition(UINT8 set, UINT32 id, char *word2) return; } } - else if ((offset=0) || fastcmp(params[0], "MAPSCORE") - || (++offset && fastcmp(params[0], "MAPTIME")) - || (++offset && fastcmp(params[0], "MAPRINGS"))) + else if ((offset=0) || fastcmp(params[0], "MAPTIME")) + //|| (++offset && fastcmp(params[0], "MAPSCORE")) + //|| (++offset && fastcmp(params[0], "MAPRINGS"))) { PARAMCHECK(2); - ty = UC_MAPSCORE + offset; + ty = UC_MAPTIME + offset; re = atoi(params[2]); // Convert to map number if it appears to be one @@ -2540,7 +2540,7 @@ static void readcondition(UINT8 set, UINT32 id, char *word2) return; } } - else if ((offset=0) || fastcmp(params[0], "NIGHTSSCORE") + /*else if ((offset=0) || fastcmp(params[0], "NIGHTSSCORE") || (++offset && fastcmp(params[0], "NIGHTSTIME")) || (++offset && fastcmp(params[0], "NIGHTSGRADE"))) { @@ -2567,7 +2567,7 @@ static void readcondition(UINT8 set, UINT32 id, char *word2) else x2 = 0; - } + }*/ else if (fastcmp(params[0], "TRIGGER")) { PARAMCHECK(1); diff --git a/src/doomstat.h b/src/doomstat.h index 25fa25a3..ed06e49c 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -62,7 +62,7 @@ extern boolean metalrecording; #define ATTACKING_NONE 0 #define ATTACKING_RECORD 1 -#define ATTACKING_NIGHTS 2 +//#define ATTACKING_NIGHTS 2 extern UINT8 modeattacking; // menu demo things @@ -343,9 +343,10 @@ extern INT32 nummaprings, nummapboxes, numgotboxes; //keep track of spawned ring */ typedef struct { - tic_t time; ///< Time in which the level was finished. - UINT32 score; ///< Score when the level was finished. - UINT16 rings; ///< Rings when the level was finished. + tic_t time; ///< Time in which the level was finished. + tic_t lap; ///< Best lap time for this level. + //UINT32 score; ///< Score when the level was finished. + //UINT16 rings; ///< Rings when the level was finished. } recorddata_t; /** Setup for one NiGHTS map. @@ -359,29 +360,29 @@ typedef struct #define GRADE_A 5 #define GRADE_S 6 -typedef struct +/*typedef struct { // 8 mares, 1 overall (0) UINT8 nummares; UINT32 score[9]; UINT8 grade[9]; tic_t time[9]; -} nightsdata_t; +} nightsdata_t;*/ -extern nightsdata_t *nightsrecords[NUMMAPS]; +//extern nightsdata_t *nightsrecords[NUMMAPS]; extern recorddata_t *mainrecords[NUMMAPS]; // mapvisited is now a set of flags that says what we've done in the map. -#define MV_VISITED 1 -#define MV_BEATEN 2 -#define MV_ALLEMERALDS 4 -#define MV_ULTIMATE 8 -#define MV_PERFECT 16 -#define MV_MAX 31 // used in gamedata check +#define MV_VISITED 1 +#define MV_BEATEN 2 +#define MV_ALLEMERALDS 4 +//#define MV_ULTIMATE 8 +//#define MV_PERFECT 16 +#define MV_MAX 7 // used in gamedata check extern UINT8 mapvisited[NUMMAPS]; // Temporary holding place for nights data for the current map -nightsdata_t ntemprecords; +//nightsdata_t ntemprecords; extern UINT32 token; ///< Number of tokens collected in a level extern UINT32 tokenlist; ///< List of tokens collected @@ -443,12 +444,13 @@ extern UINT8 gamespeed; extern boolean franticitems; extern boolean mirrormode; extern boolean comeback; +extern tic_t bestlap; extern tic_t hidetime; extern UINT32 timesBeaten; // # of times the game has been beaten. extern UINT32 timesBeatenWithEmeralds; -extern UINT32 timesBeatenUltimate; +//extern UINT32 timesBeatenUltimate; // =========================== // Internal parameters, fixed. diff --git a/src/f_finale.c b/src/f_finale.c index d9c9597a..710ff78f 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -816,8 +816,8 @@ void F_GameEvaluationDrawer(void) if (ALL7EMERALDS(emeralds)) ++timesBeatenWithEmeralds; - if (ultimatemode) - ++timesBeatenUltimate; + /*if (ultimatemode) + ++timesBeatenUltimate;*/ if (M_UpdateUnlockablesAndExtraEmblems()) S_StartSound(NULL, sfx_ncitem); diff --git a/src/g_game.c b/src/g_game.c index 1b958cf2..0770276e 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -173,11 +173,11 @@ boolean gamedataloaded = false; // Time attack data for levels // These are dynamically allocated for space reasons now recorddata_t *mainrecords[NUMMAPS] = {NULL}; -nightsdata_t *nightsrecords[NUMMAPS] = {NULL}; +//nightsdata_t *nightsrecords[NUMMAPS] = {NULL}; UINT8 mapvisited[NUMMAPS]; // Temporary holding place for nights data for the current map -nightsdata_t ntemprecords; +//nightsdata_t ntemprecords; UINT32 bluescore, redscore; // CTF and Team Match team scores @@ -244,13 +244,14 @@ UINT8 gamespeed; // Game's current speed (or difficulty, or cc, or etc); 0-2 for boolean mirrormode; // Mirror Mode currently enabled? boolean franticitems; // Frantic items currently enabled? boolean comeback; // Battle Mode's karma comeback is on/off +tic_t bestlap; // Best lap time, should be local tic_t hidetime; // Grading UINT32 timesBeaten; UINT32 timesBeatenWithEmeralds; -UINT32 timesBeatenUltimate; +//UINT32 timesBeatenUltimate; static char demoname[64]; boolean demorecording; @@ -538,12 +539,12 @@ void G_AllocMainRecordData(INT16 i) memset(mainrecords[i], 0, sizeof(recorddata_t)); } -void G_AllocNightsRecordData(INT16 i) +/*void G_AllocNightsRecordData(INT16 i) { if (!nightsrecords[i]) nightsrecords[i] = Z_Malloc(sizeof(nightsdata_t), PU_STATIC, NULL); memset(nightsrecords[i], 0, sizeof(nightsdata_t)); -} +}*/ // MAKE SURE YOU SAVE DATA BEFORE CALLING THIS void G_ClearRecords(void) @@ -556,22 +557,22 @@ void G_ClearRecords(void) Z_Free(mainrecords[i]); mainrecords[i] = NULL; } - if (nightsrecords[i]) + /*if (nightsrecords[i]) { Z_Free(nightsrecords[i]); nightsrecords[i] = NULL; - } + }*/ } } // For easy retrieval of records -UINT32 G_GetBestScore(INT16 map) +/*UINT32 G_GetBestScore(INT16 map) { if (!mainrecords[map-1]) return 0; return mainrecords[map-1]->score; -} +}*/ tic_t G_GetBestTime(INT16 map) { @@ -581,15 +582,25 @@ tic_t G_GetBestTime(INT16 map) return mainrecords[map-1]->time; } -UINT16 G_GetBestRings(INT16 map) +// Not needed +/*tic_t G_GetBestLap(INT16 map) +{ + if (!mainrecords[map-1] || mainrecords[map-1]->lap <= 0) + return (tic_t)UINT32_MAX; + + return mainrecords[map-1]->lap; +}*/ + +/*UINT16 G_GetBestRings(INT16 map) { if (!mainrecords[map-1]) return 0; return mainrecords[map-1]->rings; -} +}*/ -UINT32 G_GetBestNightsScore(INT16 map, UINT8 mare) +// No NiGHTS records for SRB2Kart +/*UINT32 G_GetBestNightsScore(INT16 map, UINT8 mare) { if (!nightsrecords[map-1]) return 0; @@ -733,7 +744,7 @@ void G_SetNightsRecords(void) // If the mare count changed, this will update the score display CV_AddValue(&cv_nextmap, 1); CV_AddValue(&cv_nextmap, -1); -} +}*/ // for consistency among messages: this modifies the game and removes savemoddata. void G_SetGameModified(boolean silent) @@ -2254,6 +2265,17 @@ static inline void G_PlayerFinishLevel(INT32 player) if (rendermode == render_soft) V_SetPaletteLump(GetPalette()); // Reset the palette + + // SRB2kart: Increment the "matches played" counter. + if (player == consoleplayer && ((!modifiedgame || savemoddata) && !demoplayback)) // SRB2kart: Yes, let stuff unlock stuff in MP + { + matchesplayed++; + if (M_UpdateUnlockablesAndExtraEmblems()) + { + S_StartSound(NULL, sfx_ncitem); + G_SaveGameData(); // only save if unlocked something + } + } } // @@ -2312,6 +2334,7 @@ void G_PlayerReborn(INT32 player) INT32 balloon; INT32 comebackpoints; INT32 comebackshowninfo; + tic_t laptime; score = players[player].score; lives = players[player].lives; @@ -2370,6 +2393,7 @@ void G_PlayerReborn(INT32 player) balloon = players[player].kartstuff[k_balloon]; comebackpoints = players[player].kartstuff[k_comebackpoints]; comebackshowninfo = players[player].kartstuff[k_comebackshowninfo]; + laptime = players[player].laptime; p = &players[player]; memset(p, 0, sizeof (*p)); @@ -2432,6 +2456,8 @@ void G_PlayerReborn(INT32 player) p->kartstuff[k_comebackshowninfo] = comebackshowninfo; p->kartstuff[k_comebacktimer] = comebacktime; + p->laptime = laptime; + // Don't do anything immediately p->pflags |= PF_USEDOWN; p->pflags |= PF_ATTACKDOWN; @@ -3338,12 +3364,13 @@ void G_LoadGameData(void) UINT8 rtemp; //For records - UINT32 recscore; - tic_t rectime; - UINT16 recrings; + tic_t rectime; + tic_t reclap; + //UINT32 recscore; + //UINT16 recrings; - UINT8 recmares; - INT32 curmare; + //UINT8 recmares; + //INT32 curmare; // Clear things so previously read gamedata doesn't transfer // to new gamedata @@ -3427,29 +3454,31 @@ void G_LoadGameData(void) timesBeaten = READUINT32(save_p); timesBeatenWithEmeralds = READUINT32(save_p); - timesBeatenUltimate = READUINT32(save_p); + //timesBeatenUltimate = READUINT32(save_p); // Main records for (i = 0; i < NUMMAPS; ++i) { - recscore = READUINT32(save_p); - rectime = (tic_t)READUINT32(save_p); - recrings = READUINT16(save_p); + rectime = (tic_t)READUINT32(save_p); + reclap = (tic_t)READUINT32(save_p); + //recscore = READUINT32(save_p); + //recrings = READUINT16(save_p); - if (recrings > 10000 || recscore > MAXSCORE) - goto datacorrupt; + /*if (recrings > 10000 || recscore > MAXSCORE) + goto datacorrupt;*/ - if (recscore || rectime || recrings) + if (rectime || reclap) { G_AllocMainRecordData((INT16)i); - mainrecords[i]->score = recscore; mainrecords[i]->time = rectime; - mainrecords[i]->rings = recrings; + mainrecords[i]->lap = reclap; + //mainrecords[i]->score = recscore; + //mainrecords[i]->rings = recrings; } } // Nights records - for (i = 0; i < NUMMAPS; ++i) + /*for (i = 0; i < NUMMAPS; ++i) { if ((recmares = READUINT8(save_p)) == 0) continue; @@ -3467,7 +3496,7 @@ void G_LoadGameData(void) } nightsrecords[i]->nummares = recmares; - } + }*/ // done Z_Free(savebuffer); @@ -3500,7 +3529,7 @@ void G_SaveGameData(void) INT32 i, j; UINT8 btemp; - INT32 curmare; + //INT32 curmare; if (!gamedataloaded) return; // If never loaded (-nodata), don't save @@ -3568,27 +3597,27 @@ void G_SaveGameData(void) WRITEUINT32(save_p, timesBeaten); WRITEUINT32(save_p, timesBeatenWithEmeralds); - WRITEUINT32(save_p, timesBeatenUltimate); + //WRITEUINT32(save_p, timesBeatenUltimate); // Main records for (i = 0; i < NUMMAPS; i++) { if (mainrecords[i]) { - WRITEUINT32(save_p, mainrecords[i]->score); WRITEUINT32(save_p, mainrecords[i]->time); - WRITEUINT16(save_p, mainrecords[i]->rings); + WRITEUINT32(save_p, mainrecords[i]->lap); + //WRITEUINT32(save_p, mainrecords[i]->score); + //WRITEUINT16(save_p, mainrecords[i]->rings); } else { WRITEUINT32(save_p, 0); WRITEUINT32(save_p, 0); - WRITEUINT16(save_p, 0); } } // NiGHTS records - for (i = 0; i < NUMMAPS; i++) + /*for (i = 0; i < NUMMAPS; i++) { if (!nightsrecords[i] || !nightsrecords[i]->nummares) { @@ -3604,7 +3633,7 @@ void G_SaveGameData(void) WRITEUINT8(save_p, nightsrecords[i]->grade[curmare]); WRITEUINT32(save_p, nightsrecords[i]->time[curmare]); } - } + }*/ length = save_p - savebuffer; @@ -4970,12 +4999,13 @@ void G_BeginRecording(void) case ATTACKING_RECORD: // 1 demotime_p = demo_p; WRITEUINT32(demo_p,UINT32_MAX); // time + WRITEUINT32(demo_p,UINT32_MAX); // lap break; - case ATTACKING_NIGHTS: // 2 + /*case ATTACKING_NIGHTS: // 2 demotime_p = demo_p; WRITEUINT32(demo_p,UINT32_MAX); // time WRITEUINT32(demo_p,0); // score - break; + break;*/ default: // 3 break; } @@ -5076,21 +5106,22 @@ void G_BeginMetal(void) oldmetal.angle = mo->angle; } -void G_SetDemoTime(UINT32 ptime, UINT32 pscore) +void G_SetDemoTime(UINT32 ptime, UINT32 plap) { if (!demorecording || !demotime_p) return; if (demoflags & DF_RECORDATTACK) { WRITEUINT32(demotime_p, ptime); + WRITEUINT32(demotime_p, plap); demotime_p = NULL; } - else if (demoflags & DF_NIGHTSATTACK) + /*else if (demoflags & DF_NIGHTSATTACK) { WRITEUINT32(demotime_p, ptime); WRITEUINT32(demotime_p, pscore); demotime_p = NULL; - } + }*/ } // Returns bitfield: @@ -5101,7 +5132,7 @@ UINT8 G_CmpDemoTime(char *oldname, char *newname) { UINT8 *buffer,*p; UINT8 flags; - UINT32 oldtime, newtime, oldscore, newscore; + UINT32 oldtime, newtime, oldlap, newlap; UINT16 oldversion; size_t bufsize ATTRUNUSED; UINT8 c; @@ -5135,13 +5166,13 @@ UINT8 G_CmpDemoTime(char *oldname, char *newname) if (flags & DF_RECORDATTACK) { newtime = READUINT32(p); - newscore = 0; + newlap = READUINT32(p); } - else if (flags & DF_NIGHTSATTACK) + /*else if (flags & DF_NIGHTSATTACK) { newtime = READUINT32(p); newscore = READUINT32(p); - } + }*/ else // appease compiler return 0; @@ -5195,13 +5226,13 @@ UINT8 G_CmpDemoTime(char *oldname, char *newname) if (flags & DF_RECORDATTACK) { oldtime = READUINT32(p); - oldscore = 0; + oldlap = READUINT32(p); } - else if (flags & DF_NIGHTSATTACK) + /*else if (flags & DF_NIGHTSATTACK) { oldtime = READUINT32(p); oldscore = READUINT32(p); - } + }*/ else // appease compiler return UINT8_MAX; @@ -5209,11 +5240,11 @@ UINT8 G_CmpDemoTime(char *oldname, char *newname) c = 0; if (newtime < oldtime - || (newtime == oldtime && (newscore > oldscore))) + || (newtime == oldtime && (newlap < oldlap))) c |= 1; // Better time - if (newscore > oldscore - || (newscore == oldscore && newtime < oldtime)) - c |= 1<<1; // Better score + if (newlap < oldlap + || (newlap == oldlap && newtime < oldtime)) + c |= 1<<1; // Better lap time return c; } @@ -5331,8 +5362,8 @@ void G_DoPlayDemo(char *defdemoname) modeattacking = (demoflags & DF_ATTACKMASK)>>DF_ATTACKSHIFT; CON_ToggleOff(); - hu_demoscore = 0; hu_demotime = UINT32_MAX; + hu_demolap = UINT32_MAX; switch (modeattacking) { @@ -5340,11 +5371,12 @@ void G_DoPlayDemo(char *defdemoname) break; case ATTACKING_RECORD: // 1 hu_demotime = READUINT32(demo_p); + hu_demolap = READUINT32(demo_p); break; - case ATTACKING_NIGHTS: // 2 + /*case ATTACKING_NIGHTS: // 2 hu_demotime = READUINT32(demo_p); hu_demoscore = READUINT32(demo_p); - break; + break;*/ default: // 3 modeattacking = ATTACKING_NONE; break; @@ -5560,11 +5592,11 @@ void G_AddGhost(char *defdemoname) case ATTACKING_NONE: // 0 break; case ATTACKING_RECORD: // 1 - p += 4; // demo time + p += 8; // demo time, lap break; - case ATTACKING_NIGHTS: // 2 + /*case ATTACKING_NIGHTS: // 2 p += 8; // demo time left, score - break; + break;*/ default: // 3 break; } diff --git a/src/g_game.h b/src/g_game.h index ec8a1817..1c3c8977 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -60,7 +60,7 @@ extern consvar_t cv_sideaxis,cv_turnaxis,cv_moveaxis,cv_lookaxis,cv_fireaxis,cv_ extern consvar_t cv_sideaxis2,cv_turnaxis2,cv_moveaxis2,cv_lookaxis2,cv_fireaxis2,cv_firenaxis2; extern consvar_t cv_sideaxis3,cv_turnaxis3,cv_moveaxis3,cv_lookaxis3,cv_fireaxis3,cv_firenaxis3; extern consvar_t cv_sideaxis4,cv_turnaxis4,cv_moveaxis4,cv_lookaxis4,cv_fireaxis4,cv_firenaxis4; -extern consvar_t cv_ghost_bestscore, cv_ghost_besttime, cv_ghost_last, cv_ghost_guest, cv_ghost_staff; //cv_ghost_bestlap +extern consvar_t cv_ghost_besttime, cv_ghost_bestlap, cv_ghost_last, cv_ghost_guest, cv_ghost_staff; // mouseaiming (looking up/down with the mouse or keyboard) #define KB_LOOKSPEED (1<<25) @@ -121,7 +121,7 @@ void G_BeginRecording(void); void G_BeginMetal(void); // Only called by shutdown code. -void G_SetDemoTime(UINT32 ptime, UINT32 pscore); +void G_SetDemoTime(UINT32 ptime, UINT32 plap); UINT8 G_CmpDemoTime(char *oldname, char *newname); typedef enum @@ -196,18 +196,19 @@ void G_SetGamestate(gamestate_t newstate); // Gamedata record shit void G_AllocMainRecordData(INT16 i); -void G_AllocNightsRecordData(INT16 i); +//void G_AllocNightsRecordData(INT16 i); void G_ClearRecords(void); -UINT32 G_GetBestScore(INT16 map); +//UINT32 G_GetBestScore(INT16 map); tic_t G_GetBestTime(INT16 map); -UINT16 G_GetBestRings(INT16 map); -UINT32 G_GetBestNightsScore(INT16 map, UINT8 mare); -tic_t G_GetBestNightsTime(INT16 map, UINT8 mare); -UINT8 G_GetBestNightsGrade(INT16 map, UINT8 mare); +//tic_t G_GetBestLap(INT16 map); +//UINT16 G_GetBestRings(INT16 map); +//UINT32 G_GetBestNightsScore(INT16 map, UINT8 mare); +//tic_t G_GetBestNightsTime(INT16 map, UINT8 mare); +//UINT8 G_GetBestNightsGrade(INT16 map, UINT8 mare); -void G_AddTempNightsRecords(UINT32 pscore, tic_t ptime, UINT8 mare); -void G_SetNightsRecords(void); +//void G_AddTempNightsRecords(UINT32 pscore, tic_t ptime, UINT8 mare); +//void G_SetNightsRecords(void); FUNCMATH INT32 G_TicsToHours(tic_t tics); FUNCMATH INT32 G_TicsToMinutes(tic_t tics, boolean full); diff --git a/src/hu_stuff.c b/src/hu_stuff.c index abc94f59..9781b76b 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -1101,30 +1101,31 @@ static void HU_drawGametype(void) // // demo info stuff // -UINT32 hu_demoscore; UINT32 hu_demotime; +UINT32 hu_demolap; static void HU_DrawDemoInfo(void) { - UINT8 timeoffset = 8; V_DrawString(4, 188-16, V_YELLOWMAP, va(M_GetText("%s's replay"), player_names[0])); if (modeattacking) { - if (modeattacking == ATTACKING_NIGHTS) - { - V_DrawString(4, 188-8, V_YELLOWMAP|V_MONOSPACE, "SCORE:"); - V_DrawRightAlignedString(120, 188-8, V_MONOSPACE, va("%d", hu_demoscore)); - timeoffset = 0; - } - - V_DrawString(4, 188- timeoffset, V_YELLOWMAP|V_MONOSPACE, "TIME:"); + V_DrawString(4, 188-8, V_YELLOWMAP|V_MONOSPACE, "BEST TIME:"); if (hu_demotime != UINT32_MAX) - V_DrawRightAlignedString(120, 188- timeoffset, V_MONOSPACE, va("%i:%02i.%02i", + V_DrawRightAlignedString(120, 188-8, V_MONOSPACE, va("%i:%02i.%02i", G_TicsToMinutes(hu_demotime,true), G_TicsToSeconds(hu_demotime), G_TicsToCentiseconds(hu_demotime))); else - V_DrawRightAlignedString(120, 188- timeoffset, V_MONOSPACE, "--:--.--"); + V_DrawRightAlignedString(120, 188-8, V_MONOSPACE, "--:--.--"); + + V_DrawString(4, 188, V_YELLOWMAP|V_MONOSPACE, "BEST LAP:"); + if (hu_demolap != UINT32_MAX) + V_DrawRightAlignedString(120, 188, V_MONOSPACE, va("%i:%02i.%02i", + G_TicsToMinutes(hu_demolap,true), + G_TicsToSeconds(hu_demolap), + G_TicsToCentiseconds(hu_demolap))); + else + V_DrawRightAlignedString(120, 188, V_MONOSPACE, "--:--.--"); } } diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 674e943f..21bc40a8 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -118,7 +118,6 @@ void HU_SetCEchoFlags(INT32 flags); void HU_DoCEcho(const char *msg); // Demo playback info -extern UINT32 hu_demoscore; extern UINT32 hu_demotime; -extern UINT16 hu_demorings; +extern UINT32 hu_demolap; #endif diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index 47560847..440fd8b1 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -228,6 +228,8 @@ static int player_get(lua_State *L) lua_pushinteger(L, plr->totalring); else if (fastcmp(field,"realtime")) lua_pushinteger(L, plr->realtime); + else if (fastcmp(field,"laptime")) + lua_pushinteger(L, plr->laptime); else if (fastcmp(field,"laps")) lua_pushinteger(L, plr->laps); else if (fastcmp(field,"ctfteam")) @@ -501,6 +503,8 @@ static int player_set(lua_State *L) plr->totalring = (INT16)luaL_checkinteger(L, 3); else if (fastcmp(field,"realtime")) plr->realtime = (tic_t)luaL_checkinteger(L, 3); + else if (fastcmp(field,"laptime")) + plr->laptime = (tic_t)luaL_checkinteger(L, 3); else if (fastcmp(field,"laps")) plr->laps = (UINT8)luaL_checkinteger(L, 3); else if (fastcmp(field,"ctfteam")) diff --git a/src/m_cheat.c b/src/m_cheat.c index bb7b4a5e..d4f4e6e1 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -58,7 +58,7 @@ typedef struct // ========================================================================== // Cheat responders -static UINT8 cheatf_ultimate(void) +/*static UINT8 cheatf_ultimate(void) { if (menuactive && (currentMenu != &MainDef && currentMenu != &SP_LoadDef)) return 0; // Only on the main menu, or the save select! @@ -70,7 +70,7 @@ static UINT8 cheatf_ultimate(void) if (currentMenu == &SP_LoadDef) M_ForceSaveSlotSelected(NOSAVESLOT); return 1; -} +}*/ static UINT8 cheatf_warp(void) { @@ -121,17 +121,17 @@ static UINT8 cheatf_devmode(void) } #endif -static cheatseq_t cheat_ultimate = { +/*static cheatseq_t cheat_ultimate = { 0, cheatf_ultimate, { SCRAMBLE('u'), SCRAMBLE('l'), SCRAMBLE('t'), SCRAMBLE('i'), SCRAMBLE('m'), SCRAMBLE('a'), SCRAMBLE('t'), SCRAMBLE('e'), 0xff } -}; +};*/ -static cheatseq_t cheat_ultimate_joy = { +/*static cheatseq_t cheat_ultimate_joy = { 0, cheatf_ultimate, { SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_DOWNARROW), SCRAMBLE(KEY_DOWNARROW), SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_ENTER), 0xff } -}; +};*/ static cheatseq_t cheat_warp = { 0, cheatf_warp, diff --git a/src/m_cond.c b/src/m_cond.c index bde84431..65a3ff6f 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -106,7 +106,7 @@ emblem_t emblemlocations[MAXEMBLEMS] = // Default Extra Emblems extraemblem_t extraemblems[MAXEXTRAEMBLEMS] = { - {"Experienced Driver", "Play 100 Matches", 10, 'X', SKINCOLOR_BLUE, 0}, + {"Experienced Driver", "Play 50 Matches", 10, 'X', SKINCOLOR_BLUE, 0}, }; // Default Unlockables @@ -130,16 +130,16 @@ void M_SetupDefaultConditionSets(void) { memset(conditionSets, 0, sizeof(conditionSets)); - // -- 1: Collect 5 emblems OR play 25 matches + // -- 1: Collect 5 emblems OR play 10 matches M_AddRawCondition(1, 1, UC_TOTALEMBLEMS, 5, 0, 0); - M_AddRawCondition(1, 2, UC_MATCHESPLAYED, 25, 0, 0); + M_AddRawCondition(1, 2, UC_MATCHESPLAYED, 10, 0, 0); - // -- 2: Collect 15 emblems OR play 50 matches + // -- 2: Collect 15 emblems OR play 30 matches M_AddRawCondition(2, 1, UC_TOTALEMBLEMS, 15, 0, 0); - M_AddRawCondition(2, 2, UC_MATCHESPLAYED, 50, 0, 0); + M_AddRawCondition(2, 2, UC_MATCHESPLAYED, 30, 0, 0); - // -- 10: Play 100 matches - M_AddRawCondition(10, 1, UC_TOTALEMBLEMS, 20, 0, 0); + // -- 10: Play 50 matches + M_AddRawCondition(10, 1, UC_TOTALEMBLEMS, 50, 0, 0); } void M_AddRawCondition(UINT8 set, UINT8 id, conditiontype_t c, INT32 r, INT16 x1, INT16 x2) @@ -190,7 +190,7 @@ void M_ClearSecrets(void) for (i = 0; i < MAXCONDITIONSETS; ++i) conditionSets[i].achieved = false; - timesBeaten = timesBeatenWithEmeralds = timesBeatenUltimate = 0; + timesBeaten = timesBeatenWithEmeralds = 0; // Re-unlock any always unlocked things M_SilentUpdateUnlockablesAndEmblems(); @@ -211,28 +211,28 @@ static UINT8 M_CheckCondition(condition_t *cn) return (timesBeaten >= (unsigned)cn->requirement); case UC_ALLEMERALDS: // Requires game beaten with all 7 emeralds >= x times return (timesBeatenWithEmeralds >= (unsigned)cn->requirement); - case UC_ULTIMATECLEAR: // Requires game beaten on ultimate >= x times (in other words, never) - return (timesBeatenUltimate >= (unsigned)cn->requirement); - case UC_OVERALLSCORE: // Requires overall score >= x - return (M_GotHighEnoughScore(cn->requirement)); + /*case UC_ULTIMATECLEAR: // Requires game beaten on ultimate >= x times (in other words, never) + return (timesBeatenUltimate >= (unsigned)cn->requirement);*/ case UC_OVERALLTIME: // Requires overall time <= x return (M_GotLowEnoughTime(cn->requirement)); + /*case UC_OVERALLSCORE: // Requires overall score >= x + return (M_GotHighEnoughScore(cn->requirement)); case UC_OVERALLRINGS: // Requires overall rings >= x - return (M_GotHighEnoughRings(cn->requirement)); + return (M_GotHighEnoughRings(cn->requirement));*/ case UC_MAPVISITED: // Requires map x to be visited return ((mapvisited[cn->requirement - 1] & MV_VISITED) == MV_VISITED); case UC_MAPBEATEN: // Requires map x to be beaten return ((mapvisited[cn->requirement - 1] & MV_BEATEN) == MV_BEATEN); case UC_MAPALLEMERALDS: // Requires map x to be beaten with all emeralds in possession return ((mapvisited[cn->requirement - 1] & MV_ALLEMERALDS) == MV_ALLEMERALDS); - case UC_MAPULTIMATE: // Requires map x to be beaten on ultimate + /*case UC_MAPULTIMATE: // Requires map x to be beaten on ultimate return ((mapvisited[cn->requirement - 1] & MV_ULTIMATE) == MV_ULTIMATE); case UC_MAPPERFECT: // Requires map x to be beaten with a perfect bonus - return ((mapvisited[cn->requirement - 1] & MV_PERFECT) == MV_PERFECT); - case UC_MAPSCORE: // Requires score on map >= x - return (G_GetBestScore(cn->extrainfo1) >= (unsigned)cn->requirement); + return ((mapvisited[cn->requirement - 1] & MV_PERFECT) == MV_PERFECT);*/ case UC_MAPTIME: // Requires time on map <= x return (G_GetBestTime(cn->extrainfo1) <= (unsigned)cn->requirement); + /*case UC_MAPSCORE: // Requires score on map >= x + return (G_GetBestScore(cn->extrainfo1) >= (unsigned)cn->requirement); case UC_MAPRINGS: // Requires rings on map >= x return (G_GetBestRings(cn->extrainfo1) >= cn->requirement); case UC_NIGHTSSCORE: @@ -240,7 +240,7 @@ static UINT8 M_CheckCondition(condition_t *cn) case UC_NIGHTSTIME: return (G_GetBestNightsTime(cn->extrainfo1, (UINT8)cn->extrainfo2) <= (unsigned)cn->requirement); case UC_NIGHTSGRADE: - return (G_GetBestNightsGrade(cn->extrainfo1, (UINT8)cn->extrainfo2) >= cn->requirement); + return (G_GetBestNightsGrade(cn->extrainfo1, (UINT8)cn->extrainfo2) >= cn->requirement);*/ case UC_TRIGGER: // requires map trigger set return !!(unlocktriggers & (1 << cn->requirement)); case UC_TOTALEMBLEMS: // Requires number of emblems >= x @@ -409,13 +409,13 @@ UINT8 M_CheckLevelEmblems(void) switch (emblemlocations[i].type) { - case ET_SCORE: // Requires score on map >= x + /*case ET_SCORE: // Requires score on map >= x res = (G_GetBestScore(levelnum) >= (unsigned)valToReach); - break; + break;*/ case ET_TIME: // Requires time on map <= x res = (G_GetBestTime(levelnum) <= (unsigned)valToReach); break; - case ET_RINGS: // Requires rings on map >= x + /*case ET_RINGS: // Requires rings on map >= x res = (G_GetBestRings(levelnum) >= valToReach); break; case ET_NGRADE: // Requires NiGHTS grade on map >= x @@ -423,7 +423,7 @@ UINT8 M_CheckLevelEmblems(void) break; case ET_NTIME: // Requires NiGHTS time on map <= x res = (G_GetBestNightsTime(levelnum, 0) <= (unsigned)valToReach); - break; + break;*/ default: // unreachable but shuts the compiler up. continue; } @@ -507,7 +507,7 @@ UINT8 M_GotEnoughEmblems(INT32 number) return false; } -UINT8 M_GotHighEnoughScore(INT32 tscore) +/*UINT8 M_GotHighEnoughScore(INT32 tscore) { INT32 mscore = 0; INT32 i; @@ -523,7 +523,7 @@ UINT8 M_GotHighEnoughScore(INT32 tscore) return true; } return false; -} +}*/ UINT8 M_GotLowEnoughTime(INT32 tictime) { @@ -543,7 +543,7 @@ UINT8 M_GotLowEnoughTime(INT32 tictime) return true; } -UINT8 M_GotHighEnoughRings(INT32 trings) +/*UINT8 M_GotHighEnoughRings(INT32 trings) { INT32 mrings = 0; INT32 i; @@ -559,7 +559,7 @@ UINT8 M_GotHighEnoughRings(INT32 trings) return true; } return false; -} +}*/ // ---------------- // Misc Emblem shit diff --git a/src/m_cond.h b/src/m_cond.h index 1f2644c5..d34b2cbf 100644 --- a/src/m_cond.h +++ b/src/m_cond.h @@ -21,24 +21,24 @@ typedef enum { UC_PLAYTIME, // PLAYTIME [tics] - UC_MATCHESPLAYED, // MATCHESPLAYED [x played] + UC_MATCHESPLAYED, // SRB2Kart: MATCHESPLAYED [x played] UC_GAMECLEAR, // GAMECLEAR UC_ALLEMERALDS, // ALLEMERALDS - UC_ULTIMATECLEAR, // ULTIMATECLEAR - UC_OVERALLSCORE, // OVERALLSCORE [score to beat] + //UC_ULTIMATECLEAR, // ULTIMATECLEAR + //UC_OVERALLSCORE, // OVERALLSCORE [score to beat] UC_OVERALLTIME, // OVERALLTIME [time to beat, tics] - UC_OVERALLRINGS, // OVERALLRINGS [rings to beat] + //UC_OVERALLRINGS, // OVERALLRINGS [rings to beat] UC_MAPVISITED, // MAPVISITED [map number] UC_MAPBEATEN, // MAPBEATEN [map number] UC_MAPALLEMERALDS, // MAPALLEMERALDS [map number] - UC_MAPULTIMATE, // MAPULTIMATE [map number] - UC_MAPPERFECT, // MAPPERFECT [map number] - UC_MAPSCORE, // MAPSCORE [map number] [score to beat] + //UC_MAPULTIMATE, // MAPULTIMATE [map number] + //UC_MAPPERFECT, // MAPPERFECT [map number] + //UC_MAPSCORE, // MAPSCORE [map number] [score to beat] UC_MAPTIME, // MAPTIME [map number] [time to beat, tics] - UC_MAPRINGS, // MAPRINGS [map number] [rings to beat] - UC_NIGHTSSCORE, // NIGHTSSCORE [map number] [score to beat] - UC_NIGHTSTIME, // NIGHTSTIME [map number] [time to beat, tics] - UC_NIGHTSGRADE, // NIGHTSGRADE [map number] [grade] + //UC_MAPRINGS, // MAPRINGS [map number] [rings to beat] + //UC_NIGHTSSCORE, // NIGHTSSCORE [map number] [score to beat] + //UC_NIGHTSTIME, // NIGHTSTIME [map number] [time to beat, tics] + //UC_NIGHTSGRADE, // NIGHTSGRADE [map number] [grade] UC_TRIGGER, // TRIGGER [trigger number] UC_TOTALEMBLEMS, // TOTALEMBLEMS [number of emblems] UC_EMBLEM, // EMBLEM [emblem number] @@ -69,11 +69,11 @@ typedef struct // Emblem information #define ET_GLOBAL 0 // Global map emblem, var == color #define ET_SKIN 1 // Skin specific emblem, var == skin -#define ET_SCORE 2 -#define ET_TIME 3 -#define ET_RINGS 4 -#define ET_NGRADE 5 -#define ET_NTIME 6 +//#define ET_SCORE 2 +#define ET_TIME 2 +//#define ET_RINGS 4 +//#define ET_NGRADE 5 +//#define ET_NTIME 6 typedef struct { @@ -172,8 +172,8 @@ const char *M_GetExtraEmblemPatch(extraemblem_t *em); // They stop checking upon reaching the target number so they // should be (theoretically?) slightly faster. UINT8 M_GotEnoughEmblems(INT32 number); -UINT8 M_GotHighEnoughScore(INT32 tscore); +//UINT8 M_GotHighEnoughScore(INT32 tscore); UINT8 M_GotLowEnoughTime(INT32 tictime); -UINT8 M_GotHighEnoughRings(INT32 trings); +//UINT8 M_GotHighEnoughRings(INT32 trings); #define M_Achieved(a) ((a) >= MAXCONDITIONSETS || conditionSets[a].achieved) diff --git a/src/m_menu.c b/src/m_menu.c index e5e0918d..ef562946 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -245,14 +245,14 @@ static void M_Statistics(INT32 choice); static void M_HandleStaffReplay(INT32 choice); static void M_ReplayTimeAttack(INT32 choice); static void M_ChooseTimeAttack(INT32 choice); -static void M_ChooseNightsAttack(INT32 choice); +//static void M_ChooseNightsAttack(INT32 choice); static void M_ModeAttackRetry(INT32 choice); static void M_ModeAttackEndGame(INT32 choice); static void M_SetGuestReplay(INT32 choice); static void M_ChoosePlayer(INT32 choice); menu_t SP_GameStatsDef, SP_LevelStatsDef; static menu_t SP_TimeAttackDef, SP_ReplayDef, SP_GuestReplayDef, SP_GhostDef; -static menu_t SP_NightsAttackDef, SP_NightsReplayDef, SP_NightsGuestReplayDef, SP_NightsGhostDef; +//static menu_t SP_NightsAttackDef, SP_NightsReplayDef, SP_NightsGuestReplayDef, SP_NightsGhostDef; // Multiplayer #ifndef NONET @@ -338,7 +338,7 @@ static void M_DrawLoad(void); static void M_DrawLevelStats(void); static void M_DrawGameStats(void); static void M_DrawTimeAttackMenu(void); -static void M_DrawNightsAttackMenu(void); +//static void M_DrawNightsAttackMenu(void); static void M_DrawSetupChoosePlayerMenu(void); static void M_DrawControl(void); static void M_DrawVideoMode(void); @@ -378,7 +378,7 @@ static void M_HandleVideoMode(INT32 choice); // Consvar onchange functions static void Nextmap_OnChange(void); static void Newgametype_OnChange(void); -static void Dummymares_OnChange(void); +//static void Dummymares_OnChange(void); static void Dummystaff_OnChange(void); // ========================================================================== @@ -435,9 +435,8 @@ static consvar_t cv_autorecord = {"autorecord", "Yes", 0, CV_YesNo, NULL, 0, NUL CV_PossibleValue_t ghost_cons_t[] = {{0, "Hide"}, {1, "Show"}, {2, "Show All"}, {0, NULL}}; CV_PossibleValue_t ghost2_cons_t[] = {{0, "Hide"}, {1, "Show"}, {0, NULL}}; -consvar_t cv_ghost_bestscore = {"ghost_bestscore", "Show All", CV_SAVE, ghost_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_ghost_besttime = {"ghost_besttime", "Show All", CV_SAVE, ghost_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -//consvar_t cv_ghost_bestlap = {"ghost_bestlap", "Show All", CV_SAVE, ghost_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_ghost_bestlap = {"ghost_bestlap", "Show All", CV_SAVE, ghost_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_ghost_last = {"ghost_last", "Show All", CV_SAVE, ghost_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_ghost_guest = {"ghost_guest", "Show", CV_SAVE, ghost2_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_ghost_staff = {"ghost_staff", "Show", CV_SAVE, ghost2_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -449,9 +448,9 @@ static CV_PossibleValue_t dummyteam_cons_t[] = {{0, "Spectator"}, {1, "Red"}, {2 static CV_PossibleValue_t dummyscramble_cons_t[] = {{0, "Random"}, {1, "Points"}, {0, NULL}}; static CV_PossibleValue_t ringlimit_cons_t[] = {{0, "MIN"}, {9999, "MAX"}, {0, NULL}}; static CV_PossibleValue_t liveslimit_cons_t[] = {{0, "MIN"}, {99, "MAX"}, {0, NULL}}; -static CV_PossibleValue_t dummymares_cons_t[] = { +/*static CV_PossibleValue_t dummymares_cons_t[] = { {-1, "END"}, {0,"Overall"}, {1,"Mare 1"}, {2,"Mare 2"}, {3,"Mare 3"}, {4,"Mare 4"}, {5,"Mare 5"}, {6,"Mare 6"}, {7,"Mare 7"}, {8,"Mare 8"}, {0,NULL} -}; +};*/ static CV_PossibleValue_t dummystaff_cons_t[] = {{0, "MIN"}, {100, "MAX"}, {0, NULL}}; static consvar_t cv_dummyteam = {"dummyteam", "Spectator", CV_HIDEN, dummyteam_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -459,7 +458,7 @@ static consvar_t cv_dummyscramble = {"dummyscramble", "Random", CV_HIDEN, dummys static consvar_t cv_dummyrings = {"dummyrings", "0", CV_HIDEN, ringlimit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_dummylives = {"dummylives", "0", CV_HIDEN, liveslimit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_dummycontinues = {"dummycontinues", "0", CV_HIDEN, liveslimit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -static consvar_t cv_dummymares = {"dummymares", "Overall", CV_HIDEN|CV_CALL, dummymares_cons_t, Dummymares_OnChange, 0, NULL, NULL, 0, 0, NULL}; +//static consvar_t cv_dummymares = {"dummymares", "Overall", CV_HIDEN|CV_CALL, dummymares_cons_t, Dummymares_OnChange, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_dummystaff = {"dummystaff", "0", CV_HIDEN|CV_CALL, dummystaff_cons_t, Dummystaff_OnChange, 0, NULL, NULL, 0, 0, NULL}; // ========================================================================== @@ -761,7 +760,8 @@ enum static menuitem_t SP_ReplayMenu[] = { - {IT_WHITESTRING|IT_CALL, NULL, "Replay Best Time", M_ReplayTimeAttack, 8}, + {IT_WHITESTRING|IT_CALL, NULL, "Replay Best Time", M_ReplayTimeAttack, 0}, + {IT_WHITESTRING|IT_CALL, NULL, "Replay Best Lap", M_ReplayTimeAttack, 8}, {IT_WHITESTRING|IT_CALL, NULL, "Replay Last", M_ReplayTimeAttack,21}, {IT_WHITESTRING|IT_CALL, NULL, "Replay Guest", M_ReplayTimeAttack,29}, @@ -770,7 +770,7 @@ static menuitem_t SP_ReplayMenu[] = {IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SP_TimeAttackDef, 50} }; -static menuitem_t SP_NightsReplayMenu[] = +/*static menuitem_t SP_NightsReplayMenu[] = { {IT_WHITESTRING|IT_CALL, NULL, "Replay Best Score", M_ReplayTimeAttack, 0}, {IT_WHITESTRING|IT_CALL, NULL, "Replay Best Time", M_ReplayTimeAttack,16}, @@ -780,11 +780,12 @@ static menuitem_t SP_NightsReplayMenu[] = {IT_WHITESTRING|IT_KEYHANDLER, NULL, "Replay Staff",M_HandleStaffReplay,37}, {IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SP_NightsAttackDef, 50} -}; +};*/ static menuitem_t SP_GuestReplayMenu[] = { - {IT_WHITESTRING|IT_CALL, NULL, "Save Best Time as Guest", M_SetGuestReplay,16}, + {IT_WHITESTRING|IT_CALL, NULL, "Save Best Time as Guest", M_SetGuestReplay, 8}, + {IT_WHITESTRING|IT_CALL, NULL, "Save Best Lap as Guest", M_SetGuestReplay,16}, {IT_WHITESTRING|IT_CALL, NULL, "Save Last as Guest", M_SetGuestReplay,24}, {IT_WHITESTRING|IT_CALL, NULL, "Delete Guest Replay", M_SetGuestReplay,37}, @@ -792,7 +793,7 @@ static menuitem_t SP_GuestReplayMenu[] = {IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SP_TimeAttackDef, 50} }; -static menuitem_t SP_NightsGuestReplayMenu[] = +/*static menuitem_t SP_NightsGuestReplayMenu[] = { {IT_WHITESTRING|IT_CALL, NULL, "Save Best Score as Guest", M_SetGuestReplay, 8}, {IT_WHITESTRING|IT_CALL, NULL, "Save Best Time as Guest", M_SetGuestReplay,16}, @@ -801,11 +802,12 @@ static menuitem_t SP_NightsGuestReplayMenu[] = {IT_WHITESTRING|IT_CALL, NULL, "Delete Guest Replay", M_SetGuestReplay,37}, {IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SP_NightsAttackDef, 50} -}; +};*/ static menuitem_t SP_GhostMenu[] = { - {IT_STRING|IT_CVAR, NULL, "Best Time", &cv_ghost_besttime, 8}, + {IT_STRING|IT_CVAR, NULL, "Best Time", &cv_ghost_besttime, 0}, + {IT_STRING|IT_CVAR, NULL, "Best Lap", &cv_ghost_bestlap, 8}, {IT_STRING|IT_CVAR, NULL, "Last", &cv_ghost_last, 16}, {IT_STRING|IT_CVAR, NULL, "Guest", &cv_ghost_guest, 29}, @@ -814,7 +816,7 @@ static menuitem_t SP_GhostMenu[] = {IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SP_TimeAttackDef, 50} }; -static menuitem_t SP_NightsGhostMenu[] = +/*static menuitem_t SP_NightsGhostMenu[] = { {IT_STRING|IT_CVAR, NULL, "Best Score", &cv_ghost_bestscore, 0}, {IT_STRING|IT_CVAR, NULL, "Best Time", &cv_ghost_besttime, 8}, @@ -824,10 +826,10 @@ static menuitem_t SP_NightsGhostMenu[] = {IT_STRING|IT_CVAR, NULL, "Staff Attack",&cv_ghost_staff, 37}, {IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SP_NightsAttackDef, 50} -}; +};*/ // Single Player Nights Attack -static menuitem_t SP_NightsAttackMenu[] = +/*static menuitem_t SP_NightsAttackMenu[] = { {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 44}, {IT_STRING|IT_CVAR, NULL, "Show Records For", &cv_dummymares, 54}, @@ -836,7 +838,7 @@ static menuitem_t SP_NightsAttackMenu[] = {IT_DISABLED, NULL, "Replay...", &SP_NightsReplayDef, 118}, {IT_DISABLED, NULL, "Ghosts...", &SP_NightsGhostDef, 128}, {IT_WHITESTRING|IT_CALL|IT_CALL_NOTMODIFIED, NULL, "Start", M_ChooseNightsAttack, 138}, -}; +};*/ enum { @@ -1667,7 +1669,7 @@ static menu_t SP_GhostDef = NULL }; -static menu_t SP_NightsAttackDef = +/*static menu_t SP_NightsAttackDef = { "M_NIGHTS", sizeof (SP_NightsAttackMenu)/sizeof (menuitem_t), @@ -1710,7 +1712,7 @@ static menu_t SP_NightsGhostDef = 32, 120, 0, NULL -}; +};*/ menu_t SP_PlayerDef = @@ -1899,7 +1901,7 @@ static void Nextmap_OnChange(void) leveltitle = G_BuildMapTitle(cv_nextmap.value); cv_nextmap.string = cv_nextmap.zstring = leveltitle ? leveltitle : Z_StrDup(G_BuildMapName(cv_nextmap.value)); - if (currentMenu == &SP_NightsAttackDef) + /*if (currentMenu == &SP_NightsAttackDef) { CV_StealthSetValue(&cv_dummymares, 0); // Hide the record changing CVAR if only one mare is available. @@ -1960,7 +1962,7 @@ static void Nextmap_OnChange(void) itemOn = nastart; } } - else if (currentMenu == &SP_TimeAttackDef) + else*/ if (currentMenu == &SP_TimeAttackDef) { CV_StealthSetValue(&cv_dummystaff, 0); @@ -1971,7 +1973,7 @@ static void Nextmap_OnChange(void) // Check if file exists, if not, disable REPLAY option sprintf(tabase,"%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-%s",srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value), cv_chooseskin.string); - for (i = 0; i < 4; i++) { + for (i = 0; i < 5; i++) { SP_ReplayMenu[i].status = IT_DISABLED; SP_GuestReplayMenu[i].status = IT_DISABLED; } @@ -1980,18 +1982,23 @@ static void Nextmap_OnChange(void) SP_GuestReplayMenu[0].status = IT_WHITESTRING|IT_CALL; active |= 3; } - if (FIL_FileExists(va("%s-last.lmp", tabase))) { + if (FIL_FileExists(va("%s-lap-best.lmp", tabase))) { SP_ReplayMenu[1].status = IT_WHITESTRING|IT_CALL; SP_GuestReplayMenu[1].status = IT_WHITESTRING|IT_CALL; active |= 3; } - if (FIL_FileExists(va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-guest.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value)))) { + if (FIL_FileExists(va("%s-last.lmp", tabase))) { SP_ReplayMenu[2].status = IT_WHITESTRING|IT_CALL; SP_GuestReplayMenu[2].status = IT_WHITESTRING|IT_CALL; active |= 3; } + if (FIL_FileExists(va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-guest.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value)))) { + SP_ReplayMenu[3].status = IT_WHITESTRING|IT_CALL; + SP_GuestReplayMenu[3].status = IT_WHITESTRING|IT_CALL; + active |= 3; + } if ((l = W_CheckNumForName(va("%sS01",G_BuildMapName(cv_nextmap.value)))) != LUMPERROR) { - SP_ReplayMenu[3].status = IT_WHITESTRING|IT_KEYHANDLER; + SP_ReplayMenu[4].status = IT_WHITESTRING|IT_KEYHANDLER; CV_StealthSetValue(&cv_dummystaff, 1); active |= 1; } @@ -2013,7 +2020,7 @@ static void Nextmap_OnChange(void) } } -static void Dummymares_OnChange(void) +/*static void Dummymares_OnChange(void) { if (!nightsrecords[cv_nextmap.value-1]) { @@ -2029,7 +2036,7 @@ static void Dummymares_OnChange(void) else if (cv_dummymares.value > mares) CV_StealthSetValue(&cv_dummymares, 0); } -} +}*/ static void Dummystaff_OnChange(void) { @@ -2567,7 +2574,7 @@ boolean M_Responder(event_t *ev) multiplayer = false; } - if (currentMenu == &SP_TimeAttackDef || currentMenu == &SP_NightsAttackDef) + if (currentMenu == &SP_TimeAttackDef) //|| currentMenu == &SP_NightsAttackDef { // D_StartTitle does its own wipe, since GS_TIMEATTACK is now a complete gamestate. menuactive = false; @@ -2903,7 +2910,7 @@ void M_Init(void) CV_RegisterVar(&cv_dummyrings); CV_RegisterVar(&cv_dummylives); CV_RegisterVar(&cv_dummycontinues); - CV_RegisterVar(&cv_dummymares); + //CV_RegisterVar(&cv_dummymares); CV_RegisterVar(&cv_dummystaff); quitmsg[QUITMSG] = M_GetText("Eggman's tied explosives\nto your girlfriend, and\nwill activate them if\nyou press the 'Y' key!\nPress 'N' to save her!\n\n(Press 'Y' to quit)"); @@ -3131,10 +3138,10 @@ static void M_DrawMapEmblems(INT32 mapnum, INT32 x, INT32 y) { switch (emblem->type) { - case ET_SCORE: case ET_TIME: case ET_RINGS: + case ET_TIME: //case ET_SCORE: case ET_RINGS: curtype = 1; break; - case ET_NGRADE: case ET_NTIME: - curtype = 2; break; + /*case ET_NGRADE: case ET_NTIME: + curtype = 2; break;*/ default: curtype = 0; break; } @@ -3350,7 +3357,7 @@ static void M_DrawPauseMenu(void) switch (emblem->type) { - case ET_SCORE: + /*case ET_SCORE: snprintf(targettext, 9, "%d", emblem->var); snprintf(currenttext, 9, "%u", G_GetBestScore(gamemap)); @@ -3358,7 +3365,7 @@ static void M_DrawPauseMenu(void) currenttext[8] = 0; emblemslot = 0; - break; + break;*/ case ET_TIME: emblemslot = emblem->var; // dumb hack snprintf(targettext, 9, "%i:%02i.%02i", @@ -3380,7 +3387,7 @@ static void M_DrawPauseMenu(void) emblemslot = 1; break; - case ET_RINGS: + /*case ET_RINGS: snprintf(targettext, 9, "%d", emblem->var); snprintf(currenttext, 9, "%u", G_GetBestRings(gamemap)); @@ -3418,7 +3425,7 @@ static void M_DrawPauseMenu(void) currenttext[8] = 0; emblemslot = 2; - break; + break;*/ default: goto bademblem; } @@ -3447,17 +3454,17 @@ static void M_DrawPauseMenu(void) switch (emblem->type) { - case ET_SCORE: + /*case ET_SCORE: case ET_NGRADE: V_DrawString(56, 44 + (i*8), V_YELLOWMAP, "SCORE:"); - break; + break;*/ case ET_TIME: - case ET_NTIME: + //case ET_NTIME: V_DrawString(56, 44 + (i*8), V_YELLOWMAP, "TIME:"); break; - case ET_RINGS: + /*case ET_RINGS: V_DrawString(56, 44 + (i*8), V_YELLOWMAP, "RINGS:"); - break; + break;*/ } V_DrawRightAlignedString(284, 44 + (i*8), V_MONOSPACE, emblem_text[i]); } @@ -5329,11 +5336,11 @@ static void M_DrawGameStats(void) char beststr[40]; tic_t besttime = 0; - UINT32 bestscore = 0; - UINT32 bestrings = 0; + //UINT32 bestscore = 0; + //UINT32 bestrings = 0; INT32 i; - INT32 mapsunfinished[3] = {0, 0, 0}; + INT32 mapsunfinished = 0; //INT32 mapsunfinished[3] = {0, 0, 0}; M_DrawMenuTitle(); V_DrawCenteredString(BASEVIDWIDTH/2, 24, V_YELLOWMAP, "PAGE 1 OF 2"); @@ -5354,26 +5361,27 @@ static void M_DrawGameStats(void) if (!mainrecords[i]) { - mapsunfinished[0]++; + /*mapsunfinished[0]++; mapsunfinished[1]++; - mapsunfinished[2]++; + mapsunfinished[2]++;*/ + mapsunfinished++; continue; } - if (mainrecords[i]->score > 0) + /*if (mainrecords[i]->score > 0) bestscore += mainrecords[i]->score; else - mapsunfinished[0]++; + mapsunfinished[0]++;*/ if (mainrecords[i]->time > 0) besttime += mainrecords[i]->time; else - mapsunfinished[1]++; + mapsunfinished++; //mapsunfinished[1]++; - if (mainrecords[i]->rings > 0) + /*if (mainrecords[i]->rings > 0) bestrings += mainrecords[i]->rings; else - mapsunfinished[2]++; + mapsunfinished[2]++;*/ } @@ -5388,8 +5396,8 @@ static void M_DrawGameStats(void) sprintf(beststr, "%i:%02i:%02i.%02i", G_TicsToHours(besttime), G_TicsToMinutes(besttime, false), G_TicsToSeconds(besttime), G_TicsToCentiseconds(besttime)); V_DrawString(32, 140, V_YELLOWMAP, "TIME:"); V_DrawRightAlignedString(BASEVIDWIDTH-32, 140, 0, beststr); - if (mapsunfinished[1]) - V_DrawRightAlignedString(BASEVIDWIDTH-32, 148, V_REDMAP, va("(%d unfinished)", mapsunfinished[1])); + if (mapsunfinished) + V_DrawRightAlignedString(BASEVIDWIDTH-32, 148, V_REDMAP, va("(%d unfinished)", mapsunfinished)); /*sprintf(beststr, "%u", bestrings); V_DrawString(32, 140, V_YELLOWMAP, "RINGS:"); @@ -5525,8 +5533,18 @@ void M_DrawTimeAttackMenu(void) G_TicsToSeconds(mainrecords[cv_nextmap.value-1]->time), G_TicsToCentiseconds(mainrecords[cv_nextmap.value-1]->time)); - V_DrawString(104-72, 58, V_YELLOWMAP, "TIME:"); - V_DrawRightAlignedString(104+72, 58, V_ALLOWLOWERCASE, beststr); + V_DrawString(104-72, 53, V_YELLOWMAP, "BEST TIME:"); + V_DrawRightAlignedString(104+72, 53, V_ALLOWLOWERCASE, beststr); + + if (!mainrecords[cv_nextmap.value-1] || !mainrecords[cv_nextmap.value-1]->lap) + sprintf(beststr, "(none)"); + else + sprintf(beststr, "%i:%02i.%02i", G_TicsToMinutes(mainrecords[cv_nextmap.value-1]->lap, true), + G_TicsToSeconds(mainrecords[cv_nextmap.value-1]->lap), + G_TicsToCentiseconds(mainrecords[cv_nextmap.value-1]->lap)); + + V_DrawString(104-72, 63, V_YELLOWMAP, "BEST LAP:"); + V_DrawRightAlignedString(104+72, 63, V_ALLOWLOWERCASE, beststr); // Draw record emblems. em = M_GetLevelEmblems(cv_nextmap.value); @@ -5534,8 +5552,7 @@ void M_DrawTimeAttackMenu(void) { switch (em->type) { - //case ET_SCORE: yHeight = 48; break; - case ET_TIME: yHeight = 58; break; + case ET_TIME: yHeight = 53; break; default: goto skipThisOne; } @@ -5602,7 +5619,7 @@ static void M_TimeAttack(INT32 choice) } // Drawing function for Nights Attack -void M_DrawNightsAttackMenu(void) +/*void M_DrawNightsAttackMenu(void) { patch_t *PictureOfLevel; lumpnum_t lumpnum; @@ -5704,7 +5721,7 @@ void M_DrawNightsAttackMenu(void) y + SP_NightsAttackMenu[0].alphaKey, V_YELLOWMAP|V_TRANSLUCENT, ncv->string); } } -} +}*/ // Going to Nights Attack menu... /*static void M_NightsAttack(INT32 choice) @@ -5735,7 +5752,7 @@ void M_DrawNightsAttackMenu(void) }*/ // Player has selected the "START" from the nights attack screen -static void M_ChooseNightsAttack(INT32 choice) +/*static void M_ChooseNightsAttack(INT32 choice) { char nameofdemo[256]; (void)choice; @@ -5754,7 +5771,7 @@ static void M_ChooseNightsAttack(INT32 choice) G_RecordDemo(nameofdemo); G_DeferedInitNew(false, G_BuildMapName(cv_nextmap.value), 0, 0, false); -} +}*/ // Player has selected the "START" from the time attack screen static void M_ChooseTimeAttack(INT32 choice) @@ -5844,12 +5861,15 @@ static void M_ReplayTimeAttack(INT32 choice) case 0: // best time which = "time-best"; break; - case 1: // last + case 1: // best lap + which = "lap-best"; + break; + case 2: // last which = "last"; break; - case 2: // best staff + case 3: // best staff return; // M_HandleStaffReplay - case 3: // guest + case 4: // guest // srb2/replay/main/map01-guest.lmp G_DoPlayDemo(va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-guest.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value))); return; @@ -5857,7 +5877,7 @@ static void M_ReplayTimeAttack(INT32 choice) // srb2/replay/main/map01-sonic-time-best.lmp G_DoPlayDemo(va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-%s-%s.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value), cv_chooseskin.string, which)); } - else if (currentMenu == &SP_NightsReplayDef) + /*else if (currentMenu == &SP_NightsReplayDef) { switch(choice) { default: @@ -5878,7 +5898,7 @@ static void M_ReplayTimeAttack(INT32 choice) } // srb2/replay/main/map01-score-best.lmp G_DoPlayDemo(va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-%s.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value), which)); - } + }*/ } static void M_EraseGuest(INT32 choice) @@ -5887,24 +5907,21 @@ static void M_EraseGuest(INT32 choice) (void)choice; if (FIL_FileExists(rguest)) remove(rguest); - if (currentMenu == &SP_NightsGuestReplayDef) + /*if (currentMenu == &SP_NightsGuestReplayDef) M_SetupNextMenu(&SP_NightsAttackDef); - else + else*/ M_SetupNextMenu(&SP_TimeAttackDef); CV_AddValue(&cv_nextmap, -1); CV_AddValue(&cv_nextmap, 1); M_StartMessage(M_GetText("Guest replay data erased.\n"),NULL,MM_NOTHING); } -static void M_OverwriteGuest(const char *which, boolean nights) +static void M_OverwriteGuest(const char *which) { char *rguest = Z_StrDup(va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-guest.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value))); UINT8 *buf; size_t len; - if (!nights) - len = FIL_ReadFile(va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-%s-%s.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value), cv_chooseskin.string, which), &buf); - else - len = FIL_ReadFile(va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-%s.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value), which), &buf); + len = FIL_ReadFile(va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-%s-%s.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value), cv_chooseskin.string, which), &buf); if (!len) { return; } @@ -5914,9 +5931,9 @@ static void M_OverwriteGuest(const char *which, boolean nights) } FIL_WriteFile(rguest, buf, len); Z_Free(rguest); - if (currentMenu == &SP_NightsGuestReplayDef) + /*if (currentMenu == &SP_NightsGuestReplayDef) M_SetupNextMenu(&SP_NightsAttackDef); - else + else*/ M_SetupNextMenu(&SP_TimeAttackDef); CV_AddValue(&cv_nextmap, -1); CV_AddValue(&cv_nextmap, 1); @@ -5926,45 +5943,49 @@ static void M_OverwriteGuest(const char *which, boolean nights) static void M_OverwriteGuest_Time(INT32 choice) { (void)choice; - M_OverwriteGuest("time-best", currentMenu == &SP_NightsGuestReplayDef); + M_OverwriteGuest("time-best"); } +static void M_OverwriteGuest_Lap(INT32 choice) +{ + (void)choice; + M_OverwriteGuest("lap-best"); +} + +/* SRB2Kart static void M_OverwriteGuest_Score(INT32 choice) { (void)choice; - M_OverwriteGuest("score-best", currentMenu == &SP_NightsGuestReplayDef); + M_OverwriteGuest("score-best"); } -/* // srb2kart static void M_OverwriteGuest_Rings(INT32 choice) { (void)choice; - M_OverwriteGuest("rings-best", false); + M_OverwriteGuest("rings-best"); }*/ static void M_OverwriteGuest_Last(INT32 choice) { (void)choice; - M_OverwriteGuest("last", currentMenu == &SP_NightsGuestReplayDef); + M_OverwriteGuest("last"); } static void M_SetGuestReplay(INT32 choice) { void (*which)(INT32); - if (currentMenu == &SP_TimeAttackDef && choice <= 0) - choice++; // skip best score switch(choice) { - case 0: // best score - which = M_OverwriteGuest_Score; - break; - case 1: // best time + case 0: // best time which = M_OverwriteGuest_Time; break; - case 3: // last + case 1: // best lap + which = M_OverwriteGuest_Lap; + break; + case 2: // last which = M_OverwriteGuest_Last; break; - case 4: // guest + case 3: // guest default: M_StartMessage(M_GetText("Are you sure you want to\ndelete the guest replay data?\n\n(Press 'Y' to confirm)\n"),M_EraseGuest,MM_YESNO); return; @@ -5981,8 +6002,8 @@ static void M_ModeAttackRetry(INT32 choice) G_CheckDemoStatus(); // Cancel recording if (modeattacking == ATTACKING_RECORD) M_ChooseTimeAttack(0); - else if (modeattacking == ATTACKING_NIGHTS) - M_ChooseNightsAttack(0); + /*else if (modeattacking == ATTACKING_NIGHTS) + M_ChooseNightsAttack(0);*/ } static void M_ModeAttackEndGame(INT32 choice) @@ -6000,9 +6021,9 @@ static void M_ModeAttackEndGame(INT32 choice) case ATTACKING_RECORD: currentMenu = &SP_TimeAttackDef; break; - case ATTACKING_NIGHTS: + /*case ATTACKING_NIGHTS: currentMenu = &SP_NightsAttackDef; - break; + break;*/ } itemOn = currentMenu->lastOn; G_SetGamestate(GS_TIMEATTACK); diff --git a/src/p_saveg.c b/src/p_saveg.c index 53ab044d..501f086d 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -182,6 +182,7 @@ static void P_NetArchivePlayers(void) WRITEINT16(save_p, players[i].numboxes); WRITEINT16(save_p, players[i].totalring); WRITEUINT32(save_p, players[i].realtime); + WRITEUINT32(save_p, players[i].laptime); // SRB2kart WRITEUINT8(save_p, players[i].laps); //////////////////// @@ -198,6 +199,7 @@ static void P_NetArchivePlayers(void) WRITEINT16(save_p, players[i].starposty); WRITEINT16(save_p, players[i].starpostz); WRITEINT32(save_p, players[i].starpostnum); + WRITEINT32(save_p, players[i].starpostcount); WRITEANGLE(save_p, players[i].starpostangle); WRITEANGLE(save_p, players[i].angle_pos); @@ -365,6 +367,7 @@ static void P_NetUnArchivePlayers(void) players[i].numboxes = READINT16(save_p); // Number of item boxes obtained for Race Mode players[i].totalring = READINT16(save_p); // Total number of rings obtained for Race Mode players[i].realtime = READUINT32(save_p); // integer replacement for leveltime + players[i].laptime = READUINT32(save_p); // SRB2kart: used to track best lap time players[i].laps = READUINT8(save_p); // Number of laps (optional) //////////////////// @@ -381,6 +384,7 @@ static void P_NetUnArchivePlayers(void) players[i].starposty = READINT16(save_p); players[i].starpostz = READINT16(save_p); players[i].starpostnum = READINT32(save_p); + players[i].starpostcount = READINT32(save_p); players[i].starpostangle = READANGLE(save_p); players[i].angle_pos = READANGLE(save_p); @@ -3230,6 +3234,12 @@ static void P_NetArchiveMisc(void) WRITEUINT32(save_p, hidetime); + // SRB2kart + WRITEUINT8(save_p, gamespeed); + WRITEUINT8(save_p, mirrormode); + WRITEUINT8(save_p, franticitems); + WRITEUINT8(save_p, comeback); + // Is it paused? if (paused) WRITEUINT8(save_p, 0x2f); @@ -3307,6 +3317,12 @@ static inline boolean P_NetUnArchiveMisc(void) hidetime = READUINT32(save_p); + // SRB2kart + gamespeed = READUINT8(save_p); + mirrormode = (boolean)READUINT8(save_p); + franticitems = (boolean)READUINT8(save_p); + comeback = (boolean)READUINT8(save_p); + // Is it paused? if (READUINT8(save_p) == 0x2f) paused = true; diff --git a/src/p_setup.c b/src/p_setup.c index b047258a..1cf4aeb7 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2190,7 +2190,7 @@ static void P_LevelInitStuff(void) // special stage stagefailed = false; // Reset temporary record data - memset(&ntemprecords, 0, sizeof(nightsdata_t)); + //memset(&ntemprecords, 0, sizeof(nightsdata_t)); // earthquake camera memset(&quake,0,sizeof(struct quake)); @@ -2204,6 +2204,7 @@ static void P_LevelInitStuff(void) } players[i].realtime = countdown = countdown2 = 0; + players[i].laptime = 0; // SRB2Kart players[i].gotcontinue = false; @@ -2434,19 +2435,6 @@ static void P_LoadRecordGhosts(void) sprintf(gpath,"%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s", srb2home, timeattackfolder, G_BuildMapName(gamemap)); - // Best Score ghost - /*if (cv_ghost_bestscore.value) - { - for (i = 0; i < numskins; ++i) - { - if (cv_ghost_bestscore.value == 1 && players[consoleplayer].skin != i) - continue; - - if (FIL_FileExists(va("%s-%s-score-best.lmp", gpath, skins[i].name))) - G_AddGhost(va("%s-%s-score-best.lmp", gpath, skins[i].name)); - } - }*/ - // Best Time ghost if (cv_ghost_besttime.value) { @@ -2460,8 +2448,8 @@ static void P_LoadRecordGhosts(void) } } - // Best lap ghost - /*if (cv_ghost_bestlap.value) + // Best Lap ghost + if (cv_ghost_bestlap.value) { for (i = 0; i < numskins; ++i) { @@ -2471,7 +2459,7 @@ static void P_LoadRecordGhosts(void) if (FIL_FileExists(va("%s-%s-lap-best.lmp", gpath, skins[i].name))) G_AddGhost(va("%s-%s-lap-best.lmp", gpath, skins[i].name)); } - }*/ + } // Last ghost if (cv_ghost_last.value) @@ -2505,7 +2493,7 @@ static void P_LoadRecordGhosts(void) free(gpath); } -static void P_LoadNightsGhosts(void) +/*static void P_LoadNightsGhosts(void) { const size_t glen = strlen(srb2home)+1+strlen("replay")+1+strlen(timeattackfolder)+1+strlen("MAPXX")+1; char *gpath = malloc(glen); @@ -2544,7 +2532,7 @@ static void P_LoadNightsGhosts(void) } free(gpath); -} +}*/ /** Loads a level from a lump or external wad. * @@ -2843,8 +2831,8 @@ boolean P_SetupLevel(boolean skipprecip) if (modeattacking == ATTACKING_RECORD && !demoplayback) P_LoadRecordGhosts(); - else if (modeattacking == ATTACKING_NIGHTS && !demoplayback) - P_LoadNightsGhosts(); + /*else if (modeattacking == ATTACKING_NIGHTS && !demoplayback) + P_LoadNightsGhosts();*/ if (G_TagGametype()) { diff --git a/src/p_spec.c b/src/p_spec.c index 36cdda6f..35f83432 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4156,6 +4156,10 @@ DoneSection2: CONS_Printf(M_GetText("%s started lap %u\n"), player_names[player-players], (UINT32)player->laps+1); } + // SRB2Kart: save best lap for record attack + bestlap = player->laptime; + player->laptime = 0; + // Reset starposts (checkpoints) info // SRB2kart 200117 player->starpostangle = player->starpostnum = 0; diff --git a/src/p_user.c b/src/p_user.c index 4f4907a4..30b6f9d5 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -732,8 +732,8 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) } // Add score to leaderboards now - if (!(netgame||multiplayer) && P_IsLocalPlayer(&players[i])) - G_AddTempNightsRecords(players[i].marescore, leveltime - player->marebegunat, players[i].mare + 1); + /*if (!(netgame||multiplayer) && P_IsLocalPlayer(&players[i])) + G_AddTempNightsRecords(players[i].marescore, leveltime - player->marebegunat, players[i].mare + 1);*/ // transfer scores anyway players[i].lastmarescore = players[i].marescore; @@ -755,8 +755,8 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) player->finishedrings = (INT16)(player->health - 1); // Add score to temp leaderboards - if (!(netgame||multiplayer) && P_IsLocalPlayer(player)) - G_AddTempNightsRecords(player->marescore, leveltime - player->marebegunat, (UINT8)(oldmare + 1)); + /*if (!(netgame||multiplayer) && P_IsLocalPlayer(player)) + G_AddTempNightsRecords(player->marescore, leveltime - player->marebegunat, (UINT8)(oldmare + 1));*/ // Starting a new mare, transfer scores player->lastmarescore = player->marescore; @@ -1645,19 +1645,6 @@ void P_DoPlayerExit(player_t *player) if (player->exiting) return; - // SRB2kart: Increment the "matches played" counter. - // Why here of all places instead of the intermission screen?!? - // To prevent someone from using "exitlevel" to unlock everything! - if (player == &players[consoleplayer] && ((!modifiedgame || savemoddata) && !demoplayback)) // SRB2kart: Unlock stuff in MP - { - matchesplayed++; - if (M_UpdateUnlockablesAndExtraEmblems()) - { - S_StartSound(NULL, sfx_ncitem); - G_SaveGameData(); // only save if unlocked something - } - } - if (gametype == GT_RACE || gametype == GT_COMPETITION) // If in Race Mode, allow { // SRB2kart 120217 @@ -8097,9 +8084,18 @@ static void P_DeathThink(player_t *player) if (!(countdown2 && !countdown) && !player->exiting && !(player->pflags & PF_TIMEOVER)) { if (leveltime >= 4*TICRATE) + { player->realtime = leveltime - 4*TICRATE; + if (player->spectator || !circuitmap) + player->laptime = 0; + else + player->laptime++; // This is too complicated to sync to realtime, just sorta hope for the best :V + } else + { player->realtime = 0; + player->laptime = 0; + } } if ((gametype == GT_RACE || gametype == GT_COMPETITION || (gametype == GT_COOP && (multiplayer || netgame))) && (player->lives <= 0)) @@ -9407,9 +9403,18 @@ void P_PlayerThink(player_t *player) if (!player->exiting) { if (leveltime >= 4*TICRATE) + { player->realtime = leveltime - 4*TICRATE; + if (player->spectator || !circuitmap) + player->laptime = 0; + else + player->laptime++; // This is too complicated to sync to realtime, just sorta hope for the best :V + } else + { player->realtime = 0; + player->laptime = 0; + } } if ((netgame || splitscreen) && player->spectator && cmd->buttons & BT_ATTACK && !player->powers[pw_flashing]) diff --git a/src/y_inter.c b/src/y_inter.c index 5bfed538..a3b2c43b 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -907,10 +907,13 @@ static void Y_UpdateRecordReplays(void) if ((mainrecords[gamemap-1]->time == 0) || (players[consoleplayer].realtime < mainrecords[gamemap-1]->time)) mainrecords[gamemap-1]->time = players[consoleplayer].realtime; + if ((mainrecords[gamemap-1]->lap == 0) || (bestlap < mainrecords[gamemap-1]->lap)) + mainrecords[gamemap-1]->lap = bestlap; + // Save demo! bestdemo[255] = '\0'; lastdemo[255] = '\0'; - G_SetDemoTime(players[consoleplayer].realtime, 0); + G_SetDemoTime(players[consoleplayer].realtime, bestlap); G_CheckDemoStatus(); I_mkdir(va("%s"PATHSEP"replay", srb2home), 0755); @@ -936,6 +939,15 @@ static void Y_UpdateRecordReplays(void) CONS_Printf("\x83%s\x80 %s '%s'\n", M_GetText("NEW RECORD TIME!"), M_GetText("Saved replay as"), bestdemo); } + snprintf(bestdemo, 255, "%s-%s-lap-best.lmp", gpath, cv_chooseskin.string); + if (!FIL_FileExists(bestdemo) || G_CmpDemoTime(bestdemo, lastdemo) & (1<<1)) + { // Better lap time, save this demo. + if (FIL_FileExists(bestdemo)) + remove(bestdemo); + FIL_WriteFile(bestdemo, buf, len); + CONS_Printf("\x83%s\x80 %s '%s'\n", M_GetText("NEW RECORD LAP!"), M_GetText("Saved replay as"), bestdemo); + } + //CONS_Printf("%s '%s'\n", M_GetText("Saved replay as"), lastdemo); Z_Free(buf); @@ -1033,7 +1045,7 @@ void Y_StartIntermission(void) { case int_nights: // Can't fail - G_SetNightsRecords(); + //G_SetNightsRecords(); // Check records { @@ -1059,10 +1071,10 @@ void Y_StartIntermission(void) mapvisited[gamemap-1] |= MV_BEATEN; if (ALL7EMERALDS(emeralds)) mapvisited[gamemap-1] |= MV_ALLEMERALDS; - if (ultimatemode) + /*if (ultimatemode) mapvisited[gamemap-1] |= MV_ULTIMATE; if (data.coop.gotperfbonus) - mapvisited[gamemap-1] |= MV_PERFECT; + mapvisited[gamemap-1] |= MV_PERFECT;*/ if (modeattacking == ATTACKING_RECORD) Y_UpdateRecordReplays(); @@ -1313,10 +1325,10 @@ void Y_StartIntermission(void) mapvisited[gamemap-1] |= MV_BEATEN; if (ALL7EMERALDS(emeralds)) mapvisited[gamemap-1] |= MV_ALLEMERALDS; - if (ultimatemode) + /*if (ultimatemode) mapvisited[gamemap-1] |= MV_ULTIMATE; if (data.coop.gotperfbonus) - mapvisited[gamemap-1] |= MV_PERFECT; + mapvisited[gamemap-1] |= MV_PERFECT;*/ if (modeattacking == ATTACKING_RECORD) Y_UpdateRecordReplays(); From 6f1dda7b7a5f96e1516a909fd8999a5ef79a7864 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 21 Jan 2018 21:03:44 -0500 Subject: [PATCH 07/14] Instead of player->laptime, lets add curlap Since lap time will only ever be used locally, it makes more sense to just use one variable instead of a player struct variable --- src/d_clisrv.c | 3 --- src/d_clisrv.h | 1 - src/d_player.h | 1 - src/doomstat.h | 2 +- src/g_game.c | 7 ++----- src/lua_playerlib.c | 4 ---- src/m_cheat.c | 4 ++-- src/m_menu.c | 8 ++++---- src/p_saveg.c | 2 -- src/p_setup.c | 2 +- src/p_spec.c | 8 ++++++-- src/p_user.c | 28 ++++++++++++++++++---------- 12 files changed, 34 insertions(+), 36 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 53288db7..dea76923 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -940,7 +940,6 @@ static inline void resynch_write_others(resynchend_pak *rst) rst->numboxes[i] = 0; rst->totalring[i] = 0; rst->realtime[i] = 0; - rst->laptime[i] = 0; rst->laps[i] = 0; continue; } @@ -952,7 +951,6 @@ static inline void resynch_write_others(resynchend_pak *rst) rst->numboxes[i] = SHORT(players[i].numboxes); rst->totalring[i] = SHORT(players[i].totalring); rst->realtime[i] = (tic_t)LONG(players[i].realtime); - rst->laptime[i] = (tic_t)LONG(players[i].laptime); rst->laps[i] = players[i].laps; } @@ -974,7 +972,6 @@ static inline void resynch_read_others(resynchend_pak *p) players[i].numboxes = SHORT(p->numboxes[i]); players[i].totalring = SHORT(p->totalring[i]); players[i].realtime = (tic_t)LONG(p->realtime[i]); - players[i].laptime = (tic_t)LONG(p->laptime[i]); players[i].laps = p->laps[i]; } } diff --git a/src/d_clisrv.h b/src/d_clisrv.h index d298d8a5..2d49bd61 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -169,7 +169,6 @@ typedef struct INT16 numboxes[MAXPLAYERS]; INT16 totalring[MAXPLAYERS]; tic_t realtime[MAXPLAYERS]; - tic_t laptime[MAXPLAYERS]; UINT8 laps[MAXPLAYERS]; } ATTRPACK resynchend_pak; diff --git a/src/d_player.h b/src/d_player.h index 9f8b4e5f..ccb428e1 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -463,7 +463,6 @@ typedef struct player_s INT16 numboxes; // Number of item boxes obtained for Race Mode INT16 totalring; // Total number of rings obtained for Race Mode tic_t realtime; // integer replacement for leveltime - tic_t laptime; // SRB2kart: Time spent on current lap, used for Record Attack UINT8 laps; // Number of laps (optional) //////////////////// diff --git a/src/doomstat.h b/src/doomstat.h index ed06e49c..7c1367ed 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -444,7 +444,7 @@ extern UINT8 gamespeed; extern boolean franticitems; extern boolean mirrormode; extern boolean comeback; -extern tic_t bestlap; +extern tic_t curlap, bestlap; extern tic_t hidetime; diff --git a/src/g_game.c b/src/g_game.c index 0770276e..883a2902 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -244,7 +244,8 @@ UINT8 gamespeed; // Game's current speed (or difficulty, or cc, or etc); 0-2 for boolean mirrormode; // Mirror Mode currently enabled? boolean franticitems; // Frantic items currently enabled? boolean comeback; // Battle Mode's karma comeback is on/off -tic_t bestlap; // Best lap time, should be local +tic_t curlap; // Current lap time, calculated locally +tic_t bestlap; // Best lap time, locally tic_t hidetime; @@ -2334,7 +2335,6 @@ void G_PlayerReborn(INT32 player) INT32 balloon; INT32 comebackpoints; INT32 comebackshowninfo; - tic_t laptime; score = players[player].score; lives = players[player].lives; @@ -2393,7 +2393,6 @@ void G_PlayerReborn(INT32 player) balloon = players[player].kartstuff[k_balloon]; comebackpoints = players[player].kartstuff[k_comebackpoints]; comebackshowninfo = players[player].kartstuff[k_comebackshowninfo]; - laptime = players[player].laptime; p = &players[player]; memset(p, 0, sizeof (*p)); @@ -2456,8 +2455,6 @@ void G_PlayerReborn(INT32 player) p->kartstuff[k_comebackshowninfo] = comebackshowninfo; p->kartstuff[k_comebacktimer] = comebacktime; - p->laptime = laptime; - // Don't do anything immediately p->pflags |= PF_USEDOWN; p->pflags |= PF_ATTACKDOWN; diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index 440fd8b1..47560847 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -228,8 +228,6 @@ static int player_get(lua_State *L) lua_pushinteger(L, plr->totalring); else if (fastcmp(field,"realtime")) lua_pushinteger(L, plr->realtime); - else if (fastcmp(field,"laptime")) - lua_pushinteger(L, plr->laptime); else if (fastcmp(field,"laps")) lua_pushinteger(L, plr->laps); else if (fastcmp(field,"ctfteam")) @@ -503,8 +501,6 @@ static int player_set(lua_State *L) plr->totalring = (INT16)luaL_checkinteger(L, 3); else if (fastcmp(field,"realtime")) plr->realtime = (tic_t)luaL_checkinteger(L, 3); - else if (fastcmp(field,"laptime")) - plr->laptime = (tic_t)luaL_checkinteger(L, 3); else if (fastcmp(field,"laps")) plr->laps = (UINT8)luaL_checkinteger(L, 3); else if (fastcmp(field,"ctfteam")) diff --git a/src/m_cheat.c b/src/m_cheat.c index d4f4e6e1..8af8a25c 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -235,8 +235,8 @@ boolean cht_Responder(event_t *ev) else ch = (UINT8)ev->data1; - ret += cht_CheckCheat(&cheat_ultimate, (char)ch); - ret += cht_CheckCheat(&cheat_ultimate_joy, (char)ch); + //ret += cht_CheckCheat(&cheat_ultimate, (char)ch); + //ret += cht_CheckCheat(&cheat_ultimate_joy, (char)ch); ret += cht_CheckCheat(&cheat_warp, (char)ch); ret += cht_CheckCheat(&cheat_warp_joy, (char)ch); #ifdef DEVELOP diff --git a/src/m_menu.c b/src/m_menu.c index ef562946..3da596d2 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -736,9 +736,9 @@ static menuitem_t SP_LevelSelectMenu[] = // Single Player Time Attack static menuitem_t SP_TimeAttackMenu[] = { - {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 52}, - {IT_STRING|IT_CVAR, NULL, "Player", &cv_chooseskin, 62}, - {IT_STRING|IT_CVAR, NULL, "Color", &cv_playercolor, 72}, + {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 48}, + {IT_STRING|IT_CVAR, NULL, "Player", &cv_chooseskin, 58}, + {IT_STRING|IT_CVAR, NULL, "Color", &cv_playercolor, 68}, {IT_DISABLED, NULL, "Guest Option...", &SP_GuestReplayDef, 100}, {IT_DISABLED, NULL, "Replay...", &SP_ReplayDef, 110}, @@ -5507,7 +5507,7 @@ void M_DrawTimeAttackMenu(void) { UINT8 *colormap = R_GetTranslationColormap(cv_chooseskin.value-1, cv_playercolor.value, 0); PictureOfUrFace = W_CachePatchName(skins[cv_chooseskin.value-1].face, PU_CACHE); - V_DrawMappedPatch(256,90,0,PictureOfUrFace, colormap); + V_DrawMappedPatch(256,88,0,PictureOfUrFace, colormap); } // Level record list diff --git a/src/p_saveg.c b/src/p_saveg.c index 501f086d..373b4d05 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -182,7 +182,6 @@ static void P_NetArchivePlayers(void) WRITEINT16(save_p, players[i].numboxes); WRITEINT16(save_p, players[i].totalring); WRITEUINT32(save_p, players[i].realtime); - WRITEUINT32(save_p, players[i].laptime); // SRB2kart WRITEUINT8(save_p, players[i].laps); //////////////////// @@ -367,7 +366,6 @@ static void P_NetUnArchivePlayers(void) players[i].numboxes = READINT16(save_p); // Number of item boxes obtained for Race Mode players[i].totalring = READINT16(save_p); // Total number of rings obtained for Race Mode players[i].realtime = READUINT32(save_p); // integer replacement for leveltime - players[i].laptime = READUINT32(save_p); // SRB2kart: used to track best lap time players[i].laps = READUINT8(save_p); // Number of laps (optional) //////////////////// diff --git a/src/p_setup.c b/src/p_setup.c index 1cf4aeb7..2142f0cf 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2204,7 +2204,7 @@ static void P_LevelInitStuff(void) } players[i].realtime = countdown = countdown2 = 0; - players[i].laptime = 0; // SRB2Kart + curlap = bestlap = 0; // SRB2Kart players[i].gotcontinue = false; diff --git a/src/p_spec.c b/src/p_spec.c index 35f83432..1648829c 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4157,8 +4157,12 @@ DoneSection2: } // SRB2Kart: save best lap for record attack - bestlap = player->laptime; - player->laptime = 0; + if (player == &players[consoleplayer]) + { + if (curlap < bestlap || bestlap == 0) + bestlap = curlap; + curlap = 0; + } // Reset starposts (checkpoints) info // SRB2kart 200117 diff --git a/src/p_user.c b/src/p_user.c index 30b6f9d5..c85ea89e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8086,15 +8086,19 @@ static void P_DeathThink(player_t *player) if (leveltime >= 4*TICRATE) { player->realtime = leveltime - 4*TICRATE; - if (player->spectator || !circuitmap) - player->laptime = 0; - else - player->laptime++; // This is too complicated to sync to realtime, just sorta hope for the best :V + if (player == &players[consoleplayer]) + { + if (player->spectator || !circuitmap) + curlap = 0; + else + curlap++; // This is too complicated to sync to realtime, just sorta hope for the best :V + } } else { player->realtime = 0; - player->laptime = 0; + if (player == &players[consoleplayer]) + curlap = 0; } } @@ -9405,15 +9409,19 @@ void P_PlayerThink(player_t *player) if (leveltime >= 4*TICRATE) { player->realtime = leveltime - 4*TICRATE; - if (player->spectator || !circuitmap) - player->laptime = 0; - else - player->laptime++; // This is too complicated to sync to realtime, just sorta hope for the best :V + if (player == &players[consoleplayer]) + { + if (player->spectator || !circuitmap) + curlap = 0; + else + curlap++; // This is too complicated to sync to realtime, just sorta hope for the best :V + } } else { player->realtime = 0; - player->laptime = 0; + if (player == &players[consoleplayer]) + curlap = 0; } } From f6cfcd4f89a0e87077580fcce7e4b4884096850c Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 24 Jan 2018 02:45:06 -0500 Subject: [PATCH 08/14] Restructured some ticcmd stuff, temporary keyboard defaults, commented out mouse options menu No more weapon number buttons, button constants reordered, and BT_JUMP renamed to BT_DRIFT, and removed a lot of commented out stuff or stuff we didn't need. Spectator-only support for looking up/down soon. Keyboard defaults are just what I use, plan on adjusting it further after more feedback --- src/b_bot.c | 10 +- src/d_netcmd.c | 10 +- src/d_ticcmd.h | 29 +++--- src/dehacked.c | 15 ++- src/g_game.c | 257 ++++++++++++----------------------------------- src/g_input.c | 266 ++++++------------------------------------------- src/g_input.h | 31 ++---- src/k_kart.c | 2 +- src/m_cheat.c | 2 +- src/m_menu.c | 2 +- src/p_user.c | 14 +-- 11 files changed, 141 insertions(+), 497 deletions(-) diff --git a/src/b_bot.c b/src/b_bot.c index 25204188..de311c0e 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -44,8 +44,8 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm if (tails->player->pflags & (PF_MACESPIN|PF_ITEMHANG)) { dist = P_AproxDistance(tails->x-sonic->x, tails->y-sonic->y); - if (sonic->player->cmd.buttons & BT_JUMP && sonic->player->pflags & (PF_JUMPED|PF_MACESPIN|PF_ITEMHANG)) - cmd->buttons |= BT_JUMP; + if (sonic->player->cmd.buttons & BT_DRIFT && sonic->player->pflags & (PF_JUMPED|PF_MACESPIN|PF_ITEMHANG)) + cmd->buttons |= BT_DRIFT; if (sonic->player->pflags & (PF_MACESPIN|PF_ITEMHANG)) { cmd->forwardmove = sonic->player->cmd.forwardmove; @@ -53,7 +53,7 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm if (sonic->angle < tails->angle) cmd->angleturn = -cmd->angleturn; } else if (dist > FixedMul(512*FRACUNIT, tails->scale)) - cmd->buttons |= BT_JUMP; + cmd->buttons |= BT_DRIFT; return; } @@ -116,7 +116,7 @@ void B_BuildTiccmd(player_t *player, ticcmd_t *cmd) if (player->playerstate == PST_DEAD) { if (B_CheckRespawn(player)) - cmd->buttons |= BT_JUMP; + cmd->buttons |= BT_DRIFT; return; } @@ -189,7 +189,7 @@ void B_KeysToTiccmd(mobj_t *mo, ticcmd_t *cmd, boolean forward, boolean backward cmd->sidemove += MAXPLMOVE<>16; } if (jump) - cmd->buttons |= BT_JUMP; + cmd->buttons |= BT_DRIFT; if (spin) cmd->buttons |= BT_BRAKE; } diff --git a/src/d_netcmd.c b/src/d_netcmd.c index fb518271..9f7d50d4 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -259,7 +259,7 @@ consvar_t cv_skipmapcheck = {"skipmapcheck", "Off", CV_SAVE, CV_OnOff, NULL, 0, INT32 cv_debug; -consvar_t cv_usemouse = {"use_mouse", "On", CV_SAVE|CV_CALL,usemouse_cons_t, I_StartupMouse, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_usemouse = {"use_mouse", "Off", CV_SAVE|CV_CALL,usemouse_cons_t, I_StartupMouse, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_usemouse2 = {"use_mouse2", "Off", CV_SAVE|CV_CALL,usemouse_cons_t, I_StartupMouse2, 0, NULL, NULL, 0, 0, NULL}; #if defined (DC) || defined (_XBOX) || defined (WMINPUT) || defined (_WII) //joystick 1 and 2 @@ -770,8 +770,8 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_crosshair2); CV_RegisterVar(&cv_crosshair3); CV_RegisterVar(&cv_crosshair4); - CV_RegisterVar(&cv_alwaysfreelook); - CV_RegisterVar(&cv_alwaysfreelook2); + //CV_RegisterVar(&cv_alwaysfreelook); + //CV_RegisterVar(&cv_alwaysfreelook2); // g_input.c CV_RegisterVar(&cv_sideaxis); @@ -815,8 +815,8 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_mousesens2); CV_RegisterVar(&cv_mouseysens); CV_RegisterVar(&cv_mouseysens2); - CV_RegisterVar(&cv_mousemove); - CV_RegisterVar(&cv_mousemove2); + //CV_RegisterVar(&cv_mousemove); + //CV_RegisterVar(&cv_mousemove2); CV_RegisterVar(&cv_usejoystick); CV_RegisterVar(&cv_usejoystick2); diff --git a/src/d_ticcmd.h b/src/d_ticcmd.h index 80403605..e140bd3d 100644 --- a/src/d_ticcmd.h +++ b/src/d_ticcmd.h @@ -24,23 +24,24 @@ // Button/action code definitions. typedef enum { - // First 4 bits are weapon change info, DO NOT USE! - BT_WEAPONMASK = 0x0F, //our first four bits. + BT_ACCELERATE = 1, // Accelerate + BT_DRIFT = 1<<2, // Drift (direction is cmd->angleturn) + 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 - BT_DRIFTLEFT = 1<<4, // Drift Left // BT_WEAPONNEXT - BT_DRIFTRIGHT = 1<<5, // Drift Right // BT_WEAPONPREV + // Want more button space? Help get rid of this hack :V + BT_DRIFTLEFT = 1<<8, // Drift left hack + BT_DRIFTRIGHT = 1<<9, // Drift right hack - BT_ATTACK = 1<<6, // use kart item // SRB2kart - BT_BRAKE = 1<<7, // brake // BT_USE - BT_FORWARD = 1<<8, // toss item forward // BT_CAMLEFT - BT_BACKWARD = 1<<9, // drop item behind // BT_CAMRIGHT - BT_SPECTATE = 1<<10, // toggle spectate // BT_TOSSFLAG - BT_JUMP = 1<<11, - BT_ACCELERATE = 1<<12, // Accelerate // BT_FIRENORMAL + // free: 1<<10 to 1<<12 - BT_CUSTOM1 = 1<<13, - BT_CUSTOM2 = 1<<14, - BT_CUSTOM3 = 1<<15, + // Lua garbage + BT_CUSTOM1 = 1<<13, + BT_CUSTOM2 = 1<<14, + BT_CUSTOM3 = 1<<15, } buttoncode_t; // The data sampled per tick (single player) diff --git a/src/dehacked.c b/src/dehacked.c index a7722d90..8dd9a8e8 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7815,16 +7815,15 @@ struct { {"NUMDIRS",NUMDIRS}, // Buttons (ticcmd_t) // SRB2kart - {"BT_WEAPONMASK",BT_WEAPONMASK}, //our first four bits. + {"BT_ACCELERATE",BT_ACCELERATE}, + {"BT_DRIFT",BT_DRIFT}, + {"BT_BRAKE",BT_BRAKE}, + {"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_ATTACK",BT_ATTACK}, // shoot rings - {"BT_BRAKE",BT_BRAKE}, // brake - {"BT_FORWARD",BT_FORWARD}, // turn camera left - {"BT_BACKWARD",BT_BACKWARD}, // turn camera right - {"BT_SPECTATE",BT_SPECTATE}, - {"BT_JUMP",BT_JUMP}, - {"BT_ACCELERATE",BT_ACCELERATE}, // Fire a normal ring no matter what {"BT_CUSTOM1",BT_CUSTOM1}, // Lua customizable {"BT_CUSTOM2",BT_CUSTOM2}, // Lua customizable {"BT_CUSTOM3",BT_CUSTOM3}, // Lua customizable diff --git a/src/g_game.c b/src/g_game.c index 883a2902..e626ec6b 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -385,11 +385,11 @@ consvar_t cv_crosshair2 = {"crosshair2", "Cross", CV_SAVE, crosshair_cons_t, NUL consvar_t cv_crosshair3 = {"crosshair3", "Cross", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_crosshair4 = {"crosshair4", "Cross", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_invertmouse = {"invertmouse", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_alwaysfreelook = {"alwaysmlook", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_alwaysfreelook = {"alwaysmlook", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_invertmouse2 = {"invertmouse2", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_alwaysfreelook2 = {"alwaysmlook2", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_mousemove = {"mousemove", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_mousemove2 = {"mousemove2", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_mousemove = {"mousemove", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_mousemove2 = {"mousemove2", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_analog = {"analog", "Off", CV_CALL, CV_OnOff, Analog_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_analog2 = {"analog2", "Off", CV_CALL, CV_OnOff, Analog2_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_analog3 = {"analog3", "Off", CV_CALL, CV_OnOff, Analog3_OnChange, 0, NULL, NULL, 0, 0, NULL}; @@ -1181,16 +1181,16 @@ INT32 localaiming, localaiming2, localaiming3, localaiming4; angle_t localangle, localangle2, localangle3, localangle4; static fixed_t forwardmove[2] = {25<>16, 50<>16}; -static fixed_t sidemove[2] = {25<>16, 50<>16}; // faster! +//static fixed_t sidemove[2] = {25<>16, 50<>16}; // faster! 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; + 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; + boolean turnleft, turnright, invertmouse, mouseaiming, lookaxis, analogjoystickmove, gamepadjoystickmove, kbl; //analog player_t *player; camera_t *thiscam; angle_t lang; @@ -1250,12 +1250,12 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) if (ssplayer == 2) { - mouseaiming = (PLAYER2INPUTDOWN(gc_mouseaiming)) ^ cv_alwaysfreelook2.value; + mouseaiming = player->spectator; //mouseaiming = (PLAYER2INPUTDOWN(gc_mouseaiming)) ^ cv_alwaysfreelook2.value; invertmouse = cv_invertmouse2.value; lookaxis = cv_lookaxis2.value; analogjoystickmove = cv_usejoystick2.value && !Joystick2.bGamepadStyle; gamepadjoystickmove = cv_usejoystick2.value && Joystick2.bGamepadStyle; - analog = cv_analog2.value; + //analog = cv_analog2.value; } else if (ssplayer == 3) { @@ -1264,7 +1264,7 @@ 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; + //analog = cv_analog3.value; } else if (ssplayer == 4) { @@ -1273,16 +1273,16 @@ 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; + //analog = cv_analog4.value; } else { - mouseaiming = (PLAYER1INPUTDOWN(gc_mouseaiming)) ^ cv_alwaysfreelook.value; + mouseaiming = player->spectator; //mouseaiming = (PLAYER1INPUTDOWN(gc_mouseaiming)) ^ cv_alwaysfreelook.value; invertmouse = cv_invertmouse.value; lookaxis = cv_lookaxis.value; analogjoystickmove = cv_usejoystick.value && !Joystick.bGamepadStyle; gamepadjoystickmove = cv_usejoystick.value && Joystick.bGamepadStyle; - analog = cv_analog.value; + //analog = cv_analog.value; } turnright = InputDown(gc_turnright, ssplayer); @@ -1318,64 +1318,16 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) tspeed = speed; // let movement keys cancel each other out - if (analog) // Analog - { - if (turnright) - cmd->angleturn = (INT16)(cmd->angleturn - angleturn[tspeed]); - if (turnleft) - cmd->angleturn = (INT16)(cmd->angleturn + angleturn[tspeed]); - } + if (turnright && !(turnleft)) + cmd->angleturn = (INT16)(cmd->angleturn - angleturn[tspeed]); + else if (turnleft && !(turnright)) + cmd->angleturn = (INT16)(cmd->angleturn + 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 (forcestrafe) // Analog + if (analogjoystickmove && axis != 0) { - if (turnright) - side += sidemove[speed]; - if (turnleft) - side -= sidemove[speed]; - - if (analogjoystickmove && axis != 0) - { - // JOYAXISRANGE is supposed to be 1023 (divide by 1024) - side += ((axis * sidemove[1]) >> 10); - } + // JOYAXISRANGE should be 1023 (divide by 1024) + cmd->angleturn = (INT16)(cmd->angleturn - ((axis * angleturn[1]) >> 10)); // ANALOG! } - 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! - } - } - - /* - axis = JoyAxis(AXISSTRAFE, ssplayer); - if (gamepadjoystickmove && axis != 0) - { - if (axis < 0) - side += sidemove[speed]; - else if (axis > 0) - side -= sidemove[speed]; - } - else if (analogjoystickmove && axis != 0) - { - // JOYAXISRANGE is supposed to be 1023 (divide by 1024) - side += ((axis * sidemove[1]) >> 10); - } - */ // forward with key or button // SRB2kart - we use an accel/brake instead of forward/backward. if (InputDown(gc_accelerate, ssplayer) || player->kartstuff[k_mushroomtimer]) @@ -1383,68 +1335,29 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) cmd->buttons |= BT_ACCELERATE; forward = forwardmove[1]; // 50 } + if (InputDown(gc_brake, ssplayer)) { cmd->buttons |= BT_BRAKE; forward -= forwardmove[0]; // 25 - Halved value so clutching is possible } - // But forward/backward IS used for aiming. + + // drift button + if (InputDown(gc_drift, ssplayer)) + cmd->buttons |= BT_DRIFT; + + // forward/backward is used for aiming axis = JoyAxis(AXISMOVE, ssplayer); if (InputDown(gc_aimforward, ssplayer) || (gamepadjoystickmove && axis < 0) || (analogjoystickmove && axis < 0)) cmd->buttons |= BT_FORWARD; if (InputDown(gc_aimbackward, ssplayer) || (gamepadjoystickmove && axis > 0) || (analogjoystickmove && axis > 0)) cmd->buttons |= BT_BACKWARD; - /* - if (InputDown(gc_forward, ssplayer) || (gamepadjoystickmove && axis < 0)) - forward = forwardmove[speed]; - if (InputDown(gc_backward, ssplayer) || (gamepadjoystickmove && axis > 0)) - forward -= forwardmove[speed]; - */ - - /* - if (analogjoystickmove && axis != 0) - forward -= ((axis * forwardmove[1]) >> 10); // ANALOG! - */ - - // some people strafe left & right with mouse buttons - // those people are weird - - /* // SRB2kart - these aren't used in kart - if (InputDown(gc_straferight, ssplayer)) - side += sidemove[speed]; - if (InputDown(gc_strafeleft, ssplayer)) - side -= sidemove[speed]; - - if (InputDown(gc_driftleft, ssplayer)) - cmd->buttons |= BT_WEAPONNEXT; // Next Weapon - if (InputDown(gc_driftright, ssplayer)) - cmd->buttons |= BT_WEAPONPREV; // Previous Weapon - */ - -#if NUM_WEAPONS > 10 -"Add extra inputs to g_input.h/gamecontrols_e" -#endif - //use the four avaliable bits to determine the weapon. - cmd->buttons &= ~BT_WEAPONMASK; - for (i = 0; i < NUM_WEAPONS; ++i) - if (InputDown(gc_wepslot1 + i, ssplayer)) - { - cmd->buttons |= (UINT16)(i + 1); - break; - } // fire with any button/key axis = JoyAxis(AXISFIRE, ssplayer); if (InputDown(gc_fire, ssplayer) || (cv_usejoystick.value && axis > 0)) cmd->buttons |= BT_ATTACK; - // fire normal with any button/key - /* - axis = JoyAxis(ssplayer, AXISFIRENORMAL); - if (InputDown(gc_accelerate, ssplayer) || (cv_usejoystick.value && axis > 0)) - cmd->buttons |= BT_ACCELERATE; - */ - if (InputDown(gc_spectate, ssplayer)) cmd->buttons |= BT_SPECTATE; @@ -1456,37 +1369,6 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) if (InputDown(gc_custom3, ssplayer)) cmd->buttons |= BT_CUSTOM3; - // use with any button/key - /* - if (InputDown(gc_brake, ssplayer)) - cmd->buttons |= BT_BRAKE; - */ - - // Camera Controls - /* - if (cv_debug || cv_analog.value || demoplayback || objectplacing || player->pflags & PF_NIGHTSMODE) - { - if (InputDown(gc_aimforward, ssplayer)) - cmd->buttons |= BT_FORWARD; - if (InputDown(gc_aimbackward, ssplayer)) - cmd->buttons |= BT_BACKWARD; - } - */ - - /* - if (InputDown(gc_lookback, ssplayer)) - { - if (thiscam->chase && !player->kartstuff[k_camspin]) - player->kartstuff[k_camspin] = 1; - } - else if (player->kartstuff[k_camspin] > 0) - player->kartstuff[k_camspin] = -1; - */ - - // jump button - if (InputDown(gc_jump, ssplayer)) - cmd->buttons |= BT_JUMP; - // player aiming shit, ahhhh... { INT32 player_invert = invertmouse ? -1 : 1; @@ -1532,18 +1414,41 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) cmd->aiming = G_ClipAimingPitch(&laim); } - if (!mouseaiming && cv_mousemove.value) - forward += mousey; - - if (analog || - (!demoplayback && (player->climbing - || (player->pflags & PF_SLIDING)))) // Analog for mouse - side += mousex*2; - else - cmd->angleturn = (INT16)(cmd->angleturn - (mousex*8)); - + cmd->angleturn = (INT16)(cmd->angleturn - (mousex*8)); mousex = mousey = mlooky = 0; + //{ SRB2kart - Drift support + axis = JoyAxis(AXISTURN, ssplayer); + if (mirrormode) + axis = -axis; + + // TODO: we really need to figure out a better way of doing this, two extra buttons used for this is stupid + 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; + //} + + // 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))) + lang += (cmd->angleturn<<16); + + cmd->angleturn = (INT16)(lang >> 16); + if (forward > MAXPLMOVE) forward = MAXPLMOVE; else if (forward < -MAXPLMOVE) @@ -1571,27 +1476,10 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) cmd->forwardmove = (SINT8)(cmd->forwardmove + forward); cmd->sidemove = (SINT8)(cmd->sidemove + side); - if (mirrormode) cmd->sidemove = -cmd->sidemove; - //{ SRB2kart - Drift support - axis = JoyAxis(AXISTURN, ssplayer); - if (mirrormode) - axis = -axis; - - 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 (ssplayer == 2 && player->bot == 1) { + /*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. @@ -1602,30 +1490,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) G_CopyTiccmd(cmd, I_BaseTiccmd2(), 1); // empty, or external driver B_BuildTiccmd(player, cmd); } - } - - 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))) - lang += (cmd->angleturn<<16); - - cmd->angleturn = (INT16)(lang >> 16); - } + }*/ if (ssplayer == 2) { diff --git a/src/g_input.c b/src/g_input.c index ebccda7f..cb5f189b 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -1188,40 +1188,23 @@ static keyname_t keynames[] = static const char *gamecontrolname[num_gamecontrols] = { "nothing", // a key/button mapped to gc_null has no effect - "forward", - "backward", - "strafeleft", - "straferight", - "turnleft", - "turnright", - "driftleft", - "driftright", - "weapon1", - "weapon2", - "weapon3", - "weapon4", - "weapon5", - "weapon6", - "weapon7", - "weapon8", - "weapon9", - "weapon10", - "fire", - "accelerate", - "spectate", - "brake", - "camtoggle", "aimforward", "aimbackward", + "turnleft", + "turnright", + "accelerate", + "drift", + "brake", + "fire", "lookback", + "camtoggle", + "spectate", "lookup", "lookdown", "centerview", - "mouseaiming", "talkkey", "teamtalkkey", "scores", - "jump", "console", "pause", "custom1", @@ -1285,222 +1268,35 @@ INT32 G_KeyStringtoNum(const char *keystr) return 0; } -#ifdef DC +// SRB2Kart void G_Controldefault(void) { - gamecontrol[gc_forward ][0] = KEY_HAT1+0; //Up - gamecontrol[gc_forward ][1] = KEY_UPARROW; - gamecontrol[gc_backward ][0] = KEY_HAT1+1; //Down - gamecontrol[gc_backward ][1] = KEY_DOWNARROW; - //gamecontrol[gc_straferight][0] = '['; - //gamecontrol[gc_strafeleft ][0] = ']'; - gamecontrol[gc_turnleft ][0] = KEY_HAT1+2; //Left - gamecontrol[gc_turnleft ][1] = KEY_LEFTARROW; - gamecontrol[gc_turnright ][0] = KEY_HAT1+3; //Right - gamecontrol[gc_turnright ][1] = KEY_RIGHTARROW; - gamecontrol[gc_driftleft ][0] = ']'; - gamecontrol[gc_driftright ][0] = '['; - gamecontrol[gc_fire ][0] = KEY_JOY1+6; //X - gamecontrol[gc_fire ][1] = KEY_RCTRL; - gamecontrol[gc_accelerate ][0] = KEY_JOY1+5; //Y - gamecontrol[gc_accelerate ][1] = ';'; - gamecontrol[gc_spectate ][0] = '\''; - gamecontrol[gc_brake ][0] = KEY_JOY1+1; //B - gamecontrol[gc_brake ][1] = '.'; - gamecontrol[gc_camtoggle ][1] = ','; - gamecontrol[gc_aimforward ][0] = 'o'; - gamecontrol[gc_aimbackward][0] = 'p'; - gamecontrol[gc_lookback ][0] = 'c'; - gamecontrol[gc_lookup ][0] = KEY_PGUP; - gamecontrol[gc_lookdown ][0] = KEY_PGDN; - gamecontrol[gc_centerview ][0] = KEY_END; - gamecontrol[gc_mouseaiming][0] = 's'; - gamecontrol[gc_talkkey ][0] = 't'; - gamecontrol[gc_teamkey ][0] = 'y'; - gamecontrol[gc_scores ][0] = KEY_TAB; - gamecontrol[gc_jump ][0] = KEY_JOY1+2; //A - gamecontrol[gc_jump ][1] = '/'; - gamecontrol[gc_console ][0] = KEY_CONSOLE; - gamecontrol[gc_console ][1] = KEY_F5; - //gamecontrolbis - gamecontrolbis[gc_forward ][0] = KEY_2HAT1+0; - gamecontrolbis[gc_forward ][1] = 'w'; - gamecontrolbis[gc_backward ][0] = KEY_2HAT1+1; - gamecontrolbis[gc_backward ][1] = 's'; - gamecontrolbis[gc_turnleft ][0] = KEY_2HAT1+2; - gamecontrolbis[gc_turnleft ][1] = 'a'; - gamecontrolbis[gc_turnright ][0] = KEY_2HAT1+3; - gamecontrolbis[gc_turnright ][1] = 'd'; - gamecontrolbis[gc_driftleft ][0] = 't'; - gamecontrolbis[gc_driftright][0] = 'r'; - gamecontrolbis[gc_fire ][0] = KEY_2JOY1+6; //X - gamecontrolbis[gc_accelerate][0] = KEY_2JOY1+5; //Y - gamecontrolbis[gc_brake ][0] = KEY_2JOY1+1; //B - gamecontrolbis[gc_jump ][0] = KEY_2JOY1+2; //A - //gamecontrolbis[gc_straferight][0] = 'x'; - //gamecontrolbis[gc_strafeleft ][0] = 'z'; -} -#elif defined (_PSP) -void G_Controldefault(void) -{ - gamecontrol[gc_forward ][0] = KEY_HAT1+0; // Up - gamecontrol[gc_backward ][0] = KEY_HAT1+1; // Down - gamecontrol[gc_turnleft ][0] = KEY_HAT1+2; // Left - gamecontrol[gc_turnright ][0] = KEY_HAT1+3; // Right - gamecontrol[gc_strafeleft ][0] = KEY_JOY1+4; // L - gamecontrol[gc_straferight][0] = KEY_JOY1+5; // R - gamecontrol[gc_spectate ][0] = KEY_JOY1+0; // Triangle - gamecontrol[gc_brake ][0] = KEY_JOY1+1; // Circle - gamecontrol[gc_camtoggle ][0] = KEY_JOY1+6; // Select - gamecontrol[gc_lookback ][0] = KEY_JOY1+3; // Square - gamecontrol[gc_centerview ][0] = KEY_JOY1+9; // Hold - gamecontrol[gc_pause ][0] = KEY_JOY1+8; // Start - gamecontrol[gc_jump ][0] = KEY_JOY1+2; // Cross -} -#elif defined (GP2X) -void G_Controldefault(void) -{ - gamecontrol[gc_fire ][0] = KEY_JOY1+0; //A - gamecontrol[gc_forward ][0] = KEY_JOY1+1; //Y - gamecontrol[gc_jump ][0] = KEY_JOY1+2; //B - gamecontrol[gc_brake ][0] = KEY_JOY1+3; //X - gamecontrol[gc_strafeleft ][0] = KEY_JOY1+4; //L - gamecontrol[gc_straferight][0] = KEY_JOY1+5; //R - gamecontrol[gc_lookup ][0] = KEY_JOY1+6; //U - gamecontrol[gc_lookdown ][0] = KEY_JOY1+7; //D - gamecontrol[gc_pause ][0] = KEY_JOY1+8; //S -} -#elif defined (_NDS) -void G_Controldefault(void) -{ - gamecontrol[gc_fire ][0] = KEY_JOY1+2; //X - gamecontrol[gc_forward ][0] = KEY_UPARROW; - gamecontrol[gc_backward ][0] = KEY_DOWNARROW; - gamecontrol[gc_jump ][0] = KEY_JOY1+0; //A - gamecontrol[gc_brake ][0] = KEY_JOY1+3; //Y - gamecontrol[gc_strafeleft ][0] = KEY_JOY1+4; //L - gamecontrol[gc_straferight][0] = KEY_JOY1+5; //R + // Main controls + gamecontrol[gc_aimforward ][0] = KEY_UPARROW; + gamecontrol[gc_aimbackward][0] = KEY_DOWNARROW; gamecontrol[gc_turnleft ][0] = KEY_LEFTARROW; gamecontrol[gc_turnright ][0] = KEY_RIGHTARROW; - gamecontrol[gc_pause ][0] = KEY_JOY1+6; //Start - gamecontrol[gc_driftleft ][0] = KEY_JOY1+7; //Select -} -#else -void G_Controldefault(void) -{ - gamecontrol[gc_forward ][0] = KEY_UPARROW; - gamecontrol[gc_forward ][1] = 'w'; - gamecontrol[gc_backward ][0] = KEY_DOWNARROW; - gamecontrol[gc_backward ][1] = 's'; - gamecontrol[gc_strafeleft ][0] = 'a'; - gamecontrol[gc_straferight][0] = 'd'; - gamecontrol[gc_turnleft ][0] = KEY_LEFTARROW; - gamecontrol[gc_turnright ][0] = KEY_RIGHTARROW; - gamecontrol[gc_driftleft ][0] = 'e'; - gamecontrol[gc_driftright ][0] = 'q'; - gamecontrol[gc_wepslot1 ][0] = '1'; - gamecontrol[gc_wepslot2 ][0] = '2'; - gamecontrol[gc_wepslot3 ][0] = '3'; - gamecontrol[gc_wepslot4 ][0] = '4'; - gamecontrol[gc_wepslot5 ][0] = '5'; - gamecontrol[gc_wepslot6 ][0] = '6'; - gamecontrol[gc_wepslot7 ][0] = '7'; - gamecontrol[gc_wepslot8 ][0] = '8'; - gamecontrol[gc_wepslot9 ][0] = '9'; - gamecontrol[gc_wepslot10 ][0] = '0'; - gamecontrol[gc_fire ][0] = KEY_RCTRL; - gamecontrol[gc_fire ][1] = KEY_MOUSE1+0; - gamecontrol[gc_accelerate ][0] = 'c'; - gamecontrol[gc_spectate ][0] = '\''; - gamecontrol[gc_brake ][0] = 'x'; - gamecontrol[gc_camtoggle ][0] = 'v'; - gamecontrol[gc_aimforward ][0] = '['; - gamecontrol[gc_aimbackward][0] = ']'; - gamecontrol[gc_lookback ][0] = 'r'; - gamecontrol[gc_lookup ][0] = KEY_PGUP; - gamecontrol[gc_lookdown ][0] = KEY_PGDN; - gamecontrol[gc_centerview ][0] = KEY_END; - gamecontrol[gc_talkkey ][0] = 't'; - gamecontrol[gc_teamkey ][0] = 'y'; - gamecontrol[gc_scores ][0] = KEY_TAB; - gamecontrol[gc_jump ][0] = 'z'; - gamecontrol[gc_jump ][1] = KEY_MOUSE1+1; - gamecontrol[gc_console ][0] = KEY_CONSOLE; + gamecontrol[gc_accelerate ][0] = 'a'; + gamecontrol[gc_drift ][0] = 's'; + gamecontrol[gc_brake ][0] = 'd'; + gamecontrol[gc_fire ][0] = KEY_SPACE; + gamecontrol[gc_lookback ][0] = KEY_LSHIFT; + + // Extra controls + gamecontrol[gc_camtoggle ][0] = KEY_BACKSPACE; gamecontrol[gc_pause ][0] = KEY_PAUSE; -#ifdef WMINPUT - gamecontrol[gc_forward ][0] = KEY_JOY1+02; //UP - gamecontrol[gc_backward ][0] = KEY_JOY1+03; //DOWN - gamecontrol[gc_turnleft ][0] = KEY_JOY1+04; //LEFT - gamecontrol[gc_turnright ][0] = KEY_JOY1+05; //RIGHT - gamecontrol[gc_driftleft ][0] = KEY_JOY1+10; //y - gamecontrol[gc_driftright ][0] = KEY_JOY1+9; //x - gamecontrol[gc_fire ][0] = KEY_JOY1+12; //L - gamecontrol[gc_accelerate ][0] = KEY_JOY1+13; //R - gamecontrol[gc_brake ][0] = KEY_JOY1+00; //B - gamecontrol[gc_brake ][1] = KEY_JOY1+07; //b - gamecontrol[gc_jump ][0] = KEY_JOY1+01; //A - gamecontrol[gc_jump ][1] = KEY_JOY1+06; //a - gamecontrol[gc_pause ][0] = KEY_JOY1+18; //Home - gamecontrolbis[gc_forward ][0] = KEY_2JOY1+02; //UP - gamecontrolbis[gc_backward ][0] = KEY_2JOY1+03; //DOWN - gamecontrolbis[gc_turnleft ][0] = KEY_2JOY1+04; //LEFT - gamecontrolbis[gc_turnright ][0] = KEY_2JOY1+05; //RIGHT - gamecontrolbis[gc_driftleft ][0] = KEY_2JOY1+10; //y - gamecontrolbis[gc_driftright ][0] = KEY_2JOY1+9; //x - gamecontrolbis[gc_fire ][0] = KEY_2JOY1+12; //L - gamecontrolbis[gc_accelerate ][0] = KEY_2JOY1+13; //R - gamecontrolbis[gc_brake ][0] = KEY_2JOY1+00; //B - gamecontrolbis[gc_brake ][1] = KEY_2JOY1+07; //b - gamecontrolbis[gc_jump ][0] = KEY_2JOY1+01; //A - gamecontrolbis[gc_jump ][1] = KEY_2JOY1+06; //a - gamecontrolbis[gc_pause ][0] = KEY_2JOY1+18; //Home -#endif -#ifdef _WII - gamecontrol[gc_forward ][1] = KEY_HAT1+00; //UP - gamecontrol[gc_backward ][1] = KEY_HAT1+01; //DOWN - gamecontrol[gc_straferight][1] = KEY_JOY1+16; //ZR - gamecontrol[gc_strafeleft ][1] = KEY_JOY1+15; //ZL - gamecontrol[gc_turnleft ][1] = KEY_HAT1+02; //LEFT - gamecontrol[gc_turnright ][1] = KEY_HAT1+03; //RIGHT - gamecontrol[gc_driftleft ][1] = KEY_JOY1+11; //x - gamecontrol[gc_fire ][0] = KEY_JOY1+12; //y - gamecontrol[gc_fire ][1] = KEY_JOY1+01; //B - gamecontrol[gc_accelerate ][0] = KEY_JOY1+13; //L - gamecontrol[gc_accelerate ][1] = KEY_JOY1+00; //A - gamecontrol[gc_spectate ][1] = KEY_JOY1+17; //Plus CC - gamecontrol[gc_brake ][0] = KEY_JOY1+9; //a - gamecontrol[gc_brake ][1] = KEY_JOY1+02; //1 - gamecontrol[gc_centerview ][1] = KEY_JOY1+14; //R - gamecontrol[gc_scores ][0] = KEY_JOY1+04; //Minus - gamecontrol[gc_scores ][1] = KEY_JOY1+18; //Minus - gamecontrol[gc_jump ][0] = KEY_JOY1+10; //b - gamecontrol[gc_jump ][1] = KEY_JOY1+3; //2 - gamecontrol[gc_pause ][0] = KEY_JOY1+06; //Home - gamecontrol[gc_pause ][1] = KEY_JOY1+19; //Home - gamecontrolbis[gc_forward ][1] = KEY_2HAT1+00; //UP - gamecontrolbis[gc_backward ][1] = KEY_2HAT1+01; //DOWN - gamecontrolbis[gc_straferight][1] = KEY_2JOY1+16; //ZR - gamecontrolbis[gc_strafeleft ][1] = KEY_2JOY1+15; //ZL - gamecontrolbis[gc_turnleft ][1] = KEY_2HAT1+02; //LEFT - gamecontrolbis[gc_turnright ][1] = KEY_2HAT1+03; //RIGHT - gamecontrolbis[gc_driftleft ][1] = KEY_2JOY1+11; //x - gamecontrolbis[gc_fire ][0] = KEY_2JOY1+12; //y - gamecontrolbis[gc_fire ][1] = KEY_2JOY1+01; //B - gamecontrolbis[gc_accelerate ][0] = KEY_2JOY1+13; //L - gamecontrolbis[gc_accelerate ][1] = KEY_2JOY1+00; //A - gamecontrolbis[gc_spectate ][1] = KEY_2JOY1+17; //Plus CC - gamecontrolbis[gc_brake ][0] = KEY_2JOY1+9; //a - gamecontrolbis[gc_brake ][1] = KEY_2JOY1+02; //1 - gamecontrolbis[gc_centerview ][1] = KEY_2JOY1+14; //R - gamecontrolbis[gc_scores ][0] = KEY_2JOY1+04; //Minus - gamecontrolbis[gc_scores ][1] = KEY_2JOY1+18; //Minus - gamecontrolbis[gc_jump ][0] = KEY_2JOY1+10; //b - gamecontrolbis[gc_jump ][1] = KEY_2JOY1+3; //2 - gamecontrolbis[gc_pause ][0] = KEY_2JOY1+06; //Home - gamecontrolbis[gc_pause ][1] = KEY_2JOY1+19; //Home -#endif + gamecontrol[gc_console ][0] = KEY_CONSOLE; + gamecontrol[gc_talkkey ][0] = 't'; + gamecontrol[gc_teamkey ][0] = 'y'; + gamecontrol[gc_scores ][0] = KEY_TAB; + gamecontrol[gc_spectate ][0] = '\''; + + // Spectator controls + gamecontrol[gc_lookup ][0] = KEY_PGUP; + gamecontrol[gc_lookdown ][0] = KEY_PGDN; + gamecontrol[gc_centerview ][0] = KEY_END; } -#endif +//#endif void G_SaveKeySetting(FILE *f) { diff --git a/src/g_input.h b/src/g_input.h index 205d50ce..6f2c6516 100644 --- a/src/g_input.h +++ b/src/g_input.h @@ -94,40 +94,23 @@ typedef enum typedef enum { gc_null = 0, // a key/button mapped to gc_null has no effect - gc_forward, - gc_backward, - gc_strafeleft, - gc_straferight, + gc_aimforward, + gc_aimbackward, gc_turnleft, gc_turnright, - gc_driftleft, // gc_weaponnext - gc_driftright, // gc_weaponprev - gc_wepslot1, - gc_wepslot2, - gc_wepslot3, - gc_wepslot4, - gc_wepslot5, - gc_wepslot6, - gc_wepslot7, - gc_wepslot8, - gc_wepslot9, - gc_wepslot10, + gc_accelerate, + gc_drift, + gc_brake, gc_fire, - gc_accelerate, // gc_firenormal - gc_spectate, // gc_tossflag - gc_brake, // gc_use + gc_lookback, gc_camtoggle, - gc_aimforward, // gc_camleft - gc_aimbackward, // gc_camright - gc_lookback, // gc_camreset + gc_spectate, gc_lookup, gc_lookdown, gc_centerview, - gc_mouseaiming, // mouse aiming is momentary (toggleable in the menu) gc_talkkey, gc_teamkey, gc_scores, - gc_jump, gc_console, gc_pause, gc_custom1, // Lua scriptable diff --git a/src/k_kart.c b/src/k_kart.c index 976a6ab0..27197347 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1575,7 +1575,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) && player->kartstuff[k_feather] & 2) player->kartstuff[k_feather] &= ~2; - if (cmd->buttons & BT_JUMP) + if (cmd->buttons & BT_DRIFT) player->kartstuff[k_jmp] = 1; else player->kartstuff[k_jmp] = 0; diff --git a/src/m_cheat.c b/src/m_cheat.c index 8af8a25c..ceb983c3 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -1101,7 +1101,7 @@ void OP_ObjectplaceMovement(player_t *player) if (!(cmd->angleturn & TICCMD_RECEIVED)) ticmiss++; - if (cmd->buttons & BT_JUMP) + if (cmd->buttons & BT_DRIFT) player->mo->z += FRACUNIT*cv_speed.value; else if (cmd->buttons & BT_BRAKE) player->mo->z -= FRACUNIT*cv_speed.value; diff --git a/src/m_menu.c b/src/m_menu.c index 3da596d2..30f2b8c2 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1120,7 +1120,7 @@ static menuitem_t OP_MoveControlsMenu[] = {IT_CALL | IT_STRING2, NULL, "Turn Left", M_ChangeControl, gc_turnleft }, {IT_CALL | IT_STRING2, NULL, "Turn Right", M_ChangeControl, gc_turnright }, {IT_CALL | IT_STRING2, NULL, "Accelerate", M_ChangeControl, gc_accelerate }, - {IT_CALL | IT_STRING2, NULL, "Drift", M_ChangeControl, gc_jump }, + {IT_CALL | IT_STRING2, NULL, "Drift", M_ChangeControl, gc_drift }, {IT_CALL | IT_STRING2, NULL, "Brake", M_ChangeControl, gc_brake }, {IT_CALL | IT_STRING2, NULL, "Use/Throw Item", M_ChangeControl, gc_fire }, {IT_CALL | IT_STRING2, NULL, "Look Backward", M_ChangeControl, gc_lookback }, diff --git a/src/p_user.c b/src/p_user.c index c85ea89e..e46717fa 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4108,7 +4108,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) } } - if (cmd->buttons & BT_JUMP && !player->exiting && !P_PlayerInPain(player)) + if (cmd->buttons & BT_DRIFT && !player->exiting && !P_PlayerInPain(player)) { #ifdef HAVE_BLUA if (LUAh_JumpSpecial(player)) @@ -4321,7 +4321,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) */ } - if (cmd->buttons & BT_JUMP) + if (cmd->buttons & BT_DRIFT) { player->pflags |= PF_JUMPDOWN; @@ -5068,7 +5068,7 @@ static void P_SpectatorMovement(player_t *player) if (player->mo->z < player->mo->floorz) player->mo->z = player->mo->floorz; - if (cmd->buttons & BT_JUMP) + if (cmd->buttons & BT_DRIFT) player->mo->z += FRACUNIT*16; else if (cmd->buttons & BT_BRAKE) player->mo->z -= FRACUNIT*16; @@ -5759,7 +5759,7 @@ static void P_NiGHTSMovement(player_t *player) if (player->drilldelay) player->drilldelay--; - if (!(cmd->buttons & BT_JUMP)) + if (!(cmd->buttons & BT_DRIFT)) { // Always have just a TINY bit of drill power. if (player->drillmeter <= 0) @@ -5996,7 +5996,7 @@ static void P_NiGHTSMovement(player_t *player) player->pflags |= PF_DRILLING; newangle = (INT16)player->flyangle; } - else if (cmd->buttons & BT_JUMP && player->drillmeter && player->drilldelay == 0) + else if (cmd->buttons & BT_DRIFT && player->drillmeter && player->drilldelay == 0) { if (!player->jumping) firstdrill = true; @@ -7003,7 +7003,7 @@ static void P_MovePlayer(player_t *player) if (player->charability2 == CA2_MULTIABILITY) { // Adventure-style flying by just holding the button down - if (cmd->buttons & BT_JUMP && !(player->pflags & PF_STASIS) && !player->exiting) + if (cmd->buttons & BT_DRIFT && !(player->pflags & PF_STASIS) && !player->exiting) P_SetObjectMomZ(player->mo, actionspd/4, true); } else @@ -8001,7 +8001,7 @@ static void P_DeathThink(player_t *player) // continue logic if (!(netgame || multiplayer) && player->lives <= 0) { - if (player->deadtimer > TICRATE && (cmd->buttons & BT_BRAKE || cmd->buttons & BT_ACCELERATE || cmd->buttons & BT_JUMP) && player->continues > 0) + if (player->deadtimer > TICRATE && (cmd->buttons & BT_BRAKE || cmd->buttons & BT_ACCELERATE || cmd->buttons & BT_DRIFT) && player->continues > 0) G_UseContinue(); else if (player->deadtimer >= gameovertics) G_UseContinue(); // Even if we don't have one this handles ending the game From 33350eb2a8f08a81a7de556377dfe9c0f0eb3208 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 24 Jan 2018 16:53:20 -0500 Subject: [PATCH 09/14] Spectator-only looking, fixed crosshairs --- src/g_game.c | 26 +++++++++++--------- src/hu_stuff.c | 64 ++++++++++++++++++++++++++++++++++++++++---------- src/m_menu.c | 43 +++++++++++++++++++-------------- 3 files changed, 92 insertions(+), 41 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 05aa2249..81e18197 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1424,7 +1424,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) ? -1 : 1; // set to -1 or 1 to multiply // mouse look stuff (mouse look is not the same as mouse aim) - if (mouseaiming) + if (mouseaiming && player->spectator) { kbl = false; @@ -1433,24 +1433,28 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) } axis = JoyAxis(AXISLOOK, ssplayer); - if (analogjoystickmove && axis != 0 && lookaxis) + if (analogjoystickmove && axis != 0 && lookaxis && player->spectator) laim += (axis<<16) * screen_invert; // spring back if not using keyboard neither mouselookin' if (!kbl && !lookaxis && !mouseaiming) laim = 0; - if (InputDown(gc_lookup, ssplayer) || (gamepadjoystickmove && axis < 0)) + if (player->spectator) { - laim += KB_LOOKSPEED * screen_invert; - kbl = true; + if (InputDown(gc_lookup, ssplayer) || (gamepadjoystickmove && axis < 0)) + { + laim += KB_LOOKSPEED * screen_invert; + kbl = true; + } + else if (InputDown(gc_lookdown, ssplayer) || (gamepadjoystickmove && axis > 0)) + { + laim -= KB_LOOKSPEED * screen_invert; + kbl = true; + } } - else if (InputDown(gc_lookdown, ssplayer) || (gamepadjoystickmove && axis > 0)) - { - laim -= KB_LOOKSPEED * screen_invert; - kbl = true; - } - else if (InputDown(gc_centerview, ssplayer)) + + if (InputDown(gc_centerview, ssplayer)) // No need to put a spectator limit on this one though :V laim = 0; // accept no mlook for network games diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 0349d979..8fc67fab 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -911,7 +911,7 @@ static void HU_DrawChat(void) static inline void HU_DrawCrosshair(void) { - INT32 i, y; + INT32 i, x, y; i = cv_crosshair.value & 3; if (!i) @@ -922,17 +922,23 @@ static inline void HU_DrawCrosshair(void) #ifdef HWRENDER if (rendermode != render_soft) + { + x = (INT32)gr_basewindowcenterx; y = (INT32)gr_basewindowcentery; + } else #endif + { + x = viewwindowx + (viewwidth>>1); y = viewwindowy + (viewheight>>1); + } - V_DrawScaledPatch(vid.width>>1, y, V_NOSCALESTART|V_OFFSET|V_TRANSLUCENT, crosshair[i - 1]); + V_DrawScaledPatch(x, y, V_NOSCALESTART|V_OFFSET|V_TRANSLUCENT, crosshair[i - 1]); } static inline void HU_DrawCrosshair2(void) { - INT32 i, y; + INT32 i, x, y; i = cv_crosshair2.value & 3; if (!i) @@ -943,27 +949,43 @@ static inline void HU_DrawCrosshair2(void) #ifdef HWRENDER if (rendermode != render_soft) + { + x = (INT32)gr_basewindowcenterx; y = (INT32)gr_basewindowcentery; + } else #endif + { + x = viewwindowx + (viewwidth>>1); y = viewwindowy + (viewheight>>1); + } if (splitscreen) { + if (splitscreen > 1) #ifdef HWRENDER - if (rendermode != render_soft) - y += (INT32)gr_viewheight; - else + if (rendermode != render_soft) + x += (INT32)gr_viewwidth; + else #endif - y += viewheight; + x += viewwidth; + else + { +#ifdef HWRENDER + if (rendermode != render_soft) + y += (INT32)gr_viewheight; + else +#endif + y += viewheight; + } - V_DrawScaledPatch(vid.width>>1, y, V_NOSCALESTART|V_OFFSET|V_TRANSLUCENT, crosshair[i - 1]); + V_DrawScaledPatch(x, y, V_NOSCALESTART|V_OFFSET|V_TRANSLUCENT, crosshair[i - 1]); } } static inline void HU_DrawCrosshair3(void) { - INT32 i, y; + INT32 i, x, y; i = cv_crosshair3.value & 3; if (!i) @@ -974,10 +996,16 @@ static inline void HU_DrawCrosshair3(void) #ifdef HWRENDER if (rendermode != render_soft) + { + x = (INT32)gr_basewindowcenterx; y = (INT32)gr_basewindowcentery; + } else #endif + { + x = viewwindowx + (viewwidth>>1); y = viewwindowy + (viewheight>>1); + } if (splitscreen > 1) { @@ -988,13 +1016,13 @@ static inline void HU_DrawCrosshair3(void) #endif y += viewheight; - V_DrawScaledPatch(vid.width>>1, y, V_NOSCALESTART|V_OFFSET|V_TRANSLUCENT, crosshair[i - 1]); + V_DrawScaledPatch(x, y, V_NOSCALESTART|V_OFFSET|V_TRANSLUCENT, crosshair[i - 1]); } } static inline void HU_DrawCrosshair4(void) { - INT32 i, y; + INT32 i, x, y; i = cv_crosshair4.value & 3; if (!i) @@ -1005,21 +1033,33 @@ static inline void HU_DrawCrosshair4(void) #ifdef HWRENDER if (rendermode != render_soft) + { + x = (INT32)gr_basewindowcenterx; y = (INT32)gr_basewindowcentery; + } else #endif + { + x = viewwindowx + (viewwidth>>1); y = viewwindowy + (viewheight>>1); + } if (splitscreen > 2) { #ifdef HWRENDER if (rendermode != render_soft) + { + x += (INT32)gr_viewwidth; y += (INT32)gr_viewheight; + } else #endif + { + x += viewwidth; y += viewheight; + } - V_DrawScaledPatch(vid.width>>1, y, V_NOSCALESTART|V_OFFSET|V_TRANSLUCENT, crosshair[i - 1]); + V_DrawScaledPatch(x, y, V_NOSCALESTART|V_OFFSET|V_TRANSLUCENT, crosshair[i - 1]); } } diff --git a/src/m_menu.c b/src/m_menu.c index 30f2b8c2..314acda2 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -282,7 +282,7 @@ static void M_SetupMultiPlayer4(INT32 choice); // Split into multiple parts due to size // Controls menu_t OP_ControlsDef, /*OP_ControlListDef,*/ OP_MoveControlsDef; -menu_t /*OP_MPControlsDef, OP_CameraControlsDef, OP_MiscControlsDef,*/ OP_CustomControlsDef; +menu_t /*OP_MPControlsDef, OP_CameraControlsDef, OP_MiscControlsDef,*/ OP_CustomControlsDef, OP_SpectateControlsDef; menu_t OP_P1ControlsDef, OP_P2ControlsDef; menu_t OP_MouseOptionsDef, OP_Mouse2OptionsDef; menu_t OP_Joystick1Def, OP_Joystick2Def; @@ -1060,11 +1060,11 @@ static menuitem_t OP_ControlsMenu[] = static menuitem_t OP_P1ControlsMenu[] = { {IT_CALL | IT_STRING, NULL, "Control Configuration...", M_Setup1PControlsMenu, 10}, - {IT_SUBMENU | IT_STRING, NULL, "Mouse Options...", &OP_MouseOptionsDef, 20}, - {IT_SUBMENU | IT_STRING, NULL, "Joystick Options...", &OP_Joystick1Def , 30}, + //{IT_SUBMENU | IT_STRING, NULL, "Mouse Options...", &OP_MouseOptionsDef, 20}, + {IT_SUBMENU | IT_STRING, NULL, "Joystick Options...", &OP_Joystick1Def , 20}, - {IT_STRING | IT_CVAR, NULL, "Camera" , &cv_chasecam , 50}, - {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair , 60}, + {IT_STRING | IT_CVAR, NULL, "Camera" , &cv_chasecam , 40}, + {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair , 50}, //{IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog, 80}, }; @@ -1072,11 +1072,11 @@ static menuitem_t OP_P1ControlsMenu[] = static menuitem_t OP_P2ControlsMenu[] = { {IT_CALL | IT_STRING, NULL, "Control Configuration...", M_Setup2PControlsMenu, 10}, - {IT_SUBMENU | IT_STRING, NULL, "Second Mouse Options...", &OP_Mouse2OptionsDef, 20}, - {IT_SUBMENU | IT_STRING, NULL, "Second Joystick Options...", &OP_Joystick2Def , 30}, + //{IT_SUBMENU | IT_STRING, NULL, "Second Mouse Options...", &OP_Mouse2OptionsDef, 20}, + {IT_SUBMENU | IT_STRING, NULL, "Second Joystick Options...", &OP_Joystick2Def , 20}, - {IT_STRING | IT_CVAR, NULL, "Camera" , &cv_chasecam2 , 50}, - {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair2, 60}, + {IT_STRING | IT_CVAR, NULL, "Camera" , &cv_chasecam2 , 40}, + {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair2, 50}, //{IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog2, 70}, }; @@ -1124,18 +1124,25 @@ static menuitem_t OP_MoveControlsMenu[] = {IT_CALL | IT_STRING2, NULL, "Brake", M_ChangeControl, gc_brake }, {IT_CALL | IT_STRING2, NULL, "Use/Throw Item", M_ChangeControl, gc_fire }, {IT_CALL | IT_STRING2, NULL, "Look Backward", M_ChangeControl, gc_lookback }, - {IT_CALL | IT_STRING2, NULL, "Toggle Chasecam", M_ChangeControl, gc_camtoggle }, - {IT_CALL | IT_STRING2, NULL, "Pause", M_ChangeControl, gc_pause }, - {IT_CALL | IT_STRING2, NULL, "Console", M_ChangeControl, gc_console }, - + {IT_CALL | IT_STRING2, NULL, "Toggle Chasecam", M_ChangeControl, gc_camtoggle }, {IT_CALL | IT_STRING2, NULL, "Talk key", M_ChangeControl, gc_talkkey }, {IT_CALL | IT_STRING2, NULL, "Team-Talk key", M_ChangeControl, gc_teamkey }, {IT_CALL | IT_STRING2, NULL, "Rankings/Scores", M_ChangeControl, gc_scores }, - {IT_CALL | IT_STRING2, NULL, "Spectate", M_ChangeControl, gc_spectate }, - {IT_SUBMENU | IT_STRING, NULL, "Custom Actions...",&OP_CustomControlsDef, 128}, -// {IT_CALL | IT_STRING2, NULL, "Strafe Left", M_ChangeControl, gc_strafeleft }, -// {IT_CALL | IT_STRING2, NULL, "Strafe Right", M_ChangeControl, gc_straferight}, + + {IT_CALL | IT_STRING2, NULL, "Pause", M_ChangeControl, gc_pause }, + {IT_CALL | IT_STRING2, NULL, "Console", M_ChangeControl, gc_console }, + + {IT_SUBMENU | IT_STRING, NULL, "Spectator Controls...",&OP_SpectateControlsDef,120}, + {IT_SUBMENU | IT_STRING, NULL, "Custom Actions...", &OP_CustomControlsDef, 128}, +}; + +static menuitem_t OP_SpectateControlsMenu[] = +{ + {IT_CALL | IT_STRING2, NULL, "Spectate", M_ChangeControl, gc_spectate }, + {IT_CALL | IT_STRING2, NULL, "Look Up", M_ChangeControl, gc_lookup }, + {IT_CALL | IT_STRING2, NULL, "Look Down", M_ChangeControl, gc_lookdown }, + {IT_CALL | IT_STRING2, NULL, "Center View", M_ChangeControl, gc_centerview}, }; static menuitem_t OP_CustomControlsMenu[] = @@ -1143,7 +1150,6 @@ static menuitem_t OP_CustomControlsMenu[] = {IT_CALL | IT_STRING2, NULL, "Custom Action 1", M_ChangeControl, gc_custom1}, {IT_CALL | IT_STRING2, NULL, "Custom Action 2", M_ChangeControl, gc_custom2}, {IT_CALL | IT_STRING2, NULL, "Custom Action 3", M_ChangeControl, gc_custom3}, - }; // Obsolete thanks to Kart @@ -1789,6 +1795,7 @@ menu_t OP_MoveControlsDef = CONTROLMENUSTYLE(OP_MoveControlsMenu, &OP_ControlsDe //menu_t OP_CameraControlsDef = CONTROLMENUSTYLE(OP_CameraControlsMenu, &OP_ControlListDef); //menu_t OP_MiscControlsDef = CONTROLMENUSTYLE(OP_MiscControlsMenu, &OP_ControlListDef); menu_t OP_CustomControlsDef = CONTROLMENUSTYLE(OP_CustomControlsMenu, &OP_MoveControlsDef); +menu_t OP_SpectateControlsDef = CONTROLMENUSTYLE(OP_SpectateControlsMenu, &OP_MoveControlsDef); menu_t OP_P1ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P1ControlsMenu, &OP_ControlsDef, 60, 30); menu_t OP_P2ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P2ControlsMenu, &OP_ControlsDef, 60, 30); #ifndef NOFOURPLAYER From e27a60847e354e2bbabb2c52dca4d86d01b5f1e3 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 24 Jan 2018 17:00:22 -0500 Subject: [PATCH 10/14] Oops Changed my mind about my prior decision to comment out crosshair drawing, forgot to readd it when I fixed it :V --- src/hu_stuff.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 8fc67fab..5769ce34 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -1212,18 +1212,20 @@ void HU_Drawer(void) return; // draw the crosshair, not when viewing demos nor with chasecam - // SRB2kart: not for kart though :V - /*if (!automapactive && cv_crosshair.value && !demoplayback && !camera.chase && !players[displayplayer].spectator) - HU_DrawCrosshair(); + if (!automapactive && !demoplayback) + { + if (cv_crosshair.value && !camera.chase && !players[displayplayer].spectator) + HU_DrawCrosshair(); - if (!automapactive && cv_crosshair2.value && !demoplayback && !camera2.chase && !players[secondarydisplayplayer].spectator) - HU_DrawCrosshair2(); + if (cv_crosshair2.value && !camera2.chase && !players[secondarydisplayplayer].spectator) + HU_DrawCrosshair2(); - if (!automapactive && cv_crosshair3.value && !demoplayback && !camera3.chase && !players[thirddisplayplayer].spectator) - HU_DrawCrosshair3(); + if (cv_crosshair3.value && !camera3.chase && !players[thirddisplayplayer].spectator) + HU_DrawCrosshair3(); - if (!automapactive && cv_crosshair4.value && !demoplayback && !camera4.chase && !players[fourthdisplayplayer].spectator) - HU_DrawCrosshair4();*/ + if (cv_crosshair4.value && !camera4.chase && !players[fourthdisplayplayer].spectator) + HU_DrawCrosshair4(); + } // draw desynch text if (hu_resynching) From 37a74cbd9444feece5894925196101f2410fec1c Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 28 Jan 2018 19:57:38 -0500 Subject: [PATCH 11/14] Double-check legitimacy on match completion --- src/doomstat.h | 1 + src/g_game.c | 19 ++++++++++++++----- src/p_user.c | 7 +++++++ 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/doomstat.h b/src/doomstat.h index 7c1367ed..a74e470b 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -445,6 +445,7 @@ extern boolean franticitems; extern boolean mirrormode; extern boolean comeback; extern tic_t curlap, bestlap; +extern boolean legitimateexit; extern tic_t hidetime; diff --git a/src/g_game.c b/src/g_game.c index 81e18197..7a022e5c 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -244,6 +244,8 @@ UINT8 gamespeed; // Game's current speed (or difficulty, or cc, or etc); 0-2 for boolean mirrormode; // Mirror Mode currently enabled? boolean franticitems; // Frantic items currently enabled? boolean comeback; // Battle Mode's karma comeback is on/off + +boolean legitimateexit; // Did this client actually finish the match? Calculated locally tic_t curlap; // Current lap time, calculated locally tic_t bestlap; // Best lap time, locally @@ -2264,14 +2266,19 @@ static inline void G_PlayerFinishLevel(INT32 player) V_SetPaletteLump(GetPalette()); // Reset the palette // SRB2kart: Increment the "matches played" counter. - if (player == consoleplayer && ((!modifiedgame || savemoddata) && !demoplayback)) // SRB2kart: Yes, let stuff unlock stuff in MP + if (player == consoleplayer) { - matchesplayed++; - if (M_UpdateUnlockablesAndExtraEmblems()) + if (legitimateexit && ((!modifiedgame || savemoddata) && !demoplayback)) { - S_StartSound(NULL, sfx_ncitem); - G_SaveGameData(); // only save if unlocked something + matchesplayed++; + if (M_UpdateUnlockablesAndExtraEmblems()) + { + S_StartSound(NULL, sfx_ncitem); + G_SaveGameData(); // only save if unlocked something + } } + + legitimateexit = false; } } @@ -3892,6 +3899,8 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean if (netgame || multiplayer) // Nice try, haxor. ultimatemode = false; + legitimateexit = false; // SRB2Kart + if (!demoplayback && !netgame) // Netgame sets random seed elsewhere, demo playback sets seed just before us! P_SetRandSeed(M_RandomizedSeed()); // Use a more "Random" random seed diff --git a/src/p_user.c b/src/p_user.c index d434a6bf..978ee1b9 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1645,6 +1645,13 @@ void P_DoPlayerExit(player_t *player) if (player->exiting) return; + if ((player == &players[consoleplayer] + || (splitscreen && player == &players[secondarydisplayplayer]) + || (splitscreen > 1 && player == &players[thirddisplayplayer]) + || (splitscreen > 2 && player == &players[fourthdisplayplayer])) + && (!player->spectator && ((!modifiedgame || savemoddata) && !demoplayback))) + legitimateexit = true; + if (gametype == GT_RACE || gametype == GT_COMPETITION) // If in Race Mode, allow { // SRB2kart 120217 From 0958c9c691ba25abbbfbb29bb9c1c469661943c8 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 28 Jan 2018 20:05:18 -0500 Subject: [PATCH 12/14] Minor adjustin's to the unlock list --- src/m_cond.c | 60 ++++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/m_cond.c b/src/m_cond.c index 65a3ff6f..2dfb502a 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -32,73 +32,73 @@ conditionset_t conditionSets[MAXCONDITIONSETS]; // Default Emblem locations emblem_t emblemlocations[MAXEMBLEMS] = { - // -- GREEN HILLS -- + // -- MAP01: GREEN HILLS -- // Time: 1:30.00 {ET_TIME, 0,0,0, 1, 'T', SKINCOLOR_GREY, 90*TICRATE, "", 0}, - // -- NORTHERN DISTRICT -- + // -- MAP02: NORTHERN DISTRICT -- // Time: x:xx.xx {ET_TIME, 0,0,0, 2, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, - // -- SUNBEAM PARADISE -- - // Time: 2:00.00 - {ET_TIME, 0,0,0, 3, 'T', SKINCOLOR_GREY, 120*TICRATE, "", 0}, - // -- PIPE SPEEDWAY -- + // -- MAP03: SUNBEAM PARADISE -- + // Time: x:xx.xx + {ET_TIME, 0,0,0, 3, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, + // -- MAP04: PIPE SPEEDWAY -- // Time: x:xx.xx {ET_TIME, 0,0,0, 4, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, - // -- DARKVILE GARDEN -- + // -- MAP05: DARKVILE GARDEN -- // Time: x:xx.xx {ET_TIME, 0,0,0, 5, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, - // -- MEGABLOCK CASTLE -- + // -- MAP06: MEGABLOCK CASTLE -- // Time: x:xx.xx {ET_TIME, 0,0,0, 6, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, - // -- MIDNIGHT MEADOW -- + // -- MAP07: MIDNIGHT MEADOW -- // Time: x:xx.xx {ET_TIME, 0,0,0, 7, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, - // -- HILL TOP -- + // -- MAP11: HILL TOP -- // Time: x:xx.xx {ET_TIME, 0,0,0, 11, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, - // -- SAPPHIRE COAST -- + // -- MAP13: SAPPHIRE COAST -- // Time: x:xx.xx {ET_TIME, 0,0,0, 13, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, - // -- BLUE MOUNTAIN -- + // -- MAP15: BLUE MOUNTAIN -- // Time: x:xx.xx {ET_TIME, 0,0,0, 15, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, - // -- CASINO RESORT -- + // -- MAP19: CASINO RESORT -- // Time: x:xx.xx {ET_TIME, 0,0,0, 19, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, - // -- SILVERCLOUD ISLAND -- + // -- MAP21: SILVERCLOUD ISLAND -- // Time: x:xx.xx {ET_TIME, 0,0,0, 21, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, - // -- CANYON RUSH -- + // -- MAP25: CANYON RUSH -- // Time: x:xx.xx {ET_TIME, 0,0,0, 25, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, - // -- CLOUD CRADLE K -- + // -- MAP26: CLOUD CRADLE K -- // Time: x:xx.xx {ET_TIME, 0,0,0, 26, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, - // -- TOXIC PALACE -- + // -- MAP27: TOXIC PALACE -- // Time: x:xx.xx {ET_TIME, 0,0,0, 27, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, - // -- ANCIENT TOMB -- + // -- MAP30: ANCIENT TOMB -- // Time: x:xx.xx {ET_TIME, 0,0,0, 30, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, - // -- SUB-ZERO PEAK -- + // -- MAP31: SUB-ZERO PEAK -- // Time: x:xx.xx {ET_TIME, 0,0,0, 31, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, - // -- VIRTUAL HIGHWAY -- + // -- MAP32: VIRTUAL HIGHWAY -- // Time: x:xx.xx {ET_TIME, 0,0,0, 32, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, - // -- EGGMAN'S NIGHTCLUB -- + // -- MAP33: EGGMAN'S NIGHTCLUB -- // Time: x:xx.xx {ET_TIME, 0,0,0, 37, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, - // -- GBA RAINBOW ROAD -- + // -- MAP61: GBA RAINBOW ROAD -- // Time: x:xx.xx {ET_TIME, 0,0,0, 61, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, - // -- SONIC SPEEDWAY -- + // -- MAP70: SONIC SPEEDWAY -- // Time: x:xx.xx {ET_TIME, 0,0,0, 70, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, - // -- AURORA ATOLL -- + // -- MAP72: AURORA ATOLL -- // Time: x:xx.xx {ET_TIME, 0,0,0, 72, 'T', SKINCOLOR_GREY, 300*TICRATE, "", 0}, - // -- BARREN BADLANDS -- + // -- MAP79: BARREN BADLANDS -- // Time: 2:30.00 {ET_TIME, 0,0,0, 79, 'T', SKINCOLOR_GREY, 150*TICRATE, "", 0}, }; @@ -113,12 +113,12 @@ extraemblem_t extraemblems[MAXEXTRAEMBLEMS] = unlockable_t unlockables[MAXUNLOCKABLES] = { // Name, Objective, Menu Height, ConditionSet, Unlock Type, Variable, NoCecho, NoChecklist - /* 01 */ {"Record Attack", "", 0, -1, SECRET_RECORDATTACK, 0, true, true, 0}, - /* 02 */ {"Play Credits", "", 10, -1, SECRET_CREDITS, 0, true, true, 0}, - /* 03 */ {"Sound Test", "", 20, -1, SECRET_SOUNDTEST, 0, true, true, 0}, + /* 01 */ {"SNES Cup", "Collect 5 Emblems", 0, 1, SECRET_NONE, 0, false, false, 0}, + /* 02 */ {"Chaotic Kart Cup", "Collect 15 Emblems", 0, 2, SECRET_NONE, 0, false, false, 0}, - /* 04 */ {"SNES Cup", "Collect 5 Emblems", 0, 1, SECRET_NONE, 0, false, false, 0}, - /* 05 */ {"Chaotic Kart Cup", "Collect 15 Emblems", 0, 2, SECRET_NONE, 0, false, false, 0}, + /* 03 */ {"Record Attack", "", 0, -1, SECRET_RECORDATTACK, 0, true, true, 0}, + /* 04 */ {"Play Credits", "", 10, -1, SECRET_CREDITS, 0, true, true, 0}, + /* 05 */ {"Sound Test", "", 20, -1, SECRET_SOUNDTEST, 0, true, true, 0}, }; // Default number of emblems and extra emblems From 5b9a9faae72745defb061df7c23a194258c3c71d Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 28 Jan 2018 20:37:53 -0500 Subject: [PATCH 13/14] Minor adjustments for a taller thin font --- src/hu_stuff.c | 10 +++++----- src/m_menu.c | 10 +++++----- src/y_inter.c | 20 ++++++++++---------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 5769ce34..7f7946af 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -1491,7 +1491,7 @@ void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer) else V_DrawSmallMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap); } - V_DrawRightAlignedThinString(x+120, y, ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count)); + V_DrawRightAlignedThinString(x+120, y-1, ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count)); } } @@ -1568,15 +1568,15 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline if (circuitmap) { if (players[tab[i].num].exiting) - V_DrawRightAlignedThinString(x+156, y, 0, va("%i:%02i.%02i", G_TicsToMinutes(players[tab[i].num].realtime,true), G_TicsToSeconds(players[tab[i].num].realtime), G_TicsToCentiseconds(players[tab[i].num].realtime))); + V_DrawRightAlignedThinString(x+156, y-1, 0, va("%i:%02i.%02i", G_TicsToMinutes(players[tab[i].num].realtime,true), G_TicsToSeconds(players[tab[i].num].realtime), G_TicsToCentiseconds(players[tab[i].num].realtime))); else - V_DrawRightAlignedThinString(x+156, y, ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count)); + V_DrawRightAlignedThinString(x+156, y-1, ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count)); } else - V_DrawRightAlignedThinString(x+156, y, ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count))); + V_DrawRightAlignedThinString(x+156, y-1, ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count))); } else - V_DrawRightAlignedThinString(x+120, y, ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count)); + V_DrawRightAlignedThinString(x+120, y-1, ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count)); y += 16; if (y > 160) diff --git a/src/m_menu.c b/src/m_menu.c index 314acda2..978c45e8 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2640,16 +2640,16 @@ void M_Drawer(void) { if (customversionstring[0] != '\0') { - V_DrawThinString(vid.dupx, vid.height - 17*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT, "Mod version:"); - V_DrawThinString(vid.dupx, vid.height - 9*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, customversionstring); + V_DrawThinString(vid.dupx, vid.height - 20*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT, "Mod version:"); + V_DrawThinString(vid.dupx, vid.height - 10*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, customversionstring); } else { #ifdef DEVELOP // Development -- show revision / branch info - V_DrawThinString(vid.dupx, vid.height - 17*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, "KART DEV EXE"); - V_DrawThinString(vid.dupx, vid.height - 9*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, va("%s", VERSIONSTRINGW)); + V_DrawThinString(vid.dupx, vid.height - 20*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, "KART DEV EXE"); + V_DrawThinString(vid.dupx, vid.height - 10*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, va("%s", VERSIONSTRINGW)); #else // Regular build - V_DrawThinString(vid.dupx, vid.height - 9*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, va("%s", VERSIONSTRING)); + V_DrawThinString(vid.dupx, vid.height - 10*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, va("%s", VERSIONSTRING)); #endif } } diff --git a/src/y_inter.c b/src/y_inter.c index a3b2c43b..297f88a0 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -577,15 +577,15 @@ void Y_IntermissionDrawer(void) V_DrawRightAlignedString(x+160, 32, V_YELLOWMAP, "TIME"); // Rings - V_DrawThinString(x+168, 32, V_YELLOWMAP, "RING"); + V_DrawThinString(x+168, 31, V_YELLOWMAP, "RING"); // Total rings - V_DrawThinString(x+191, 24, V_YELLOWMAP, "TOTAL"); - V_DrawThinString(x+196, 32, V_YELLOWMAP, "RING"); + V_DrawThinString(x+191, 22, V_YELLOWMAP, "TOTAL"); + V_DrawThinString(x+196, 31, V_YELLOWMAP, "RING"); // Monitors - V_DrawThinString(x+223, 24, V_YELLOWMAP, "ITEM"); - V_DrawThinString(x+229, 32, V_YELLOWMAP, "BOX"); + V_DrawThinString(x+223, 22, V_YELLOWMAP, "ITEM"); + V_DrawThinString(x+229, 31, V_YELLOWMAP, "BOX"); // Score V_DrawRightAlignedString(x+288, 32, V_YELLOWMAP, "SCORE"); @@ -629,15 +629,15 @@ void Y_IntermissionDrawer(void) sstrtime[sizeof sstrtime - 1] = '\0'; // Time - V_DrawRightAlignedThinString(x+160, y, ((data.competition.times[i] & 0x80000000) ? V_YELLOWMAP : 0), sstrtime); + V_DrawRightAlignedThinString(x+160, y-1, ((data.competition.times[i] & 0x80000000) ? V_YELLOWMAP : 0), sstrtime); // Rings - V_DrawRightAlignedThinString(x+188, y, V_MONOSPACE|((data.competition.rings[i] & 0x80000000) ? V_YELLOWMAP : 0), va("%u", pring)); + V_DrawRightAlignedThinString(x+188, y-1, V_MONOSPACE|((data.competition.rings[i] & 0x80000000) ? V_YELLOWMAP : 0), va("%u", pring)); // Total rings - V_DrawRightAlignedThinString(x+216, y, V_MONOSPACE|((data.competition.maxrings[i] & 0x80000000) ? V_YELLOWMAP : 0), va("%u", pmaxring)); + V_DrawRightAlignedThinString(x+216, y-1, V_MONOSPACE|((data.competition.maxrings[i] & 0x80000000) ? V_YELLOWMAP : 0), va("%u", pmaxring)); // Monitors - V_DrawRightAlignedThinString(x+244, y, V_MONOSPACE|((data.competition.monitors[i] & 0x80000000) ? V_YELLOWMAP : 0), va("%u", pmonitor)); + V_DrawRightAlignedThinString(x+244, y-1, V_MONOSPACE|((data.competition.monitors[i] & 0x80000000) ? V_YELLOWMAP : 0), va("%u", pmonitor)); // Score - V_DrawRightAlignedThinString(x+288, y, V_MONOSPACE|((data.competition.scores[i] & 0x80000000) ? V_YELLOWMAP : 0), va("%u", pscore)); + V_DrawRightAlignedThinString(x+288, y-1, V_MONOSPACE|((data.competition.scores[i] & 0x80000000) ? V_YELLOWMAP : 0), va("%u", pscore)); // Final Points V_DrawRightAlignedString(x+312, y, V_YELLOWMAP, va("%d", data.competition.points[i])); } From 1e01e65a8b126fd4aab3fde590537e27085467af Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 29 Jan 2018 19:15:25 -0500 Subject: [PATCH 14/14] Fixed spectating for real, messages for changing some kart cvars, Mirror Mode disallowed in Battle --- src/d_netcmd.c | 40 +++++++++++++++++++++++++++++++----- src/g_game.c | 56 +++++++++++++++++++++++++------------------------- src/k_kart.c | 39 +++++++++++++++++------------------ src/p_mobj.c | 5 +++-- src/p_setup.c | 7 ++++++- 5 files changed, 91 insertions(+), 56 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index e3e97eed..2388d8fc 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -105,6 +105,11 @@ static void Color4_OnChange(void); static void DummyConsvar_OnChange(void); static void SoundTest_OnChange(void); +static void KartFrantic_OnChange(void); +static void KartSpeed_OnChange(void); +static void KartMirror_OnChange(void); +static void KartComeback_OnChange(void); + #ifdef NETGAME_DEVMODE static void Fishcake_OnChange(void); #endif @@ -347,12 +352,12 @@ consvar_t cv_kartminimap = {"kartminimap", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NU consvar_t cv_kartcheck = {"kartcheck", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t kartstarsfx_cons_t[] = {{0, "Music"}, {1, "SMK"}, {0, NULL}}; consvar_t cv_kartstarsfx = {"kartstarsfx", "SMK", CV_SAVE, kartstarsfx_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_kartspeed = {"kartspeed", "Standard", CV_NETVAR, kartspeed_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_kartspeed = {"kartspeed", "Standard", CV_NETVAR|CV_CALL|CV_NOINIT, kartspeed_cons_t, KartSpeed_OnChange, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t kartballoons_cons_t[] = {{1, "MIN"}, {12, "MAX"}, {0, NULL}}; -consvar_t cv_kartballoons = {"kartballoons", "3", CV_NETVAR, kartballoons_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_kartfrantic = {"kartfrantic", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_kartcomeback = {"kartcomeback", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_kartmirror = {"kartmirror", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_kartballoons = {"kartballoons", "3", CV_NETVAR|CV_CHEAT, kartballoons_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_kartfrantic = {"kartfrantic", "Off", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartFrantic_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_kartcomeback = {"kartcomeback", "On", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartComeback_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_kartmirror = {"kartmirror", "Off", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartMirror_OnChange, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t speedometer_cons_t[] = {{0, "Off"}, {1, "Kilometers"}, {2, "Miles"}, {3, "Fracunits"}, {0, NULL}}; consvar_t cv_speedometer = {"speedometer", "Kilometers", CV_SAVE, speedometer_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // use tics in display @@ -5049,3 +5054,28 @@ static void Command_ShowTime_f(void) CONS_Printf(M_GetText("The current time is %f.\nThe timelimit is %f\n"), (double)leveltime/TICRATE, (double)timelimitintics/TICRATE); } + +// SRB2Kart: On change messages +static void KartFrantic_OnChange(void) +{ + if (cv_kartfrantic.value != franticitems && gamestate == GS_LEVEL) + CONS_Printf(M_GetText("Frantic Items will be turned %s next round.\n"), cv_kartfrantic.value ? M_GetText("on") : M_GetText("off")); +} + +static void KartSpeed_OnChange(void) +{ + if (cv_kartspeed.value != gamespeed && gametype == GT_RACE && gamestate == GS_LEVEL) + CONS_Printf(M_GetText("Game speed will be changed to \"%s\" next round.\n"), cv_kartspeed.string); +} + +static void KartMirror_OnChange(void) +{ + if (cv_kartmirror.value != mirrormode && gametype == GT_RACE && gamestate == GS_LEVEL) + CONS_Printf(M_GetText("Mirror Mode will be turned %s next round.\n"), cv_kartmirror.value ? M_GetText("on") : M_GetText("off")); +} + +static void KartComeback_OnChange(void) +{ + if (cv_kartcomeback.value != comeback && gametype == GT_MATCH && gamestate == GS_LEVEL) + CONS_Printf(M_GetText("Karma Comeback will be turned %s next round.\n"), cv_kartcomeback.value ? M_GetText("on") : M_GetText("off")); +} \ No newline at end of file diff --git a/src/g_game.c b/src/g_game.c index 7a022e5c..a8dc26d9 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1293,7 +1293,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) axis = JoyAxis(AXISTURN, ssplayer); - if (cv_kartmirror.value) + if (mirrormode) { turnright ^= turnleft; // swap these using three XORs turnleft ^= turnright; @@ -1514,7 +1514,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) cmd->sidemove = (SINT8)(cmd->sidemove + side); } - if (cv_kartmirror.value) + if (mirrormode) cmd->sidemove = -cmd->sidemove; if (ssplayer == 2 && player->bot == 1) { @@ -1532,7 +1532,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) //{ SRB2kart - Drift support axis = JoyAxis(AXISTURN, ssplayer); - if (cv_kartmirror.value) + if (mirrormode) axis = -axis; // TODO: Remove this hack please :( @@ -2017,50 +2017,38 @@ boolean G_Responder(event_t *ev) if (ev->data1 == gamecontrol[gc_spectate][0] || ev->data1 == gamecontrol[gc_spectate][1]) { - if ((netgame || splitscreen) && !players[consoleplayer].powers[pw_flashing] && !spectatedelay) + if (!spectatedelay) { - if (players[consoleplayer].spectator && cv_allowteamchange.value) - P_SpectatorJoinGame(&players[consoleplayer]); - else - COM_ImmedExecute("changeteam spectator"); + spectatedelay = NEWTICRATE / 7; + COM_ImmedExecute("changeteam spectator"); } - spectatedelay = NEWTICRATE / 7; } if (ev->data1 == gamecontrolbis[gc_spectate][0] || ev->data1 == gamecontrolbis[gc_spectate][1]) { - if (splitscreen && !players[secondarydisplayplayer].powers[pw_flashing] && !spectatedelay2) + if (!spectatedelay2) { - if (players[secondarydisplayplayer].spectator && cv_allowteamchange.value) - P_SpectatorJoinGame(&players[secondarydisplayplayer]); - else - COM_ImmedExecute("changeteam2 spectator"); + spectatedelay2 = NEWTICRATE / 7; + COM_ImmedExecute("changeteam2 spectator"); } - spectatedelay2 = NEWTICRATE / 7; } if (ev->data1 == gamecontrol3[gc_spectate][0] || ev->data1 == gamecontrol3[gc_spectate][1]) { - if (splitscreen > 1 && !players[thirddisplayplayer].powers[pw_flashing] && !spectatedelay3) + if (!spectatedelay3) { - if (players[thirddisplayplayer].spectator && cv_allowteamchange.value) - P_SpectatorJoinGame(&players[thirddisplayplayer]); - else - COM_ImmedExecute("changeteam3 spectator"); + spectatedelay3 = NEWTICRATE / 7; + COM_ImmedExecute("changeteam3 spectator"); } - spectatedelay3 = NEWTICRATE / 7; } if (ev->data1 == gamecontrol4[gc_spectate][0] || ev->data1 == gamecontrol4[gc_spectate][1]) { - if (splitscreen > 2 && !players[fourthdisplayplayer].powers[pw_flashing] && !spectatedelay4) + if (!spectatedelay4) { - if (players[fourthdisplayplayer].spectator && cv_allowteamchange.value) - P_SpectatorJoinGame(&players[fourthdisplayplayer]); - else - COM_ImmedExecute("changeteam4 spectator"); + spectatedelay4 = NEWTICRATE / 7; + COM_ImmedExecute("changeteam4 spectator"); } - spectatedelay4 = NEWTICRATE / 7; } return true; @@ -2227,9 +2215,21 @@ void G_Ticker(boolean run) if (camtoggledelay) camtoggledelay--; - if (camtoggledelay2) camtoggledelay2--; + if (camtoggledelay3) + camtoggledelay3--; + if (camtoggledelay4) + camtoggledelay4--; + + if (spectatedelay) + spectatedelay--; + if (spectatedelay2) + spectatedelay2--; + if (spectatedelay3) + spectatedelay3--; + if (spectatedelay4) + spectatedelay4--; } } diff --git a/src/k_kart.c b/src/k_kart.c index 43806eea..b2cd9afb 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1037,7 +1037,8 @@ static void K_KartItemRouletteByDistance(player_t *player, ticcmd_t *cmd) for (i = 0; i < MAXPLAYERS; i++) { - if (playeringame[i] && !players[i].spectator && players[i].kartstuff[k_position] < player->kartstuff[k_position]) + if (playeringame[i] && !players[i].spectator && players[i].mo + && players[i].kartstuff[k_position] < player->kartstuff[k_position]) pdis += P_AproxDistance(P_AproxDistance(players[i].mo->x - player->mo->x, players[i].mo->y - player->mo->y), players[i].mo->z - player->mo->z) / FRACUNIT @@ -1057,12 +1058,8 @@ static void K_KartItemRouletteByDistance(player_t *player, ticcmd_t *cmd) } else { - if (franticitems) // Frantic items - { - pdis = (13*pdis/12); // make the distances between everyone artifically higher... - //pdis += distvar; // and set everyone back another place! - } - + if (franticitems) // Frantic items make the distances between everyone artifically higher :P + pdis = (15*pdis/14); if (pingame == 1) useodds = 0; // Record Attack, or just alone else if (pdis <= distvar * 0) useodds = 1; // (64*14) * 0 = 0 else if (pdis <= distvar * 1) useodds = 2; // (64*14) * 1 = 896 @@ -1083,8 +1080,8 @@ static void K_KartItemRouletteByDistance(player_t *player, ticcmd_t *cmd) //{ if (cv_magnet.value) SETITEMRESULT(useodds, 1); // Magnet if (cv_boo.value) SETITEMRESULT(useodds, 2); // Boo - if (cv_mushroom.value) SETITEMRESULT(useodds, 3); // Mushroom - if (cv_mushroom.value) SETITEMRESULT(useodds, 4); // Triple Mushroom + if (cv_mushroom.value && !modeattacking) SETITEMRESULT(useodds, 3); // Mushroom + if (cv_triplemushroom.value) SETITEMRESULT(useodds, 4); // Triple Mushroom if (cv_megashroom.value && !player->kartstuff[k_poweritemtimer]) SETITEMRESULT(useodds, 5); // Mega Mushroom if (cv_goldshroom.value) SETITEMRESULT(useodds, 6); // Gold Mushroom if (cv_star.value && !player->kartstuff[k_poweritemtimer]) SETITEMRESULT(useodds, 7); // Star @@ -1097,7 +1094,7 @@ static void K_KartItemRouletteByDistance(player_t *player, ticcmd_t *cmd) if (cv_bobomb.value) SETITEMRESULT(useodds, 14); // Bob-omb if (cv_blueshell.value && pexiting == 0) SETITEMRESULT(useodds, 15); // Blue Shell if (cv_fireflower.value) SETITEMRESULT(useodds, 16); // Fire Flower - if (cv_tripleredshell.value && pingame > 2) SETITEMRESULT(useodds, 17); // Triple Red Shell + if (cv_tripleredshell.value && pingame > 2) SETITEMRESULT(useodds, 17); // Triple Red Shell if (cv_lightning.value && pingame > pexiting) SETITEMRESULT(useodds, 18); // Lightning if (cv_feather.value) SETITEMRESULT(useodds, 19); // Feather @@ -2927,17 +2924,21 @@ static void K_KartUpdatePosition(player_t *player) thinker_t *th; mobj_t *mo; + if (player->spectator || !player->mo) + return; + for (i = 0; i < MAXPLAYERS; i++) { + if (!playeringame[i] || players[i].spectator || !players[i].mo) + continue; + if (gametype == GT_RACE) { - if (playeringame[i] && !players[i].spectator && - (((players[i].starpostnum) + (numstarposts + 1) * players[i].laps) > + if ((((players[i].starpostnum) + (numstarposts + 1) * players[i].laps) > ((player->starpostnum) + (numstarposts + 1) * player->laps))) position++; - else if (playeringame[i] && !players[i].spectator - && (((players[i].starpostnum) + (numstarposts+1)*players[i].laps) == - ((player->starpostnum) + (numstarposts+1)*player->laps))) + else if (((players[i].starpostnum) + (numstarposts+1)*players[i].laps) == + ((player->starpostnum) + (numstarposts+1)*player->laps)) { ppcd = pncd = ipcd = incd = 0; @@ -3147,7 +3148,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) else if (cmd->buttons & BT_ATTACK) player->pflags |= PF_ATTACKDOWN; - if (player && player->health > 0 && !player->spectator && !player->exiting && player->kartstuff[k_spinouttimer] == 0) + if (player && player->mo && player->mo->health > 0 && !player->spectator && !player->exiting && player->kartstuff[k_spinouttimer] == 0) { // Magnet @@ -4680,10 +4681,7 @@ static void K_drawKartPositionFaces(void) for (j = 0; j < MAXPLAYERS; j++) { - if (!playeringame[j]) - continue; - - if (players[j].spectator) + if (!playeringame[j] || players[j].spectator || !players[j].mo) continue; for (i = 0; i < MAXPLAYERS; i++) @@ -4706,6 +4704,7 @@ static void K_drawKartPositionFaces(void) for (i = 0; i < ranklines; i++) { if (players[rankplayer[i]].spectator) continue; // Spectators are ignored + if (!players[rankplayer[i]].mo) continue; balloonx = FACE_X+18; diff --git a/src/p_mobj.c b/src/p_mobj.c index 9b5f6060..1ba05d69 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6782,8 +6782,9 @@ void P_MobjThinker(mobj_t *mobj) break; case MT_PLAYERARROW: if (mobj->target && mobj->target->health - && mobj->target->player && mobj->target->player->mo - && mobj->target->player->health && mobj->target->player->playerstate != PST_DEAD) + && mobj->target->player && !mobj->target->player->spectator + && mobj->target->player->health && mobj->target->player->playerstate != PST_DEAD + && players[displayplayer].mo && !players[displayplayer].spectator) { fixed_t scale = mobj->target->scale; mobj->color = mobj->target->color; diff --git a/src/p_setup.c b/src/p_setup.c index 2142f0cf..371a70b7 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2982,8 +2982,13 @@ boolean P_SetupLevel(boolean skipprecip) gamespeed = 0; else gamespeed = cv_kartspeed.value; + + if (gametype == GT_MATCH) + mirrormode = false; + else + mirrormode = cv_kartmirror.value; + franticitems = cv_kartfrantic.value; - mirrormode = cv_kartmirror.value; comeback = cv_kartcomeback.value; // clear special respawning que