From f611554cbc692169cbf69b56d463c65a48684886 Mon Sep 17 00:00:00 2001 From: NepDisk <16447892+NepDisk@users.noreply.github.com> Date: Tue, 30 Jul 2024 18:00:37 -0400 Subject: [PATCH] Assorted Changes 2 Restored old titlescreen, generally made the game closer to v1 gameplay wise and visual wise --- src/d_player.h | 9 +- src/deh_soc.c | 12 +- src/deh_tables.c | 81 +-- src/f_finale.c | 129 +--- src/f_finale.h | 3 +- src/g_game.c | 1 - src/info.c | 289 --------- src/info.h | 86 +-- src/k_kart.c | 1370 +++++++++---------------------------------- src/k_kart.h | 5 +- src/k_respawn.c | 2 +- src/lua_baselib.c | 2 +- src/lua_playerlib.c | 22 - src/m_menu.c | 34 ++ src/m_menu.h | 2 +- src/p_enemy.c | 91 --- src/p_inter.c | 4 +- src/p_mobj.c | 199 ------- src/p_saveg.c | 14 - src/p_spec.c | 5 +- src/p_user.c | 71 ++- src/r_textures.h | 4 +- 22 files changed, 406 insertions(+), 2029 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index ac736a9e1..a329a8851 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -420,7 +420,6 @@ typedef struct player_s SINT8 drift; // (-5 to 5) - Drifting Left or Right, plus a bigger counter = sharper turn fixed_t driftcharge; // Charge your drift so you can release a burst of speed UINT8 driftboost; // (0 to 125) - Boost you get from drifting - UINT8 strongdriftboost; // (0 to 125) - While active, boost from drifting gives a stronger speed increase SINT8 aizdriftstrat; // (-1 to 1) - Let go of your drift while boosting? Helper for the SICK STRATZ (sliptiding!) you have just unlocked INT32 aizdrifttilt; @@ -440,18 +439,13 @@ typedef struct player_s UINT8 spindashboost; // Spindash release boost timer fixed_t fastfall; // Fast fall momentum - - UINT8 numboosts; // Count of how many boosts are being stacked, for after image spawning + fixed_t boostpower; // Base boost value, for offroad fixed_t speedboost; // Boost value smoothing for max speed fixed_t accelboost; // Boost value smoothing for acceleration fixed_t handleboost; // Boost value smoothing for handling angle_t boostangle; // angle set when not spun out OR boosted to determine what direction you should keep going at if you're spun out and boosted. - fixed_t draftpower; // (0 to FRACUNIT) - Drafting power, doubles your top speed & acceleration at max - UINT16 draftleeway; // Leniency timer before removing draft power - SINT8 lastdraft; // (-1 to 15) - Last player being drafted - UINT8 tripwireState; // see tripwirestate_t UINT8 tripwirePass; // see tripwirepass_t UINT16 tripwireLeniency; // When reaching a state that lets you go thru tripwire, you get an extra second leniency after it ends to still go through it. @@ -487,7 +481,6 @@ typedef struct player_s mobj_t *hoverhyudoro; // First hyudoro hovering next to player UINT16 sneakertimer; // Duration of a Sneaker Boost (from Sneakers or level boosters) - UINT8 numsneakers; // Number of stacked sneaker effects UINT8 floorboost; // (0 to 3) - Prevents Sneaker sounds for a brief duration when triggered by a floor panel UINT8 boostcharge; // Charge during race start diff --git a/src/deh_soc.c b/src/deh_soc.c index a24473931..1a394a5c5 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -2343,10 +2343,8 @@ void readmenu(MYFILE *f, INT32 num) menupres[num].ttname[0] = 0; menupres[num].hidetitlepics = true; } - else if (fastcmp(word2, "RINGRACERS")) - menupres[num].ttmode = TTMODE_RINGRACERS; - else if (fastcmp(word2, "OLD")) - menupres[num].ttmode = TTMODE_OLD; + else if (fastcmp(word2, "KART")) + menupres[num].ttmode = TTMODE_KART; titlechanged = true; } else if (fastcmp(word, "TITLEPICSSCALE")) @@ -3438,10 +3436,8 @@ void readmaincfg(MYFILE *f) ttname[0] = 0; hidetitlepics = true; } - else if (fastcmp(word2, "RINGRACERS")) - ttmode = TTMODE_RINGRACERS; - else if (fastcmp(word2, "OLD") || fastcmp(word2, "SSNTAILS")) - ttmode = TTMODE_OLD; + else if (fastcmp(word2, "KART")) + ttmode = TTMODE_KART; titlechanged = true; } else if (fastcmp(word, "TITLEPICSNAME")) diff --git a/src/deh_tables.c b/src/deh_tables.c index 0ed2a79df..fe7111f7a 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -3324,16 +3324,6 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi "S_DRIFTDUST3", "S_DRIFTDUST4", - // Drift Sparkles - "S_DRIFTWARNSPARK1", - "S_DRIFTWARNSPARK2", - "S_DRIFTWARNSPARK3", - "S_DRIFTWARNSPARK4", - - // Drift electricity - "S_DRIFTELECTRICITY", - "S_DRIFTELECTRICSPARK", - // Fast lines "S_FASTLINE1", "S_FASTLINE2", @@ -3350,45 +3340,6 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi "S_FASTDUST6", "S_FASTDUST7", - // Drift boost effect - "S_DRIFTEXPLODE1", - "S_DRIFTEXPLODE2", - "S_DRIFTEXPLODE3", - "S_DRIFTEXPLODE4", - "S_DRIFTEXPLODE5", - "S_DRIFTEXPLODE6", - "S_DRIFTEXPLODE7", - "S_DRIFTEXPLODE8", - - // Drift boost clip - "S_DRIFTCLIPA1", - "S_DRIFTCLIPA2", - "S_DRIFTCLIPA3", - "S_DRIFTCLIPA4", - "S_DRIFTCLIPA5", - "S_DRIFTCLIPA6", - "S_DRIFTCLIPA7", - "S_DRIFTCLIPA8", - "S_DRIFTCLIPA9", - "S_DRIFTCLIPA10", - "S_DRIFTCLIPA11", - "S_DRIFTCLIPA12", - "S_DRIFTCLIPA13", - "S_DRIFTCLIPA14", - "S_DRIFTCLIPA15", - "S_DRIFTCLIPA16", - "S_DRIFTCLIPB1", - "S_DRIFTCLIPB2", - "S_DRIFTCLIPB3", - "S_DRIFTCLIPB4", - "S_DRIFTCLIPB5", - "S_DRIFTCLIPB6", - "S_DRIFTCLIPB7", - "S_DRIFTCLIPB8", - - // Drift boost clip spark - "S_DRIFTCLIPSPARK", - // Sneaker boost effect "S_BOOSTFLAME", "S_BOOSTSMOKESPAWNER", @@ -3805,12 +3756,6 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi "S_BATTLEBUMPER_EXBLAST9", "S_BATTLEBUMPER_EXBLAST10", - // Tripwire - "S_TRIPWIREBOOST_TOP", - "S_TRIPWIREBOOST_BOTTOM", - "S_TRIPWIREBOOST_BLAST_TOP", - "S_TRIPWIREBOOST_BLAST_BOTTOM", - // DEZ respawn laser "S_DEZLASER", "S_DEZLASER_TRAIL1", @@ -4411,12 +4356,6 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi "S_GAINAX_MID1", "S_GAINAX_MID2", - "S_DRAFTDUST1", - "S_DRAFTDUST2", - "S_DRAFTDUST3", - "S_DRAFTDUST4", - "S_DRAFTDUST5", - "S_OVERTIME_BULB1", "S_OVERTIME_BULB2", "S_OVERTIME_LASER", @@ -4466,16 +4405,7 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi "S_DOWNLINE5", "S_HOLDBUBBLE", - - // Finish line beam - "S_FINISHBEAM1", - "S_FINISHBEAM2", - "S_FINISHBEAM3", - "S_FINISHBEAM4", - "S_FINISHBEAM5", - "S_FINISHBEAMEND1", - "S_FINISHBEAMEND2", - + // Funny Spike "S_DEBTSPIKE1", "S_DEBTSPIKE2", @@ -5265,9 +5195,6 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t "MT_FASTLINE", "MT_FASTDUST", - "MT_DRIFTEXPLODE", - "MT_DRIFTCLIP", - "MT_DRIFTCLIPSPARK", "MT_BOOSTFLAME", "MT_BOOSTSMOKE", "MT_SNEAKERTRAIL", @@ -5279,8 +5206,6 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t "MT_BRAKEDRIFT", "MT_BRAKEDUST", "MT_DRIFTDUST", - "MT_DRIFTELECTRICITY", - "MT_DRIFTELECTRICSPARK", "MT_ROCKETSNEAKER", // Rocket sneakers @@ -5335,8 +5260,6 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t "MT_BATTLEBUMPER_DEBRIS", "MT_BATTLEBUMPER_BLAST", - "MT_TRIPWIREBOOST", - "MT_DEZLASER", "MT_WAYPOINT", @@ -5549,8 +5472,6 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t "MT_KARMAFIREWORK", "MT_RINGSPARKS", "MT_GAINAX", - "MT_DRAFTDUST", - "MT_SPBDUST", "MT_OVERTIME_PARTICLE", "MT_OVERTIME_CENTER", diff --git a/src/f_finale.c b/src/f_finale.c index e8df8738c..7c2a49a59 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -80,7 +80,7 @@ static UINT32 demoIdleLeft; // customizable title screen graphics -ttmode_enum ttmode = TTMODE_RINGRACERS; +ttmode_enum ttmode = TTMODE_KART; UINT8 ttscale = 1; // FRACUNIT / ttscale // ttmode user vars char ttname[9]; @@ -99,20 +99,11 @@ INT16 curtty; INT16 curttloop; UINT16 curtttics; -// ttmode old -/* +// ttmode kart static patch_t *ttbanner; // SONIC ROBO BLAST 2 static patch_t *ttkart; // *vroom* KART static patch_t *ttcheckers; // *vroom* KART static patch_t *ttkflash; // flash screen -*/ - -static patch_t *kts_bumper; // DR ROBOTNIKS RING RACERS -static patch_t *kts_eggman; // dr. robotnik himself -static patch_t *kts_tails; // tails himself -static patch_t *kts_tails_tails; // tails' tails -static patch_t *kts_electricity[6]; // ring o' electricity -static patch_t *kts_copyright; // (C) SEGA #define NOWAY @@ -245,7 +236,7 @@ static void F_NewCutscene(const char *basetext) // // F_TitleBGScroll // -/* + static void F_TitleBGScroll(INT32 scrollspeed) { INT32 x, y, w; @@ -285,7 +276,7 @@ static void F_TitleBGScroll(INT32 scrollspeed) W_UnlockCachedPatch(pat); W_UnlockCachedPatch(pat2); } -*/ + // ============= // INTRO SCENE @@ -1814,19 +1805,11 @@ static void F_CacheTitleScreen(void) case TTMODE_NONE: break; - case TTMODE_OLD: - break; // idk do we still want this? - - case TTMODE_RINGRACERS: - kts_bumper = W_CachePatchName("KTSBUMPR1", PU_PATCH_LOWPRIORITY); - kts_eggman = W_CachePatchName("KTSEGG01", PU_PATCH_LOWPRIORITY); - kts_tails = W_CachePatchName("KTSTAL01", PU_PATCH_LOWPRIORITY); - kts_tails_tails = W_CachePatchName("KTSTAL02", PU_PATCH_LOWPRIORITY); - for (i = 0; i < 6; i++) - { - kts_electricity[i] = W_CachePatchName(va("KTSELCT%.1d", i+1), PU_PATCH_LOWPRIORITY); - } - kts_copyright = W_CachePatchName("KTSCR", PU_PATCH_LOWPRIORITY); + case TTMODE_KART: + ttbanner = W_CachePatchName("TTKBANNR", PU_PATCH_LOWPRIORITY); + ttkart = W_CachePatchName("TTKART", PU_PATCH_LOWPRIORITY); + ttcheckers = W_CachePatchName("TTCHECK", PU_PATCH_LOWPRIORITY); + ttkflash = W_CachePatchName("TTKFLASH", PU_PATCH_LOWPRIORITY); break; case TTMODE_USER: @@ -1957,80 +1940,8 @@ void F_TitleScreenDrawer(void) case TTMODE_NONE: break; - case TTMODE_RINGRACERS: + case TTMODE_KART: { - const char *eggName = "eggman"; - INT32 eggSkin = R_SkinAvailable(eggName); - skincolornum_t eggColor = SKINCOLOR_RED; - UINT8 *eggColormap = NULL; - - const char *tailsName = "tails"; - INT32 tailsSkin = R_SkinAvailable(tailsName); - skincolornum_t tailsColor = SKINCOLOR_ORANGE; - UINT8 *tailsColormap = NULL; - - if (eggSkin != -1) - { - eggColor = skins[eggSkin].prefcolor; - } - eggColormap = R_GetTranslationColormap(TC_DEFAULT, eggColor, GTC_MENUCACHE); - - if (tailsSkin != -1) - { - tailsColor = skins[tailsSkin].prefcolor; - } - tailsColormap = R_GetTranslationColormap(TC_DEFAULT, tailsColor, GTC_MENUCACHE); - - V_DrawFixedPatch(0, 0, FRACUNIT, 0, kts_tails_tails, tailsColormap); - V_DrawFixedPatch(0, 0, FRACUNIT, V_ADD, kts_electricity[finalecount % 6], NULL); - - V_DrawFixedPatch(0, 0, FRACUNIT, 0, kts_eggman, eggColormap); - V_DrawFixedPatch(0, 0, FRACUNIT, 0, kts_tails, tailsColormap); - - V_DrawFixedPatch(0, 0, FRACUNIT, 0, kts_bumper, NULL); - - V_DrawFixedPatch(0, 0, FRACUNIT, 0, kts_copyright, NULL); - - // An adapted thing from old menus - most games have version info on the title screen now... - { - INT32 texty = vid.height - 10*vid.dupy; -#define addtext(f, str) {\ - V_DrawThinString(vid.dupx, texty, V_NOSCALESTART|f, str);\ - texty -= 10*vid.dupy;\ -} - if (customversionstring[0] != '\0') - { - addtext(V_ALLOWLOWERCASE, customversionstring); - addtext(0, "Mod version:"); - } - else - { -// Development -- show revision / branch info -#if defined(TESTERS) - addtext(V_ALLOWLOWERCASE|V_SKYMAP, "Tester client"); - addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, va("%s", compdate)); -#elif defined(HOSTTESTERS) - addtext(V_ALLOWLOWERCASE|V_REDMAP, "Netgame host for testers"); - addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, va("%s", compdate)); -#elif defined(DEVELOP) - addtext(V_ALLOWLOWERCASE|V_GREENMAP|V_TRANSLUCENT, comprevision); - addtext(V_ALLOWLOWERCASE|V_YELLOWMAP|V_TRANSLUCENT, compbranch); - addtext(V_ALLOWLOWERCASE|V_ORANGEMAP|V_TRANSLUCENT, va("%s", complast)); - -#else // Regular build - addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, va("%s", VERSIONSTRING)); -#endif - if (compuncommitted) - addtext(V_REDMAP|V_STRINGDANCE|V_TRANSLUCENT, "! UNCOMMITTED CHANGES !"); - } -#undef addtext - } - - break; - } - - case TTMODE_OLD: -/* if (finalecount < 50) { V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); @@ -2054,6 +1965,8 @@ void F_TitleScreenDrawer(void) if (finalecount <= (50+(9<<1))) transval = (finalecount - 50)>>1; + F_TitleBGScroll(5); + V_DrawSciencePatch(0, 0 - FixedMul(40<karmadelay = comebacktime; p->overtimekarma = 0; p->eggmanblame = -1; - p->lastdraft = -1; p->nocontrol = nocontrol; p->kickstartaccel = kickstartaccel; diff --git a/src/info.c b/src/info.c index bcbfb6b04..2065fe4f5 100644 --- a/src/info.c +++ b/src/info.c @@ -546,10 +546,6 @@ char sprnames[NUMSPRITES + 1][5] = "DRIF", // Drift Sparks "BDRF", // Brake drift sparks "BRAK", // Brake dust - "DRWS", // Drift dust sparks - "DREL", // Drift electricity - "DRES", // Drift electric sparks - "JANK", // Stair janking sparks // Kart Items "RSHE", // Rocket sneaker @@ -737,7 +733,6 @@ char sprnames[NUMSPRITES + 1][5] = "MXCL", "RGSP", "LENS", - "DRAF", "GRES", "OTBU", @@ -766,8 +761,6 @@ char sprnames[NUMSPRITES + 1][5] = "TRCK", - "FLBM", - // First person view sprites; this is a sprite so that it can be replaced by a specialized MD2 draw later "VIEW", }; @@ -3908,14 +3901,6 @@ state_t states[NUMSTATES] = {SPR_DUST, FF_TRANS20|2, 3, {NULL}, 0, 0, S_DRIFTDUST4}, // S_DRIFTDUST3 {SPR_DUST, FF_TRANS20|3, 3, {NULL}, 0, 0, S_NULL}, // S_DRIFTDUST4 - {SPR_DRWS, FF_FULLBRIGHT|0, 3, {NULL}, 0, 0, S_DRIFTWARNSPARK2}, // S_DRIFTWARNSPARK1 - {SPR_DRWS, FF_FULLBRIGHT|1, 3, {NULL}, 0, 0, S_DRIFTWARNSPARK3}, // S_DRIFTWARNSPARK2 - {SPR_DRWS, FF_FULLBRIGHT|FF_TRANS20|2, 3, {NULL}, 0, 0, S_DRIFTWARNSPARK4}, // S_DRIFTWARNSPARK3 - {SPR_DRWS, FF_FULLBRIGHT|FF_TRANS20|3, 3, {NULL}, 0, 0, S_NULL}, // S_DRIFTWARNSPARK4 - - {SPR_DREL, FF_FULLBRIGHT|FF_PAPERSPRITE|FF_ANIMATE|FF_GLOBALANIM, 2, {NULL}, 5, 2, S_NULL}, // S_DRIFTELECTRICITY - {SPR_DRES, FF_FULLBRIGHT|FF_PAPERSPRITE|FF_ANIMATE, 20, {NULL}, 1, 10, S_NULL}, // S_DRIFTELECTRICSPARK - {SPR_FAST, FF_PAPERSPRITE|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_FASTLINE2}, // S_FASTLINE1 {SPR_FAST, FF_PAPERSPRITE|FF_FULLBRIGHT|1, 1, {NULL}, 0, 0, S_FASTLINE3}, // S_FASTLINE2 {SPR_FAST, FF_PAPERSPRITE|FF_FULLBRIGHT|2, 1, {NULL}, 0, 0, S_FASTLINE4}, // S_FASTLINE3 @@ -3930,43 +3915,6 @@ state_t states[NUMSTATES] = {SPR_DSHR, FF_PAPERSPRITE|5, 1, {NULL}, 0, 0, S_FASTDUST7}, // S_FASTDUST6 {SPR_DSHR, FF_PAPERSPRITE|6, 1, {NULL}, 0, 0, S_NULL}, // S_FASTDUST7 - {SPR_DBOS, FF_FULLBRIGHT, 1, {NULL}, 6, 1, S_DRIFTEXPLODE2}, // S_DRIFTEXPLODE1 - {SPR_DBST, FF_PAPERSPRITE|FF_FULLBRIGHT, 1, {NULL}, 6, 1, S_DRIFTEXPLODE3}, // S_DRIFTEXPLODE2 - {SPR_DBOS, FF_FULLBRIGHT|1, 1, {NULL}, 6, 1, S_DRIFTEXPLODE4}, // S_DRIFTEXPLODE3 - {SPR_DBST, FF_PAPERSPRITE|FF_FULLBRIGHT|1, 1, {NULL}, 6, 1, S_DRIFTEXPLODE5}, // S_DRIFTEXPLODE4 - {SPR_DBOS, FF_FULLBRIGHT|2, 1, {NULL}, 6, 1, S_DRIFTEXPLODE6}, // S_DRIFTEXPLODE5 - {SPR_DBST, FF_PAPERSPRITE|FF_FULLBRIGHT|2, 1, {NULL}, 6, 1, S_DRIFTEXPLODE7}, // S_DRIFTEXPLODE6 - {SPR_DBOS, FF_FULLBRIGHT|3, 1, {NULL}, 6, 1, S_DRIFTEXPLODE8}, // S_DRIFTEXPLODE7 - {SPR_DBST, FF_PAPERSPRITE|FF_FULLBRIGHT|3, 1, {NULL}, 6, 1, S_DRIFTEXPLODE1}, // S_DRIFTEXPLODE8 - - {SPR_DBCL, FF_FULLBRIGHT|0x0, 1, {NULL}, 6, 1, S_DRIFTCLIPA2}, // S_DRIFTCLIPA1 - {SPR_DBCL, FF_FULLBRIGHT|0x8, 1, {NULL}, 6, 1, S_DRIFTCLIPA3}, // S_DRIFTCLIPA2 - {SPR_DBCL, FF_FULLBRIGHT|0x1, 1, {NULL}, 6, 1, S_DRIFTCLIPA4}, // S_DRIFTCLIPA3 - {SPR_DBCL, FF_FULLBRIGHT|0x9, 1, {NULL}, 6, 1, S_DRIFTCLIPA5}, // S_DRIFTCLIPA4 - {SPR_DBCL, FF_FULLBRIGHT|0x2, 1, {NULL}, 6, 1, S_DRIFTCLIPA6}, // S_DRIFTCLIPA5 - {SPR_DBCL, FF_FULLBRIGHT|0xA, 1, {NULL}, 6, 1, S_DRIFTCLIPA7}, // S_DRIFTCLIPA6 - {SPR_DBCL, FF_FULLBRIGHT|0x3, 1, {NULL}, 6, 1, S_DRIFTCLIPA8}, // S_DRIFTCLIPA7 - {SPR_DBCL, FF_FULLBRIGHT|0xB, 1, {NULL}, 6, 1, S_DRIFTCLIPA9}, // S_DRIFTCLIPA8 - {SPR_DBCL, FF_FULLBRIGHT|0x4, 1, {NULL}, 6, 1, S_DRIFTCLIPA10}, // S_DRIFTCLIPA9 - {SPR_DBCL, FF_FULLBRIGHT|0xC, 1, {NULL}, 6, 1, S_DRIFTCLIPA11}, // S_DRIFTCLIPA10 - {SPR_DBCL, FF_FULLBRIGHT|0x5, 1, {NULL}, 6, 1, S_DRIFTCLIPA12}, // S_DRIFTCLIPA11 - {SPR_DBCL, FF_FULLBRIGHT|0xD, 1, {NULL}, 6, 1, S_DRIFTCLIPA13}, // S_DRIFTCLIPA12 - {SPR_DBCL, FF_FULLBRIGHT|0x6, 1, {NULL}, 6, 1, S_DRIFTCLIPA14}, // S_DRIFTCLIPA13 - {SPR_DBCL, FF_FULLBRIGHT|0xE, 1, {NULL}, 6, 1, S_DRIFTCLIPA15}, // S_DRIFTCLIPA14 - {SPR_DBCL, FF_FULLBRIGHT|0x7, 1, {NULL}, 6, 1, S_DRIFTCLIPA16}, // S_DRIFTCLIPA15 - {SPR_DBCL, FF_FULLBRIGHT|0xF, 1, {NULL}, 6, 1, S_DRIFTCLIPB1}, // S_DRIFTCLIPA16 - - {SPR_DBCL, FF_FULLBRIGHT, 2, {NULL}, 6, 1, S_DRIFTCLIPB2}, // S_DRIFTCLIPB1 - {SPR_DBCL, FF_FULLBRIGHT|1, 2, {NULL}, 6, 1, S_DRIFTCLIPB3}, // S_DRIFTCLIPB2 - {SPR_DBCL, FF_FULLBRIGHT|2, 2, {NULL}, 6, 1, S_DRIFTCLIPB4}, // S_DRIFTCLIPB3 - {SPR_DBCL, FF_FULLBRIGHT|3, 2, {NULL}, 6, 1, S_DRIFTCLIPB5}, // S_DRIFTCLIPB4 - {SPR_DBCL, FF_FULLBRIGHT|4, 2, {NULL}, 6, 1, S_DRIFTCLIPB6}, // S_DRIFTCLIPB5 - {SPR_DBCL, FF_FULLBRIGHT|5, 2, {NULL}, 6, 1, S_DRIFTCLIPB7}, // S_DRIFTCLIPB6 - {SPR_DBCL, FF_FULLBRIGHT|6, 2, {NULL}, 6, 1, S_DRIFTCLIPB8}, // S_DRIFTCLIPB7 - {SPR_DBCL, FF_FULLBRIGHT|7, 2, {NULL}, 6, 1, S_DRIFTCLIPB1}, // S_DRIFTCLIPB8 - - {SPR_DBNC, FF_FULLBRIGHT|FF_ANIMATE, 14, {NULL}, 6, 1, S_NULL}, // S_DRIFTCLIPSPARK - {SPR_BOST, FF_FULLBRIGHT|FF_ANIMATE, TICRATE, {NULL}, 6, 1, S_BOOSTSMOKESPAWNER}, // S_BOOSTFLAME {SPR_NULL, 0, TICRATE/2, {NULL}, 0, 0, S_NULL}, // S_BOOSTSMOKESPAWNER @@ -4362,12 +4310,6 @@ state_t states[NUMSTATES] = {SPR_BEXB, FF_FULLBRIGHT|FF_PAPERSPRITE|FF_TRANS80, 2, {NULL}, 0, 0, S_BATTLEBUMPER_EXBLAST10}, // S_BATTLEBUMPER_EXBLAST9 {SPR_BEXB, FF_FULLBRIGHT|FF_PAPERSPRITE|FF_TRANS90, 2, {NULL}, 0, 0, S_NULL}, // S_BATTLEBUMPER_EXBLAST10 - {SPR_TWBS, FF_FULLBRIGHT|FF_ADD|FF_ANIMATE, -1, {NULL}, 6, 2, S_NULL}, // S_TRIPWIREBOOST_TOP - {SPR_TWBS, FF_FULLBRIGHT|FF_ADD|FF_ANIMATE|FF_VERTICALFLIP|FF_HORIZONTALFLIP, -1, {NULL}, 6, 2, S_NULL}, // S_TRIPWIREBOOST_BOTTOM - - {SPR_TWBT, FF_FULLBRIGHT|FF_ADD|FF_ANIMATE, -1, {NULL}, 6, 2, S_NULL}, // S_TRIPWIREBOOST_BLAST_TOP - {SPR_TWBT, FF_FULLBRIGHT|FF_ADD|FF_ANIMATE|FF_VERTICALFLIP|FF_HORIZONTALFLIP, -1, {NULL}, 6, 2, S_NULL}, // S_TRIPWIREBOOST_BLAST_BOTTOM - {SPR_DEZL, FF_FULLBRIGHT|FF_PAPERSPRITE, 8, {NULL}, 0, 0, S_NULL}, // S_DEZLASER {SPR_DEZL, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_DEZLASER_TRAIL2}, // S_DEZLASER_TRAIL1 {SPR_DEZL, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_DEZLASER_TRAIL3}, // S_DEZLASER_TRAIL2 @@ -4997,12 +4939,6 @@ state_t states[NUMSTATES] = {SPR_LENS, FF_FULLBRIGHT|FF_ADD|FF_TRANS10|FF_ANIMATE|5, 14, {NULL}, 14, 1, S_GAINAX_MID2}, // S_GAINAX_MID1 {SPR_LENS, FF_FULLBRIGHT|FF_ADD|FF_TRANS10|FF_ANIMATE|19, -1, {NULL}, 1, 1, S_NULL}, // S_GAINAX_MID2 - {SPR_DRAF, 0, 2, {NULL}, 0, 0, S_DRAFTDUST2}, // S_DRAFTDUST1 - {SPR_DRAF, 1, 1, {NULL}, 0, 0, S_DRAFTDUST3}, // S_DRAFTDUST2 - {SPR_DRAF, 2, 1, {NULL}, 0, 0, S_DRAFTDUST4}, // S_DRAFTDUST3 - {SPR_DRAF, 3, 1, {NULL}, 0, 0, S_DRAFTDUST5}, // S_DRAFTDUST4 - {SPR_DRAF, 4, 1, {NULL}, 0, 0, S_NULL}, // S_DRAFTDUST5 - {SPR_OTBU, FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_NULL}, // S_OVERTIME_BULB1 {SPR_OTBU, FF_FULLBRIGHT|2, 1, {NULL}, 0, 0, S_NULL}, // S_OVERTIME_BULB2 {SPR_OTLS, FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_NULL}, // S_OVERTIME_LASER @@ -5057,15 +4993,6 @@ state_t states[NUMSTATES] = // HOLD Bubble {SPR_HBUB, 0|FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_HOLDBUBBLE}, // S_HOLDBUBBLE - // Finish line beam - {SPR_FLBM, FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_NULL}, // S_FINISHBEAM1 - {SPR_FLBM, FF_FULLBRIGHT|1, 1, {NULL}, 0, 0, S_NULL}, // S_FINISHBEAM2 - {SPR_FLBM, FF_FULLBRIGHT|2, 1, {NULL}, 0, 0, S_NULL}, // S_FINISHBEAM3 - {SPR_FLBM, FF_FULLBRIGHT|3, 1, {NULL}, 0, 0, S_NULL}, // S_FINISHBEAM4 - {SPR_FLBM, FF_FULLBRIGHT|4, 1, {NULL}, 0, 0, S_NULL}, // S_FINISHBEAM5 - {SPR_FLBM, FF_PAPERSPRITE|5, 1, {NULL}, 0, 0, S_NULL}, // S_FINISHBEAMEND1 - {SPR_FLBM, FF_PAPERSPRITE|6, 1, {NULL}, 0, 0, S_NULL}, // S_FINISHBEAMEND2 - // Funny Spike {SPR_DEBT, 0|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_DEBTSPIKE2}, // S_DEBTSPIKE1 {SPR_DEBT, 7|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_DEBTSPIKE3}, // S_DEBTSPIKE2 @@ -22705,87 +22632,6 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_DRIFTEXPLODE - -1, // doomednum - S_DRIFTEXPLODE1, // spawnstate - 1000, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_NULL, // deathstate - S_NULL, // xdeathstate - sfx_None, // deathsound - 8, // speed - 32*FRACUNIT, // radius - 64*FRACUNIT, // height - 1, // display offset - 100, // mass - 0, // damage - sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags - S_NULL // raisestate - }, - - { // MT_DRIFTCLIP - -1, // doomednum - S_DRIFTCLIPA1, // spawnstate - 1000, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_NULL, // deathstate - S_NULL, // xdeathstate - sfx_None, // deathsound - 105, // speed - 32*FRACUNIT, // radius - 64*FRACUNIT, // height - 1, // display offset - 100, // mass - 0, // damage - sfx_None, // activesound - MF_NOBLOCKMAP|MF_DONTENCOREMAP|MF_GRENADEBOUNCE, // flags - S_NULL // raisestate - }, - - { // MT_DRIFTCLIPSPARK - -1, // doomednum - S_DRIFTCLIPSPARK, // spawnstate - 1000, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_NULL, // deathstate - S_NULL, // xdeathstate - sfx_None, // deathsound - 8, // speed - 32*FRACUNIT, // radius - 64*FRACUNIT, // height - 1, // display offset - 100, // mass - 0, // damage - sfx_None, // activesound - MF_NOBLOCKMAP|MF_DONTENCOREMAP, // flags - S_NULL // raisestate - }, - { // MT_BOOSTFLAME -1, // doomednum S_BOOSTFLAME, // spawnstate @@ -23083,60 +22929,6 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_DRIFTELECTRICITY - -1, // doomednum - S_DRIFTELECTRICITY, // spawnstate - 1000, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 0, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_NULL, // deathstate - S_NULL, // xdeathstate - sfx_None, // deathsound - 0, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 0, // mass - 0, // damage - sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIPHEIGHT|MF_NOCLIP|MF_NOCLIPTHING|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags - S_NULL // raisestate - }, - - { // MT_DRIFTELECTRICSPARK - -1, // doomednum - S_DRIFTELECTRICSPARK, // spawnstate - 1000, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 0, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_NULL, // deathstate - S_NULL, // xdeathstate - sfx_None, // deathsound - 4*FRACUNIT, // speed - 9*FRACUNIT, // radius - 37*FRACUNIT, // height - 0, // display offset - 0, // mass - 0, // damage - sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIPHEIGHT|MF_NOCLIP|MF_NOCLIPTHING|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags - S_NULL // raisestate - }, - { // MT_ROCKETSNEAKER -1, // doomednum S_ROCKETSNEAKER_L, // spawnstate @@ -24136,33 +23928,6 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_TRIPWIREBOOST - -1, // doomednum - S_TRIPWIREBOOST_TOP, // spawnstate - 1000, // spawnhealth - S_TRIPWIREBOOST_BOTTOM, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 0, // painchance - sfx_None, // painsound - S_TRIPWIREBOOST_BLAST_TOP, // meleestate - S_TRIPWIREBOOST_BLAST_BOTTOM, // missilestate - S_NULL, // deathstate - S_NULL, // xdeathstate - sfx_None, // deathsound - 0, // speed - 8*FRACUNIT, // radius - 16*FRACUNIT, // height - 1, // display offset - 100, // mass - 0, // damage - sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_NOCLIPTHING|MF_DONTENCOREMAP, // flags - S_NULL // raisestate - }, - { // MT_DEZLASER -1, // doomednum S_DEZLASER, // spawnstate @@ -28323,60 +28088,6 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_DRAFTDUST - -1, // doomednum - S_DRAFTDUST1, // spawnstate - 1000, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_NULL, // deathstate - S_NULL, // xdeathstate - sfx_None, // deathsound - 0, // speed - 8<offroad = 0; } -static void K_DrawDraftCombiring(player_t *player, player_t *victim, fixed_t curdist, fixed_t maxdist, boolean transparent) -{ -#define CHAOTIXBANDLEN 15 -#define CHAOTIXBANDCOLORS 9 - static const UINT8 colors[CHAOTIXBANDCOLORS] = { - SKINCOLOR_SAPPHIRE, - SKINCOLOR_PLATINUM, - SKINCOLOR_TEA, - SKINCOLOR_GARDEN, - SKINCOLOR_BANANA, - SKINCOLOR_GOLD, - SKINCOLOR_ORANGE, - SKINCOLOR_SCARLET, - SKINCOLOR_TAFFY - }; - fixed_t minimumdist = FixedMul(RING_DIST>>1, player->mo->scale); - UINT8 n = CHAOTIXBANDLEN; - UINT8 offset = ((leveltime / 3) % 3); - fixed_t stepx, stepy, stepz; - fixed_t curx, cury, curz; - UINT8 c; - - if (maxdist == 0) - { - c = leveltime % CHAOTIXBANDCOLORS; - } - else - { - c = FixedMul(CHAOTIXBANDCOLORS<> FRACBITS; - } - - stepx = (victim->mo->x - player->mo->x) / CHAOTIXBANDLEN; - stepy = (victim->mo->y - player->mo->y) / CHAOTIXBANDLEN; - stepz = ((victim->mo->z + (victim->mo->height / 2)) - (player->mo->z + (player->mo->height / 2))) / CHAOTIXBANDLEN; - - curx = player->mo->x + stepx; - cury = player->mo->y + stepy; - curz = player->mo->z + stepz; - - while (n) - { - if (offset == 0) - { - mobj_t *band = P_SpawnMobj(curx + (P_RandomRange(-12,12)*mapobjectscale), - cury + (P_RandomRange(-12,12)*mapobjectscale), - curz + (P_RandomRange(24,48)*mapobjectscale), - MT_SIGNSPARKLE); - - if (maxdist == 0) - { - P_SetMobjState(band, S_KSPARK1 + (leveltime % 8)); - P_SetScale(band, (band->destscale = player->mo->scale)); - } - else - { - P_SetMobjState(band, S_SIGNSPARK1 + (leveltime % 11)); - P_SetScale(band, (band->destscale = (3*player->mo->scale)/2)); - } - - band->color = colors[c]; - band->colorized = true; - - band->fuse = 2; - - if (transparent) - band->renderflags |= RF_GHOSTLY; - - band->renderflags |= RF_DONTDRAW & ~(K_GetPlayerDontDrawFlag(player) | K_GetPlayerDontDrawFlag(victim)); - } - - curx += stepx; - cury += stepy; - curz += stepz; - - offset = abs(offset-1) % 3; - n--; - } -#undef CHAOTIXBANDLEN -} - -/** \brief Updates the player's drafting values once per frame - - \param player player object passed from K_KartPlayerThink - - \return void -*/ -static void K_UpdateDraft(player_t *player) -{ - fixed_t topspd = K_GetKartSpeed(player, false, false); - fixed_t draftdistance; - fixed_t minDist; - UINT8 leniency; - UINT8 i; - - if (player->itemtype == KITEM_LIGHTNINGSHIELD) - { - // Lightning Shield gets infinite draft distance as its (other) passive effect. - draftdistance = 0; - } - else - { - // Distance you have to be to draft. If you're still accelerating, then this distance is lessened. - // This distance biases toward low weight! (min weight gets 4096 units, max weight gets 3072 units) - // This distance is also scaled based on game speed. - draftdistance = (3072 + (128 * (9 - player->kartweight))) * player->mo->scale; - if (player->speed < topspd) - draftdistance = FixedMul(draftdistance, FixedDiv(player->speed, topspd)); - draftdistance = FixedMul(draftdistance, K_GetKartGameSpeedScalar(gamespeed)); - } - - // On the contrary, the leniency period biases toward high weight. - // (See also: the leniency variable in K_SpawnDraftDust) - leniency = (3*TICRATE)/4 + ((player->kartweight-1) * (TICRATE/4)); - - minDist = 640 * player->mo->scale; - - if (gametype == GT_BATTLE) - { - // TODO: gametyperules - minDist /= 4; - draftdistance *= 2; - leniency *= 4; - } - - // Not enough speed to draft. - if (player->speed >= 20*player->mo->scale) - { -//#define EASYDRAFTTEST - // Let's hunt for players to draft off of! - for (i = 0; i < MAXPLAYERS; i++) - { - fixed_t dist, olddraft; -#ifndef EASYDRAFTTEST - angle_t yourangle, theirangle, diff; -#endif - - if (!playeringame[i] || players[i].spectator || !players[i].mo) - continue; - -#ifndef EASYDRAFTTEST - // Don't draft on yourself :V - if (&players[i] == player) - continue; -#endif - - // Not enough speed to draft off of. - if (players[i].speed < 20*players[i].mo->scale) - continue; - - // No tethering off of the guy who got the starting bonus :P - if (players[i].startboost > 0) - continue; - -#ifndef EASYDRAFTTEST - yourangle = K_MomentumAngle(player->mo); - theirangle = K_MomentumAngle(players[i].mo); - - diff = R_PointToAngle2(player->mo->x, player->mo->y, players[i].mo->x, players[i].mo->y) - yourangle; - if (diff > ANGLE_180) - diff = InvAngle(diff); - - // Not in front of this player. - if (diff > ANG10) - continue; - - diff = yourangle - theirangle; - if (diff > ANGLE_180) - diff = InvAngle(diff); - - // Not moving in the same direction. - if (diff > ANGLE_90) - continue; -#endif - - dist = 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); - -#ifndef EASYDRAFTTEST - // TOO close to draft. - if (dist < minDist) - continue; - - // Not close enough to draft. - if (dist > draftdistance && draftdistance > 0) - continue; -#endif - - olddraft = player->draftpower; - - player->draftleeway = leniency; - player->lastdraft = i; - - // Draft power is used later in K_GetKartBoostPower, ranging from 0 for normal speed and FRACUNIT for max draft speed. - // How much this increments every tic biases toward acceleration! (min speed gets 1.5% per tic, max speed gets 0.5% per tic) - if (player->draftpower < FRACUNIT) - { - fixed_t add = (FRACUNIT/200) + ((9 - player->kartspeed) * ((3*FRACUNIT)/1600));; - player->draftpower += add; - - if (player->bot && player->botvars.rival) - { - // Double speed for the rival! - player->draftpower += add; - } - - if (gametype == GT_BATTLE) - { - // TODO: gametyperules - // Double speed in Battle - player->draftpower += add; - } - } - - if (player->draftpower > FRACUNIT) - player->draftpower = FRACUNIT; - - // Play draft finish noise - if (olddraft < FRACUNIT && player->draftpower >= FRACUNIT) - S_StartSound(player->mo, sfx_cdfm62); - - // Spawn in the visual! - K_DrawDraftCombiring(player, &players[i], dist, draftdistance, false); - - return; // Finished doing our draft. - } - } - - // No one to draft off of? Then you can knock that off. - if (player->draftleeway > 0) // Prevent small disruptions from stopping your draft. - { - if (P_IsObjectOnGround(player->mo) == true) - { - // Allow maintaining tether in air setpieces. - player->draftleeway--; - } - - if (player->lastdraft >= 0 - && player->lastdraft < MAXPLAYERS - && playeringame[player->lastdraft] - && !players[player->lastdraft].spectator - && players[player->lastdraft].mo) - { - player_t *victim = &players[player->lastdraft]; - fixed_t dist = P_AproxDistance(P_AproxDistance(victim->mo->x - player->mo->x, victim->mo->y - player->mo->y), victim->mo->z - player->mo->z); - K_DrawDraftCombiring(player, victim, dist, draftdistance, true); - } - } - else // Remove draft speed boost. - { - player->draftpower = 0; - player->lastdraft = -1; - } -} - void K_KartPainEnergyFling(player_t *player) { static const UINT8 numfling = 5; @@ -2073,12 +1821,7 @@ static void K_SpawnBrakeDriftSparks(player_t *player) // Be sure to update the m sparks->renderflags |= RF_DONTDRAW; } -static void -spawn_brake_dust -( mobj_t * master, - angle_t aoff, - fixed_t rad, - fixed_t scale) +static void spawn_brake_dust(mobj_t * master, angle_t aoff, fixed_t rad, fixed_t scale) { const angle_t a = master->angle + aoff; @@ -2146,49 +1889,6 @@ static void K_SpawnBrakeVisuals(player_t *player) player->mo->spriteyoffset = P_RandomFlip(2 * scale); } -void K_SpawnDriftBoostClip(player_t *player) -{ - mobj_t *clip; - fixed_t scale = 115*FRACUNIT/100; - fixed_t momz = P_GetMobjZMovement(player->mo); - fixed_t z; - - if (( player->mo->eflags & MFE_VERTICALFLIP )) - z = player->mo->z; - else - z = player->mo->z + player->mo->height; - - clip = P_SpawnMobj(player->mo->x, player->mo->y, z, MT_DRIFTCLIP); - - P_SetTarget(&clip->target, player->mo); - P_SetScale(clip, ( clip->destscale = FixedMul(scale, player->mo->scale) )); - K_MatchGenericExtraFlags(clip, player->mo); - - clip->fuse = 105; - clip->momz = 7 * P_MobjFlip(clip) * clip->scale; - - if (momz > 0) - clip->momz += momz; - - P_InstaThrust(clip, player->mo->angle + - P_RandomFlip(P_RandomRange(FRACUNIT/2, FRACUNIT)), - FixedMul(scale, player->speed)); -} - -void K_SpawnDriftBoostClipSpark(mobj_t *clip) -{ - mobj_t *spark; - - spark = P_SpawnMobj(clip->x, clip->y, clip->z, MT_DRIFTCLIPSPARK); - - P_SetTarget(&spark->target, clip); - P_SetScale(spark, ( spark->destscale = clip->scale )); - K_MatchGenericExtraFlags(spark, clip); - - spark->momx = clip->momx/2; - spark->momy = clip->momx/2; -} - void K_SpawnNormalSpeedLines(player_t *player) { mobj_t *fast = P_SpawnMobj(player->mo->x + (P_RandomRange(-36,36) * player->mo->scale), @@ -2236,6 +1936,11 @@ void K_SpawnNormalSpeedLines(player_t *player) fast->colorized = true; fast->renderflags |= RF_ADD; } + else if (player->pflags & PF_AIRFAILSAFE) + { + fast->color = SKINCOLOR_WHITE; + fast->colorized = true; + } } void K_SpawnInvincibilitySpeedLines(mobj_t *mo) @@ -3007,17 +2712,12 @@ fixed_t K_GetSpindashChargeSpeed(player_t *player) // sets boostpower, speedboost, accelboost, and handleboost to whatever we need it to be static void K_GetKartBoostPower(player_t *player) { - // Light weights have stronger boost stacking -- aka, better metabolism than heavies XD - const fixed_t maxmetabolismincrease = FRACUNIT/2; - const fixed_t metabolism = FRACUNIT - ((9-player->kartweight) * maxmetabolismincrease / 8); - // v2 almost broke sliptiding when it fixed turning bugs! // This value is fine-tuned to feel like v1 again without reverting any of those changes. const fixed_t sliptidehandling = FRACUNIT/2; fixed_t boostpower = FRACUNIT; fixed_t speedboost = 0, accelboost = 0, handleboost = 0; - UINT8 numboosts = 0; if (player->spinouttimer && player->wipeoutslow == 1) // Slow down after you've been bumped { @@ -3031,26 +2731,41 @@ static void K_GetKartBoostPower(player_t *player) if (player->bananadrag > TICRATE) boostpower = (4*boostpower)/5; + + // Banana drag/offroad dust + if (boostpower < FRACUNIT + && player->mo && P_IsObjectOnGround(player->mo) + && player->speed > 0 + && !player->spectator) + { + K_SpawnWipeoutTrail(player->mo, true); + if (leveltime % 6 == 0) + S_StartSound(player->mo, sfx_cdfm70); + } - // Note: Handling will ONLY stack when sliptiding! - // When you're not, it just uses the best instead of adding together, like the old behavior. #define ADDBOOST(s,a,h) { \ - numboosts++; \ - speedboost += FixedDiv(s, FRACUNIT + (metabolism * (numboosts-1))); \ - accelboost += FixedDiv(a, FRACUNIT + (metabolism * (numboosts-1))); \ - if (player->aizdriftstrat) \ - handleboost += FixedDiv(h, FRACUNIT + (metabolism * (numboosts-1))); \ - else \ - handleboost = max(h, handleboost); \ + speedboost = max(speedboost,s); \ + accelboost = max(accelboost,a); \ + handleboost = max(h, handleboost); \ } if (player->sneakertimer) // Sneaker { - UINT8 i; - for (i = 0; i < player->numsneakers; i++) + fixed_t sneakerspeedboost = 0; + switch (gamespeed) { - ADDBOOST(FRACUNIT/2, 8*FRACUNIT, sliptidehandling); // + 50% top speed, + 800% acceleration, +50% handling + case 0: + sneakerspeedboost = max(speedboost, 53740+768); + break; + case 2: + sneakerspeedboost = max(speedboost, 17294+768); + break; + default: + sneakerspeedboost = max(speedboost, 32768); + break; } + ADDBOOST(sneakerspeedboost, 8*FRACUNIT, sliptidehandling); // + ???% top speed, + 800% acceleration, +50% handlin + } if (player->invincibilitytimer) // Invincibility @@ -3088,27 +2803,12 @@ static void K_GetKartBoostPower(player_t *player) if (player->startboost) // Startup Boost { - ADDBOOST(FRACUNIT, 4*FRACUNIT, sliptidehandling/2); // + 100% top speed, + 400% acceleration, +25% handling + ADDBOOST(FRACUNIT/4, 6*FRACUNIT, sliptidehandling/2); // + 25% top speed, + 300% acceleration, +25% handling } if (player->driftboost) // Drift Boost { - // Rebuff Eggman's stat block corner - const INT32 heavyAccel = ((9 - player->kartspeed) * 2) + (player->kartweight - 1); - const fixed_t heavyAccelBonus = FRACUNIT + ((heavyAccel * maxmetabolismincrease * 2) / 24); - - fixed_t driftSpeed = FRACUNIT/4; // 25% base - - if (player->strongdriftboost > 0) - { - // Purple/Rainbow drift boost - driftSpeed = FixedMul(driftSpeed, 4*FRACUNIT/3); // 25% -> 33% - } - - // Bottom-left bonus - driftSpeed = FixedMul(driftSpeed, heavyAccelBonus); - - ADDBOOST(driftSpeed, 4*FRACUNIT, 0); // + variable top speed, + 400% acceleration, +0% handling + ADDBOOST(FRACUNIT/4, 4*FRACUNIT, 0); // + 25% top speed, + 400% acceleration, +0% handling } if (player->trickboost) // Trick pannel up-boost @@ -3126,27 +2826,6 @@ static void K_GetKartBoostPower(player_t *player) ADDBOOST(3*FRACUNIT/20, FRACUNIT, 0); // + 15% top speed, + 100% acceleration, +0% handling } - if (player->draftpower > 0) // Drafting - { - // 30% - 44%, each point of speed adds 1.75% - fixed_t draftspeed = ((3*FRACUNIT)/10) + ((player->kartspeed-1) * ((7*FRACUNIT)/400)); - - if (gametype == GT_BATTLE) - { - // TODO: gametyperules - draftspeed *= 2; - } - - if (player->itemtype == KITEM_LIGHTNINGSHIELD) - { - // infinite tether - draftspeed *= 2; - } - - speedboost += FixedMul(draftspeed, player->draftpower); // (Drafting suffers no boost stack penalty.) - numboosts++; - } - player->boostpower = boostpower; // value smoothing @@ -3161,19 +2840,30 @@ static void K_GetKartBoostPower(player_t *player) player->accelboost = accelboost; player->handleboost = handleboost; - - player->numboosts = numboosts; } // Returns kart speed from a stat. Boost power and scale are NOT taken into account, no player or object is necessary. fixed_t K_GetKartSpeedFromStat(UINT8 kartspeed) { - const fixed_t xspd = (3*FRACUNIT)/64; - fixed_t g_cc = K_GetKartGameSpeedScalar(gamespeed) + xspd; - fixed_t k_speed = 148; + const fixed_t xspd = 3072; + fixed_t g_cc = FRACUNIT; + fixed_t k_speed = 150; fixed_t finalspeed; - k_speed += kartspeed*4; // 152 - 184 + switch (gamespeed) + { + case 0: + g_cc = 53248 + xspd; // 50cc = 81.25 + 4.69 = 85.94% + break; + case 2: + g_cc = 77824 + xspd; // 150cc = 118.75 + 4.69 = 123.44% + break; + default: + g_cc = 65536 + xspd; // 100cc = 100.00 + 4.69 = 104.69% + break; + } + + k_speed += kartspeed*3; // 153 - 177 finalspeed = FixedMul(k_speed<<14, g_cc); return finalspeed; @@ -3181,15 +2871,21 @@ fixed_t K_GetKartSpeedFromStat(UINT8 kartspeed) fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower, boolean dorubberband) { + UINT8 kartspeed = player->kartspeed; + fixed_t finalspeed = 0; const boolean mobjValid = (player->mo != NULL && P_MobjWasRemoved(player->mo) == false); - fixed_t finalspeed = K_GetKartSpeedFromStat(player->kartspeed); - if (gametyperules & GTR_BUMPERS && player->bumpers <= 0) - finalspeed = 3 * finalspeed / 2; + if (doboostpower && /*!player->pogospring &&*/ !P_IsObjectOnGround(player->mo)) + return (75*mapobjectscale); // air speed cap + + if ((gametyperules & GTR_KARMA) && (player->bumpers <= 0)) + kartspeed = 1; + + finalspeed = K_GetKartSpeedFromStat(kartspeed); if (player->spheres > 0) { - fixed_t sphereAdd = (FRACUNIT/40); // 100% at max + fixed_t sphereAdd = (FRACUNIT/60); // 66% at max finalspeed = FixedMul(finalspeed, FRACUNIT + (sphereAdd * player->spheres)); } @@ -3218,8 +2914,8 @@ fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower, boolean dorubberb finalspeed = FixedMul(finalspeed, player->boostpower + player->speedboost); } - - if (dorubberband == true && K_PlayerUsesBotMovement(player) == true) + + if (dorubberband == true && player->botvars.rubberband < FRACUNIT && K_PlayerUsesBotMovement(player) == true) { finalspeed = FixedMul(finalspeed, player->botvars.rubberband); } @@ -3229,15 +2925,15 @@ fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower, boolean dorubberb fixed_t K_GetKartAccel(player_t *player) { - fixed_t k_accel = 121; + fixed_t k_accel = 32; // 36; + UINT8 kartspeed = player->kartspeed; - k_accel += 17 * (9 - player->kartspeed); // 121 - 257 + if ((gametyperules & GTR_KARMA) && player->bumpers <= 0) + kartspeed = 1; - // karma bomb gets 2x acceleration - if (gametype == GT_BATTLE && player->bumpers <= 0) - k_accel *= 2; + k_accel += 4 * (9 - kartspeed); // 32 - 64 - return FixedMul(k_accel, (FRACUNIT + player->accelboost) / 4); + return FixedMul(k_accel, FRACUNIT+player->accelboost); } UINT16 K_GetKartFlashing(player_t *player) @@ -3873,69 +3569,39 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color) #undef MINEQUAKEDIST -fixed_t K_ItemScaleForPlayer(player_t *player) -{ - switch (player->itemscale) - { - case ITEMSCALE_GROW: - return FixedMul(GROW_SCALE, mapobjectscale); - - case ITEMSCALE_SHRINK: - return FixedMul(SHRINK_SCALE, mapobjectscale); - - default: - return mapobjectscale; - } -} - static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t an, INT32 flags2, fixed_t speed) { mobj_t *th; fixed_t x, y, z; - fixed_t topspeed = K_GetKartSpeed(source->player, false, false); fixed_t finalspeed = speed; - fixed_t finalscale = mapobjectscale; mobj_t *throwmo; - if (source->player != NULL) + if (source->player && source->player->speed > K_GetKartSpeed(source->player, false, false)) { - - if (source->player->itemscale == ITEMSCALE_SHRINK) - { - // Nerf the base item speed a bit. - finalspeed = FixedMul(finalspeed, SHRINK_SCALE); - } + angle_t input = source->angle - an; + boolean invert = (input > ANGLE_180); + if (invert) + input = InvAngle(input); - if (source->player->speed > topspeed) - { - angle_t input = source->angle - an; - boolean invert = (input > ANGLE_180); - if (invert) - input = InvAngle(input); - - finalspeed = max(speed, FixedMul(speed, FixedMul( - FixedDiv(source->player->speed, topspeed), // Multiply speed to be proportional to your own, boosted maxspeed. - (((180<player); - } - - if (type == MT_BUBBLESHIELDTRAP) - { - finalscale = source->scale; + finalspeed = max(speed, FixedMul(speed, FixedMul( + FixedDiv(source->player->speed, K_GetKartSpeed(source->player, false, false)), // Multiply speed to be proportional to your own, boosted maxspeed. + (((180<x + source->momx + FixedMul(finalspeed, FINECOSINE(an>>ANGLETOFINESHIFT)); y = source->y + source->momy + FixedMul(finalspeed, FINESINE(an>>ANGLETOFINESHIFT)); z = source->z; // spawn on the ground please - th = P_SpawnMobj(x, y, z, type); // this will never return null because collision isn't processed here + if (P_MobjFlip(source) < 0) + { + z = source->z+source->height - mobjinfo[type].height; + } - K_FlipFromObject(th, source); + th = P_SpawnMobj(x, y, z, type); th->flags2 |= flags2; + th->threshold = 10; if (th->info->seesound) @@ -3943,17 +3609,11 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t an, I P_SetTarget(&th->target, source); - P_SetScale(th, finalscale); - th->destscale = finalscale; - if (P_IsObjectOnGround(source)) { // floorz and ceilingz aren't properly set to account for FOFs and Polyobjects on spawn // This should set it for FOFs - P_SetOrigin(th, th->x, th->y, th->z); // however, THIS can fuck up your day. just absolutely ruin you. - if (P_MobjWasRemoved(th)) - return NULL; - + P_SetOrigin(th, th->x, th->y, th->z); // spawn on the ground if the player is on the ground if (P_MobjFlip(source) < 0) { @@ -3964,16 +3624,9 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t an, I th->z = th->floorz; } - P_InitAngle(th, an); - + th->angle = an; th->momx = FixedMul(finalspeed, FINECOSINE(an>>ANGLETOFINESHIFT)); th->momy = FixedMul(finalspeed, FINESINE(an>>ANGLETOFINESHIFT)); - th->momz = source->momz; - - if (source->player != NULL) - { - th->cusval = source->player->itemscale; - } switch (type) { @@ -4026,27 +3679,23 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t an, I P_SetTarget(&throwmo->target, source); } - return th; + return NULL; } UINT16 K_DriftSparkColor(player_t *player, INT32 charge) { - const INT32 dsone = K_GetKartDriftSparkValueForStage(player, 1); - const INT32 dstwo = K_GetKartDriftSparkValueForStage(player, 2); - const INT32 dsthree = K_GetKartDriftSparkValueForStage(player, 3); - const INT32 dsfour = K_GetKartDriftSparkValueForStage(player, 4); - + INT32 ds = K_GetKartDriftSparkValue(player); UINT16 color = SKINCOLOR_NONE; if (charge < 0) { - // Stage 0: Grey - color = SKINCOLOR_SILVER; + // Stage 0: GREY + color = SKINCOLOR_GREY; } - else if (charge >= dsfour) + else if (charge >= ds*4) { - // Stage 4: Rainbow - if (charge <= dsfour+(32*3)) + // Stage 3: Rainbow + if (charge <= (ds*4)+(32*3)) { // transition color = SKINCOLOR_SILVER; @@ -4056,28 +3705,10 @@ UINT16 K_DriftSparkColor(player_t *player, INT32 charge) color = K_RainbowColor(leveltime); } } - else if (charge >= dsthree) - { - // Stage 3: Blue - if (charge <= dsthree+(16*3)) - { - // transition 1 - color = SKINCOLOR_TAFFY; - } - else if (charge <= dsthree+(32*3)) - { - // transition 2 - color = SKINCOLOR_NOVA; - } - else - { - color = SKINCOLOR_SAPPHIRE; - } - } - else if (charge >= dstwo) + else if (charge >= ds*2) { // Stage 2: Red - if (charge <= dstwo+(32*3)) + if (charge <= (ds*2)+(32*3)) { // transition color = SKINCOLOR_TANGERINE; @@ -4087,123 +3718,26 @@ UINT16 K_DriftSparkColor(player_t *player, INT32 charge) color = SKINCOLOR_KETCHUP; } } - else if (charge >= dsone) + else if (charge >= ds) { - // Stage 1: Yellow - if (charge <= dsone+(32*3)) + // Stage 1: Blue + if (charge <= (ds)+(32*3)) { // transition - color = SKINCOLOR_TAN; + color = SKINCOLOR_PURPLE; } else { - color = SKINCOLOR_GOLD; + color = SKINCOLOR_SAPPHIRE; } } return color; } -static void K_SpawnDriftElectricity(player_t *player) -{ - UINT8 i; - UINT16 color = K_DriftSparkColor(player, player->driftcharge); - mobj_t *mo = player->mo; - fixed_t vr = FixedDiv(mo->radius/3, mo->scale); // P_SpawnMobjFromMobj will rescale - fixed_t horizontalradius = FixedDiv(5*mo->radius/3, mo->scale); - angle_t verticalangle = K_MomentumAngle(mo) + ANGLE_180; // points away from the momentum angle - - for (i = 0; i < 2; i++) - { - // i == 0 is right, i == 1 is left - mobj_t *spark; - angle_t horizonatalangle = verticalangle + (i ? ANGLE_90 : ANGLE_270); - angle_t sparkangle = verticalangle + ANGLE_180; - fixed_t verticalradius = vr; // local version of the above so we can modify it - fixed_t scalefactor = 0; // positive values enlarge sparks, negative values shrink them - fixed_t x, y; - - if (player->drift == 0) - ; // idk what you're doing spawning drift sparks when you're not drifting but you do you - else - { - scalefactor = -(2*i - 1) * min(max(player->steering, -1), 1) * FRACUNIT; - if ((player->drift > 0) == !(i)) // inwards spark should be closer to the player - verticalradius = 0; - } - - x = P_ReturnThrustX(mo, verticalangle, verticalradius) - + P_ReturnThrustX(mo, horizonatalangle, horizontalradius); - y = P_ReturnThrustY(mo, verticalangle, verticalradius) - + P_ReturnThrustY(mo, horizonatalangle, horizontalradius); - spark = P_SpawnMobjFromMobj(mo, x, y, 0, MT_DRIFTELECTRICITY); - P_InitAngle(spark, sparkangle); - spark->momx = mo->momx; - spark->momy = mo->momy; - spark->momz = mo->momz; - spark->color = color; - K_GenericExtraFlagsNoZAdjust(spark, mo); - - spark->spritexscale += scalefactor/3; - spark->spriteyscale += scalefactor/8; - } -} - -void K_SpawnDriftElectricSparks(player_t *player) -{ - SINT8 hdir, vdir, i; - - mobj_t *mo = player->mo; - angle_t momangle = K_MomentumAngle(mo) + ANGLE_180; - fixed_t radius = 2 * FixedDiv(mo->radius, mo->scale); // P_SpawnMobjFromMobj will rescale - fixed_t x = P_ReturnThrustX(mo, momangle, radius); - fixed_t y = P_ReturnThrustY(mo, momangle, radius); - fixed_t z = FixedDiv(mo->height, 2 * mo->scale); // P_SpawnMobjFromMobj will rescale - - fixed_t sparkspeed = mobjinfo[MT_DRIFTELECTRICSPARK].speed; - fixed_t sparkradius = 2 * mobjinfo[MT_DRIFTELECTRICSPARK].radius; - UINT16 color = K_DriftSparkColor(player, player->driftcharge); - - // if the sparks are spawned from first blood rather than drift boost, color will be SKINCOLOR_NONE. ew! - if (color == SKINCOLOR_NONE) - color = SKINCOLOR_SILVER; - - for (hdir = -1; hdir <= 1; hdir += 2) - { - for (vdir = -1; vdir <= 1; vdir += 2) - { - fixed_t hspeed = FixedMul(hdir * sparkspeed, mo->scale); // P_InstaThrust treats speed as absolute - fixed_t vspeed = vdir * sparkspeed; // P_SetObjectMomZ scales speed with object scale - angle_t sparkangle = mo->angle + ANGLE_45; - - for (i = 0; i < 4; i++) - { - fixed_t xoff = P_ReturnThrustX(mo, sparkangle, sparkradius); - fixed_t yoff = P_ReturnThrustY(mo, sparkangle, sparkradius); - mobj_t *spark = P_SpawnMobjFromMobj(mo, x + xoff, y + yoff, z, MT_DRIFTELECTRICSPARK); - - P_InitAngle(spark, sparkangle); - spark->color = color; - P_InstaThrust(spark, mo->angle + ANGLE_90, hspeed); - P_SetObjectMomZ(spark, vspeed, false); - spark->momx += mo->momx; // copy player speed - spark->momy += mo->momy; - spark->momz += P_GetMobjZMovement(mo); - - sparkangle += ANGLE_90; - } - } - } - S_StartSound(mo, sfx_s3k45); -} - static void K_SpawnDriftSparks(player_t *player) { - const INT32 dsone = K_GetKartDriftSparkValueForStage(player, 1); - const INT32 dstwo = K_GetKartDriftSparkValueForStage(player, 2); - const INT32 dsthree = K_GetKartDriftSparkValueForStage(player, 3); - const INT32 dsfour = K_GetKartDriftSparkValueForStage(player, 4); - + INT32 ds = K_GetKartDriftSparkValue(player); fixed_t newx; fixed_t newy; mobj_t *spark; @@ -4218,7 +3752,7 @@ static void K_SpawnDriftSparks(player_t *player) return; if (!player->drift - || (player->driftcharge < dsone && !(player->driftcharge < 0))) + || (player->driftcharge < ds && !(player->driftcharge < 0))) return; travelangle = player->mo->angle-(ANGLE_45/5)*player->drift; @@ -4233,57 +3767,44 @@ static void K_SpawnDriftSparks(player_t *player) spark = P_SpawnMobj(newx, newy, player->mo->z, MT_DRIFTSPARK); P_SetTarget(&spark->target, player->mo); - P_InitAngle(spark, travelangle-(ANGLE_45/5)*player->drift); + spark->angle = travelangle-(ANGLE_45/5)*player->drift; spark->destscale = player->mo->scale; P_SetScale(spark, player->mo->scale); spark->momx = player->mo->momx/2; spark->momy = player->mo->momy/2; - spark->momz = P_GetMobjZMovement(player->mo)/2; + //spark->momz = player->mo->momz/2; spark->color = K_DriftSparkColor(player, player->driftcharge); if (player->driftcharge < 0) { - // Stage 0: Yellow + // Stage 0: Grey size = 0; } - else if (player->driftcharge >= dsfour) + else if (player->driftcharge >= ds*4) { - // Stage 4: Rainbow + // Stage 3: Rainbow size = 2; trail = 2; - if (player->driftcharge <= (dsfour)+(32*3)) + if (player->driftcharge <= (ds*4)+(32*3)) { // transition P_SetScale(spark, (spark->destscale = spark->scale*3/2)); - S_StartSound(player->mo, sfx_cock); } else { spark->colorized = true; } } - else if (player->driftcharge >= dsthree) - { - // Stage 3: Purple - size = 2; - trail = 1; - - if (player->driftcharge <= dsthree+(32*3)) - { - // transition - P_SetScale(spark, (spark->destscale = spark->scale*3/2)); - } - } - else if (player->driftcharge >= dstwo) + else if (player->driftcharge >= ds*2) { // Stage 2: Blue size = 2; trail = 1; - if (player->driftcharge <= dstwo+(32*3)) + if (player->driftcharge <= (ds*2)+(32*3)) { // transition P_SetScale(spark, (spark->destscale = spark->scale*3/2)); @@ -4294,15 +3815,15 @@ static void K_SpawnDriftSparks(player_t *player) // Stage 1: Red size = 1; - if (player->driftcharge <= dsone+(32*3)) + if (player->driftcharge <= (ds)+(32*3)) { // transition P_SetScale(spark, (spark->destscale = spark->scale*2)); } } - if ((player->drift > 0 && player->steering > 0) // Inward drifts - || (player->drift < 0 && player->steering < 0)) + if ((player->drift > 0 && player->cmd.turning > 0) // Inward drifts + || (player->drift < 0 && player->cmd.turning < 0)) { if ((player->drift < 0 && (i & 1)) || (player->drift > 0 && !(i & 1))) @@ -4315,8 +3836,8 @@ static void K_SpawnDriftSparks(player_t *player) size--; } } - else if ((player->drift > 0 && player->steering < 0) // Outward drifts - || (player->drift < 0 && player->steering > 0)) + else if ((player->drift > 0 && player->cmd.turning < 0) // Outward drifts + || (player->drift < 0 && player->cmd.turning > 0)) { if ((player->drift < 0 && (i & 1)) || (player->drift > 0 && !(i & 1))) @@ -4342,13 +3863,9 @@ static void K_SpawnDriftSparks(player_t *player) K_MatchGenericExtraFlags(spark, player->mo); } - - if (player->driftcharge >= dsthree) - { - K_SpawnDriftElectricity(player); - } } + static void K_SpawnAIZDust(player_t *player) { fixed_t newx; @@ -4503,7 +4020,7 @@ void K_SpawnSparkleTrail(mobj_t *mo) } } -void K_SpawnWipeoutTrail(mobj_t *mo) +void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent) { mobj_t *dust; angle_t aoff; @@ -4526,89 +4043,20 @@ void K_SpawnWipeoutTrail(mobj_t *mo) mo->z, MT_WIPEOUTTRAIL); P_SetTarget(&dust->target, mo); - P_InitAngle(dust, K_MomentumAngle(mo)); + dust->angle = R_PointToAngle2(0,0,mo->momx,mo->momy); dust->destscale = mo->scale; P_SetScale(dust, mo->scale); K_FlipFromObject(dust, mo); -} -void K_SpawnDraftDust(mobj_t *mo) -{ - UINT8 i; - - I_Assert(mo != NULL); - I_Assert(!P_MobjWasRemoved(mo)); - - for (i = 0; i < 2; i++) + if (translucent) // offroad effect { - angle_t ang, aoff; - SINT8 sign = 1; - UINT8 foff = 0; - mobj_t *dust; - boolean drifting = false; - - if (mo->player) - { - UINT8 leniency = (3*TICRATE)/4 + ((mo->player->kartweight-1) * (TICRATE/4)); - - if (gametype == GT_BATTLE) - leniency *= 4; - - ang = mo->player->drawangle; - - if (mo->player->drift != 0) - { - drifting = true; - ang += (mo->player->drift * ((ANGLE_270 + ANGLE_22h) / 5)); // -112.5 doesn't work. I fucking HATE SRB2 angles - if (mo->player->drift < 0) - sign = 1; - else - sign = -1; - } - - foff = 5 - ((mo->player->draftleeway * 5) / leniency); - - // this shouldn't happen - if (foff > 4) - foff = 4; - } - else - ang = mo->angle; - - if (!drifting) - { - if (i & 1) - sign = -1; - else - sign = 1; - } - - aoff = (ang + ANGLE_180) + (ANGLE_45 * sign); - - dust = P_SpawnMobj(mo->x + FixedMul(24*mo->scale, FINECOSINE(aoff>>ANGLETOFINESHIFT)), - mo->y + FixedMul(24*mo->scale, FINESINE(aoff>>ANGLETOFINESHIFT)), - mo->z, MT_DRAFTDUST); - - P_SetMobjState(dust, S_DRAFTDUST1 + foff); - - P_SetTarget(&dust->target, mo); - P_InitAngle(dust, ang - (ANGLE_90 * sign)); // point completely perpendicular from the player - dust->destscale = mo->scale; - P_SetScale(dust, mo->scale); - K_FlipFromObject(dust, mo); - - if (leveltime & 1) - dust->tics++; // "randomize" animation - - dust->momx = (4*mo->momx)/5; - dust->momy = (4*mo->momy)/5; - dust->momz = (4*P_GetMobjZMovement(mo))/5; - - P_Thrust(dust, dust->angle, 4*mo->scale); - - if (drifting) // only 1 trail while drifting - break; + dust->momx = mo->momx/2; + dust->momy = mo->momy/2; + dust->momz = mo->momz/2; } + + if (translucent) + dust->renderflags |= RF_TRANS50; } // K_DriftDustHandling @@ -4621,7 +4069,7 @@ void K_SpawnDraftDust(mobj_t *mo) void K_DriftDustHandling(mobj_t *spawner) { angle_t anglediff; - const INT16 spawnrange = spawner->radius >> FRACBITS; + const INT16 spawnrange = spawner->radius>>FRACBITS; if (!P_IsObjectOnGround(spawner) || leveltime % 2 != 0) return; @@ -4638,10 +4086,10 @@ void K_DriftDustHandling(mobj_t *spawner) { angle_t playerangle = spawner->angle; - if (spawner->player->speed < 5*spawner->scale) + if (spawner->player->speed < 5<player) < 0) + if (spawner->player->cmd.forwardmove < 0) playerangle += ANGLE_180; anglediff = abs((signed)(playerangle - R_PointToAngle2(0, 0, spawner->player->rmomx, spawner->player->rmomy))); @@ -4649,10 +4097,10 @@ void K_DriftDustHandling(mobj_t *spawner) } else { - if (P_AproxDistance(spawner->momx, spawner->momy) < 5*spawner->scale) + if (P_AproxDistance(spawner->momx, spawner->momy) < 5<angle - K_MomentumAngle(spawner))); + anglediff = abs((signed)(spawner->angle - R_PointToAngle2(0, 0, spawner->momx, spawner->momy))); } if (anglediff > ANGLE_180) @@ -4660,50 +4108,22 @@ void K_DriftDustHandling(mobj_t *spawner) if (anglediff > ANG10*4) // Trying to turn further than 40 degrees { - fixed_t spawnx = P_RandomRange(-spawnrange, spawnrange) << FRACBITS; - fixed_t spawny = P_RandomRange(-spawnrange, spawnrange) << FRACBITS; + fixed_t spawnx = P_RandomRange(-spawnrange, spawnrange)<x + spawnx, spawner->y + spawny, spawner->z, MT_DRIFTDUST); - dust->momx = FixedMul(spawner->momx + (P_RandomRange(-speedrange, speedrange) * spawner->scale), 3*FRACUNIT/4); - dust->momy = FixedMul(spawner->momy + (P_RandomRange(-speedrange, speedrange) * spawner->scale), 3*FRACUNIT/4); + dust->momx = FixedMul(spawner->momx + (P_RandomRange(-speedrange, speedrange)<scale)/4); + dust->momy = FixedMul(spawner->momy + (P_RandomRange(-speedrange, speedrange)<scale)/4); dust->momz = P_MobjFlip(spawner) * (P_RandomRange(1, 4) * (spawner->scale)); P_SetScale(dust, spawner->scale/2); dust->destscale = spawner->scale * 3; dust->scalespeed = spawner->scale/12; + dust->target = spawner; if (leveltime % 6 == 0) S_StartSound(spawner, sfx_screec); K_MatchGenericExtraFlags(dust, spawner); - - // Sparkle-y warning for when you're about to change drift sparks! - if (spawner->player && spawner->player->drift) - { - INT32 driftval = K_GetKartDriftSparkValue(spawner->player); - INT32 warntime = driftval/3; - INT32 dc = spawner->player->driftcharge; - UINT8 c = SKINCOLOR_NONE; - boolean rainbow = false; - - if (dc >= 0) - { - dc += warntime; - } - - c = K_DriftSparkColor(spawner->player, dc); - - if (dc > (4*driftval)+(32*3)) - { - rainbow = true; - } - - if (c != SKINCOLOR_NONE) - { - P_SetMobjState(dust, S_DRIFTWARNSPARK1); - dust->color = c; - dust->colorized = rainbow; - } - } } } @@ -4779,15 +4199,29 @@ mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t mapthing, return NULL; // Figure out projectile speed by game speed - if (missile) + if (missile && mapthing != MT_BALLHOG) // Trying to keep compatability... { - // Use info->speed for missiles - PROJSPEED = FixedMul(mobjinfo[mapthing].speed, K_GetKartGameSpeedScalar(gamespeed)); + PROJSPEED = mobjinfo[mapthing].speed; + if (gamespeed == 0) + PROJSPEED = FixedMul(PROJSPEED, FRACUNIT-FRACUNIT/4); + else if (gamespeed == 2) + PROJSPEED = FixedMul(PROJSPEED, FRACUNIT+FRACUNIT/4); + PROJSPEED = FixedMul(PROJSPEED, mapobjectscale); } else { - // Use pre-determined speed for tossing - PROJSPEED = FixedMul(82 * FRACUNIT, K_GetKartGameSpeedScalar(gamespeed)); + switch (gamespeed) + { + case 0: + PROJSPEED = 68*mapobjectscale; // Avg Speed is 34 + break; + case 2: + PROJSPEED = 96*mapobjectscale; // Avg Speed is 48 + break; + default: + PROJSPEED = 82*mapobjectscale; // Avg Speed is 41 + break; + } } // Scale to map scale @@ -4876,21 +4310,19 @@ mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t mapthing, } else { - fixed_t finalscale = K_ItemScaleForPlayer(player); - player->bananadrag = 0; // RESET timer, for multiple bananas if (dir > 0) { // Shoot forward mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + player->mo->height/2, mapthing); - + //K_FlipFromObject(mo, player->mo); // These are really weird so let's make it a very specific case to make SURE it works... if (player->mo->eflags & MFE_VERTICALFLIP) { mo->z -= player->mo->height; + mo->flags2 |= MF2_OBJECTFLIP; mo->eflags |= MFE_VERTICALFLIP; - mo->flags2 |= (player->mo->flags2 & MF2_OBJECTFLIP); } mo->threshold = 10; @@ -4901,9 +4333,9 @@ mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t mapthing, if (mo) { angle_t fa = player->mo->angle>>ANGLETOFINESHIFT; - fixed_t HEIGHT = ((20 + (dir*10)) * FRACUNIT) + (FixedDiv(player->mo->momz, mapobjectscale)*P_MobjFlip(player->mo)); // Also intentionally not player scale + fixed_t HEIGHT = (20 + (dir*10))*mapobjectscale + (player->mo->momz*P_MobjFlip(player->mo)); - P_SetObjectMomZ(mo, HEIGHT, false); + mo->momz = HEIGHT*P_MobjFlip(mo); mo->momx = player->mo->momx + FixedMul(FINECOSINE(fa), PROJSPEED*dir); mo->momy = player->mo->momy + FixedMul(FINESINE(fa), PROJSPEED*dir); @@ -4911,9 +4343,6 @@ mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t mapthing, if (mo->eflags & MFE_UNDERWATER) mo->momz = (117 * mo->momz) / 200; - - P_SetScale(mo, finalscale); - mo->destscale = finalscale; } // this is the small graphic effect that plops in you when you throw an item: @@ -4923,29 +4352,18 @@ mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t mapthing, if (player->mo->eflags & MFE_VERTICALFLIP) { throwmo->z -= player->mo->height; + throwmo->flags2 |= MF2_OBJECTFLIP; throwmo->eflags |= MFE_VERTICALFLIP; - mo->flags2 |= (player->mo->flags2 & MF2_OBJECTFLIP); } throwmo->movecount = 0; // above player - - P_SetScale(throwmo, finalscale); - throwmo->destscale = finalscale; } else { mobj_t *lasttrail = K_FindLastTrailMobj(player); - if (mapthing == MT_BUBBLESHIELDTRAP) // Drop directly on top of you. + if (lasttrail) { - newangle = player->mo->angle; - newx = player->mo->x + player->mo->momx; - newy = player->mo->y + player->mo->momy; - newz = player->mo->z; - } - else if (lasttrail) - { - newangle = lasttrail->angle; newx = lasttrail->x; newy = lasttrail->y; newz = lasttrail->z; @@ -4968,9 +4386,6 @@ mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t mapthing, mo->threshold = 10; P_SetTarget(&mo->target, player->mo); - P_SetScale(mo, finalscale); - mo->destscale = finalscale; - if (P_IsObjectOnGround(player->mo)) { // floorz and ceilingz aren't properly set to account for FOFs and Polyobjects on spawn @@ -5250,29 +4665,35 @@ static void K_DoHyudoroSteal(player_t *player) void K_DoSneaker(player_t *player, INT32 type) { - const fixed_t intendedboost = FRACUNIT/2; + fixed_t intendedboost; + + switch (gamespeed) + { + case 0: + intendedboost = 53740+768; + break; + case 2: + intendedboost = 17294+768; + break; + //expert + case 3: + intendedboost = 14706; + break; + + default: + intendedboost = 32768; + break; + } if (player->floorboost == 0 || player->floorboost == 3) { - const sfxenum_t normalsfx = sfx_cdfm01; - const sfxenum_t smallsfx = sfx_cdfm40; - sfxenum_t sfx = normalsfx; - - if (player->numsneakers) - { - // Use a less annoying sound when stacking sneakers. - sfx = smallsfx; - } - - S_StopSoundByID(player->mo, normalsfx); - S_StopSoundByID(player->mo, smallsfx); - S_StartSound(player->mo, sfx); + S_StopSoundByID(player->mo, sfx_cdfm01); + S_StartSound(player->mo, sfx_cdfm01); K_SpawnDashDustRelease(player); if (intendedboost > player->speedboost) player->karthud[khud_destboostcam] = FixedMul(FRACUNIT, FixedDiv((intendedboost - player->speedboost), intendedboost)); - player->numsneakers++; } if (player->sneakertimer == 0) @@ -5645,8 +5066,6 @@ void K_DropHnextList(player_t *player, boolean keepshields) dropwork->angle = work->angle; - P_SetScale(dropwork, work->scale); - dropwork->destscale = K_ItemScaleForPlayer(player); //work->destscale; dropwork->scalespeed = work->scalespeed; dropwork->spritexscale = work->spritexscale; dropwork->spriteyscale = work->spriteyscale; @@ -5695,17 +5114,6 @@ void K_DropHnextList(player_t *player, boolean keepshields) if (orbit) // splay out { - if (dropwork->destscale > work->destscale) - { - fixed_t radius = FixedMul(work->info->radius, dropwork->destscale); - radius = FixedHypot(player->mo->radius, player->mo->radius) + FixedHypot(radius, radius); // mobj's distance from its Target, or Radius. - dropwork->flags |= MF_NOCLIPTHING; - work->momx = FixedMul(FINECOSINE(work->angle>>ANGLETOFINESHIFT), radius); - work->momy = FixedMul(FINESINE(work->angle>>ANGLETOFINESHIFT), radius); - P_MoveOrigin(dropwork, player->mo->x + work->momx, player->mo->y + work->momy, player->mo->z); - dropwork->flags &= ~MF_NOCLIPTHING; - } - dropwork->flags2 |= MF2_AMBUSH; dropwork->z += flip; @@ -6132,8 +5540,6 @@ void K_CalculateBananaSlope(mobj_t *mobj, fixed_t x, fixed_t y, fixed_t z, fixed // Move the hnext chain! static void K_MoveHeldObjects(player_t *player) { - fixed_t finalscale = INT32_MAX; - if (!player->mo) return; @@ -6167,8 +5573,6 @@ static void K_MoveHeldObjects(player_t *player) return; } - finalscale = K_ItemScaleForPlayer(player); - switch (player->mo->hnext->type) { case MT_ORBINAUT_SHIELD: // Kart orbit items @@ -6207,7 +5611,7 @@ static void K_MoveHeldObjects(player_t *player) cur->eflags &= ~MFE_VERTICALFLIP; // Shrink your items if the player shrunk too. - P_SetScale(cur, (cur->destscale = FixedMul(FixedDiv(cur->extravalue1, radius), finalscale))); + P_SetScale(cur, (cur->destscale = FixedMul(FixedDiv(cur->extravalue1, radius), player->mo->scale))); if (P_MobjFlip(cur) > 0) z = player->mo->z; @@ -6238,7 +5642,7 @@ static void K_MoveHeldObjects(player_t *player) } // Center it during the scale up animation - z += (FixedMul(mobjinfo[cur->type].height, finalscale - cur->scale)>>1) * P_MobjFlip(cur); + z += (FixedMul(mobjinfo[cur->type].height, player->mo->scale - cur->scale)>>1) * P_MobjFlip(cur); cur->z = z; cur->momx = cur->momy = 0; @@ -6311,7 +5715,7 @@ static void K_MoveHeldObjects(player_t *player) } // Shrink your items if the player shrunk too. - P_SetScale(cur, (cur->destscale = FixedMul(FixedDiv(cur->extravalue1, radius), finalscale))); + P_SetScale(cur, (cur->destscale = FixedMul(FixedDiv(cur->extravalue1, radius), player->mo->scale))); ang = targ->angle; targx = targ->x + P_ReturnThrustX(cur, ang + ANGLE_180, dist); @@ -6962,21 +6366,6 @@ static void K_UpdateTripwire(player_t *player) if (triplevel != TRIPWIRE_NONE) { - if (!boostExists) - { - mobj_t *front = P_SpawnMobjFromMobj(player->mo, 0, 0, 0, MT_TRIPWIREBOOST); - mobj_t *back = P_SpawnMobjFromMobj(player->mo, 0, 0, 0, MT_TRIPWIREBOOST); - - P_SetTarget(&front->target, player->mo); - P_SetTarget(&back->target, player->mo); - - front->dispoffset = 1; - front->old_angle = back->old_angle = K_MomentumAngle(player->mo); - back->dispoffset = -1; - back->extravalue1 = 1; - P_SetMobjState(back, S_TRIPWIREBOOST_BOTTOM); - } - player->tripwirePass = triplevel; player->tripwireLeniency = max(player->tripwireLeniency, TRIPWIRETIME); } @@ -7024,7 +6413,7 @@ static void K_RaceStart(player_t *player) { player->mo->scalespeed = mapobjectscale/12; player->mo->destscale = mapobjectscale + (FixedMul(mapobjectscale, player->boostcharge*131)); - if ((player->pflags & PF_SHRINKME) && !modeattacking && !player->bot) + if (K_PlayerShrinkCheat(player) && !modeattacking && !player->bot) player->mo->destscale = (6*player->mo->destscale)/8; } @@ -7089,7 +6478,6 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) const boolean onground = P_IsObjectOnGround(player->mo); K_UpdateOffroad(player); - K_UpdateDraft(player); K_UpdateEngineSounds(player); // Thanks, VAda! // update boost angle if not spun out @@ -7127,36 +6515,8 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) K_SpawnNormalSpeedLines(player); } - if (player->numboosts > 0) // Boosting after images - { - mobj_t *ghost; - ghost = P_SpawnGhostMobj(player->mo); - ghost->extravalue1 = player->numboosts+1; - ghost->extravalue2 = (leveltime % ghost->extravalue1); - ghost->fuse = ghost->extravalue1; - ghost->renderflags |= RF_FULLBRIGHT; - ghost->colorized = true; - //ghost->color = player->skincolor; - //ghost->momx = (3*player->mo->momx)/4; - //ghost->momy = (3*player->mo->momy)/4; - //ghost->momz = (3*player->mo->momz)/4; - if (leveltime & 1) - ghost->renderflags |= RF_DONTDRAW; - } - // Could probably be moved somewhere else. K_HandleFootstepParticles(player->mo); - - if (P_IsObjectOnGround(player->mo)) - { - // Draft dust - if (player->draftpower >= FRACUNIT) - { - K_SpawnDraftDust(player->mo); - /*if (leveltime % 23 == 0 || !S_SoundPlaying(player->mo, sfx_s265)) - S_StartSound(player->mo, sfx_s265);*/ - } - } } if (gametype == GT_RACE && player->rings <= 0) // spawn ring debt indicator @@ -7334,11 +6694,6 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (player->sneakertimer) { player->sneakertimer--; - - if (player->sneakertimer <= 0) - { - player->numsneakers = 0; - } } if (player->trickboost) @@ -7356,9 +6711,6 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (player->driftboost) player->driftboost--; - if (player->strongdriftboost) - player->strongdriftboost--; - if (player->startboost > 0 && onground == true) { player->startboost--; @@ -8294,168 +7646,71 @@ INT32 K_GetKartDriftSparkValue(player_t *player) return (26*4 + player->kartspeed*2 + (9 - player->kartweight))*8; } -INT32 K_GetKartDriftSparkValueForStage(player_t *player, UINT8 stage) -{ - fixed_t mul = FRACUNIT; - - // This code is function is pretty much useless now that the timing changes are linear but bleh. - switch (stage) - { - case 2: - mul = 2*FRACUNIT; // x2 - break; - case 3: - mul = 3*FRACUNIT; // x3 - break; - case 4: - mul = 4*FRACUNIT; // x4 - break; - } - - return (FixedMul(K_GetKartDriftSparkValue(player) * FRACUNIT, mul) / FRACUNIT); -} - -/* -Stage 1: yellow sparks -Stage 2: red sparks -Stage 3: blue sparks -Stage 4: big large rainbow sparks -Stage 0: air failsafe -*/ -void K_SpawnDriftBoostExplosion(player_t *player, int stage) -{ - mobj_t *overlay = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_DRIFTEXPLODE); - - P_InitAngle(overlay, K_MomentumAngle(player->mo)); - P_SetTarget(&overlay->target, player->mo); - P_SetScale(overlay, (overlay->destscale = player->mo->scale)); - K_FlipFromObject(overlay, player->mo); - - switch (stage) - { - case 1: - overlay->fuse = 16; - break; - - case 2: - - overlay->fuse = 32; - S_StartSound(player->mo, sfx_kc5b); - break; - - case 3: - overlay->fuse = 48; - - S_StartSound(player->mo, sfx_kc5b); - break; - - case 4: - overlay->fuse = 120; - - S_StartSound(player->mo, sfx_kc5b); - S_StartSound(player->mo, sfx_s3kc4l); - break; - - case 0: - overlay->fuse = 16; - break; - } - - overlay->extravalue1 = stage; -} - static void K_KartDrift(player_t *player, boolean onground) { - const fixed_t minspeed = (10 * player->mo->scale); + fixed_t minspeed = (10 * player->mo->scale); + INT32 dsone = K_GetKartDriftSparkValue(player); + INT32 dstwo = dsone*2; + INT32 dsthree = dstwo*2; - const INT32 dsone = K_GetKartDriftSparkValueForStage(player, 1); - const INT32 dstwo = K_GetKartDriftSparkValueForStage(player, 2); - const INT32 dsthree = K_GetKartDriftSparkValueForStage(player, 3); - const INT32 dsfour = K_GetKartDriftSparkValueForStage(player, 4); - - const UINT16 buttons = K_GetKartButtons(player); + // Grown players taking yellow spring panels will go below minspeed for one tic, + // and will then wrongdrift or have their sparks removed because of this. + // This fixes this problem. + //if (player->pogospring == 2 && player->mo->scale > mapobjectscale) + //minspeed = FixedMul(10<drift != -5 && player->drift != 5) + if ((player->drift != -5 && player->drift != 5) + && player->driftcharge < dsone + && onground) { - if (player->driftcharge < 0 || player->driftcharge >= dsone) - { - angle_t pushdir = K_MomentumAngle(player->mo); - - S_StartSound(player->mo, sfx_s23c); - //K_SpawnDashDustRelease(player); - - if (player->driftcharge < 0) - { - // Stage 0: Grey sparks - if (!onground) - P_Thrust(player->mo, pushdir, player->speed / 8); - - if (player->driftboost < 15) - player->driftboost = 15; - } - else if (player->driftcharge >= dsone && player->driftcharge < dstwo) - { - // Stage 1: Yellow sparks - if (!onground) - P_Thrust(player->mo, pushdir, player->speed / 4); - - if (player->driftboost < 20) - player->driftboost = 20; - - K_SpawnDriftBoostExplosion(player, 1); - } - else if (player->driftcharge < dsthree) - { - // Stage 2: Red sparks - if (!onground) - P_Thrust(player->mo, pushdir, player->speed / 3); - - if (player->driftboost < 50) - player->driftboost = 50; - - K_SpawnDriftBoostExplosion(player, 2); - } - else if (player->driftcharge < dsfour) - { - // Stage 3: Blue sparks - if (!onground) - P_Thrust(player->mo, pushdir, ( 5 * player->speed ) / 12); - - if (player->driftboost < 85) - player->driftboost = 85; - if (player->strongdriftboost < 85) - player->strongdriftboost = 85; - - K_SpawnDriftBoostExplosion(player, 3); - K_SpawnDriftElectricSparks(player); - } - else if (player->driftcharge >= dsfour) - { - // Stage 4: Rainbow sparks - if (!onground) - P_Thrust(player->mo, pushdir, player->speed / 2); - - if (player->driftboost < 125) - player->driftboost = 125; - if (player->strongdriftboost < 125) - player->strongdriftboost = 125; - - K_SpawnDriftBoostExplosion(player, 4); - K_SpawnDriftElectricSparks(player); - } - } - - // Remove charge + player->driftcharge = 0; + } + else if ((player->drift != -5 && player->drift != 5) + && (player->driftcharge >= dsone && player->driftcharge < dstwo) + && onground) + { + if (player->driftboost < 20) + player->driftboost = 20; + S_StartSound(player->mo, sfx_s23c); + player->driftcharge = 0; + } + else if ((player->drift != -5 && player->drift != 5) + && player->driftcharge < dsthree + && onground) + { + if (player->driftboost < 50) + player->driftboost = 50; + S_StartSound(player->mo, sfx_s23c); + player->driftcharge = 0; + } + else if ((player->drift != -5 && player->drift != 5) + && player->driftcharge >= dsthree + && onground) + { + if (player->driftboost < 125) + player->driftboost = 125; + S_StartSound(player->mo, sfx_s23c); player->driftcharge = 0; } // Drifting: left or right? - if (!(player->pflags & PF_DRIFTINPUT)) + if ((player->cmd.turning > 0) && player->speed > minspeed && (player->pflags & PF_DRIFTINPUT) && (player->drift == 0 || (player->pflags & PF_DRIFTEND))) + { + // Starting left drift + player->drift = 1; + player->pflags &= ~PF_DRIFTEND; + } + else if ((player->cmd.turning < 0) && player->speed > minspeed && (player->pflags & PF_DRIFTINPUT) && (player->drift == 0 || (player->pflags & PF_DRIFTEND))) + { + // Starting right drift + player->drift = -1; + player->pflags &= ~PF_DRIFTEND; + } + else if (!(player->pflags & PF_DRIFTINPUT)) { // drift is not being performed so if we're just finishing set driftend and decrement counters if (player->drift > 0) @@ -8471,124 +7726,71 @@ static void K_KartDrift(player_t *player, boolean onground) else player->pflags &= ~PF_DRIFTEND; } - else if (player->speed > minspeed - && (player->drift == 0 || (player->pflags & PF_DRIFTEND))) - { - // Uses turning over steering, since this is very binary. - // Using steering would cause a lot more "wrong drifts". - if (player->cmd.turning > 0) - { - // Starting left drift - player->drift = 1; - player->driftcharge = 0; - player->pflags &= ~PF_DRIFTEND; - } - else if (player->cmd.turning < 0) - { - // Starting right drift - player->drift = -1; - player->driftcharge = 0; - player->pflags &= ~PF_DRIFTEND; - } - } - if (P_PlayerInPain(player) || player->speed <= 0) + + // Incease/decrease the drift value to continue drifting in that direction + if (!P_PlayerInPain(player) && (player->pflags & PF_DRIFTINPUT) && onground && player->drift != 0) { - // Stop drifting - player->drift = player->driftcharge = player->aizdriftstrat = 0; - player->pflags &= ~(PF_BRAKEDRIFT|PF_GETSPARKS); - } - else if ((player->pflags & PF_DRIFTINPUT) && player->drift != 0) - { - // Incease/decrease the drift value to continue drifting in that direction fixed_t driftadditive = 24; - boolean playsound = false; - if (onground) + if (player->drift >= 1) // Drifting to the left { - if (player->drift >= 1) // Drifting to the left - { - player->drift++; - if (player->drift > 5) - player->drift = 5; + player->drift++; + if (player->drift > 5) + player->drift = 5; - if (player->steering > 0) // Inward - driftadditive += abs(player->steering)/100; - if (player->steering < 0) // Outward - driftadditive -= abs(player->steering)/75; - } - else if (player->drift <= -1) // Drifting to the right - { - player->drift--; - if (player->drift < -5) - player->drift = -5; - - if (player->steering < 0) // Inward - driftadditive += abs(player->steering)/100; - if (player->steering > 0) // Outward - driftadditive -= abs(player->steering)/75; - } - - // Disable drift-sparks until you're going fast enough - if (!(player->pflags & PF_GETSPARKS) - || (player->offroad && K_ApplyOffroad(player))) - driftadditive = 0; - - // Inbetween minspeed and minspeed*2, it'll keep your previous drift-spark state. - if (player->speed > minspeed*2) - { - player->pflags |= PF_GETSPARKS; - - if (player->driftcharge <= -1) - { - player->driftcharge = dsone; // Back to red - playsound = true; - } - } - else if (player->speed <= minspeed) - { - player->pflags &= ~PF_GETSPARKS; - driftadditive = 0; - - if (player->driftcharge >= dsone) - { - player->driftcharge = -1; // Set yellow sparks - playsound = true; - } - } + if (player->cmd.turning > 0) // Inward + driftadditive += abs(player->cmd.turning)/100; + if (player->cmd.turning < 0) // Outward + driftadditive -= abs(player->cmd.turning)/75; } - else + else if (player->drift <= -1) // Drifting to the right { + player->drift--; + if (player->drift < -5) + player->drift = -5; + + if (player->cmd.turning < 0) // Inward + driftadditive += abs(player->cmd.turning)/100; + if (player->cmd.turning > 0) // Outward + driftadditive -= abs(player->cmd.turning)/75; + } + + // Disable drift-sparks until you're going fast enough + if (!(player->pflags & PF_GETSPARKS) + || (player->offroad && K_ApplyOffroad(player))) driftadditive = 0; - } - - // This spawns the drift sparks - if ((player->driftcharge + driftadditive >= dsone) - || (player->driftcharge < 0)) - { - K_SpawnDriftSparks(player); - } + + if (player->speed > minspeed*2) + player->pflags |= PF_GETSPARKS; + // Sound whenever you get a different tier of sparks if ((player->driftcharge < dsone && player->driftcharge+driftadditive >= dsone) || (player->driftcharge < dstwo && player->driftcharge+driftadditive >= dstwo) || (player->driftcharge < dsthree && player->driftcharge+driftadditive >= dsthree)) { - playsound = true; + if (P_IsDisplayPlayer(player)) // UGHGHGH... + S_StartSoundAtVolume(player->mo, sfx_s3ka2, 192); // Ugh... } - // Sound whenever you get a different tier of sparks - if (playsound && P_IsDisplayPlayer(player)) - { - if (player->driftcharge == -1) - S_StartSoundAtVolume(player->mo, sfx_sploss, 192); // Yellow spark sound - else - S_StartSoundAtVolume(player->mo, sfx_s3ka2, 192); - } + + // moved this below sounds to help with scaling + // This spawns the drift sparks + if (player->driftcharge + driftadditive >= dsone) + K_SpawnDriftSparks(player); player->driftcharge += driftadditive; player->pflags &= ~PF_DRIFTEND; } + // Stop drifting + if (P_PlayerInPain(player) || player->speed < minspeed) + { + // Stop drifting + player->drift = player->driftcharge = player->aizdriftstrat = 0; + player->pflags &= ~(PF_BRAKEDRIFT|PF_GETSPARKS); + } + if ((player->handleboost == 0) || (!player->steering) || (!player->aizdriftstrat) @@ -8630,8 +7832,8 @@ static void K_KartDrift(player_t *player, boolean onground) } if (player->drift - && ((buttons & BT_BRAKE) - || !(buttons & BT_ACCELERATE)) + && ((player->cmd.buttons & BT_BRAKE) + || !(player->cmd.buttons & BT_ACCELERATE)) && P_IsObjectOnGround(player->mo)) { if (!(player->pflags & PF_BRAKEDRIFT)) @@ -9299,7 +8501,7 @@ static void K_AirFailsafe(player_t *player) P_Thrust(player->mo, K_MomentumAngle(player->mo), thrustSpeed); S_StartSound(player->mo, sfx_s23c); - K_SpawnDriftBoostExplosion(player, 0); + K_SpawnNormalSpeedLines(player); player->pflags &= ~PF_AIRFAILSAFE; } diff --git a/src/k_kart.h b/src/k_kart.h index 048dbd1d2..0e8a883e7 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -48,7 +48,6 @@ void K_MatchGenericExtraFlags(mobj_t *mo, mobj_t *master); void K_GenericExtraFlagsNoZAdjust(mobj_t *mo, mobj_t *master); void K_SpawnDashDustRelease(player_t *player); void K_SpawnDriftBoostClip(player_t *player); -void K_SpawnDriftBoostClipSpark(mobj_t *clip); void K_SpawnNormalSpeedLines(player_t *player); void K_SpawnInvincibilitySpeedLines(mobj_t *mo); void K_SpawnBumpEffect(mobj_t *mo); @@ -73,8 +72,7 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color); UINT16 K_DriftSparkColor(player_t *player, INT32 charge); void K_SpawnBoostTrail(player_t *player); void K_SpawnSparkleTrail(mobj_t *mo); -void K_SpawnWipeoutTrail(mobj_t *mo); -void K_SpawnDraftDust(mobj_t *mo); +void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent); void K_DriftDustHandling(mobj_t *spawner); void K_Squish(mobj_t *mo); mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t mapthing, INT32 defaultDir, INT32 altthrow); @@ -145,7 +143,6 @@ void K_PlayHitEmSound(mobj_t *source, mobj_t *other); void K_TryHurtSoundExchange(mobj_t *victim, mobj_t *attacker); void K_PlayPowerGloatSound(mobj_t *source); -fixed_t K_ItemScaleForPlayer(player_t *player); void K_SetItemOut(player_t *player); void K_UnsetItemOut(player_t *player); diff --git a/src/k_respawn.c b/src/k_respawn.c index 2f95da7e0..9eb53ad53 100644 --- a/src/k_respawn.c +++ b/src/k_respawn.c @@ -124,7 +124,7 @@ void K_DoIngameRespawn(player_t *player) } player->ringboost = 0; - player->driftboost = player->strongdriftboost = 0; + player->driftboost = 0; P_ResetPlayer(player); diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 601088bb1..419e61847 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -3552,7 +3552,7 @@ static int lib_kSpawnWipeoutTrail(lua_State *L) NOHUD if (!mo) return LUA_ErrInvalid(L, "mobj_t"); - K_SpawnWipeoutTrail(mo); + K_SpawnWipeoutTrail(mo, false); return 0; } diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index 473b54dc3..36be51921 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -244,8 +244,6 @@ static int player_get(lua_State *L) lua_pushinteger(L, plr->driftcharge); else if (fastcmp(field,"driftboost")) lua_pushinteger(L, plr->driftboost); - else if (fastcmp(field,"strongdriftboost")) - lua_pushinteger(L, plr->strongdriftboost); else if (fastcmp(field,"aizdriftstraft")) lua_pushinteger(L, plr->aizdriftstrat); else if (fastcmp(field,"aizdrifttilt")) @@ -270,8 +268,6 @@ static int player_get(lua_State *L) lua_pushinteger(L, plr->spindashboost); else if (fastcmp(field,"fastfall")) lua_pushfixed(L, plr->fastfall); - else if (fastcmp(field,"numboosts")) - lua_pushinteger(L, plr->numboosts); else if (fastcmp(field,"boostpower")) lua_pushinteger(L, plr->boostpower); else if (fastcmp(field,"speedboost")) @@ -282,12 +278,6 @@ static int player_get(lua_State *L) lua_pushinteger(L, plr->handleboost); else if (fastcmp(field,"boostangle")) lua_pushangle(L, plr->boostangle); - else if (fastcmp(field,"draftpower")) - lua_pushinteger(L, plr->draftpower); - else if (fastcmp(field,"draftleeway")) - lua_pushinteger(L, plr->draftleeway); - else if (fastcmp(field,"lastdraft")) - lua_pushinteger(L, plr->lastdraft); else if (fastcmp(field,"tripwireState")) lua_pushinteger(L, plr->tripwireState); else if (fastcmp(field,"tripwirePass")) @@ -336,8 +326,6 @@ static int player_get(lua_State *L) lua_pushinteger(L, plr->stealingtimer); else if (fastcmp(field,"sneakertimer")) lua_pushinteger(L, plr->sneakertimer); - else if (fastcmp(field,"numsneakers")) - lua_pushinteger(L, plr->numsneakers); else if (fastcmp(field,"floorboost")) lua_pushinteger(L, plr->floorboost); else if (fastcmp(field,"growshrinktimer")) @@ -624,8 +612,6 @@ static int player_set(lua_State *L) plr->spindashboost = luaL_checkinteger(L, 3); else if (fastcmp(field,"fastfall")) plr->fastfall = luaL_checkfixed(L, 3); - else if (fastcmp(field,"numboosts")) - plr->numboosts = luaL_checkinteger(L, 3); else if (fastcmp(field,"boostpower")) plr->boostpower = luaL_checkinteger(L, 3); else if (fastcmp(field,"speedboost")) @@ -636,12 +622,6 @@ static int player_set(lua_State *L) plr->handleboost = luaL_checkinteger(L, 3); else if (fastcmp(field,"boostangle")) plr->boostangle = luaL_checkangle(L, 3); - else if (fastcmp(field,"draftpower")) - plr->draftpower = luaL_checkinteger(L, 3); - else if (fastcmp(field,"draftleeway")) - plr->draftleeway = luaL_checkinteger(L, 3); - else if (fastcmp(field,"lastdraft")) - plr->lastdraft = luaL_checkinteger(L, 3); else if (fastcmp(field,"tripwireState")) plr->tripwireState = luaL_checkinteger(L, 3); else if (fastcmp(field,"tripwirePass")) @@ -690,8 +670,6 @@ static int player_set(lua_State *L) plr->stealingtimer = luaL_checkinteger(L, 3); else if (fastcmp(field,"sneakertimer")) plr->sneakertimer = luaL_checkinteger(L, 3); - else if (fastcmp(field,"numsneakers")) - plr->numsneakers = luaL_checkinteger(L, 3); else if (fastcmp(field,"floorboost")) plr->floorboost = luaL_checkinteger(L, 3); else if (fastcmp(field,"growshrinktimer")) diff --git a/src/m_menu.c b/src/m_menu.c index f0702d5ab..9530568fe 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -3119,6 +3119,40 @@ void M_Drawer(void) M_GetGametypeColor(); currentMenu->drawroutine(); // call current menu Draw routine } + + if (currentMenu == &MainDef) + { + INT32 texty = vid.height - 10*vid.dupy; +#define addtext(f, str) {\ + V_DrawThinString(vid.dupx, texty, V_NOSCALESTART|f, str);\ + texty -= 10*vid.dupy;\ +} + if (customversionstring[0] != '\0') + { + addtext(V_ALLOWLOWERCASE, customversionstring); + addtext(0, "Mod version:"); + } + else + { +// Development -- show revision / branch info +#if defined(TESTERS) + addtext(V_ALLOWLOWERCASE|V_SKYMAP, "Tester client"); + addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, va("%s", compdate)); +#elif defined(HOSTTESTERS) + addtext(V_ALLOWLOWERCASE|V_REDMAP, "Netgame host for testers"); + addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, va("%s", compdate)); +#elif defined(DEVELOP) + addtext(V_ALLOWLOWERCASE|V_GREENMAP|V_TRANSLUCENT, comprevision); + addtext(V_ALLOWLOWERCASE|V_YELLOWMAP|V_TRANSLUCENT, compbranch); + V_DrawThinString(0, 0, V_ALLOWLOWERCASE|V_ORANGEMAP|V_TRANSLUCENT|V_SNAPTOTOP, va("%s", complast)); +#else // Regular build + addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, va("%s", VERSIONSTRING)); +#endif + if (compuncommitted) + addtext(V_REDMAP|V_STRINGDANCE|V_TRANSLUCENT, "! UNCOMMITTED CHANGES !"); + } +#undef addtext + } } // focus lost notification goes on top of everything, even the former everything diff --git a/src/m_menu.h b/src/m_menu.h index be199b142..52fe05896 100644 --- a/src/m_menu.h +++ b/src/m_menu.h @@ -151,7 +151,7 @@ typedef struct boolean bghide; // for titlemaps, hide the background. SINT8 hidetitlepics; // hide title gfx per menu; -1 means undefined, inherits global setting - ttmode_enum ttmode; // title wing animation mode; default TTMODE_OLD + ttmode_enum ttmode; // title wing animation mode; default TTMODE_KART UINT8 ttscale; // scale of title wing gfx (FRACUNIT / ttscale); -1 means undefined, inherits global setting char ttname[9]; // lump name of title wing gfx. If name length is <= 6, engine will attempt to load numbered frames (TTNAMExx) INT16 ttx; // X position of title wing diff --git a/src/p_enemy.c b/src/p_enemy.c index ff9f93be4..4742e8181 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -13436,97 +13436,6 @@ static void SpawnSPBTrailRings(mobj_t *actor) } } -// Spawns the V shaped dust. To be used when the SPB is going mostly forward. -static void SpawnSPBDust(mobj_t *mo) -{ - // The easiest way to spawn a V shaped cone of dust from the SPB is simply to spawn 2 particles, and to both move them to the sides in opposite direction. - mobj_t *dust; - fixed_t sx; - fixed_t sy; - fixed_t sz = mo->floorz; - angle_t sa = mo->angle - ANG1*60; - INT32 i; - - if (mo->eflags & MFE_VERTICALFLIP) - sz = mo->ceilingz; - - if (leveltime & 1 && abs(mo->z - sz) < FRACUNIT*64) // Only ever other frame. Also don't spawn it if we're way above the ground. - { - // Determine spawning position next to the SPB: - for (i=0; i < 2; i++) - { - sx = mo->x + FixedMul((mo->scale*96), FINECOSINE((sa)>>ANGLETOFINESHIFT)); - sy = mo->y + FixedMul((mo->scale*96), FINESINE((sa)>>ANGLETOFINESHIFT)); - - dust = P_SpawnMobj(sx, sy, sz, MT_SPBDUST); - dust->momx = mo->momx/2; - dust->momy = mo->momy/2; - dust->momz = mo->momz/2; // Give some of the momentum to the dust - P_SetScale(dust, mo->scale*2); - dust->colorized = true; - dust->color = SKINCOLOR_RED; - P_InitAngle(dust, mo->angle - FixedAngle(FRACUNIT*90 - FRACUNIT*180*i)); // The first one will spawn to the right of the spb, the second one to the left. - P_Thrust(dust, dust->angle, 6*dust->scale); - - K_MatchGenericExtraFlags(dust, mo); - - sa += ANG1*120; // Add 120 degrees to get to mo->angle + ANG1*60 - } - } -} - -// Spawns SPB slip tide. To be used when the SPB is turning. -// Modified version of K_SpawnAIZDust. Maybe we could merge those to be cleaner? - -// dir should be either 1 or -1 to determine where to spawn the dust. - -static void SpawnSPBAIZDust(mobj_t *mo, INT32 dir) -{ - fixed_t newx; - fixed_t newy; - mobj_t *spark; - angle_t travelangle; - fixed_t sz = mo->floorz; - - if (mo->eflags & MFE_VERTICALFLIP) - sz = mo->ceilingz; - - travelangle = K_MomentumAngle(mo); - if (leveltime & 1 && abs(mo->z - sz) < FRACUNIT*64) - { - newx = mo->x + P_ReturnThrustX(mo, travelangle - (dir*ANGLE_45), FixedMul(24*FRACUNIT, mo->scale)); - newy = mo->y + P_ReturnThrustY(mo, travelangle - (dir*ANGLE_45), FixedMul(24*FRACUNIT, mo->scale)); - spark = P_SpawnMobj(newx, newy, sz, MT_AIZDRIFTSTRAT); - spark->colorized = true; - spark->color = SKINCOLOR_RED; - spark->flags = MF_NOGRAVITY|MF_PAIN; - P_SetTarget(&spark->target, mo); - - P_InitAngle(spark, travelangle+(dir*ANGLE_90)); - P_SetScale(spark, (spark->destscale = mo->scale*3/2)); - - spark->momx = (6*mo->momx)/5; - spark->momy = (6*mo->momy)/5; - - K_MatchGenericExtraFlags(spark, mo); - } -} - -// Used for seeking and when SPB is trailing its target from way too close! -static void SpawnSPBSpeedLines(mobj_t *actor) -{ - mobj_t *fast = P_SpawnMobj(actor->x + (P_RandomRange(-24,24) * actor->scale), - actor->y + (P_RandomRange(-24,24) * actor->scale), - actor->z + (actor->height/2) + (P_RandomRange(-24,24) * actor->scale), - MT_FASTLINE); - - P_SetTarget(&fast->target, actor); - P_InitAngle(fast, K_MomentumAngle(actor)); - fast->color = SKINCOLOR_RED; - fast->colorized = true; - K_MatchGenericExtraFlags(fast, actor); -} - void A_SPBChase(mobj_t *actor) { diff --git a/src/p_inter.c b/src/p_inter.c index 526bf12fd..9ab32d948 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2035,8 +2035,8 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da } } - player->sneakertimer = player->numsneakers = 0; - player->driftboost = player->strongdriftboost = 0; + player->sneakertimer = 0; + player->driftboost = 0; player->ringboost = 0; player->glanceDir = 0; player->pflags &= ~PF_LOOKDOWN; diff --git a/src/p_mobj.c b/src/p_mobj.c index 1f67270d5..b88b958ee 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2334,17 +2334,6 @@ boolean P_ZMovement(mobj_t *mo) mom.z = P_MobjFlip(mo)*FixedMul(5*FRACUNIT, mo->scale); else if (mo->type == MT_SPINFIRE) // elemental shield fire is another exception here ; - else if (mo->type == MT_DRIFTCLIP) - { - mom.z = -mom.z/2; - if (abs(mom.z) > 4 * mo->scale / 3) - { - K_SpawnDriftBoostClipSpark(mo); - S_StartSound(mo, sfx_tink); - } - else - mo->renderflags ^= RF_DONTDRAW; - } else if (mo->type == MT_DEBTSPIKE) { mom.x = mom.y = 0; @@ -6248,9 +6237,6 @@ static void P_MobjSceneryThink(mobj_t *mobj) mobj->renderflags ^= RF_DONTDRAW; break; case MT_SPINDASHWIND: - case MT_DRIFTELECTRICSPARK: - mobj->renderflags ^= RF_DONTDRAW; - break; case MT_VWREF: case MT_VWREB: { @@ -7127,188 +7113,6 @@ static boolean P_MobjRegularThink(mobj_t *mobj) mobj->threshold--; } break; - case MT_DRIFTEXPLODE: - if (!mobj->target || !mobj->target->health) - { - P_RemoveMobj(mobj); - return false; - } - - //mobj->angle = mobj->target->angle; - { - angle_t angle = K_MomentumAngle(mobj->target); - fixed_t nudge; - - mobj->angle = angle; - - if (( mobj->fuse & 1 )) - { - nudge = 4*mobj->target->radius; - /* unrotate interp angle */ - mobj->old_angle -= ANGLE_90; - } - else - { - nudge = 2*mobj->target->radius; - /* rotate the papersprite frames to see the flat angle */ - mobj->angle += ANGLE_90; - mobj->old_angle += ANGLE_90; - } - - P_MoveOrigin(mobj, - mobj->target->x + P_ReturnThrustX(mobj, angle + ANGLE_180, nudge), - mobj->target->y + P_ReturnThrustY(mobj, angle + ANGLE_180, nudge), - mobj->target->z); - } - P_SetScale(mobj, mobj->target->scale); - - mobj->roll = mobj->target->roll; - mobj->pitch = mobj->target->pitch; - - if (mobj->fuse <= 16) - { - mobj->color = SKINCOLOR_GOLD; - /* don't draw papersprite frames after blue boost */ - mobj->renderflags ^= RF_DONTDRAW; - } - else if (mobj->fuse <= 32) - mobj->color = SKINCOLOR_KETCHUP; - else if (mobj->fuse <= 48) - mobj->color = SKINCOLOR_SAPPHIRE; - else if (mobj->fuse > 48) - mobj->color = K_RainbowColor( - (SKINCOLOR_SAPPHIRE - SKINCOLOR_PINK) // Smoothly transition into the other state - + ((mobj->fuse - 32) * 2) // Make the color flashing slow down while it runs out - ); - - switch (mobj->extravalue1) - { - case 4:/* rainbow boost */ - /* every 20 tics, bang! */ - if (( 120 - mobj->fuse ) % 10 == 0) - { - K_SpawnDriftBoostClip(mobj->target->player); - S_StartSound(mobj->target, sfx_s3k77); - } - break; - - case 3:/* blue boost */ - if ((mobj->fuse == 32)/* to red*/ - || (mobj->fuse == 16))/* to yellow*/ - K_SpawnDriftBoostClip(mobj->target->player); - break; - - case 2:/* red boost */ - if (mobj->fuse == 16)/* to yellow*/ - K_SpawnDriftBoostClip(mobj->target->player); - break; - - case 0:/* air failsafe boost */ - mobj->color = SKINCOLOR_SILVER; // force white - break; - } - - { - player_t *p = NULL; - if (mobj->target->target && mobj->target->target->player) - p = mobj->target->target->player; - else if (mobj->target->player) - p = mobj->target->player; - - if (p) - { - if (p->driftboost > mobj->movecount) - { - ; // reset animation - } - - mobj->movecount = p->driftboost; - } - } - break; - case MT_TRIPWIREBOOST: - if (!mobj->target || !mobj->target->health - || !mobj->target->player || !mobj->target->player->tripwireLeniency) - { - P_RemoveMobj(mobj); - return false; - } - - mobj->angle = K_MomentumAngle(mobj->target); - P_MoveOrigin(mobj, mobj->target->x, mobj->target->y, mobj->target->z + (mobj->target->height >> 1)); - mobj->destscale = mobj->target->scale; - P_SetScale(mobj, mobj->target->scale); - - if (mobj->extravalue1) - { - mobj->angle += ANGLE_180; - } - - { - fixed_t convSpeed = (mobj->target->player->speed * 100) / K_GetKartSpeed(mobj->target->player, false, true); - UINT8 trans = ((mobj->target->player->tripwireLeniency + 1) * (NUMTRANSMAPS+1)) / TRIPWIRETIME; - - if (trans > NUMTRANSMAPS) - trans = NUMTRANSMAPS; - - trans = NUMTRANSMAPS - trans; - - if ((trans >= NUMTRANSMAPS) // not a valid visibility - || (convSpeed < 150 && (leveltime & 1)) // < 150% flickering - || (mobj->target->player->tripwirePass < TRIPWIRE_BOOST) // Not strong enough to make an aura - || mobj->target->player->flamedash) // Flameshield dash - { - mobj->renderflags |= RF_DONTDRAW; - } - else - { - boolean blastermode = (convSpeed >= 200) && (mobj->target->player->tripwirePass >= TRIPWIRE_BLASTER); - - mobj->renderflags &= ~(RF_TRANSMASK|RF_DONTDRAW); - if (trans != 0) - { - mobj->renderflags |= (trans << RF_TRANSSHIFT); - } - mobj->renderflags |= (mobj->target->renderflags & RF_DONTDRAW); - - if (mobj->target->player->invincibilitytimer > 0) - { - if (mobj->target->player->invincibilitytimer > itemtime+(2*TICRATE)) - { - mobj->color = K_RainbowColor(leveltime / 2); - } - else - { - mobj->color = SKINCOLOR_INVINCFLASH; - } - mobj->colorized = true; - } - else if (mobj->target->player->curshield == KSHIELD_FLAME) - { - mobj->color = SKINCOLOR_KETCHUP; - mobj->colorized = true; - } - else - { - mobj->color = SKINCOLOR_NONE; - mobj->colorized = false; - } - - if (blastermode == !(mobj->flags2 & MF2_AMBUSH)) - { - mobj->flags2 ^= MF2_AMBUSH; - if (blastermode) - { - P_SetMobjState(mobj, (mobj->extravalue1) ? S_TRIPWIREBOOST_BLAST_BOTTOM : S_TRIPWIREBOOST_BLAST_TOP); - } - else - { - P_SetMobjState(mobj, (mobj->extravalue1) ? S_TRIPWIREBOOST_BOTTOM : S_TRIPWIREBOOST_TOP); - } - } - } - } - break; case MT_BOOSTFLAME: if (!mobj->target || !mobj->target->health) { @@ -9832,9 +9636,6 @@ static void P_DefaultMobjShadowScale(mobj_t *thing) case MT_POGOSPRING: thing->shadowscale = FRACUNIT/2; break; - case MT_DRIFTCLIP: - thing->shadowscale = FRACUNIT/3; - break; default: if (thing->flags & (MF_ENEMY|MF_BOSS)) thing->shadowscale = FRACUNIT; diff --git a/src/p_saveg.c b/src/p_saveg.c index d2b89eea9..81087b940 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -267,7 +267,6 @@ static void P_NetArchivePlayers(void) WRITESINT8(save_p, players[i].drift); WRITEFIXED(save_p, players[i].driftcharge); WRITEUINT8(save_p, players[i].driftboost); - WRITEUINT8(save_p, players[i].strongdriftboost); WRITESINT8(save_p, players[i].aizdriftstrat); WRITEINT32(save_p, players[i].aizdrifttilt); @@ -288,17 +287,12 @@ static void P_NetArchivePlayers(void) WRITEFIXED(save_p, players[i].fastfall); - WRITEUINT8(save_p, players[i].numboosts); WRITEFIXED(save_p, players[i].boostpower); WRITEFIXED(save_p, players[i].speedboost); WRITEFIXED(save_p, players[i].accelboost); WRITEFIXED(save_p, players[i].handleboost); WRITEANGLE(save_p, players[i].boostangle); - WRITEFIXED(save_p, players[i].draftpower); - WRITEUINT16(save_p, players[i].draftleeway); - WRITESINT8(save_p, players[i].lastdraft); - WRITEUINT8(save_p, players[i].tripwireState); WRITEUINT8(save_p, players[i].tripwirePass); WRITEUINT16(save_p, players[i].tripwireLeniency); @@ -330,7 +324,6 @@ static void P_NetArchivePlayers(void) WRITESINT8(save_p, players[i].stealingtimer); WRITEUINT16(save_p, players[i].sneakertimer); - WRITEUINT8(save_p, players[i].numsneakers); WRITEUINT8(save_p, players[i].floorboost); WRITEUINT8(save_p, players[i].boostcharge); @@ -563,7 +556,6 @@ static void P_NetUnArchivePlayers(void) players[i].drift = READSINT8(save_p); players[i].driftcharge = READFIXED(save_p); players[i].driftboost = READUINT8(save_p); - players[i].strongdriftboost = READUINT8(save_p); players[i].aizdriftstrat = READSINT8(save_p); players[i].aizdrifttilt = READINT32(save_p); @@ -584,17 +576,12 @@ static void P_NetUnArchivePlayers(void) players[i].fastfall = READFIXED(save_p); - players[i].numboosts = READUINT8(save_p); players[i].boostpower = READFIXED(save_p); players[i].speedboost = READFIXED(save_p); players[i].accelboost = READFIXED(save_p); players[i].handleboost = READFIXED(save_p); players[i].boostangle = READANGLE(save_p); - players[i].draftpower = READFIXED(save_p); - players[i].draftleeway = READUINT16(save_p); - players[i].lastdraft = READSINT8(save_p); - players[i].tripwireState = READUINT8(save_p); players[i].tripwirePass = READUINT8(save_p); players[i].tripwireLeniency = READUINT16(save_p); @@ -626,7 +613,6 @@ static void P_NetUnArchivePlayers(void) players[i].stealingtimer = READSINT8(save_p); players[i].sneakertimer = READUINT16(save_p); - players[i].numsneakers = READUINT8(save_p); players[i].floorboost = READUINT8(save_p); players[i].boostcharge = READUINT8(save_p); diff --git a/src/p_spec.c b/src/p_spec.c index 785cd8462..2df5f1f7c 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -8255,7 +8255,10 @@ void T_Friction(friction_t *f) // apparently, all I had to do was comment out part of the next line and // friction works for all mobj's // (or at least MF_PUSHABLEs, which is all I care about anyway) - if (!(thing->flags & (MF_NOGRAVITY | MF_NOCLIP)) && thing->z == thing->floorz) + // Readded v1 kart condition - Nep + if (!(thing->flags & (MF_NOGRAVITY | MF_NOCLIP)) && thing->z == thing->floorz && (thing->player + && (thing->player->invincibilitytimer == 0 && thing->player->hyudorotimer == 0 + && thing->player->sneakertimer == 0 && thing->player->growshrinktimer <= 0))) { if (f->roverfriction) { diff --git a/src/p_user.c b/src/p_user.c index 763ea0835..27ea699f5 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1919,39 +1919,37 @@ static void P_3dMovement(player_t *player) // 2) If "yes" to 1, were we moving over topspeed to begin with? // 3) If "yes" to 2, are we now going faster? + // Time to ask three questions: + // 1) Are we over topspeed? + // 2) If "yes" to 1, were we moving over topspeed to begin with? + // 3) If "yes" to 2, are we now going faster? + // If "yes" to 3, normalize to our initial momentum; this will allow thoks to stay as fast as they normally are. // If "no" to 3, ignore it; the player might be going too fast, but they're slowing down, so let them. // If "no" to 2, normalize to topspeed, so we can't suddenly run faster than it of our own accord. // If "no" to 1, we're not reaching any limits yet, so ignore this entirely! // -Shadow Hog - // Only do this forced cap of speed when in midair, the kart acceleration code takes into account friction, and - // doesn't let you accelerate past top speed, so this is unnecessary on the ground, but in the air is needed to - // allow for being able to change direction on spring jumps without being accelerated into the void - Sryder - if (!P_IsObjectOnGround(player->mo)) + newMagnitude = R_PointToDist2(player->mo->momx - player->cmomx, player->mo->momy - player->cmomy, 0, 0); + if (newMagnitude > K_GetKartSpeed(player, true, true)) //topspeed) { - fixed_t topspeed = K_GetKartSpeed(player, true, true); - newMagnitude = R_PointToDist2(player->mo->momx - player->cmomx, player->mo->momy - player->cmomy, 0, 0); - if (newMagnitude > topspeed) + fixed_t tempmomx, tempmomy; + if (oldMagnitude > K_GetKartSpeed(player, true, true) && onground) // SRB2Kart: onground check for air speed cap { - fixed_t tempmomx, tempmomy; - if (oldMagnitude > topspeed) + if (newMagnitude > oldMagnitude) { - if (newMagnitude > oldMagnitude) - { - tempmomx = FixedMul(FixedDiv(player->mo->momx - player->cmomx, newMagnitude), oldMagnitude); - tempmomy = FixedMul(FixedDiv(player->mo->momy - player->cmomy, newMagnitude), oldMagnitude); - player->mo->momx = tempmomx + player->cmomx; - player->mo->momy = tempmomy + player->cmomy; - } - // else do nothing - } - else - { - tempmomx = FixedMul(FixedDiv(player->mo->momx - player->cmomx, newMagnitude), topspeed); - tempmomy = FixedMul(FixedDiv(player->mo->momy - player->cmomy, newMagnitude), topspeed); + tempmomx = FixedMul(FixedDiv(player->mo->momx - player->cmomx, newMagnitude), oldMagnitude); + tempmomy = FixedMul(FixedDiv(player->mo->momy - player->cmomy, newMagnitude), oldMagnitude); player->mo->momx = tempmomx + player->cmomx; player->mo->momy = tempmomy + player->cmomy; } + // else do nothing + } + else + { + tempmomx = FixedMul(FixedDiv(player->mo->momx - player->cmomx, newMagnitude), K_GetKartSpeed(player, true, true)); //topspeed) + tempmomy = FixedMul(FixedDiv(player->mo->momy - player->cmomy, newMagnitude), K_GetKartSpeed(player, true, true)); //topspeed) + player->mo->momx = tempmomx + player->cmomx; + player->mo->momy = tempmomy + player->cmomy; } } } @@ -2318,7 +2316,7 @@ void P_MovePlayer(player_t *player) K_SpawnSparkleTrail(player->mo); if (player->wipeoutslow > 1 && (leveltime & 1)) - K_SpawnWipeoutTrail(player->mo); + K_SpawnWipeoutTrail(player->mo, false); K_DriftDustHandling(player->mo); @@ -4297,6 +4295,33 @@ void P_PlayerThink(player_t *player) P_DoBubbleBreath(player); // Spawn Sonic's bubbles P_CheckInvincibilityTimer(player); // Spawn Invincibility Sparkles + + // "Blur" a bit when you have speed shoes and are going fast enough + if ((player->driftboost || player->sneakertimer || player->startboost || player->ringboost) && !player->invincibilitytimer // SRB2kart + && (player->speed + abs(player->mo->momz)) > FixedMul(20*FRACUNIT,player->mo->scale)) + { + UINT8 i; + mobj_t *gmobj = P_SpawnGhostMobj(player->mo); + + gmobj->fuse = 2; + if (leveltime & 1) + { + gmobj->frame &= ~FF_TRANSMASK; + gmobj->frame |= tr_trans70<renderflags |= RF_DONTDRAW; + break; + } + } + } // check for buttons if (cmd->buttons & BT_ACCELERATE) diff --git a/src/r_textures.h b/src/r_textures.h index d4c9302e5..1de51f666 100644 --- a/src/r_textures.h +++ b/src/r_textures.h @@ -23,8 +23,8 @@ #pragma interface #endif -#define MISSING_TEXTURE "AASMELLY" // Replacement for invalid textures - +#define MISSING_TEXTURE "MISSTEX" // Replacement for invalid textures + // A single patch from a texture definition, // basically a rectangular area within // the texture rectangle.