From 82f2f2f2f9965cc79eec8fdd3d885a5b0bed44d2 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 4 Jan 2018 14:29:29 -0500 Subject: [PATCH 01/41] SDL: disable check for noreturn --- src/sdl/i_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sdl/i_main.c b/src/sdl/i_main.c index 65b7b5ff..f54f0d7c 100644 --- a/src/sdl/i_main.c +++ b/src/sdl/i_main.c @@ -103,6 +103,10 @@ static inline VOID MakeCodeWritable(VOID) \return int */ +#if defined (__GNUC__) && (__GNUC__ >= 4) +#pragma GCC diagnostic ignored "-Wmissing-noreturn" +#endif + #ifdef FORCESDLMAIN int SDL_main(int argc, char **argv) #else From a7dc20e7d2d53dad20f41884f382bfedf8f1d44e Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 29 Aug 2016 22:42:06 +0100 Subject: [PATCH 02/41] Upper Unpegged on an FOF's control linedef now enables skewing of walls with respect to slopes Skewing direction is decided per in-level wall by the Lower Unpegged flag on in-level linedefs themselves, since they already decide the stuff for FOF wall pegging as it is. That is unless Transfer Line is involved which moves everything to the control sector linedefs instead... --- src/r_segs.c | 73 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 64 insertions(+), 9 deletions(-) diff --git a/src/r_segs.c b/src/r_segs.c index 502ff330..fff98dbf 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -743,6 +743,12 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) // Render FOF sides kinda like normal sides, with the frac and step and everything // NOTE: INT64 instead of fixed_t because overflow concerns INT64 top_frac, top_step, bottom_frac, bottom_step; + // skew FOF walls with slopes? + boolean slopeskew = false; + fixed_t ffloortextureslide = 0; + INT32 oldx = -1; + fixed_t left_top, left_bottom; // needed here for slope skewing + pslope_t *skewslope = NULL; #endif void (*colfunc_2s) (column_t *); @@ -966,21 +972,68 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) mceilingclip = ds->sprtopclip; dc_texheight = textureheight[texnum]>>FRACBITS; +#ifdef ESLOPE + // calculate both left ends + if (*pfloor->t_slope) + left_top = P_GetZAt(*pfloor->t_slope, ds->leftpos.x, ds->leftpos.y) - viewz; + else + left_top = *pfloor->topheight - viewz; + + if (*pfloor->b_slope) + left_bottom = P_GetZAt(*pfloor->b_slope, ds->leftpos.x, ds->leftpos.y) - viewz; + else + left_bottom = *pfloor->bottomheight - viewz; + dc_texturemid = left_top; + skewslope = *pfloor->t_slope; // skew using top slope by default +#else dc_texturemid = *pfloor->topheight - viewz; +#endif if (newline) { offsetvalue = sides[newline->sidenum[0]].rowoffset; if (newline->flags & ML_DONTPEGBOTTOM) +#ifdef ESLOPE + { + dc_texturemid = left_bottom; + skewslope = *pfloor->b_slope; // skew using bottom slope + } +#else offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; +#endif +#ifdef ESLOPE + if (newline->flags & ML_DONTPEGTOP) + slopeskew = true; +#endif } else { offsetvalue = sides[pfloor->master->sidenum[0]].rowoffset; if (curline->linedef->flags & ML_DONTPEGBOTTOM) +#ifdef ESLOPE + { + dc_texturemid = left_bottom; + skewslope = *pfloor->b_slope; // skew using bottom slope + } +#else offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; +#endif +#ifdef ESLOPE + if (pfloor->master->flags & ML_DONTPEGTOP) // use control linedef's flags + slopeskew = true; +#endif } +#ifdef ESLOPE + if (slopeskew) + { + angle_t lineangle = R_PointToAngle2(curline->v1->x, curline->v1->y, curline->v2->x, curline->v2->y); + + if (skewslope) + ffloortextureslide = FixedMul(skewslope->zdelta, FINECOSINE((lineangle-skewslope->xydirection)>>ANGLETOFINESHIFT)); + } +#endif + dc_texturemid += offsetvalue; // Texture must be cached before setting colfunc_2s, @@ -999,23 +1052,18 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) #ifdef ESLOPE // Set heights according to plane, or slope, whichever { - fixed_t left_top, right_top, left_bottom, right_bottom; + fixed_t right_top, right_bottom; + // calculate right ends now if (*pfloor->t_slope) - { - left_top = P_GetZAt(*pfloor->t_slope, ds->leftpos.x, ds->leftpos.y) - viewz; right_top = P_GetZAt(*pfloor->t_slope, ds->rightpos.x, ds->rightpos.y) - viewz; - } else - left_top = right_top = *pfloor->topheight - viewz; + right_top = *pfloor->topheight - viewz; if (*pfloor->b_slope) - { - left_bottom = P_GetZAt(*pfloor->b_slope, ds->leftpos.x, ds->leftpos.y) - viewz; right_bottom = P_GetZAt(*pfloor->b_slope, ds->rightpos.x, ds->rightpos.y) - viewz; - } else - left_bottom = right_bottom = *pfloor->bottomheight - viewz; + right_bottom = *pfloor->bottomheight - viewz; // using INT64 to avoid 32bit overflow top_frac = (INT64)centeryfrac - (((INT64)left_top * ds->scale1) >> FRACBITS); @@ -1039,6 +1087,13 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) { if (maskedtexturecol[dc_x] != INT16_MAX) { +#ifdef ESLOPE + if (ffloortextureslide) { // skew FOF walls + if (oldx != -1) + dc_texturemid += FixedMul(ffloortextureslide, (maskedtexturecol[oldx]-maskedtexturecol[dc_x])< Date: Mon, 29 Aug 2016 23:21:57 +0100 Subject: [PATCH 03/41] If NOT skewing FOF walls, make sure dc_texturemid reverts to using unsloped FOF topheight/bottomheight rather than actual left side top/bottom heights --- src/r_segs.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/r_segs.c b/src/r_segs.c index fff98dbf..0d3a6430 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -983,45 +983,45 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) left_bottom = P_GetZAt(*pfloor->b_slope, ds->leftpos.x, ds->leftpos.y) - viewz; else left_bottom = *pfloor->bottomheight - viewz; - dc_texturemid = left_top; skewslope = *pfloor->t_slope; // skew using top slope by default -#else - dc_texturemid = *pfloor->topheight - viewz; + if (newline && newline->flags & ML_DONTPEGTOP) + slopeskew = true; + else if (pfloor->master->flags & ML_DONTPEGTOP) + slopeskew = true; + + if (slopeskew) + dc_texturemid = left_top; + else #endif + dc_texturemid = *pfloor->topheight - viewz; if (newline) { offsetvalue = sides[newline->sidenum[0]].rowoffset; if (newline->flags & ML_DONTPEGBOTTOM) -#ifdef ESLOPE { - dc_texturemid = left_bottom; - skewslope = *pfloor->b_slope; // skew using bottom slope - } -#else - offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; -#endif #ifdef ESLOPE - if (newline->flags & ML_DONTPEGTOP) - slopeskew = true; + skewslope = *pfloor->b_slope; // skew using bottom slope + if (slopeskew) + dc_texturemid = left_bottom; + else #endif + offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; + } } else { offsetvalue = sides[pfloor->master->sidenum[0]].rowoffset; if (curline->linedef->flags & ML_DONTPEGBOTTOM) -#ifdef ESLOPE { - dc_texturemid = left_bottom; - skewslope = *pfloor->b_slope; // skew using bottom slope - } -#else - offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; -#endif #ifdef ESLOPE - if (pfloor->master->flags & ML_DONTPEGTOP) // use control linedef's flags - slopeskew = true; + skewslope = *pfloor->b_slope; // skew using bottom slope + if (slopeskew) + dc_texturemid = left_bottom; + else #endif + offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; + } } #ifdef ESLOPE From 40cb22a130be5dc06b22a280b44588430f5a8610 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 29 Aug 2016 23:24:59 +0100 Subject: [PATCH 04/41] probably best if we did this instead actually --- src/r_segs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/r_segs.c b/src/r_segs.c index 0d3a6430..b997c2a8 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -984,8 +984,11 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) else left_bottom = *pfloor->bottomheight - viewz; skewslope = *pfloor->t_slope; // skew using top slope by default - if (newline && newline->flags & ML_DONTPEGTOP) - slopeskew = true; + if (newline) + { + if (newline->flags & ML_DONTPEGTOP) + slopeskew = true; + } else if (pfloor->master->flags & ML_DONTPEGTOP) slopeskew = true; From 858a7adcb3773c0d5fce821f1c366b48327cd804 Mon Sep 17 00:00:00 2001 From: Sryder13 Date: Thu, 8 Feb 2018 15:46:07 +0000 Subject: [PATCH 05/41] The main explosion particles bounce off the floor too --- src/dehacked.c | 1 + src/info.c | 27 +++++++++++++++++++++++++++ src/info.h | 1 + src/k_kart.c | 3 +-- src/p_mobj.c | 13 ++++++++++++- 5 files changed, 42 insertions(+), 3 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 05762fce..1b89ac1a 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7017,6 +7017,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_BOMBEXPLOSIONSOUND", "MT_SMOLDERING", // New explosion + "MT_BOOMEXPLODE", "MT_BOOMPARTICLE", "MT_BLUELIGHTNING", // Lightning stuff diff --git a/src/info.c b/src/info.c index 2b38bada..b9a51ee1 100644 --- a/src/info.c +++ b/src/info.c @@ -15056,6 +15056,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_BOOMEXPLODE + -1, // doomednum + S_SLOWBOOM1, // spawnstate + 1, // 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 + 1, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 0, // mass + 0, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOGRAVITY|MF_BOUNCE|MF_SCENERY, // flags + S_NULL // raisestate + }, + { // MT_BOOMPARTICLE -1, // doomednum S_INVISIBLE, // spawnstate diff --git a/src/info.h b/src/info.h index fa751c7a..d7ec70b5 100644 --- a/src/info.h +++ b/src/info.h @@ -3999,6 +3999,7 @@ typedef enum mobj_type MT_BOMBEXPLOSIONSOUND, MT_SMOLDERING, // New explosion + MT_BOOMEXPLODE, MT_BOOMPARTICLE, MT_BLUELIGHTNING, // Lightning stuff diff --git a/src/k_kart.c b/src/k_kart.c index 098ee4ea..64ddf99a 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2196,10 +2196,9 @@ void K_SpawnBobombExplosion(mobj_t *source, UINT8 color) truc = P_SpawnMobj(source->x + P_RandomRange(-radius, radius)*FRACUNIT, source->y + P_RandomRange(-radius, radius)*FRACUNIT, - source->z + P_RandomRange(0, height)*FRACUNIT, MT_BOSSEXPLODE); + source->z + P_RandomRange(0, height)*FRACUNIT, MT_BOOMEXPLODE); truc->scale = source->scale*2; truc->destscale = source->scale*6; - P_SetMobjState(truc, S_SLOWBOOM1); speed = FixedMul(10*FRACUNIT, source->scale)>>FRACBITS; truc->momx = P_RandomRange(-speed, speed)*FRACUNIT; truc->momy = P_RandomRange(-speed, speed)*FRACUNIT; diff --git a/src/p_mobj.c b/src/p_mobj.c index ce104999..30323023 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3038,11 +3038,22 @@ static boolean P_SceneryZMovement(mobj_t *mo) switch (mo->type) { + case MT_BOOMEXPLODE: case MT_BOOMPARTICLE: if ((mo->flags & MF_BOUNCE) && (mo->z <= mo->floorz || mo->z+mo->height >= mo->ceilingz)) { + // set standingslope + P_TryMove(mo, mo->x, mo->y, true); mo->momz = -mo->momz; - mo->z += mo->momz; +#ifdef ESLOPE + if (mo->standingslope) + { + if (mo->flags & MF_NOCLIPHEIGHT) + mo->standingslope = NULL; + else if (!P_IsObjectOnGround(mo)) + P_SlopeLaunch(mo); + } +#endif S_StartSound(mo, mo->info->activesound); } break; From 3e7fbad4900857a6abf13780440b6504a655e4ed Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 13 Feb 2018 16:48:09 -0500 Subject: [PATCH 06/41] Porting over some things from sonicitems --- src/d_netcmd.c | 5 +- src/g_game.c | 2 +- src/k_kart.c | 210 ++++++++++++++++++++++++------------------------- src/m_menu.c | 7 +- src/p_inter.c | 4 +- src/p_user.c | 4 +- src/sounds.c | 70 +++++++++++++++++ src/sounds.h | 72 ++++++++++++++++- src/v_video.c | 6 +- 9 files changed, 260 insertions(+), 120 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index e449a831..10ce175e 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -352,7 +352,8 @@ consvar_t cv_lightning = {"lightning", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, consvar_t cv_feather = {"feathers", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_karthud = {"karthud", "Default", CV_SAVE|CV_CALL, karthud_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_kartminimap = {"kartminimap", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; +static CV_PossibleValue_t kartminimap_cons_t[] = {{0, "MIN"}, {10, "MAX"}, {0, NULL}}; +consvar_t cv_kartminimap = {"kartminimap", "4", CV_SAVE, kartminimap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_kartcheck = {"kartcheck", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t kartstarsfx_cons_t[] = {{0, "Music"}, {1, "SMK"}, {0, NULL}}; consvar_t cv_kartstarsfx = {"kartstarsfx", "SMK", CV_SAVE, kartstarsfx_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -363,7 +364,7 @@ consvar_t cv_kartfrantic = {"kartfrantic", "Off", CV_NETVAR|CV_CHEAT|CV_CALL|CV_ consvar_t cv_kartcomeback = {"kartcomeback", "On", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartComeback_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_kartmirror = {"kartmirror", "Off", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartMirror_OnChange, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t speedometer_cons_t[] = {{0, "Off"}, {1, "Kilometers"}, {2, "Miles"}, {3, "Fracunits"}, {0, NULL}}; -consvar_t cv_speedometer = {"speedometer", "Kilometers", CV_SAVE, speedometer_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // use tics in display +consvar_t cv_speedometer = {"speedometer", "Off", CV_SAVE, speedometer_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // use tics in display static CV_PossibleValue_t votetime_cons_t[] = {{10, "MIN"}, {3600, "MAX"}, {0, NULL}}; consvar_t cv_votetime = {"votetime", "20", CV_NETVAR, votetime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; diff --git a/src/g_game.c b/src/g_game.c index 30b771f7..feeacb96 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2495,7 +2495,7 @@ void G_PlayerReborn(INT32 player) } } - if (leveltime > 157) + if (leveltime > 157 && !p->spectator) p->kartstuff[k_lakitu] = 48; // Lakitu Spawner if (gametype == GT_COOP) diff --git a/src/k_kart.c b/src/k_kart.c index 60bffb7d..67df2030 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1349,9 +1349,9 @@ void K_LakituChecker(player_t *player) newx = player->mo->x + P_ReturnThrustX(player->mo, newangle, 0); newy = player->mo->y + P_ReturnThrustY(player->mo, newangle, 0); if (player->mo->eflags & MFE_VERTICALFLIP) - newz = player->mo->z - 128*FRACUNIT; + newz = player->mo->z - 128*(mapheaderinfo[gamemap-1]->mobj_scale); else - newz = player->mo->z + 64*FRACUNIT; + newz = player->mo->z + 64*(mapheaderinfo[gamemap-1]->mobj_scale); mo = P_SpawnMobj(newx, newy, newz, MT_LAKITU); if (mo) { @@ -2381,17 +2381,17 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map if (!player) return NULL; - // Figure out projectile speed by CC + // Figure out projectile speed by game speed switch (gamespeed) { case 0: - PROJSPEED = 68*FRACUNIT; // Avg Speed is 34 + PROJSPEED = 68*(mapheaderinfo[gamemap-1]->mobj_scale); // Avg Speed is 34 break; case 2: - PROJSPEED = 96*FRACUNIT; // Avg Speed is 48 + PROJSPEED = 96*(mapheaderinfo[gamemap-1]->mobj_scale); // Avg Speed is 48 break; default: - PROJSPEED = 82*FRACUNIT; // Avg Speed is 41 + PROJSPEED = 82*(mapheaderinfo[gamemap-1]->mobj_scale); // Avg Speed is 41 break; } @@ -2741,7 +2741,8 @@ static void K_DoLightning(player_t *player, boolean bluelightning) mo = (mobj_t *)think; - if (mo->type == MT_PLAYER) + if (mo->player && !mo->player->spectator + && mo->player->kartstuff[k_position] < player->kartstuff[k_position]) P_DamageMobj(mo, player->mo, player->mo, bluelightning ? 65 : 64); else continue; @@ -4235,8 +4236,8 @@ static void K_initKartHUD(void) SPDM_X = 9; // 9 SPDM_Y = BASEVIDHEIGHT- 45; // 155 // Position Number - POSI_X = BASEVIDWIDTH - 6; // 268 - POSI_Y = BASEVIDHEIGHT- 4; // 138 + POSI_X = BASEVIDWIDTH - 9; // 268 + POSI_Y = BASEVIDHEIGHT- 9; // 138 // Top-Four Faces FACE_X = 9; // 9 FACE_Y = 92; // 92 @@ -5093,17 +5094,95 @@ void K_ReloadSkinIconGraphics(void) K_LoadIconGraphics(skins[i].iconprefix, i); } -static void K_drawKartMinimap(void) +static void K_drawKartMinimapHead(player_t *player, INT32 x, INT32 y, INT32 flags, patch_t *AutomapPic) { + // amnum xpos & ypos are the icon's speed around the HUD. + // The number being divided by is for how fast it moves. + // The higher the number, the slower it moves. + + // am xpos & ypos are the icon's starting position. Withouht + // it, they wouldn't 'spawn' on the top-right side of the HUD. + fixed_t amnumxpos; fixed_t amnumypos; INT32 amxpos; INT32 amypos; + + node_t *bsp = &nodes[numnodes-1]; + fixed_t maxx, minx, maxy, miny; + maxx = maxy = INT32_MAX; + minx = miny = INT32_MIN; + minx = bsp->bbox[0][BOXLEFT]; + maxx = bsp->bbox[0][BOXRIGHT]; + miny = bsp->bbox[0][BOXBOTTOM]; + maxy = bsp->bbox[0][BOXTOP]; + + if (bsp->bbox[1][BOXLEFT] < minx) + minx = bsp->bbox[1][BOXLEFT]; + if (bsp->bbox[1][BOXRIGHT] > maxx) + maxx = bsp->bbox[1][BOXRIGHT]; + if (bsp->bbox[1][BOXBOTTOM] < miny) + miny = bsp->bbox[1][BOXBOTTOM]; + if (bsp->bbox[1][BOXTOP] > maxy) + maxy = bsp->bbox[1][BOXTOP]; + + // You might be wondering why these are being bitshift here + // it's because mapwidth and height would otherwise overflow for maps larger than half the size possible... + // map boundaries and sizes will ALWAYS be whole numbers thankfully + // later calculations take into consideration that these are actually not in terms of FRACUNIT though + minx >>= FRACBITS; + maxx >>= FRACBITS; + miny >>= FRACBITS; + maxy >>= FRACBITS; + + fixed_t mapwidth = maxx - minx; + fixed_t mapheight = maxy - miny; + + // These should always be small enough to be bitshift back right now + fixed_t xoffset = (minx + mapwidth/2)<width, mapwidth); + fixed_t yscale = FixedDiv(AutomapPic->height, mapheight); + fixed_t zoom = FixedMul(min(xscale, yscale), FRACUNIT-FRACUNIT/20); + + amnumxpos = (FixedMul(player->mo->x, zoom) - FixedMul(xoffset, zoom)); + amnumypos = -(FixedMul(player->mo->y, zoom) - FixedMul(yoffset, zoom)); + + amxpos = amnumxpos + ((x + AutomapPic->width/2 - (iconprefix[player->skin]->width/2))<height/2 - (iconprefix[player->skin]->height/2))<width/2 + (iconprefix[player->skin]->width/2))<skincolor) // 'default' color + V_DrawSciencePatch(amxpos, amypos, flags, iconprefix[player->skin], FRACUNIT); + else + { + UINT8 *colormap; + if (player->mo->colorized) + { + colormap = R_GetTranslationColormap(TC_STARMAN, player->mo->color, 0); + } + else + { + colormap = R_GetTranslationColormap(player->skin, player->mo->color, 0); + } + V_DrawFixedPatch(amxpos, amypos, FRACUNIT, flags, iconprefix[player->skin], colormap); + } +} + +static void K_drawKartMinimap(void) +{ INT32 lumpnum; patch_t *AutomapPic; INT32 i = 0; INT32 x, y; - INT32 splitflags = V_SNAPTORIGHT|V_HUDTRANSHALF; + const INT32 minimaptrans = ((10-cv_kartminimap.value)<bbox[0][BOXLEFT]; - maxx = bsp->bbox[0][BOXRIGHT]; - miny = bsp->bbox[0][BOXBOTTOM]; - maxy = bsp->bbox[0][BOXTOP]; - - if (bsp->bbox[1][BOXLEFT] < minx) - minx = bsp->bbox[1][BOXLEFT]; - if (bsp->bbox[1][BOXRIGHT] > maxx) - maxx = bsp->bbox[1][BOXRIGHT]; - if (bsp->bbox[1][BOXBOTTOM] < miny) - miny = bsp->bbox[1][BOXBOTTOM]; - if (bsp->bbox[1][BOXTOP] > maxy) - maxy = bsp->bbox[1][BOXTOP]; - - // You might be wondering why these are being bitshift here - // it's because mapwidth and height would otherwise overflow for maps larger than half the size possible... - // map boundaries and sizes will ALWAYS be whole numbers thankfully - // later calculations take into consideration that these are actually not in terms of FRACUNIT though - minx >>= FRACBITS; - maxx >>= FRACBITS; - miny >>= FRACBITS; - maxy >>= FRACBITS; - - fixed_t mapwidth = maxx - minx; - fixed_t mapheight = maxy - miny; - - // These should always be small enough to be bitshift back right now - fixed_t xoffset = (minx + mapwidth/2)<width, mapwidth); - fixed_t yscale = FixedDiv(AutomapPic->height, mapheight); - fixed_t zoom = FixedMul(min(xscale, yscale), FRACUNIT-FRACUNIT/20); - - amnumxpos = (FixedMul(players[i].mo->x, zoom) - FixedMul(xoffset, zoom)); - amnumypos = -(FixedMul(players[i].mo->y, zoom) - FixedMul(yoffset, zoom)); - - amxpos = amnumxpos + ((x + AutomapPic->width/2 - (iconprefix[players[i].skin]->width/2))<height/2 - (iconprefix[players[i].skin]->height/2))<width/2 + (iconprefix[players[i].skin]->width/2))<colorized) - { - colormap = R_GetTranslationColormap(TC_STARMAN, players[i].mo->color, 0); - } - else - { - colormap = R_GetTranslationColormap(players[i].skin, players[i].mo->color, 0); - } - V_DrawFixedPatch(amxpos, amypos, FRACUNIT, splitflags|V_FLIP, iconprefix[players[i].skin], colormap); - } - } - else - { - if (!players[i].skincolor) // 'default' color - V_DrawSciencePatch(amxpos, amypos, splitflags, iconprefix[players[i].skin], FRACUNIT); - else - { - UINT8 *colormap; - if (players[i].mo->colorized) - { - colormap = R_GetTranslationColormap(TC_STARMAN, players[i].mo->color, 0); - } - else - { - colormap = R_GetTranslationColormap(players[i].skin, players[i].mo->color, 0); - } - V_DrawFixedPatch(amxpos, amypos, FRACUNIT, splitflags, iconprefix[players[i].skin], colormap); - } - } - } + K_drawKartMinimapHead(&players[i], x, y, splitflags, AutomapPic); } + + if (splitscreen == 2) + return; // Don't need this for splits + + splitflags &= ~V_HUDTRANSHALF; + splitflags |= V_HUDTRANS; + K_drawKartMinimapHead(stplyr, x, y, splitflags, AutomapPic); } static void K_drawBattleFullscreen(void) @@ -5460,7 +5460,7 @@ void K_drawKartHUD(void) K_drawKartPlayerCheck(); } - if ((splitscreen == 0 || splitscreen == 2) && cv_kartminimap.value) + if ((splitscreen == 0 && cv_kartminimap.value) || splitscreen == 2) K_drawKartMinimap(); // If the item window is closing, draw it closing! diff --git a/src/m_menu.c b/src/m_menu.c index 0553b984..ad7c371c 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1422,10 +1422,11 @@ static menuitem_t OP_GameOptionsMenu[] = {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "HUD Visibility", &cv_translucenthud, 50}, - {IT_STRING | IT_CVAR, NULL, "Star SFX", &cv_kartstarsfx, 62}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, + NULL, "Minimap Visibility", &cv_kartminimap, 62}, {IT_STRING | IT_CVAR, NULL, "Speedometer Display", &cv_speedometer, 72}, - {IT_STRING | IT_CVAR, NULL, "Show Minimap", &cv_kartminimap, 82}, - {IT_STRING | IT_CVAR, NULL, "Show \"CHECK\"", &cv_kartcheck, 92}, + {IT_STRING | IT_CVAR, NULL, "Show \"CHECK\"", &cv_kartcheck, 82}, + {IT_STRING | IT_CVAR, NULL, "Star SFX", &cv_kartstarsfx, 92}, #ifdef SEENAMES {IT_STRING | IT_CVAR, NULL, "HUD Player Names", &cv_seenames, 104}, diff --git a/src/p_inter.c b/src/p_inter.c index 3544b712..84c602de 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2005,7 +2005,7 @@ boolean P_CheckRacers(void) // Check if all the players in the race have finished. If so, end the level. for (i = 0; i < MAXPLAYERS; i++) { - if (playeringame[i] && !players[i].exiting && players[i].lives > 0) + if (playeringame[i] && !players[i].spectator && !players[i].exiting && players[i].lives > 0) break; } @@ -3159,7 +3159,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da K_SpinPlayer(player, source); // Start shrinking! - player->mo->destscale = 6*FRACUNIT/8; + player->mo->destscale = 6*(mapheaderinfo[gamemap-1]->mobj_scale)/8; player->kartstuff[k_growshrinktimer] -= (100+20*(16-(player->kartstuff[k_position]))); } // Mega Mushroom? Let's take that away. diff --git a/src/p_user.c b/src/p_user.c index 5097d2b2..75c98f58 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9258,7 +9258,7 @@ void P_PlayerThink(player_t *player) // Check if all the players in the race have finished. If so, end the level. for (i = 0; i < MAXPLAYERS; i++) { - if (playeringame[i]) + if (playeringame[i] && !players[i].spectator) { if (!players[i].exiting && players[i].lives > 0) break; @@ -9280,7 +9280,7 @@ void P_PlayerThink(player_t *player) // If you've hit the countdown and you haven't made // it to the exit, you're a goner! else */ - if (countdown == 1 && !player->exiting && player->lives > 0) + if (countdown == 1 && !player->exiting && !player->spectator && player->lives > 0) { if (netgame && player->health > 0) CONS_Printf(M_GetText("%s ran out of time.\n"), player_names[player-players]); diff --git a/src/sounds.c b/src/sounds.c index 22f966ee..ec8ceea0 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -505,6 +505,76 @@ sfxinfo_t S_sfx[NUMSFX] = {"boing", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"smkinv", false, 140, 16, -1, NULL, 0, -1, -1, LUMPERROR}, + // Knuckles Chaotix sounds + {"kc2a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc2b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc2c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc2d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc2e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc2f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Pogo Spring + {"kc30", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc31", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc32", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc33", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc34", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc35", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc36", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc37", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc38", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc39", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc3a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc3b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc3c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc3d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc3e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc3f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc40", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc41", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc42", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc43", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc44", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc45", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc46", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc47", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc48", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc49", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc4a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc4b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc4c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc4d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc4e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc4f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc50", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc51", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc52", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc53", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc54", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc55", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc56", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc57", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc58", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc59", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Shrink + {"kc5a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Grow + {"kc5b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc5c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc5d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc5e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc5f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc60", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc61", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc62", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc63", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc64", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc65", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc66", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc67", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc68", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc69", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc6b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc6c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc6d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc6e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + // SRB2kart - Skin sounds {"kwin", false, 64, 0, -1, NULL, 0, SKSWIN, -1, LUMPERROR}, {"klose", false, 64, 0, -1, NULL, 0, SKSLOSE, -1, LUMPERROR}, diff --git a/src/sounds.h b/src/sounds.h index 9ffc3a87..142c4a4e 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -577,11 +577,79 @@ typedef enum sfx_boing, sfx_smkinv, + // KC sounds + sfx_kc2a, + sfx_kc2b, + sfx_kc2c, + sfx_kc2d, + sfx_kc2e, + sfx_kc2f, + sfx_kc30, + sfx_kc31, + sfx_kc32, + sfx_kc33, + sfx_kc34, + sfx_kc35, + sfx_kc36, + sfx_kc37, + sfx_kc38, + sfx_kc39, + sfx_kc3a, + sfx_kc3b, + sfx_kc3c, + sfx_kc3d, + sfx_kc3e, + sfx_kc3f, + sfx_kc40, + sfx_kc41, + sfx_kc42, + sfx_kc43, + sfx_kc44, + sfx_kc45, + sfx_kc46, + sfx_kc47, + sfx_kc48, + sfx_kc49, + sfx_kc4a, + sfx_kc4b, + sfx_kc4c, + sfx_kc4d, + sfx_kc4e, + sfx_kc4f, + sfx_kc50, + sfx_kc51, + sfx_kc52, + sfx_kc53, + sfx_kc54, + sfx_kc55, + sfx_kc56, + sfx_kc57, + sfx_kc58, + sfx_kc59, + sfx_kc5a, + sfx_kc5b, + sfx_kc5c, + sfx_kc5d, + sfx_kc5e, + sfx_kc5f, + sfx_kc60, + sfx_kc61, + sfx_kc62, + sfx_kc63, + sfx_kc64, + sfx_kc65, + sfx_kc66, + sfx_kc67, + sfx_kc68, + sfx_kc69, + sfx_kc6b, + sfx_kc6c, + sfx_kc6d, + sfx_kc6e, + sfx_kwin, sfx_klose, sfx_slow, - // - sfx_taunt1, sfx_taunt2, sfx_taunt3, diff --git a/src/v_video.c b/src/v_video.c index 643d7758..68998139 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -303,7 +303,7 @@ void VID_BlitLinearScreen(const UINT8 *srcptr, UINT8 *destptr, INT32 width, INT3 #endif } -static UINT8 hudplusalpha[11] = { 10, 8, 6, 4, 2, 0, 0, 0, 0, 0, 0}; +//static UINT8 hudplusalpha[11] = { 10, 8, 6, 4, 2, 0, 0, 0, 0, 0, 0}; static UINT8 hudminusalpha[11] = { 10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5}; static const UINT8 *v_colormap = NULL; @@ -362,8 +362,8 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t alphalevel = hudminusalpha[cv_translucenthud.value]; else if (alphalevel == 14) alphalevel = 10 - cv_translucenthud.value; - else if (alphalevel == 15) - alphalevel = hudplusalpha[cv_translucenthud.value]; + /*else if (alphalevel == 15) + alphalevel = hudplusalpha[cv_translucenthud.value];*/ if (alphalevel >= 10) return; // invis From 581e231a3edc3935ed1cce8053fd52177e755024 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 13 Feb 2018 18:13:27 -0500 Subject: [PATCH 07/41] sonicitems porting, Part 2 BUT with more tweaks on top of that: - matchesplayed can go up & unlock stuff regardless of modifiedgame - votetime added to menu - flame jets are fullbright (been meaning to do this for a while) - screenshots are prefixed with kart instead of srb2 (ditto) --- src/g_game.c | 2 +- src/info.c | 6 +++--- src/m_menu.c | 11 ++++++----- src/m_misc.c | 4 ++-- src/y_inter.c | 36 ++++++++++++++++++++++++++++-------- 5 files changed, 40 insertions(+), 19 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index feeacb96..7582006b 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2279,7 +2279,7 @@ static inline void G_PlayerFinishLevel(INT32 player) // SRB2kart: Increment the "matches played" counter. if (player == consoleplayer) { - if (legitimateexit && ((!modifiedgame || savemoddata) && !demoplayback)) + if (legitimateexit && !demoplayback) // (yes you're allowed to unlock stuff this way when the game is modified) { matchesplayed++; if (M_UpdateUnlockablesAndExtraEmblems()) diff --git a/src/info.c b/src/info.c index 2b38bada..7d1a9bb0 100644 --- a/src/info.c +++ b/src/info.c @@ -1470,9 +1470,9 @@ state_t states[NUMSTATES] = {SPR_NULL, 0, 2*TICRATE, {NULL}, 0, 0, S_FLAMEJETSTART}, // S_FLAMEJETSTND {SPR_NULL, 0, 3*TICRATE, {A_ToggleFlameJet}, 0, 0, S_FLAMEJETSTOP}, // S_FLAMEJETSTART {SPR_NULL, 0, 1, {A_ToggleFlameJet}, 0, 0, S_FLAMEJETSTND}, // S_FLAMEJETSTOP - {SPR_FLME, FF_TRANS50 , 4, {NULL}, 0, 0, S_FLAMEJETFLAME2}, // S_FLAMEJETFLAME1 - {SPR_FLME, FF_TRANS60|1, 5, {NULL}, 0, 0, S_FLAMEJETFLAME3}, // S_FLAMEJETFLAME2 - {SPR_FLME, FF_TRANS70|2, 11, {NULL}, 0, 0, S_NULL}, // S_FLAMEJETFLAME3 + {SPR_FLME, FF_FULLBRIGHT|FF_TRANS50 , 4, {NULL}, 0, 0, S_FLAMEJETFLAME2}, // S_FLAMEJETFLAME1 + {SPR_FLME, FF_FULLBRIGHT|FF_TRANS60|1, 5, {NULL}, 0, 0, S_FLAMEJETFLAME3}, // S_FLAMEJETFLAME2 + {SPR_FLME, FF_FULLBRIGHT|FF_TRANS70|2, 11, {NULL}, 0, 0, S_NULL}, // S_FLAMEJETFLAME3 // Spinning flame jets // A: Counter-clockwise diff --git a/src/m_menu.c b/src/m_menu.c index ad7c371c..95086d4d 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1452,13 +1452,14 @@ static menuitem_t OP_ServerOptionsMenu[] = #endif {IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 80}, - {IT_STRING | IT_CVAR, NULL, "Advance to next map", &cv_advancemap, 90}, + {IT_STRING | IT_CVAR, NULL, "Voting Timer", &cv_votetime, 90}, + {IT_STRING | IT_CVAR, NULL, "Advance to next map", &cv_advancemap, 100}, #ifndef NONET - {IT_STRING | IT_CVAR, NULL, "Max Players", &cv_maxplayers, 110}, - {IT_STRING | IT_CVAR, NULL, "Allow players to join", &cv_allownewplayer, 120}, - {IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 130}, - {IT_STRING | IT_CVAR, NULL, "Attempts to Resynch", &cv_resynchattempts, 140}, + {IT_STRING | IT_CVAR, NULL, "Max Players", &cv_maxplayers, 120}, + {IT_STRING | IT_CVAR, NULL, "Allow players to join", &cv_allownewplayer, 130}, + {IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 140}, + {IT_STRING | IT_CVAR, NULL, "Attempts to Resynch", &cv_resynchattempts, 150}, #endif }; diff --git a/src/m_misc.c b/src/m_misc.c index 74ba8b31..0d0be0f6 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -546,7 +546,7 @@ void M_SaveConfig(const char *filename) #if NUMSCREENS > 2 static const char *Newsnapshotfile(const char *pathname, const char *ext) { - static char freename[13] = "srb2XXXX.ext"; + static char freename[13] = "kartXXXX.ext"; int i = 5000; // start in the middle: num screenshots divided by 2 int add = i; // how much to add or subtract if wrong; gets divided by 2 each time int result; // -1 = guess too high, 0 = correct, 1 = guess too low @@ -1390,7 +1390,7 @@ void M_ScreenShot(void) } /** Takes a screenshot. - * The screenshot is saved as "srb2xxxx.pcx" (or "srb2xxxx.tga" in hardware + * The screenshot is saved as "kartxxxx.pcx" (or "kartxxxx.tga" in hardware * rendermode) where xxxx is the lowest four-digit number for which a file * does not already exist. * diff --git a/src/y_inter.c b/src/y_inter.c index 4c75dfc2..e443e91f 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -182,6 +182,8 @@ typedef struct UINT8 ranim; UINT8 rtics; UINT8 roffset; + UINT8 rsynctime; + UINT8 rendoff; } y_voteclient; static y_votelvlinfo levelinfo[4]; @@ -2272,7 +2274,7 @@ void Y_VoteTicker(void) D_PickVote(); if (!votetic) - S_ChangeMusicInternal("racent", true); + S_ChangeMusicInternal("vote", true); if (timer) timer--; @@ -2283,6 +2285,7 @@ void Y_VoteTicker(void) if (pickedvote != -1) { timer = 0; + voteclient.rsynctime++; if (voteendtic == -1) { @@ -2302,16 +2305,29 @@ void Y_VoteTicker(void) if (voteclient.rtics <= 0) { voteclient.roffset++; - voteclient.rtics = min(TICRATE/2, (voteclient.roffset/3)+1); - S_StartSound(NULL, sfx_s3k5b); + voteclient.rtics = min(TICRATE/2, (voteclient.roffset/2)+5); + S_StartSound(NULL, sfx_kc39); } - voteclient.ranim = tempvotes[((pickedvote + voteclient.roffset) % numvotes)]; + if (voteclient.rendoff == 0 || voteclient.roffset < voteclient.rendoff) + voteclient.ranim = tempvotes[((pickedvote + voteclient.roffset) % numvotes)]; - if (voteclient.ranim == pickedvote && voteclient.roffset >= 30) + if (voteclient.roffset >= 24) { - voteendtic = votetic + (4*TICRATE); - S_StartSound(NULL, sfx_s3k63); + if (voteclient.rendoff == 0) + { + if (tempvotes[((pickedvote + voteclient.roffset + 4) % numvotes)] == pickedvote + && voteclient.rsynctime % (29*TICRATE/20) == 0) // Song is 1.45 seconds long (sorry @ whoever wants to replace it in a music wad :V) + { + voteclient.rendoff = voteclient.roffset+4; + S_ChangeMusicInternal("voteeb", false); + } + } + else if (voteclient.roffset >= voteclient.rendoff) + { + voteendtic = votetic + (3*TICRATE); + S_StartSound(NULL, sfx_kc48); + } } } else @@ -2349,7 +2365,7 @@ void Y_VoteTicker(void) if (pressed) { - S_StartSound(NULL, sfx_s3k5b); + S_StartSound(NULL, sfx_kc4a); voteclient.delay = NEWTICRATE/7; } @@ -2413,6 +2429,8 @@ void Y_StartVote(void) voteclient.ranim = 0; voteclient.rtics = 1; voteclient.roffset = 0; + voteclient.rsynctime = 0; + voteclient.rendoff = 0; for (i = 0; i < MAXPLAYERS; i++) votes[i] = -1; @@ -2495,4 +2513,6 @@ void Y_SetupVoteFinish(INT8 pick, INT8 level) pickedvote = pick; nextmap = votelevels[level]; timer = 0; + S_ChangeMusicInternal("voteea", true); + // TODO: Just end the vote here if there's only 1 player } \ No newline at end of file From 275132da5fed000f1bf16a82ac45791aba0e79b3 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 17 Feb 2018 01:53:44 -0500 Subject: [PATCH 08/41] Minor but important fixes --- src/k_kart.c | 3 ++- src/y_inter.c | 73 ++++++++++++++++++++++++++++++++------------------- 2 files changed, 48 insertions(+), 28 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 67df2030..0cdfdb03 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -5230,7 +5230,8 @@ static void K_drawKartMinimap(void) splitflags &= ~V_HUDTRANSHALF; splitflags |= V_HUDTRANS; - K_drawKartMinimapHead(stplyr, x, y, splitflags, AutomapPic); + if (stplyr->mo && !stplyr->spectator) + K_drawKartMinimapHead(stplyr, x, y, splitflags, AutomapPic); } static void K_drawBattleFullscreen(void) diff --git a/src/y_inter.c b/src/y_inter.c index e443e91f..f8e735fa 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -2192,7 +2192,7 @@ void Y_VoteDrawer(void) for (i = 0; i < MAXPLAYERS; i++) { - if (votes[i] != -1) + if ((playeringame[i] && !players[i].spectator) && votes[i] != -1) { patch_t *pic; @@ -2233,8 +2233,6 @@ void Y_VoteDrawer(void) } } - //V_DrawScaledPatch(x, y, V_SNAPTOBOTTOM, pic); - if (timer) V_DrawCenteredString(BASEVIDWIDTH/2, 188, V_YELLOWMAP|V_SNAPTOBOTTOM, va("Vote ends in %d seconds", timer/TICRATE)); @@ -2265,12 +2263,12 @@ void Y_VoteTicker(void) for (i = 0; i < MAXPLAYERS; i++) // Correct votes as early as possible, before they're processed by the game at all { if (!playeringame[i] || players[i].spectator) - votes[i] = -1; + votes[i] = -1; // Spectators are the lower class, and have effectively no voice in the government. Democracy sucks. else if (pickedvote != -1 && votes[i] == -1 && !splitscreen) votes[i] = 3; // Slow people get random } - if (server && votes[pickedvote] == -1) // Uh oh! The person who got picked left! Recalculate, quick! + if (server && pickedvote != -1 && votes[pickedvote] == -1) // Uh oh! The person who got picked left! Recalculate, quick! D_PickVote(); if (!votetic) @@ -2305,19 +2303,19 @@ void Y_VoteTicker(void) if (voteclient.rtics <= 0) { voteclient.roffset++; - voteclient.rtics = min(TICRATE/2, (voteclient.roffset/2)+5); + voteclient.rtics = min(20, (3*voteclient.roffset/4)+5); S_StartSound(NULL, sfx_kc39); } if (voteclient.rendoff == 0 || voteclient.roffset < voteclient.rendoff) voteclient.ranim = tempvotes[((pickedvote + voteclient.roffset) % numvotes)]; - if (voteclient.roffset >= 24) + if (voteclient.roffset >= 20) { if (voteclient.rendoff == 0) { if (tempvotes[((pickedvote + voteclient.roffset + 4) % numvotes)] == pickedvote - && voteclient.rsynctime % (29*TICRATE/20) == 0) // Song is 1.45 seconds long (sorry @ whoever wants to replace it in a music wad :V) + && voteclient.rsynctime % 50 == 0) // Song is 1.45 seconds long (sorry @ whoever wants to replace it in a music wad :V) { voteclient.rendoff = voteclient.roffset+4; S_ChangeMusicInternal("voteeb", false); @@ -2338,9 +2336,8 @@ void Y_VoteTicker(void) if (votetic < 3*(NEWTICRATE/7)) // give it some time before letting you control it :V return; - if ((!playeringame[consoleplayer] || players[consoleplayer].spectator) && votes[consoleplayer] != -1) - D_ModifyClientVote(-1); - else if (pickedvote == -1 && votes[consoleplayer] == -1 && !voteclient.delay) + if ((playeringame[consoleplayer] && !players[consoleplayer].spectator) + && !voteclient.delay && pickedvote == -1 && votes[consoleplayer] == -1) { if (InputDown(gc_aimforward, 1) || JoyAxis(AXISMOVE, 1) < 0) { @@ -2371,30 +2368,22 @@ void Y_VoteTicker(void) if (server) { - UINT8 numplayers = 0, numvotes = 0; - if (splitscreen) { - numplayers = 1; - if (votes[0] != -1) - numvotes = 1; + if (votes[0] == -1) + return; } else { for (i = 0; i < MAXPLAYERS; i++) { - if (!playeringame[i] || players[i].spectator) - continue; - numplayers++; - if (votes[i] != -1) - numvotes++; + if ((playeringame[i] && !players[i].spectator) && votes[i] == -1) + return; } } - if (numvotes >= numplayers) - timer = 0; - - if (timer == 0 && voteendtic == -1) + timer = 0; + if (voteendtic == -1) D_PickVote(); } } @@ -2510,9 +2499,39 @@ static void Y_UnloadVoteData(void) // void Y_SetupVoteFinish(INT8 pick, INT8 level) { + if (pickedvote == -1) + { + INT32 i; + SINT8 votecompare = -1; + boolean allsame = true; + + voteclient.rsynctime = 0; + + for (i = 0; i < MAXPLAYERS; i++) + { + if ((playeringame[consoleplayer] && !players[consoleplayer].spectator) && votes[i] == -1) + votes[i] = 3; + + if (votes[i] == -1) + continue; + + if (votecompare == -1) + votecompare = votes[i]; + else if (votes[i] != votecompare) + allsame = false; + } + + if (allsame) + { + voteendtic = votetic + (5*TICRATE); + S_StartSound(NULL, sfx_kc48); + S_ChangeMusicInternal("voteeb", false); + } + else + S_ChangeMusicInternal("voteea", true); + } + pickedvote = pick; nextmap = votelevels[level]; timer = 0; - S_ChangeMusicInternal("voteea", true); - // TODO: Just end the vote here if there's only 1 player } \ No newline at end of file From ccae121c262f5c1b57f6e475a879ed64af37c5ad Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 20 Feb 2018 18:18:10 -0500 Subject: [PATCH 09/41] Quick fix --- src/y_inter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/y_inter.c b/src/y_inter.c index f8e735fa..26c52051 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -2509,7 +2509,7 @@ void Y_SetupVoteFinish(INT8 pick, INT8 level) for (i = 0; i < MAXPLAYERS; i++) { - if ((playeringame[consoleplayer] && !players[consoleplayer].spectator) && votes[i] == -1) + if ((playeringame[i] && !players[i].spectator) && votes[i] == -1) votes[i] = 3; if (votes[i] == -1) From 2a23549d637099845b77632c0cbd23419d039d91 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 20 Feb 2018 19:11:09 -0500 Subject: [PATCH 10/41] Winning positions scale with number of players Anyone in the top 50% gets winning music & blue position, everyone below gets the losing music & red position. For odd numbers, it rounds up. 2p: 1st wins, 2nd loses 3p: 1-2 win, 3rd loses 4p: 1-2 win, 3-4 lose 5p: 1-3 win, 4-5 lose 6p: 1-3 win, 4-6 lose 7p: 1-4 win, 5-7 lose 8p: 1-4 win, 5-8 lose (SMK) 12p: 1-6 win, 7-12 lose (modern MK) 16p: 1-8 win, 9-16 lose (max player count) In big netgames you won't just hear the losing music all of the time now :V --- src/k_kart.c | 518 +++------------------------------------------------ src/k_kart.h | 1 + src/p_spec.c | 8 +- src/p_user.c | 8 +- 4 files changed, 38 insertions(+), 497 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 0cdfdb03..b767e731 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -332,369 +332,35 @@ void K_RegisterKartStuff(void) //} +boolean K_IsPlayerLosing(player_t *player) +{ + INT32 winningpos = 1; + UINT8 i, pcount = 0; + + if (player->kartstuff[k_position] == 1) + return false; + + for (i = 0; i < MAXPLAYERS; i++) + { + if (playeringame[i] && !players[i].spectator) + pcount++; + } + + if (pcount <= 1) + return false; + + winningpos = pcount/2; + if (pcount % 2) // any remainder? + winningpos++; + + return (player->kartstuff[k_position] > winningpos); +} + //{ SRB2kart Roulette Code - Position Based #define NUMKARTITEMS 19 #define NUMKARTODDS 40 -// Ugly ol' 3D arrays -/* -static INT32 K_KartItemOddsPosition_Retro[MAXPLAYERS][NUMKARTITEMS][MAXPLAYERS] = -{ - // 1 Active Player - { //1st // - { 0 }, // Magnet - { 0 }, // Boo - { 40 }, // Mushroom - { 0 }, // Triple Mushroom - { 0 }, // Mega Mushroom - { 0 }, // Gold Mushroom - { 0 }, // Star - { 0 }, // Triple Banana - { 0 }, // Fake Item - { 0 }, // Banana - { 0 }, // Green Shell - { 0 }, // Red Shell - { 0 }, // Triple Green Shell - { 0 }, // Bob-omb - { 0 }, // Blue Shell - { 0 }, // Fire Flower - { 0 }, // Triple Red Shell - { 0 } // Lightning - }, //1st // - - // 2 Active Players - { //1st 2nd // - { 1, 0 }, // Magnet - { 0, 0 }, // Boo - { 6, 11 }, // Mushroom - { 0, 3 }, // Triple Mushroom - { 0, 1 }, // Mega Mushroom - { 0, 1 }, // Gold Mushroom - { 0, 0 }, // Star - { 4, 0 }, // Triple Banana - { 7, 0 }, // Fake Item - { 12, 0 }, // Banana - { 8, 6 }, // Green Shell - { 2, 12 }, // Red Shell - { 0, 4 }, // Triple Green Shell - { 0, 0 }, // Bob-omb - { 0, 2 }, // Blue Shell - { 0, 0 }, // Fire Flower - { 0, 0 }, // Triple Red Shell - { 0, 0 } // Lightning - }, //1st 2nd // - - // 3 Active Players - { //1st 2nd 3rd // - { 1, 0, 0 }, // Magnet - { 0, 1, 0 }, // Boo - { 4, 10, 0 }, // Mushroom - { 0, 4, 11 }, // Triple Mushroom - { 0, 0, 2 }, // Mega Mushroom - { 0, 0, 16 }, // Gold Mushroom - { 0, 0, 6 }, // Star - { 4, 0, 0 }, // Triple Banana - { 7, 2, 0 }, // Fake Item - { 13, 4, 0 }, // Banana - { 9, 4, 0 }, // Green Shell - { 2, 8, 0 }, // Red Shell - { 0, 3, 0 }, // Triple Green Shell - { 0, 2, 0 }, // Bob-omb - { 0, 2, 0 }, // Blue Shell - { 0, 0, 0 }, // Fire Flower - { 0, 0, 0 }, // Triple Red Shell - { 0, 0, 5 } // Lightning - }, //1st 2nd 3rd // - - // 4 Active Players - { //1st 2nd 3rd 4th // - { 1, 1, 0, 0 }, // Magnet - { 0, 3, 0, 0 }, // Boo - { 2, 10, 0, 0 }, // Mushroom - { 0, 3, 9, 10 }, // Triple Mushroom - { 0, 0, 3, 0 }, // Mega Mushroom - { 0, 0, 9, 16 }, // Gold Mushroom - { 0, 0, 0, 8 }, // Star - { 4, 0, 0, 0 }, // Triple Banana - { 7, 2, 0, 0 }, // Fake Item - { 14, 4, 0, 0 }, // Banana - { 9, 5, 0, 0 }, // Green Shell - { 3, 8, 6, 0 }, // Red Shell - { 0, 2, 4, 0 }, // Triple Green Shell - { 0, 2, 0, 0 }, // Bob-omb - { 0, 0, 3, 0 }, // Blue Shell - { 0, 0, 3, 0 }, // Fire Flower - { 0, 0, 3, 0 }, // Triple Red Shell - { 0, 0, 0, 6 } // Lightning - }, //1st 2nd 3rd 4th // - - // 5 Active Players - { //1st 2nd 3rd 4th 5th // - { 1, 2, 0, 0, 0 }, // Magnet - { 0, 3, 0, 0, 0 }, // Boo - { 0, 9, 7, 0, 0 }, // Mushroom - { 0, 0, 8, 12, 12 }, // Triple Mushroom - { 0, 0, 2, 2, 0 }, // Mega Mushroom - { 0, 0, 0, 9, 20 }, // Gold Mushroom - { 0, 0, 0, 3, 8 }, // Star - { 4, 2, 0, 0, 0 }, // Triple Banana - { 7, 3, 0, 0, 0 }, // Fake Item - { 15, 4, 0, 0, 0 }, // Banana - { 10, 6, 3, 0, 0 }, // Green Shell - { 3, 9, 6, 0, 0 }, // Red Shell - { 0, 2, 4, 0, 0 }, // Triple Green Shell - { 0, 0, 3, 0, 0 }, // Bob-omb - { 0, 0, 4, 0, 0 }, // Blue Shell - { 0, 0, 3, 4, 0 }, // Fire Flower - { 0, 0, 0, 3, 0 }, // Triple Red Shell - { 0, 0, 0, 7, 0 } // Lightning - }, //1st 2nd 3rd 4th 5th // - - // 6 Active Players - { //1st 2nd 3rd 4th 5th 6th // - { 1, 2, 0, 0, 0, 0 }, // Magnet - { 0, 2, 2, 0, 0, 0 }, // Boo - { 0, 9, 8, 0, 0, 0 }, // Mushroom - { 0, 0, 5, 11, 14, 12 }, // Triple Mushroom - { 0, 0, 0, 2, 2, 0 }, // Mega Mushroom - { 0, 0, 0, 6, 11, 20 }, // Gold Mushroom - { 0, 0, 0, 0, 3, 8 }, // Star - { 4, 2, 0, 0, 0, 0 }, // Triple Banana - { 7, 3, 0, 0, 0, 0 }, // Fake Item - { 15, 5, 3, 0, 0, 0 }, // Banana - { 10, 6, 4, 0, 0, 0 }, // Green Shell - { 3, 9, 8, 6, 0, 0 }, // Red Shell - { 0, 2, 4, 5, 0, 0 }, // Triple Green Shell - { 0, 0, 3, 0, 0, 0 }, // Bob-omb - { 0, 0, 3, 3, 0, 0 }, // Blue Shell - { 0, 0, 0, 4, 0, 0 }, // Fire Flower - { 0, 0, 0, 3, 3, 0 }, // Triple Red Shell - { 0, 0, 0, 0, 7, 0 } // Lightning - }, //1st 2nd 3rd 4th 5th 6th // - - // 7 Active Players - { //1st 2nd 3rd 4th 5th 6th 7th // - { 1, 2, 0, 0, 0, 0, 0 }, // Magnet - { 0, 2, 3, 0, 0, 0, 0 }, // Boo - { 0, 8, 8, 8, 0, 0, 0 }, // Mushroom - { 0, 0, 3, 8, 14, 15, 12 }, // Triple Mushroom - { 0, 0, 0, 2, 4, 2, 0 }, // Mega Mushroom - { 0, 0, 0, 0, 7, 12, 20 }, // Gold Mushroom - { 0, 0, 0, 0, 0, 3, 8 }, // Star - { 4, 2, 0, 0, 0, 0, 0 }, // Triple Banana - { 7, 4, 2, 0, 0, 0, 0 }, // Fake Item - { 15, 5, 4, 0, 0, 0, 0 }, // Banana - { 10, 6, 4, 0, 0, 0, 0 }, // Green Shell - { 3, 10, 8, 7, 0, 0, 0 }, // Red Shell - { 0, 1, 4, 6, 4, 0, 0 }, // Triple Green Shell - { 0, 0, 3, 0, 0, 0, 0 }, // Bob-omb - { 0, 0, 1, 3, 3, 0, 0 }, // Blue Shell - { 0, 0, 0, 3, 5, 0, 0 }, // Fire Flower - { 0, 0, 0, 3, 3, 0, 0 }, // Triple Red Shell - { 0, 0, 0, 0, 0, 8, 0 } // Lightning - }, //1st 2nd 3rd 4th 5th 6th 7th // - - // 8 Active Players - { //1st 2nd 3rd 4th 5th 6th 7th 8th // - { 1, 2, 0, 0, 0, 0, 0, 0 }, // Magnet - { 0, 2, 3, 0, 0, 0, 0, 0 }, // Boo - { 0, 8, 8, 8, 0, 0, 0, 0 }, // Mushroom - { 0, 0, 3, 7, 12, 15, 11, 7 }, // Triple Mushroom - { 0, 0, 0, 2, 4, 4, 2, 0 }, // Mega Mushroom - { 0, 0, 0, 0, 4, 8, 15, 24 }, // Gold Mushroom - { 0, 0, 0, 0, 0, 2, 5, 9 }, // Star - { 4, 2, 0, 0, 0, 0, 0, 0 }, // Triple Banana - { 7, 4, 2, 0, 0, 0, 0, 0 }, // Fake Item - { 15, 5, 4, 0, 0, 0, 0, 0 }, // Banana - { 10, 7, 5, 2, 0, 0, 0, 0 }, // Green Shell - { 3, 9, 8, 7, 5, 0, 0, 0 }, // Red Shell - { 0, 1, 4, 6, 4, 0, 0, 0 }, // Triple Green Shell - { 0, 0, 2, 3, 0, 0, 0, 0 }, // Bob-omb - { 0, 0, 1, 3, 3, 0, 0, 0 }, // Blue Shell - { 0, 0, 0, 2, 5, 3, 0, 0 }, // Fire Flower - { 0, 0, 0, 0, 3, 3, 0, 0 }, // Triple Red Shell - { 0, 0, 0, 0, 0, 5, 7, 0 } // Lightning - }, //1st 2nd 3rd 4th 5th 6th 7th 8th // - - // 9 Active Players - { //1st 2nd 3rd 4th 5th 6th 7th 8th 9th // - { 1, 3, 2, 0, 0, 0, 0, 0, 0 }, // Magnet - { 0, 2, 2, 3, 0, 0, 0, 0, 0 }, // Boo - { 0, 7, 9, 10, 8, 0, 0, 0, 0 }, // Mushroom - { 0, 0, 3, 7, 10, 17, 16, 12, 0 }, // Triple Mushroom - { 0, 0, 0, 0, 2, 4, 6, 0, 0 }, // Mega Mushroom - { 0, 0, 0, 0, 0, 4, 8, 15, 29 }, // Gold Mushroom - { 0, 0, 0, 0, 0, 0, 3, 6, 11 }, // Star - { 4, 2, 0, 0, 0, 0, 0, 0, 0 }, // Triple Banana - { 7, 4, 2, 0, 0, 0, 0, 0, 0 }, // Fake Item - { 15, 6, 5, 2, 0, 0, 0, 0, 0 }, // Banana - { 10, 7, 5, 2, 0, 0, 0, 0, 0 }, // Green Shell - { 3, 9, 8, 7, 6, 0, 0, 0, 0 }, // Red Shell - { 0, 0, 2, 4, 6, 4, 0, 0, 0 }, // Triple Green Shell - { 0, 0, 2, 3, 0, 0, 0, 0, 0 }, // Bob-omb - { 0, 0, 0, 2, 3, 3, 0, 0, 0 }, // Blue Shell - { 0, 0, 0, 0, 3, 5, 0, 0, 0 }, // Fire Flower - { 0, 0, 0, 0, 2, 3, 2, 0, 0 }, // Triple Red Shell - { 0, 0, 0, 0, 0, 0, 5, 7, 0 } // Lightning - }, //1st 2nd 3rd 4th 5th 6th 7th 8th 9th // - - // 10 Active Players - { //1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10t // - { 1, 3, 2, 0, 0, 0, 0, 0, 0, 0 }, // Magnet - { 0, 2, 3, 3, 0, 0, 0, 0, 0, 0 }, // Boo - { 0, 7, 8, 10, 8, 0, 0, 0, 0, 0 }, // Mushroom - { 0, 0, 2, 5, 9, 14, 16, 14, 9, 0 }, // Triple Mushroom - { 0, 0, 0, 0, 2, 4, 6, 5, 0, 0 }, // Mega Mushroom - { 0, 0, 0, 0, 0, 4, 5, 10, 16, 28 }, // Gold Mushroom - { 0, 0, 0, 0, 0, 0, 2, 4, 7, 12 }, // Star - { 4, 2, 0, 0, 0, 0, 0, 0, 0, 0 }, // Triple Banana - { 7, 4, 2, 0, 0, 0, 0, 0, 0, 0 }, // Fake Item - { 15, 6, 5, 2, 0, 0, 0, 0, 0, 0 }, // Banana - { 10, 7, 6, 4, 2, 0, 0, 0, 0, 0 }, // Green Shell - { 3, 9, 8, 7, 6, 3, 0, 0, 0, 0 }, // Red Shell - { 0, 0, 2, 4, 6, 4, 0, 0, 0, 0 }, // Triple Green Shell - { 0, 0, 2, 3, 1, 0, 0, 0, 0, 0 }, // Bob-omb - { 0, 0, 0, 2, 3, 3, 0, 0, 0, 0 }, // Blue Shell - { 0, 0, 0, 0, 3, 6, 4, 0, 0, 0 }, // Fire Flower - { 0, 0, 0, 0, 0, 2, 3, 1, 0, 0 }, // Triple Red Shell - { 0, 0, 0, 0, 0, 0, 4, 6, 8, 0 } // Lightning - }, //1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10t // - - // 11 Active Players - { //1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10t 11t // - { 1, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0 }, // Magnet - { 0, 2, 3, 3, 0, 0, 0, 0, 0, 0, 0 }, // Boo - { 0, 6, 8, 9, 8, 6, 0, 0, 0, 0, 0 }, // Mushroom - { 0, 0, 2, 5, 9, 10, 15, 17, 14, 10, 0 }, // Triple Mushroom - { 0, 0, 0, 0, 2, 3, 6, 6, 4, 0, 0 }, // Mega Mushroom - { 0, 0, 0, 0, 0, 0, 4, 5, 11, 15, 18 }, // Gold Mushroom - { 0, 0, 0, 0, 0, 0, 0, 3, 5, 7, 12 }, // Star - { 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Triple Banana - { 7, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0 }, // Fake Item - { 15, 7, 5, 2, 0, 0, 0, 0, 0, 0, 0 }, // Banana - { 10, 8, 6, 4, 2, 0, 0, 0, 0, 0, 0 }, // Green Shell - { 3, 9, 8, 7, 6, 4, 0, 0, 0, 0, 0 }, // Red Shell - { 0, 0, 2, 4, 6, 6, 5, 0, 0, 0, 0 }, // Triple Green Shell - { 0, 0, 2, 3, 1, 0, 0, 0, 0, 0, 0 }, // Bob-omb - { 0, 0, 0, 2, 3, 3, 2, 0, 0, 0, 0 }, // Blue Shell - { 0, 0, 0, 0, 3, 6, 5, 3, 0, 0, 0 }, // Fire Flower - { 0, 0, 0, 0, 0, 2, 3, 2, 0, 0, 0 }, // Triple Red Shell - { 0, 0, 0, 0, 0, 0, 0, 4, 6, 8, 0 } // Lightning - }, //1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10t 11t // - - // 12 Active Players - { //1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10t 11t 12t // - { 1, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Magnet - { 0, 2, 3, 3, 2, 0, 0, 0, 0, 0, 0, 0 }, // Boo - { 0, 6, 8, 9, 10, 8, 0, 0, 0, 0, 0, 0 }, // Mushroom - { 0, 0, 1, 4, 9, 11, 15, 17, 15, 11, 6, 0 }, // Triple Mushroom - { 0, 0, 0, 0, 0, 2, 4, 6, 7, 5, 0, 0 }, // Mega Mushroom - { 0, 0, 0, 0, 0, 0, 3, 5, 9, 13, 18, 28 }, // Gold Mushroom - { 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 8, 12 }, // Star - { 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Triple Banana - { 7, 4, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, // Fake Item - { 15, 7, 6, 3, 2, 0, 0, 0, 0, 0, 0, 0 }, // Banana - { 10, 7, 6, 4, 2, 0, 0, 0, 0, 0, 0, 0 }, // Green Shell - { 3, 9, 8, 7, 6, 5, 2, 0, 0, 0, 0, 0 }, // Red Shell - { 0, 0, 2, 4, 5, 7, 5, 3, 0, 0, 0, 0 }, // Triple Green Shell - { 0, 0, 2, 3, 1, 0, 0, 0, 0, 0, 0, 0 }, // Bob-omb - { 0, 0, 0, 2, 3, 3, 3, 2, 0, 0, 0, 0 }, // Blue Shell - { 0, 0, 0, 0, 0, 2, 5, 4, 0, 0, 0, 0 }, // Fire Flower - { 0, 0, 0, 0, 0, 2, 3, 3, 2, 0, 0, 0 }, // Triple Red Shell - { 0, 0, 0, 0, 0, 0, 0, 0, 4, 6, 8, 0 } // Lightning - }, //1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10t 11t 12t // - - // 13 Active Players - { //1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10t 11t 12t 13t // - { 1, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Magnet - { 0, 2, 4, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0 }, // Boo - { 0, 5, 8, 9, 10, 8, 5, 0, 0, 0, 0, 0, 0 }, // Mushroom - { 0, 0, 0, 2, 6, 9, 11, 15, 16, 14, 11, 10, 0 }, // Triple Mushroom - { 0, 0, 0, 0, 0, 2, 5, 6, 8, 6, 3, 0, 0 }, // Mega Mushroom - { 0, 0, 0, 0, 0, 0, 0, 4, 5, 8, 11, 20, 27 }, // Gold Mushroom - { 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 5, 10, 13 }, // Star - { 4, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Triple Banana - { 7, 4, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Fake Item - { 15, 7, 6, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0 }, // Banana - { 10, 8, 6, 4, 3, 2, 0, 0, 0, 0, 0, 0, 0 }, // Green Shell - { 3, 9, 8, 7, 6, 5, 2, 0, 0, 0, 0, 0, 0 }, // Red Shell - { 0, 0, 2, 4, 5, 7, 6, 5, 0, 0, 0, 0, 0 }, // Triple Green Shell - { 0, 0, 0, 2, 3, 1, 0, 0, 0, 0, 0, 0, 0 }, // Bob-omb - { 0, 0, 0, 2, 3, 3, 3, 2, 0, 0, 0, 0, 0 }, // Blue Shell - { 0, 0, 0, 0, 0, 3, 6, 5, 3, 0, 0, 0, 0 }, // Fire Flower - { 0, 0, 0, 0, 0, 0, 2, 3, 3, 2, 0, 0, 0 }, // Triple Red Shell - { 0, 0, 0, 0, 0, 0, 0, 0, 3, 7, 10, 0, 0 } // Lightning - }, //1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10t 11t 12t 13t // - - // 14 Active Players - { //1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10t 11t 12t 13t 14t // - { 1, 2, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Magnet - { 0, 2, 4, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Boo - { 0, 5, 7, 9, 11, 8, 5, 0, 0, 0, 0, 0, 0, 0 }, // Mushroom - { 0, 0, 0, 2, 6, 9, 10, 12, 17, 15, 14, 12, 8, 0 }, // Triple Mushroom - { 0, 0, 0, 0, 0, 2, 5, 6, 8, 7, 3, 0, 0, 0 }, // Mega Mushroom - { 0, 0, 0, 0, 0, 0, 0, 3, 5, 8, 11, 13, 22, 27 }, // Gold Mushroom - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 5, 10, 13 }, // Star - { 4, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Triple Banana - { 7, 4, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Fake Item - { 15, 7, 6, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Banana - { 10, 8, 6, 4, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0 }, // Green Shell - { 3, 10, 8, 7, 6, 5, 3, 2, 0, 0, 0, 0, 0, 0 }, // Red Shell - { 0, 0, 2, 4, 5, 7, 6, 5, 2, 0, 0, 0, 0, 0 }, // Triple Green Shell - { 0, 0, 0, 2, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, // Bob-omb - { 0, 0, 0, 0, 2, 3, 4, 3, 1, 0, 0, 0, 0, 0 }, // Blue Shell - { 0, 0, 0, 0, 0, 3, 5, 6, 4, 2, 0, 0, 0, 0 }, // Fire Flower - { 0, 0, 0, 0, 0, 0, 2, 3, 3, 3, 2, 0, 0, 0 }, // Triple Red Shell - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 7, 10, 0, 0 } // Lightning - }, //1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10t 11t 12t 13t 14t // - - // 15 Active Players - { //1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10t 11t 12t 13t 14t 15t // - { 1, 2, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Magnet - { 0, 2, 4, 4, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Boo - { 0, 4, 6, 8, 10, 9, 8, 4, 0, 0, 0, 0, 0, 0, 0 }, // Mushroom - { 0, 0, 0, 2, 4, 8, 11, 13, 17, 18, 15, 13, 9, 8, 0 }, // Triple Mushroom - { 0, 0, 0, 0, 0, 0, 2, 5, 6, 8, 7, 3, 0, 0, 0 }, // Mega Mushroom - { 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 8, 11, 13, 22, 27 }, // Gold Mushroom - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 5, 7, 10, 13 }, // Star - { 4, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Triple Banana - { 7, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Fake Item - { 15, 8, 6, 4, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Banana - { 10, 8, 6, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, // Green Shell - { 3, 10, 9, 8, 7, 6, 4, 3, 0, 0, 0, 0, 0, 0, 0 }, // Red Shell - { 0, 0, 2, 4, 5, 7, 6, 5, 3, 0, 0, 0, 0, 0, 0 }, // Triple Green Shell - { 0, 0, 0, 2, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, // Bob-omb - { 0, 0, 0, 0, 2, 3, 4, 3, 2, 0, 0, 0, 0, 0, 0 }, // Blue Shell - { 0, 0, 0, 0, 0, 0, 3, 5, 6, 2, 0, 0, 0, 0, 0 }, // Fire Flower - { 0, 0, 0, 0, 0, 0, 0, 2, 3, 3, 2, 0, 0, 0, 0 }, // Triple Red Shell - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 8, 11, 0, 0 } // Lightning - }, //1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10t 11t 12t 13t 14t 15t // - - // 16 Active Players - { //1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10t 11t 12t 13t 14t 15t 16t // - { 1, 2, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Magnet - { 0, 2, 4, 4, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Boo - { 0, 4, 6, 8, 10, 9, 7, 4, 0, 0, 0, 0, 0, 0, 0, 0 }, // Mushroom - { 0, 0, 0, 2, 4, 7, 10, 13, 16, 18, 15, 14, 12, 8, 7, 0 }, // Triple Mushroom - { 0, 0, 0, 0, 0, 0, 2, 5, 6, 8, 8, 5, 2, 0, 0, 0 }, // Mega Mushroom - { 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 8, 11, 13, 14, 23, 27 }, // Gold Mushroom - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 5, 7, 10, 13 }, // Star - { 4, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Triple Banana - { 7, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Fake Item - { 15, 8, 6, 4, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Banana - { 10, 8, 6, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Green Shell - { 3, 10, 9, 8, 7, 6, 5, 3, 2, 0, 0, 0, 0, 0, 0, 0 }, // Red Shell - { 0, 0, 2, 4, 5, 8, 7, 5, 3, 2, 0, 0, 0, 0, 0, 0 }, // Triple Green Shell - { 0, 0, 0, 2, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Bob-omb - { 0, 0, 0, 0, 2, 3, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0 }, // Blue Shell - { 0, 0, 0, 0, 0, 0, 3, 5, 6, 4, 2, 0, 0, 0, 0, 0 }, // Fire Flower - { 0, 0, 0, 0, 0, 0, 0, 2, 3, 3, 3, 2, 0, 0, 0, 0 }, // Triple Red Shell - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 8, 11, 0, 0 } // Lightning - } //1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10t 11t 12t 13t 14t 15t 16t // -}; -*/ - // Less ugly 2D arrays static INT32 K_KartItemOddsDistance_Retro[NUMKARTITEMS][9] = { @@ -842,133 +508,7 @@ static void K_KartGetItemResult(player_t *player, fixed_t getitem, boolean retro \param player player object passed from P_KartPlayerThink \return void -/ -static void K_KartItemRouletteByPosition(player_t *player, ticcmd_t *cmd) -{ - INT32 i; - INT32 pingame = 0, pexiting = 0; - INT32 roulettestop; - INT32 prandom; - INT32 ppos = player->kartstuff[k_position] - 1; - INT32 spawnchance[NUMKARTITEMS * NUMKARTODDS]; - INT32 chance = 0, numchoices = 0; - - - // This makes the roulette cycle through items - if this is 0, you shouldn't be here. - if (player->kartstuff[k_itemroulette]) - player->kartstuff[k_itemroulette]++; - else - return; - - // This makes the roulette produce the random noises. - if ((player->kartstuff[k_itemroulette] % 3) == 1 && P_IsLocalPlayer(player)) - S_StartSound(NULL,sfx_mkitm1 + ((player->kartstuff[k_itemroulette] / 3) % 8)); - - // Initializes existing spawnchance values - for (i = 0; i < (NUMKARTITEMS * NUMKARTODDS); i++) - spawnchance[i] = 0; - - // Gotta check how many players are active at this moment. - for (i = 0; i < MAXPLAYERS; i++) - { - if (playeringame[i] && !players[i].spectator) - pingame++; - if (players[i].exiting) - pexiting++; - } - - roulettestop = (TICRATE*1) + (3*(pingame - player->kartstuff[k_position])); - - // If the roulette finishes or the player presses BT_ATTACK, stop the roulette and calculate the item. - // I'm returning via the exact opposite, however, to forgo having another bracket embed. Same result either way, I think. - // Finally, if you get past this check, now you can actually start calculating what item you get. - if (!(player->kartstuff[k_itemroulette] >= (TICRATE*3) - || ((cmd->buttons & BT_ATTACK) && player->kartstuff[k_itemroulette] >= roulettestop))) - return; - - if (cmd->buttons & BT_ATTACK) - player->pflags |= PF_ATTACKDOWN; - - player->kartstuff[k_itemclose] = 0; // Reset the item window closer. - - // Tiny catcher in case player position is unset. - if (ppos < 0) ppos = 0; - -#define SETITEMRESULT(pos, numplayers, itemnum) \ - for (chance = 0; chance < K_KartItemOddsPosition_Retro[numplayers-1][itemnum-1][pos]; chance++) spawnchance[numchoices++] = itemnum - - // Check the game type to differentiate odds. - //if (gametype == GT_RETRO) - //{ - if (cv_magnet.value) SETITEMRESULT(ppos, pingame, 1); // Magnet - if (cv_boo.value) SETITEMRESULT(ppos, pingame, 2); // Boo - if (cv_mushroom.value) SETITEMRESULT(ppos, pingame, 3); // Mushroom - if (cv_mushroom.value) SETITEMRESULT(ppos, pingame, 4); // Triple Mushroom - if (cv_megashroom.value) SETITEMRESULT(ppos, pingame, 5); // Mega Mushroom - if (cv_goldshroom.value) SETITEMRESULT(ppos, pingame, 6); // Gold Mushroom - if (cv_star.value) SETITEMRESULT(ppos, pingame, 7); // Star - if (cv_triplebanana.value) SETITEMRESULT(ppos, pingame, 8); // Triple Banana - if (cv_fakeitem.value) SETITEMRESULT(ppos, pingame, 9); // Fake Item - if (cv_banana.value) SETITEMRESULT(ppos, pingame, 10); // Banana - if (cv_greenshell.value) SETITEMRESULT(ppos, pingame, 11); // Green Shell - if (cv_redshell.value) SETITEMRESULT(ppos, pingame, 12); // Red Shell - if (cv_triplegreenshell.value) SETITEMRESULT(ppos, pingame, 13); // Triple Green Shell - if (cv_bobomb.value) SETITEMRESULT(ppos, pingame, 14); // Bob-omb - if (cv_blueshell.value && pexiting == 0) SETITEMRESULT(ppos, pingame, 15); // Blue Shell - //if (cv_fireflower.value) SETITEMRESULT(ppos, pingame, 16); // Fire Flower - if (cv_tripleredshell.value) SETITEMRESULT(ppos, pingame, 17); // Triple Red Shell - if (cv_lightning.value && pingame > pexiting) SETITEMRESULT(ppos, pingame, 18); // Lightning - - prandom = P_RandomKey(numchoices); - - // Award the player whatever power is rolled - if (numchoices > 0) - K_KartGetItemResult(player, spawnchance[prandom], true); - else - CONS_Printf("ERROR: P_KartItemRoulette - There were no choices given by the roulette (ppos = %d).\n", ppos); - //} - //else if (gametype == GT_NEO) - { - if (cv_magnet.value) SETITEMRESULT(ppos, pingame, 1) // Electro-Shield - if (cv_boo.value) SETITEMRESULT(ppos, pingame, 2) // S3K Ghost - if (cv_mushroom.value) SETITEMRESULT(ppos, pingame, 3) // Speed Shoe - if (cv_mushroom.value) SETITEMRESULT(ppos, pingame, 4) // Triple Speed Shoe - if (cv_megashroom.value) SETITEMRESULT(ppos, pingame, 5) // Size-Up Monitor - if (cv_goldshroom.value) SETITEMRESULT(ppos, pingame, 6) // Rocket Shoe - if (cv_star.value) SETITEMRESULT(ppos, pingame, 7) // Invincibility - if (cv_triplebanana.value) SETITEMRESULT(ppos, pingame, 8) // Triple Banana - if (cv_fakeitem.value) SETITEMRESULT(ppos, pingame, 9) // Eggman Monitor - if (cv_banana.value) SETITEMRESULT(ppos, pingame, 10) // Banana - if (cv_greenshell.value) SETITEMRESULT(ppos, pingame, 11) // 1x Orbinaut - if (cv_redshell.value) SETITEMRESULT(ppos, pingame, 12) // 1x Jaws - if (cv_laserwisp.value) SETITEMRESULT(ppos, pingame, 13) // Laser Wisp - if (cv_triplegreenshell.value) SETITEMRESULT(ppos, pingame, 14) // 3x Orbinaut - if (cv_bobomb.value) SETITEMRESULT(ppos, pingame, 15) // Specialstage Mines - if (cv_blueshell.value && pexiting == 0) SETITEMRESULT(ppos, pingame, 16) // Deton - if (cv_jaws.value) SETITEMRESULT(ppos, pingame, 17) // 2x Jaws - if (cv_lightning.value && pingame > pexiting) SETITEMRESULT(ppos, pingame, 18) // Size-Down Monitor - - prandom = P_RandomKey(numchoices); - - // Award the player whatever power is rolled - if (numchoices > 0) - K_KartGetItemResult(player, spawnchance[prandom], false) - else - CONS_Printf("ERROR: P_KartItemRoulette - There were no choices given by the roulette (ppos = %d).\n", ppos); - } - else - CONS_Printf("ERROR: P_KartItemRoulette - There's no applicable game type!\n"); - // - -#undef SETITEMRESULT - - player->kartstuff[k_itemroulette] = 0; // Since we're done, clear the roulette number - - if (P_IsLocalPlayer(player)) - S_StartSound(NULL, sfx_mkitmF); -}*/ - -//} +*/ static INT32 K_KartGetItemOdds(INT32 pos, INT32 itemnum) { @@ -4061,7 +3601,7 @@ void K_LoadKartHUDGraphics(void) { for (j = 0; j < NUMPOSFRAMES; j++) { - if (i > 4 && j < 4 && j != 0) continue; // We don't need blue numbers for ranks past 4th + //if (i > 4 && j < 4 && j != 0) continue; // We don't need blue numbers for ranks past 4th sprintf(buffer, "K_POSN%d%d", i, j); kp_positionnum[i][j] = (patch_t *) W_CachePatchName(buffer, PU_HUDGFX); } @@ -4717,19 +4257,19 @@ static void K_DrawKartPositionNum(INT32 num) switch (leveltime % 9) { case 1: case 2: case 3: - if (stplyr->kartstuff[k_position] >= 4 || (splitscreen && stplyr->kartstuff[k_position] >= splitscreen+1)) + if (K_IsPlayerLosing(stplyr)) localpatch = kp_positionnum[num % 10][4]; else localpatch = kp_positionnum[num % 10][1]; break; case 4: case 5: case 6: - if (stplyr->kartstuff[k_position] >= 4 || (splitscreen && stplyr->kartstuff[k_position] >= splitscreen+1)) + if (K_IsPlayerLosing(stplyr)) localpatch = kp_positionnum[num % 10][5]; else localpatch = kp_positionnum[num % 10][2]; break; case 7: case 8: case 9: - if (stplyr->kartstuff[k_position] >= 4 || (splitscreen && stplyr->kartstuff[k_position] >= splitscreen+1)) + if (K_IsPlayerLosing(stplyr)) localpatch = kp_positionnum[num % 10][6]; else localpatch = kp_positionnum[num % 10][3]; diff --git a/src/k_kart.h b/src/k_kart.h index 11ec63c6..9d1cf08f 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -17,6 +17,7 @@ UINT8 K_GetKartColorByName(const char *name); void K_RegisterKartStuff(void); +boolean K_IsPlayerLosing(player_t *player); void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid); void K_LakituChecker(player_t *player); void K_KartMoveAnimation(player_t *player); diff --git a/src/p_spec.c b/src/p_spec.c index 1648829c..2042e492 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4204,13 +4204,13 @@ DoneSection2: { if (player->kartstuff[k_position] == 1) S_ChangeMusicInternal("karwin", true); - else if (player->kartstuff[k_position] == 2 || player->kartstuff[k_position] == 3) - S_ChangeMusicInternal("karok", true); - else if (player->kartstuff[k_position] >= 4) + else if (K_IsPlayerLosing(player)) S_ChangeMusicInternal("karlos", true); + else + S_ChangeMusicInternal("karok", true); } else - S_ChangeMusicInternal("karwin", true); + S_ChangeMusicInternal("karok", true); // //HU_SetCEchoFlags(0); //HU_SetCEchoDuration(5); diff --git a/src/p_user.c b/src/p_user.c index 75c98f58..f873f1a3 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1676,13 +1676,13 @@ void P_DoPlayerExit(player_t *player) { if (player->kartstuff[k_position] == 1) S_ChangeMusicInternal("karwin", true); - else if (player->kartstuff[k_position] == 2 || player->kartstuff[k_position] == 3) - S_ChangeMusicInternal("karok", true); - else if (player->kartstuff[k_position] >= 4) + else if (K_IsPlayerLosing(player)) S_ChangeMusicInternal("karlos", true); + else + S_ChangeMusicInternal("karok", true); } else - S_ChangeMusicInternal("karwin", true); + S_ChangeMusicInternal("karok", true); } player->exiting = 3*TICRATE; From da32f9a4ed46c609aa4af7ad30649c9abd0a530f Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 20 Feb 2018 19:33:50 -0500 Subject: [PATCH 11/41] Fixed fourth taunt sound not playing % 4 would output 0 to 3, not 1 to 4 guys :V --- src/k_kart.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index b767e731..95602ca2 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1192,16 +1192,16 @@ static void K_PlayTauntSound(mobj_t *source) { switch (P_RandomFixed() % 4) { - case 1: + case 0: S_StartSound(source, sfx_taunt1); return; - case 2: + case 1: S_StartSound(source, sfx_taunt2); return; - case 3: + case 2: S_StartSound(source, sfx_taunt3); return; - case 4: + case 3: S_StartSound(source, sfx_taunt4); return; } From 6d3d098c3f982e7447aabfcfce95dc7156191c6f Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 20 Feb 2018 20:04:33 -0500 Subject: [PATCH 12/41] Fixed stereoreverse, and its effects are applied to mirror mode How long has this cvar been broken?! --- src/s_sound.c | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/src/s_sound.c b/src/s_sound.c index e63aca15..cb310176 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -391,7 +391,7 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume) { INT32 sep, pitch, priority, cnum; sfxinfo_t *sfx; - + const boolean reverse = (stereoreverse.value ^ mirrormode); const mobj_t *origin = (const mobj_t *)origin_p; listener_t listener = {0,0,0,0}; @@ -572,14 +572,13 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume) if (sfx->usefulness++ < 0) sfx->usefulness = -1; -#ifdef SURROUND // Avoid channel reverse if surround - if (stereoreverse.value && sep != SURROUND_SEP) - sep = (~sep) & 255; -#else - if (stereoreverse.value) - sep = (~sep) & 255; + if (reverse +#ifdef SURROUND + && sep != SURROUND_SEP #endif + ) + sep = (~sep) & 255; // Assigns the handle to one of the channels in the // mix/output buffer. @@ -627,14 +626,13 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume) if (sfx->usefulness++ < 0) sfx->usefulness = -1; -#ifdef SURROUND // Avoid channel reverse if surround - if (stereoreverse.value && sep != SURROUND_SEP) - sep = (~sep) & 255; -#else - if (stereoreverse.value) - sep = (~sep) & 255; + if (reverse +#ifdef SURROUND + && sep != SURROUND_SEP #endif + ) + sep = (~sep) & 255; // Assigns the handle to one of the channels in the // mix/output buffer. @@ -682,14 +680,13 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume) if (sfx->usefulness++ < 0) sfx->usefulness = -1; -#ifdef SURROUND // Avoid channel reverse if surround - if (stereoreverse.value && sep != SURROUND_SEP) - sep = (~sep) & 255; -#else - if (stereoreverse.value) - sep = (~sep) & 255; + if (reverse +#ifdef SURROUND + && sep != SURROUND_SEP #endif + ) + sep = (~sep) & 255; // Assigns the handle to one of the channels in the // mix/output buffer. @@ -732,14 +729,13 @@ dontplay: if (sfx->usefulness++ < 0) sfx->usefulness = -1; -#ifdef SURROUND // Avoid channel reverse if surround - if (stereoreverse.value && sep != SURROUND_SEP) - sep = (~sep) & 255; -#else - if (stereoreverse.value) - sep = (~sep) & 255; + if (reverse +#ifdef SURROUND + && sep != SURROUND_SEP #endif + ) + sep = (~sep) & 255; // Assigns the handle to one of the channels in the // mix/output buffer. @@ -1212,6 +1208,8 @@ INT32 S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32 *v listener_t listensource; + const boolean reverse = (stereoreverse.value ^ mirrormode); + (void)pitch; if (!listener) return false; @@ -1309,6 +1307,9 @@ INT32 S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32 *v else angle = angle + InvAngle(listensource.angle); + if (reverse) + angle = InvAngle(angle); + #ifdef SURROUND // Produce a surround sound for angle from 105 till 255 if (surround.value == 1 && (angle > ANG105 && angle < ANG255 )) From cb593aa2b1839e0e514bf3dd8d61a555fe33bf6e Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 20 Feb 2018 20:08:53 -0500 Subject: [PATCH 13/41] Battle Mode wins award (player count * 2) points now --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index 95602ca2..4f36b3cc 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3426,7 +3426,7 @@ void K_CheckBalloons(void) if (playeringame[winnernum]) { P_AddPlayerScore(&players[winnernum], numingame); - CONS_Printf(M_GetText("%s recieved %d points for winning!\n"), player_names[winnernum], numingame); // numingame/2 == 1 ? "" : "s" + CONS_Printf(M_GetText("%s recieved %d points for winning!\n"), player_names[winnernum], numingame*2); } for (i = 0; i < MAXPLAYERS; i++) From dbc27e9c9e1e3dee85d5cece519e9f7f49d16ae9 Mon Sep 17 00:00:00 2001 From: Sryder Date: Fri, 23 Feb 2018 01:04:52 +0000 Subject: [PATCH 14/41] It's SINT8 not INT8 --- src/d_netcmd.c | 16 ++++++++-------- src/d_netcmd.h | 2 +- src/doomstat.h | 6 +++--- src/g_game.c | 8 ++++---- src/y_inter.c | 8 ++++---- src/y_inter.h | 2 +- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 10ce175e..b7b67f2c 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1973,7 +1973,7 @@ void D_SetupVote(void) SendNetXCmd(XD_SETUPVOTE, buf, p - buf); } -void D_ModifyClientVote(INT8 voted) +void D_ModifyClientVote(SINT8 voted) { XBOXSTATIC UINT8 buf[1]; buf[0] = (UINT8)(voted+1); @@ -4599,14 +4599,14 @@ static void Got_SetupVotecmd(UINT8 **cp, INT32 playernum) static void Got_ModifyVotecmd(UINT8 **cp, INT32 playernum) { - INT8 voted = READUINT8(*cp); - votes[playernum] = (INT8)(voted-1); + SINT8 voted = READSINT8(*cp); + votes[playernum] = (SINT8)(voted-1); } static void Got_PickVotecmd(UINT8 **cp, INT32 playernum) { - INT8 pick = READUINT8(*cp); - INT8 level = READUINT8(*cp); + SINT8 pick = READSINT8(*cp); + SINT8 level = READSINT8(*cp); if (playernum != serverplayer && !IsPlayerAdmin(playernum)) { @@ -4622,7 +4622,7 @@ static void Got_PickVotecmd(UINT8 **cp, INT32 playernum) return; } - Y_SetupVoteFinish((INT8)pick, (INT8)level); + Y_SetupVoteFinish((SINT8)pick, (SINT8)level); } /** Prints the number of the displayplayer. @@ -4712,7 +4712,7 @@ static void Command_RestartAudio_f(void) I_ShutdownSound(); I_StartupSound(); I_InitMusic(); - + // These must be called or no sound and music until manually set. I_SetSfxVolume(cv_soundvolume.value); @@ -4720,7 +4720,7 @@ static void Command_RestartAudio_f(void) I_SetMIDIMusicVolume(cv_midimusicvolume.value); if (Playing()) // Gotta make sure the player is in a level P_RestoreMusic(&players[consoleplayer]); - + } /** Quits a game and returns to the title screen. diff --git a/src/d_netcmd.h b/src/d_netcmd.h index f1c6790c..53132d74 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -252,7 +252,7 @@ void Command_Retry_f(void); void D_GameTypeChanged(INT32 lastgametype); // not a real _OnChange function anymore void D_MapChange(INT32 pmapnum, INT32 pgametype, boolean pultmode, boolean presetplayers, INT32 pdelay, boolean pskipprecutscene, boolean pfromlevelselect); void D_SetupVote(void); -void D_ModifyClientVote(INT8 voted); +void D_ModifyClientVote(SINT8 voted); void D_PickVote(void); void ObjectPlace_OnChange(void); boolean IsPlayerAdmin(INT32 playernum); diff --git a/src/doomstat.h b/src/doomstat.h index 785998ae..41a3656f 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -254,7 +254,7 @@ typedef struct // SRB2kart //boolean automap; ///< Displays a level's white map outline in modified games - fixed_t mobj_scale; ///< Replacement for TOL_ERZ3 + fixed_t mobj_scale; ///< Replacement for TOL_ERZ3 // Lua stuff. // (This is not ifdeffed so the map header structure can stay identical, just in case.) @@ -450,8 +450,8 @@ extern boolean comebackshowninfo; extern tic_t curlap, bestlap; extern INT16 votelevels[4]; -extern INT8 votes[MAXPLAYERS]; -extern INT8 pickedvote; +extern SINT8 votes[MAXPLAYERS]; +extern SINT8 pickedvote; extern tic_t hidetime; diff --git a/src/g_game.c b/src/g_game.c index 7582006b..3d7d5d42 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -249,8 +249,8 @@ boolean comeback; // Battle Mode's karma comeback is on/off // Voting system INT16 votelevels[4]; // Levels that were rolled by the host -INT8 votes[MAXPLAYERS]; // Each player's vote -INT8 pickedvote; // What vote the host rolls +SINT8 votes[MAXPLAYERS]; // Each player's vote +SINT8 pickedvote; // What vote the host rolls // Client-sided variables (NEVER use in anything that needs to be synced with other players) boolean legitimateexit; // Did this client actually finish the match? @@ -1407,7 +1407,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) // drift button if (InputDown(gc_drift, ssplayer)) cmd->buttons |= BT_DRIFT; - + // Lua scriptable buttons if (InputDown(gc_custom1, ssplayer)) cmd->buttons |= BT_CUSTOM1; @@ -3142,7 +3142,7 @@ INT16 G_RandMap(INT16 tolflags, INT16 pprevmap, boolean dontadd, boolean ignoreb } } } - + if (isokmap) okmaps[numokmaps++] = ix; } diff --git a/src/y_inter.c b/src/y_inter.c index 26c52051..e1bf1e5e 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -177,7 +177,7 @@ typedef struct typedef struct { - INT8 selection; + SINT8 selection; UINT8 delay; UINT8 ranim; UINT8 rtics; @@ -1351,7 +1351,7 @@ void Y_StartIntermission(void) { // setup time data data.coop.tics = players[consoleplayer].realtime; - + // Update visitation flags mapvisited[gamemap-1] |= MV_BEATEN; if (ALL7EMERALDS(emeralds)) @@ -1364,7 +1364,7 @@ void Y_StartIntermission(void) if (modeattacking == ATTACKING_RECORD) Y_UpdateRecordReplays(); } - + // Calculate who won Y_CalculateTournamentPoints(); @@ -2497,7 +2497,7 @@ static void Y_UnloadVoteData(void) // // Y_SetupVoteFinish // -void Y_SetupVoteFinish(INT8 pick, INT8 level) +void Y_SetupVoteFinish(SINT8 pick, SINT8 level) { if (pickedvote == -1) { diff --git a/src/y_inter.h b/src/y_inter.h index 6ba83583..6171f42b 100644 --- a/src/y_inter.h +++ b/src/y_inter.h @@ -21,7 +21,7 @@ void Y_VoteDrawer(void); void Y_VoteTicker(void); void Y_StartVote(void); void Y_EndVote(void); -void Y_SetupVoteFinish(INT8 pick, INT8 level); +void Y_SetupVoteFinish(SINT8 pick, SINT8 level); typedef enum { From 387f6b904cda9995d000887f2bf780d1092dd0c8 Mon Sep 17 00:00:00 2001 From: Sryder Date: Fri, 23 Feb 2018 01:11:31 +0000 Subject: [PATCH 15/41] I don't see a reason for this to be in caps, but it stops me compiling DEVELOP on linux so fix --- src/m_cheat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_cheat.c b/src/m_cheat.c index 6ad31d5b..b468d733 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -111,7 +111,7 @@ static UINT8 cheatf_devmode(void) G_SetGameModified(false); for (i = 0; i < MAXUNLOCKABLES; i++) unlockables[i].unlocked = true; - devparm = TRUE; + devparm = true; cv_debug |= 0x8000; // Refresh secrets menu existing. From 0454293baeca6681ab479ec898480797f82e5429 Mon Sep 17 00:00:00 2001 From: Sryder Date: Fri, 23 Feb 2018 01:53:30 +0000 Subject: [PATCH 16/41] Hopefully a few more fixes and sanity changes for map voting --- src/d_netcmd.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index b7b67f2c..09fa39ff 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1956,12 +1956,10 @@ void D_MapChange(INT32 mapnum, INT32 newgametype, boolean pultmode, boolean rese void D_SetupVote(void) { - XBOXSTATIC char buf[8]; - char *p; + char buf[8]; + char *p = buf; INT32 i; - p = buf; - for (i = 0; i < 4; i++) { if (i == 3) @@ -1975,16 +1973,19 @@ void D_SetupVote(void) void D_ModifyClientVote(SINT8 voted) { - XBOXSTATIC UINT8 buf[1]; - buf[0] = (UINT8)(voted+1); + char buf[1]; + char *p = buf; + + WRITESINT8(p, voted); SendNetXCmd(XD_MODIFYVOTE, &buf, 1); } void D_PickVote(void) { - XBOXSTATIC UINT8 buf[2]; - UINT8 temppicks[MAXPLAYERS]; - UINT8 templevels[MAXPLAYERS]; + char buf[2]; + char* p = buf; + SINT8 temppicks[MAXPLAYERS]; + SINT8 templevels[MAXPLAYERS]; UINT8 numvotes = 0, key = 0; INT32 i; @@ -1994,16 +1995,16 @@ void D_PickVote(void) continue; if (votes[i] != -1) { - temppicks[numvotes] = (UINT8)i; - templevels[numvotes] = (UINT8)votes[i]; + temppicks[numvotes] = i; + templevels[numvotes] = votes[i]; numvotes++; } } key = M_RandomKey(numvotes); - buf[0] = temppicks[key]; - buf[1] = templevels[key]; + WRITESINT8(p, temppicks[key]); + WRITESINT8(p, templevels[key]); SendNetXCmd(XD_PICKVOTE, &buf, 2); } @@ -4600,7 +4601,7 @@ static void Got_SetupVotecmd(UINT8 **cp, INT32 playernum) static void Got_ModifyVotecmd(UINT8 **cp, INT32 playernum) { SINT8 voted = READSINT8(*cp); - votes[playernum] = (SINT8)(voted-1); + votes[playernum] = voted; } static void Got_PickVotecmd(UINT8 **cp, INT32 playernum) @@ -4622,7 +4623,7 @@ static void Got_PickVotecmd(UINT8 **cp, INT32 playernum) return; } - Y_SetupVoteFinish((SINT8)pick, (SINT8)level); + Y_SetupVoteFinish(pick, level); } /** Prints the number of the displayplayer. From aa15b34a0863f26462bc90fc338cfd3f5bd9ef48 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 27 Feb 2018 19:53:12 -0500 Subject: [PATCH 17/41] Actual Race starts --- src/g_game.c | 38 ++++++++++++++++++++++++++++++-------- src/g_game.h | 2 +- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 3d7d5d42..2f148cda 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2611,7 +2611,7 @@ void G_SpawnPlayer(INT32 playernum, boolean starpost) { if (!(spawnpoint = G_FindCTFStart(playernum)) // find a CTF start && !(spawnpoint = G_FindMatchStart(playernum))) // find a DM start - spawnpoint = G_FindCoopStart(playernum); // fallback + spawnpoint = G_FindRaceStart(playernum); // fallback } // -- DM/Tag/CTF-spectator/etc -- @@ -2621,14 +2621,14 @@ void G_SpawnPlayer(INT32 playernum, boolean starpost) { if (!(spawnpoint = G_FindMatchStart(playernum)) // find a DM start && !(spawnpoint = G_FindCTFStart(playernum))) // find a CTF start - spawnpoint = G_FindCoopStart(playernum); // fallback + spawnpoint = G_FindRaceStart(playernum); // fallback } // -- Other game modes -- // Order: Coop->DM->CTF else { - if (!(spawnpoint = G_FindCoopStart(playernum)) // find a Co-op start + if (!(spawnpoint = G_FindRaceStart(playernum)) // find a Race start && !(spawnpoint = G_FindMatchStart(playernum))) // find a DM start spawnpoint = G_FindCTFStart(playernum); // fallback } @@ -2760,24 +2760,46 @@ mapthing_t *G_FindMatchStart(INT32 playernum) return NULL; } -mapthing_t *G_FindCoopStart(INT32 playernum) +mapthing_t *G_FindRaceStart(INT32 playernum) { if (numcoopstarts) { + INT32 i, pos = 0; + //if there's 6 players in a map with 3 player starts, this spawns them 1/2/3/1/2/3. - if (G_CheckSpot(playernum, playerstarts[playernum % numcoopstarts])) - return playerstarts[playernum % numcoopstarts]; + /*if (G_CheckSpot(playernum, playerstarts[playernum % numcoopstarts])) + return playerstarts[playernum % numcoopstarts];*/ + + // SRB2Kart: figure out player spawn pos from points + for (i = 0; i < MAXPLAYERS; i++) + { + if (i == playernum) + continue; + if (players[i].score > players[playernum]->score) + pos++; + } + + if (G_CheckSpot(playernum, playerstarts[pos % numcoopstarts])) + return playerstarts[pos % numcoopstarts]; //Don't bother checking to see if the player 1 start is open. //Just spawn there. - return playerstarts[0]; + //return playerstarts[0]; + + // SRB2Kart: We have solid players, so that is less ideal. + if (playernum == consoleplayer + || (splitscreen && playernum == secondarydisplayplayer) + || (splitscreen > 1 && playernum == thirddisplayplayer) + || (splitscreen > 2 && playernum == fourthdisplayplayer)) + CONS_Alert(CONS_WARNING, M_GetText("Could not spawn at any Race starts!\n")); + return NULL; } if (playernum == consoleplayer || (splitscreen && playernum == secondarydisplayplayer) || (splitscreen > 1 && playernum == thirddisplayplayer) || (splitscreen > 2 && playernum == fourthdisplayplayer)) - CONS_Alert(CONS_WARNING, M_GetText("No Co-op starts in this map!\n")); + CONS_Alert(CONS_WARNING, M_GetText("No Race starts in this map!\n")); return NULL; } diff --git a/src/g_game.h b/src/g_game.h index 8ea9d8f6..9e11727f 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -112,7 +112,7 @@ char *G_BuildMapTitle(INT32 mapnum); // XMOD spawning mapthing_t *G_FindCTFStart(INT32 playernum); mapthing_t *G_FindMatchStart(INT32 playernum); -mapthing_t *G_FindCoopStart(INT32 playernum); +mapthing_t *G_FindRaceStart(INT32 playernum); void G_SpawnPlayer(INT32 playernum, boolean starpost); // Can be called by the startup code or M_Responder. From adfe3337cb5682128dd563fc445047f13d623679 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 27 Feb 2018 20:40:06 -0500 Subject: [PATCH 18/41] Race position starts --- src/g_game.c | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 2f148cda..89725ce6 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2766,27 +2766,46 @@ mapthing_t *G_FindRaceStart(INT32 playernum) { INT32 i, pos = 0; - //if there's 6 players in a map with 3 player starts, this spawns them 1/2/3/1/2/3. - /*if (G_CheckSpot(playernum, playerstarts[playernum % numcoopstarts])) - return playerstarts[playernum % numcoopstarts];*/ - // SRB2Kart: figure out player spawn pos from points + if (!playeringame[playernum] || players[playernum].spectator) + return playerstarts[0]; // go to first spot if you're a spectator + for (i = 0; i < MAXPLAYERS; i++) { if (i == playernum) continue; - if (players[i].score > players[playernum]->score) + if (!playeringame[i] || players[i].spectator) + continue; + if (players[i].score > players[playernum].score) pos++; + if (i != 0) + { + INT32 j; + for (j = 0; j < i; j++) // I don't like loops in loops, but is needed to resolve ties :< + { + if (i == j) + continue; + if (!playeringame[j] || players[j].spectator) + continue; + if (players[i].score == players[j].score) + pos++; + } + } } if (G_CheckSpot(playernum, playerstarts[pos % numcoopstarts])) return playerstarts[pos % numcoopstarts]; - //Don't bother checking to see if the player 1 start is open. - //Just spawn there. + // Your spot isn't available? Go for the old behavior + // if there's 6 players in a map with 3 player starts, this spawns them 1/2/3/1/2/3. + if (G_CheckSpot(playernum, playerstarts[playernum % numcoopstarts])) + return playerstarts[playernum % numcoopstarts]; + + // SRB2Kart: We have solid players, so this behavior is less ideal. + // Don't bother checking to see if the player 1 start is open. + // Just spawn there. //return playerstarts[0]; - // SRB2Kart: We have solid players, so that is less ideal. if (playernum == consoleplayer || (splitscreen && playernum == secondarydisplayplayer) || (splitscreen > 1 && playernum == thirddisplayplayer) From 29e4c6764d574e49fd115583f39d9dfb9ee0dbb0 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 27 Feb 2018 20:46:01 -0500 Subject: [PATCH 19/41] Fixed an odd bug --- src/y_inter.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index e1bf1e5e..ed26e2f3 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -2368,18 +2368,29 @@ void Y_VoteTicker(void) if (server) { - if (splitscreen) - { - if (votes[0] == -1) - return; - } - else + if (timer == 0) { for (i = 0; i < MAXPLAYERS; i++) { if ((playeringame[i] && !players[i].spectator) && votes[i] == -1) + votes[i] = 3; + } + } + else + { + if (splitscreen) + { + if (votes[0] == -1) return; } + else + { + for (i = 0; i < MAXPLAYERS; i++) + { + if ((playeringame[i] && !players[i].spectator) && votes[i] == -1) + return; + } + } } timer = 0; From acb98b50c731d64136b3981525d3dadbe39563d9 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 27 Feb 2018 20:52:12 -0500 Subject: [PATCH 20/41] Another minor voting thing --- src/y_inter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index ed26e2f3..62f60388 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -2372,7 +2372,7 @@ void Y_VoteTicker(void) { for (i = 0; i < MAXPLAYERS; i++) { - if ((playeringame[i] && !players[i].spectator) && votes[i] == -1) + if ((playeringame[i] && !players[i].spectator) && votes[i] == -1 && !splitscreen) votes[i] = 3; } } @@ -2520,7 +2520,7 @@ void Y_SetupVoteFinish(SINT8 pick, SINT8 level) for (i = 0; i < MAXPLAYERS; i++) { - if ((playeringame[i] && !players[i].spectator) && votes[i] == -1) + if ((playeringame[i] && !players[i].spectator) && votes[i] == -1 && !splitscreen) votes[i] = 3; if (votes[i] == -1) From 0ed75724e6be12bc134a6ab00d198dca4e99e988 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 27 Feb 2018 21:17:34 -0500 Subject: [PATCH 21/41] Some offset adjustin' --- src/y_inter.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index 62f60388..8fdbac27 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -2188,7 +2188,7 @@ void Y_VoteDrawer(void) } x = 20; - y = 15; + y = 10; for (i = 0; i < MAXPLAYERS; i++) { @@ -2226,10 +2226,10 @@ void Y_VoteDrawer(void) y += 30; - if (y > BASEVIDHEIGHT-38) + if (y > BASEVIDHEIGHT-40) { - x += 100; - y = 15; + x += 60; + y = 10; } } From a144a04abb8967d808e382d7d0ccecda790fd390 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 27 Feb 2018 21:18:42 -0500 Subject: [PATCH 22/41] Taunt sound simplification --- src/k_kart.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index daddb0c0..8e06c527 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1190,21 +1190,7 @@ void K_KartPlayerAfterThink(player_t *player) static void K_PlayTauntSound(mobj_t *source) { - switch (P_RandomFixed() % 4) - { - case 0: - S_StartSound(source, sfx_taunt1); - return; - case 1: - S_StartSound(source, sfx_taunt2); - return; - case 2: - S_StartSound(source, sfx_taunt3); - return; - case 3: - S_StartSound(source, sfx_taunt4); - return; - } + S_StartSound(source, sfx_taunt1+P_RandomKey(4)); } void K_MomentumToFacing(player_t *player) From f0067d4719c6f87b7b1a10621c9ccfb77b2bc371 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 27 Feb 2018 22:07:20 -0500 Subject: [PATCH 23/41] Restore battle wait fade --- src/k_kart.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/k_kart.c b/src/k_kart.c index 8e06c527..104ed9cb 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4830,6 +4830,8 @@ static void K_drawBattleFullscreen(void) || stplyr == &players[thirddisplayplayer] || stplyr == &players[fourthdisplayplayer]) ty += (BASEVIDHEIGHT/2); } + else + V_DrawFadeScreen(); if (!comebackshowninfo) V_DrawFixedPatch(x< Date: Thu, 1 Mar 2018 17:05:36 -0500 Subject: [PATCH 24/41] Attempted to fix how voting handles no votes I don't know exactly what it did previously since I never actually observed what happens, but now in dedicated servers it will wait for time to run out, then if there's no votes by that time it will just go onto nextlevel --- src/d_netcmd.c | 12 ++++++++++-- src/y_inter.c | 26 ++++++++++++++++++++++---- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 09fa39ff..3099ca45 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -2003,8 +2003,16 @@ void D_PickVote(void) key = M_RandomKey(numvotes); - WRITESINT8(p, temppicks[key]); - WRITESINT8(p, templevels[key]); + if (numvotes > 0) + { + WRITESINT8(p, temppicks[key]); + WRITESINT8(p, templevels[key]); + } + else + { + WRITESINT8(p, -1); + WRITESINT8(p, 0); + } SendNetXCmd(XD_PICKVOTE, &buf, 2); } diff --git a/src/y_inter.c b/src/y_inter.c index 8fdbac27..ed651ce3 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -2510,11 +2510,19 @@ static void Y_UnloadVoteData(void) // void Y_SetupVoteFinish(SINT8 pick, SINT8 level) { + if (pick == -1) // No other votes? We gotta get out of here, then! + { + timer = 0; + Y_UnloadVoteData(); + Y_FollowIntermission(); + return; + } + if (pickedvote == -1) { INT32 i; SINT8 votecompare = -1; - boolean allsame = true; + INT32 endtype = 0; voteclient.rsynctime = 0; @@ -2523,16 +2531,26 @@ void Y_SetupVoteFinish(SINT8 pick, SINT8 level) if ((playeringame[i] && !players[i].spectator) && votes[i] == -1 && !splitscreen) votes[i] = 3; - if (votes[i] == -1) + if (votes[i] == -1 || endtype > 1) // Don't need to go on continue; if (votecompare == -1) + { votecompare = votes[i]; + endtype = 1; + } else if (votes[i] != votecompare) - allsame = false; + endtype = 2; } - if (allsame) + if (endtype == 0) // Might as well put this here, too. + { + timer = 0; + Y_UnloadVoteData(); + Y_FollowIntermission(); + return; + } + else if (endtype == 1) // Only one unique vote, so just end it immediately. { voteendtic = votetic + (5*TICRATE); S_StartSound(NULL, sfx_kc48); From b0be1c7bbfc0f1a2a182a1712bc8ece317ef87f4 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 1 Mar 2018 17:20:13 -0500 Subject: [PATCH 25/41] Hopefully this fixes item throwing & distribution in mobjscale maps --- src/k_kart.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 104ed9cb..79b6533f 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -587,7 +587,7 @@ static void K_KartItemRouletteByDistance(player_t *player, ticcmd_t *cmd) && players[i].kartstuff[k_position] < player->kartstuff[k_position]) pdis += P_AproxDistance(P_AproxDistance(players[i].mo->x - player->mo->x, players[i].mo->y - player->mo->y), - players[i].mo->z - player->mo->z) / FRACUNIT + players[i].mo->z - player->mo->z) / mapheaderinfo[gamemap-1]->mobj_scale * (pingame - players[i].kartstuff[k_position]) / ((pingame - 1) * (pingame + 1) / 3); } @@ -1997,9 +1997,9 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map INT32 HEIGHT; if (dir == 2) - HEIGHT = 40*FRACUNIT + player->mo->momz; + HEIGHT = 40*(mapheaderinfo[gamemap-1]->mobj_scale) + player->mo->momz; else - HEIGHT = 30*FRACUNIT + player->mo->momz; + HEIGHT = 30*(mapheaderinfo[gamemap-1]->mobj_scale) + player->mo->momz; mo->momx = player->mo->momx + FixedMul(FINECOSINE(fa), PROJSPEED); mo->momy = player->mo->momy + FixedMul(FINESINE(fa), PROJSPEED); From 1a6730fb72a2e6cb57bb2df47f52042e8fb0fb21 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 1 Mar 2018 19:00:16 -0500 Subject: [PATCH 26/41] Some unlockable stuff MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Secrets renamed to Extras - Extras leads to the checklist instead of another menu - Credits & Sound Test are on the Options menu now - New title screen cheat for unlocking everything ("banana", or "← ↑ → → ↑ ← ↓ → Enter") --- src/m_cheat.c | 24 +++++++++++++++--------- src/m_menu.c | 33 ++++++++++++++++++--------------- src/sounds.h | 14 +++++++------- 3 files changed, 40 insertions(+), 31 deletions(-) diff --git a/src/m_cheat.c b/src/m_cheat.c index b468d733..f7476fca 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -74,19 +74,20 @@ typedef struct static UINT8 cheatf_warp(void) { - if (modifiedgame) - return 0; + UINT8 i; + + /*if (modifiedgame) + return 0;*/ if (menuactive && currentMenu != &MainDef) return 0; // Only on the main menu! - S_StartSound(0, sfx_itemup); + S_StartSound(0, sfx_kc42); - // Temporarily unlock stuff. + // Temporarily unlock EVERYTHING. G_SetGameModified(false); - unlockables[1].unlocked = true; // credits - unlockables[2].unlocked = true; // sound test - //unlockables[16].unlocked = true; // level select + for (i = 0; i < MAXUNLOCKABLES; i++) + unlockables[i].unlocked = true; // Refresh secrets menu existing. M_ClearMenus(true); @@ -135,14 +136,19 @@ static UINT8 cheatf_devmode(void) static cheatseq_t cheat_warp = { 0, cheatf_warp, - { SCRAMBLE('r'), SCRAMBLE('e'), SCRAMBLE('d'), SCRAMBLE('x'), SCRAMBLE('v'), SCRAMBLE('i'), 0xff } + //{ SCRAMBLE('r'), SCRAMBLE('e'), SCRAMBLE('d'), SCRAMBLE('x'), SCRAMBLE('v'), SCRAMBLE('i'), 0xff } + { SCRAMBLE('b'), SCRAMBLE('a'), SCRAMBLE('n'), SCRAMBLE('a'), SCRAMBLE('n'), SCRAMBLE('a'), 0xff } }; static cheatseq_t cheat_warp_joy = { 0, cheatf_warp, - { SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW), + /*{ SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW), + SCRAMBLE(KEY_ENTER), 0xff }*/ + { SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_RIGHTARROW), + SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_LEFTARROW), + SCRAMBLE(KEY_DOWNARROW), SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_ENTER), 0xff } }; diff --git a/src/m_menu.c b/src/m_menu.c index 95086d4d..b498e484 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -207,8 +207,8 @@ menu_t MessageDef; menu_t SPauseDef; // Sky Room -static void M_CustomLevelSelect(INT32 choice); -static void M_CustomWarp(INT32 choice); +//static void M_CustomLevelSelect(INT32 choice); +//static void M_CustomWarp(INT32 choice); FUNCNORETURN static ATTRNORETURN void M_UltimateCheat(INT32 choice); static void M_LoadGameLevelSelect(INT32 choice); static void M_GetAllEmeralds(INT32 choice); @@ -231,7 +231,7 @@ static void M_ConfirmSpectate(INT32 choice); static void M_ConfirmEnterGame(INT32 choice); static void M_ConfirmTeamScramble(INT32 choice); static void M_ConfirmTeamChange(INT32 choice); -static void M_SecretsMenu(INT32 choice); +//static void M_SecretsMenu(INT32 choice); static void M_SetupChoosePlayer(INT32 choice); static void M_QuitSRB2(INT32 choice); menu_t SP_MainDef, MP_MainDef, OP_MainDef; @@ -475,11 +475,11 @@ static consvar_t cv_dummystaff = {"dummystaff", "0", CV_HIDEN|CV_CALL, dummystaf // --------- static menuitem_t MainMenu[] = { - {IT_CALL |IT_STRING, NULL, "Secrets", M_SecretsMenu, 84}, - {IT_CALL |IT_STRING, NULL, "1 Player", M_SinglePlayerMenu, 92}, - {IT_SUBMENU|IT_STRING, NULL, "Multiplayer", &MP_MainDef, 100}, - {IT_CALL |IT_STRING, NULL, "Options", M_Options, 108}, - {IT_CALL |IT_STRING, NULL, "Quit Game", M_QuitSRB2, 116}, + {IT_SUBMENU|IT_STRING, NULL, "Extras", &SR_UnlockChecklistDef, 84}, + {IT_CALL |IT_STRING, NULL, "1 Player", M_SinglePlayerMenu, 92}, + {IT_SUBMENU|IT_STRING, NULL, "Multiplayer", &MP_MainDef, 100}, + {IT_CALL |IT_STRING, NULL, "Options", M_Options, 108}, + {IT_CALL |IT_STRING, NULL, "Quit Game", M_QuitSRB2, 116}, }; typedef enum @@ -1040,6 +1040,9 @@ static menuitem_t OP_MainMenu[] = {IT_SUBMENU | IT_STRING, NULL, "Game Options...", &OP_GameOptionsDef, 70}, {IT_SUBMENU | IT_STRING, NULL, "Server Options...", &OP_ServerOptionsDef, 80}, + + {IT_CALL | IT_STRING, NULL, "Play Credits", M_Credits, 90}, + {IT_KEYHANDLER | IT_STRING, NULL, "Sound Test", M_HandleSoundTest, 100}, }; static menuitem_t OP_ControlsMenu[] = @@ -2692,7 +2695,7 @@ void M_StartControlPanel(void) if (!Playing()) { // Secret menu! - MainMenu[secrets].status = (M_AnySecretUnlocked()) ? (IT_STRING | IT_CALL) : (IT_DISABLED); + //MainMenu[secrets].status = (M_AnySecretUnlocked()) ? (IT_STRING | IT_CALL) : (IT_DISABLED); currentMenu = &MainDef; itemOn = singleplr; @@ -4403,7 +4406,7 @@ static void M_HandleSoundTest(INT32 choice) } // Entering secrets menu -static void M_SecretsMenu(INT32 choice) +/*static void M_SecretsMenu(INT32 choice) { INT32 i, j, ul; UINT8 done[MAXUNLOCKABLES]; @@ -4478,7 +4481,7 @@ static void M_SecretsMenu(INT32 choice) } M_SetupNextMenu(&SR_MainDef); -} +}*/ // ================== // NEW GAME FUNCTIONS @@ -4496,14 +4499,14 @@ static void M_NewGame(void) M_SetupChoosePlayer(0); } -static void M_CustomWarp(INT32 choice) +/*static void M_CustomWarp(INT32 choice) { INT32 ul = skyRoomMenuTranslations[choice-1]; startmap = (INT16)(unlockables[ul].variable); M_SetupChoosePlayer(0); -} +}*/ static void M_Credits(INT32 choice) { @@ -4513,7 +4516,7 @@ static void M_Credits(INT32 choice) F_StartCredits(); } -static void M_CustomLevelSelect(INT32 choice) +/*static void M_CustomLevelSelect(INT32 choice) { INT32 ul = skyRoomMenuTranslations[choice-1]; @@ -4528,7 +4531,7 @@ static void M_CustomLevelSelect(INT32 choice) M_PrepareLevelSelect(); M_SetupNextMenu(&SR_LevelSelectDef); -} +}*/ // ================== // SINGLE PLAYER MENU diff --git a/src/sounds.h b/src/sounds.h index 142c4a4e..2a004e4c 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -583,7 +583,7 @@ typedef enum sfx_kc2c, sfx_kc2d, sfx_kc2e, - sfx_kc2f, + sfx_kc2f, // Pogo Spring sfx_kc30, sfx_kc31, sfx_kc32, @@ -593,7 +593,7 @@ typedef enum sfx_kc36, sfx_kc37, sfx_kc38, - sfx_kc39, + sfx_kc39, // Voting roulette sfx_kc3a, sfx_kc3b, sfx_kc3c, @@ -602,15 +602,15 @@ typedef enum sfx_kc3f, sfx_kc40, sfx_kc41, - sfx_kc42, + sfx_kc42, // Unlock everything cheat sfx_kc43, sfx_kc44, sfx_kc45, sfx_kc46, sfx_kc47, - sfx_kc48, + sfx_kc48, // Vote picked sfx_kc49, - sfx_kc4a, + sfx_kc4a, // Voting beep sfx_kc4b, sfx_kc4c, sfx_kc4d, @@ -625,8 +625,8 @@ typedef enum sfx_kc56, sfx_kc57, sfx_kc58, - sfx_kc59, - sfx_kc5a, + sfx_kc59, // Shrink + sfx_kc5a, // Grow sfx_kc5b, sfx_kc5c, sfx_kc5d, From 94b1ce7ce345799618c0743ed5a7b2ded74d9b4e Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 1 Mar 2018 19:07:07 -0500 Subject: [PATCH 27/41] And a few more fixes that went under my nose For later: fix sound test in the options menu, make the cheat notif sound only play if it can unlock something --- src/m_menu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index b498e484..1775dc9e 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1041,8 +1041,8 @@ static menuitem_t OP_MainMenu[] = {IT_SUBMENU | IT_STRING, NULL, "Game Options...", &OP_GameOptionsDef, 70}, {IT_SUBMENU | IT_STRING, NULL, "Server Options...", &OP_ServerOptionsDef, 80}, - {IT_CALL | IT_STRING, NULL, "Play Credits", M_Credits, 90}, - {IT_KEYHANDLER | IT_STRING, NULL, "Sound Test", M_HandleSoundTest, 100}, + {IT_CALL | IT_STRING, NULL, "Play Credits", M_Credits, 100}, + //{IT_KEYHANDLER | IT_STRING, NULL, "Sound Test", M_HandleSoundTest, 110}, }; static menuitem_t OP_ControlsMenu[] = @@ -1578,7 +1578,7 @@ menu_t SR_UnlockChecklistDef = { NULL, 1, - &SR_MainDef, + &MainDef, //&SR_MainDef SR_UnlockChecklistMenu, M_DrawChecklist, 280, 185, From f985401ca4901e1a1296d1ac01df340242731f23 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Fri, 2 Mar 2018 00:02:26 -0500 Subject: [PATCH 28/41] Revamped race position Should support ties for real now :V --- src/g_game.c | 46 ++++++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 89725ce6..f71e9e15 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2764,7 +2764,8 @@ mapthing_t *G_FindRaceStart(INT32 playernum) { if (numcoopstarts) { - INT32 i, pos = 0; + UINT8 i; + UINT8 pos = 0; // SRB2Kart: figure out player spawn pos from points if (!playeringame[playernum] || players[playernum].spectator) @@ -2772,34 +2773,47 @@ mapthing_t *G_FindRaceStart(INT32 playernum) for (i = 0; i < MAXPLAYERS; i++) { - if (i == playernum) - continue; if (!playeringame[i] || players[i].spectator) continue; - if (players[i].score > players[playernum].score) - pos++; - if (i != 0) + if (i == playernum) + continue; + + if (players[i].score < players[playernum].score) { - INT32 j; - for (j = 0; j < i; j++) // I don't like loops in loops, but is needed to resolve ties :< + UINT8 j; + UINT8 num = 0; + + for (j = 0; j < MAXPLAYERS; j++) // I hate similar loops inside loops... :< { - if (i == j) - continue; if (!playeringame[j] || players[j].spectator) continue; - if (players[i].score == players[j].score) - pos++; + if (j == playernum) + continue; + if (j == i) + continue; + if (players[j].score == players[i].score) + num++; } + + if (num > 1) // found dupes + pos++; + } + else + { + if (players[i].score > players[playernum].score || i < playernum) + pos++; } } if (G_CheckSpot(playernum, playerstarts[pos % numcoopstarts])) return playerstarts[pos % numcoopstarts]; - // Your spot isn't available? Go for the old behavior - // if there's 6 players in a map with 3 player starts, this spawns them 1/2/3/1/2/3. - if (G_CheckSpot(playernum, playerstarts[playernum % numcoopstarts])) - return playerstarts[playernum % numcoopstarts]; + // Your spot isn't available? Find whatever you can get first. + for (i = 0; i < numcoopstarts; i++) + { + if (G_CheckSpot(playernum, playerstarts[i])) + return playerstarts[i]; + } // SRB2Kart: We have solid players, so this behavior is less ideal. // Don't bother checking to see if the player 1 start is open. From 1e1867fe427fc4df08bf77c125a6e237dd5f197b Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 4 Mar 2018 14:28:29 -0500 Subject: [PATCH 29/41] General fixes - Flame trails don't spawn if you're not on the ground - Mobjscale: Shells are now the correct speed - Mobjscale: Explosion's wipeout hit height scales --- src/k_kart.c | 10 ++++++---- src/p_mobj.c | 18 +++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 79b6533f..409f2afe 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1487,7 +1487,7 @@ void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we ju || (gametype != GT_RACE && ((player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]) || player->kartstuff[k_comebackmode] == 1))) return; - player->mo->momz = 18*FRACUNIT; + player->mo->momz = 18*(mapheaderinfo[gamemap-1]->mobj_scale); player->mo->momx = player->mo->momy = 0; player->kartstuff[k_mushroomtimer] = 0; @@ -1847,6 +1847,11 @@ void K_SpawnDriftTrail(player_t *player) I_Assert(player->mo != NULL); I_Assert(!P_MobjWasRemoved(player->mo)); + if (!P_IsObjectOnGround(player->mo) + || player->kartstuff[k_bootimer] != 0 + || (gametype != GT_RACE && player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]))) + return; + if (player->mo->eflags & MFE_VERTICALFLIP) ground = player->mo->ceilingz - FixedMul(mobjinfo[MT_MUSHROOMTRAIL].height, player->mo->scale); else @@ -1859,9 +1864,6 @@ void K_SpawnDriftTrail(player_t *player) for (i = 0; i < 2; i++) { - if (player->kartstuff[k_bootimer] != 0 || (gametype != GT_RACE && player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer])) - continue; - newx = player->mo->x + P_ReturnThrustX(player->mo, travelangle + ((i&1) ? -1 : 1)*ANGLE_135, FixedMul(24*FRACUNIT, player->mo->scale)); newy = player->mo->y + P_ReturnThrustY(player->mo, travelangle + ((i&1) ? -1 : 1)*ANGLE_135, FixedMul(24*FRACUNIT, player->mo->scale)); #ifdef ESLOPE diff --git a/src/p_mobj.c b/src/p_mobj.c index bd10d898..c113d3d0 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -7787,9 +7787,9 @@ void P_MobjThinker(mobj_t *mobj) P_SpawnGhostMobj(mobj); if (gamespeed == 0) - finalspeed = FixedMul(finalspeed, FRACUNIT-FRACUNIT/4); + finalspeed = FixedMul(finalspeed, (mapheaderinfo[gamemap-1]->mobj_scale)-(mapheaderinfo[gamemap-1]->mobj_scale/4)); else if (gamespeed == 2) - finalspeed = FixedMul(finalspeed, FRACUNIT+FRACUNIT/4); + finalspeed = FixedMul(finalspeed, (mapheaderinfo[gamemap-1]->mobj_scale)+(mapheaderinfo[gamemap-1]->mobj_scale/4)); mobj->angle = R_PointToAngle2(mobj->x, mobj->y, mobj->x+mobj->momx, mobj->y+mobj->momy); if (mobj->health <= 5) @@ -7797,7 +7797,7 @@ void P_MobjThinker(mobj_t *mobj) INT32 i; for (i = 5; i >= mobj->health; i--) { - finalspeed = FixedMul(finalspeed, FRACUNIT-FRACUNIT/4); + finalspeed = FixedMul(finalspeed, (mapheaderinfo[gamemap-1]->mobj_scale)-(mapheaderinfo[gamemap-1]->mobj_scale/4)); } P_InstaThrust(mobj, mobj->angle, finalspeed); } @@ -7822,8 +7822,8 @@ void P_MobjThinker(mobj_t *mobj) case MT_REDITEM: { sector_t *sec2; - fixed_t topspeed = 64*FRACUNIT; - fixed_t distbarrier = 512*FRACUNIT; + fixed_t topspeed = 64*(mapheaderinfo[gamemap-1]->mobj_scale); + fixed_t distbarrier = 512*(mapheaderinfo[gamemap-1]->mobj_scale); fixed_t distaway; P_SpawnGhostMobj(mobj); @@ -7835,13 +7835,13 @@ void P_MobjThinker(mobj_t *mobj) if (gamespeed == 0) { - topspeed = FixedMul(topspeed, FRACUNIT-FRACUNIT/4); - distbarrier = FixedMul(distbarrier, FRACUNIT-FRACUNIT/4); + topspeed = FixedMul(topspeed, (mapheaderinfo[gamemap-1]->mobj_scale)-(mapheaderinfo[gamemap-1]->mobj_scale/4)); + distbarrier = FixedMul(distbarrier, (mapheaderinfo[gamemap-1]->mobj_scale)-(mapheaderinfo[gamemap-1]->mobj_scale/4)); } else if (gamespeed == 2) { - topspeed = FixedMul(topspeed, FRACUNIT+FRACUNIT/4); - distbarrier = FixedMul(distbarrier, FRACUNIT+FRACUNIT/4); + topspeed = FixedMul(topspeed, (mapheaderinfo[gamemap-1]->mobj_scale)+(mapheaderinfo[gamemap-1]->mobj_scale/4)); + distbarrier = FixedMul(distbarrier, (mapheaderinfo[gamemap-1]->mobj_scale)+(mapheaderinfo[gamemap-1]->mobj_scale/4); } if (gametype == GT_RACE && mobj->tracer) From f97ec304935c6b881df080a56d9c5197c5824ea1 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 4 Mar 2018 15:27:52 -0500 Subject: [PATCH 30/41] Made a lot of gametype checks use either G_RaceGametype or G_BattleGametype Should make it a lot easier to add more gametypes later. Also some minor fixes: - Changed up how shell speed scales in mobjscale juuuust slightly, so it's less messy - Fixed CHECK showing spectators --- src/d_clisrv.c | 6 ++-- src/d_netcmd.c | 12 ++++---- src/g_game.c | 10 +++---- src/hu_stuff.c | 10 +++---- src/k_kart.c | 80 ++++++++++++++++++++++++++------------------------ src/p_enemy.c | 14 ++++----- src/p_inter.c | 16 +++++----- src/p_map.c | 14 ++++----- src/p_mobj.c | 37 +++++++++++++---------- src/p_setup.c | 6 ++-- src/p_spec.c | 8 ++--- src/p_user.c | 20 ++++++------- 12 files changed, 120 insertions(+), 113 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 3d864e39..9485e910 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2473,9 +2473,9 @@ static void CL_RemovePlayer(INT32 playernum) if (G_TagGametype()) //Check if you still have a game. Location flexible. =P P_CheckSurvivors(); - else if (gametype == GT_MATCH || gametype == GT_TEAMMATCH || gametype == GT_CTF) - K_CheckBalloons(); // SRB2Kart - else if (gametype == GT_RACE || gametype == GT_COMPETITION) + else if (G_BattleGametype()) // SRB2Kart + K_CheckBalloons(); + else if (G_RaceGametype()) P_CheckRacers(); } diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 3099ca45..fbf2dee0 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3229,7 +3229,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum) // In tag, check to see if you still have a game. if (G_TagGametype()) P_CheckSurvivors(); - else if (gametype == GT_MATCH || gametype == GT_TEAMMATCH || gametype == GT_CTF) + else if (G_BattleGametype()) K_CheckBalloons(); // SRB2Kart } @@ -4114,7 +4114,7 @@ static void PointLimit_OnChange(void) static void NumLaps_OnChange(void) { // Just don't be verbose - if (gametype == GT_RACE) + if (G_RaceGametype()) CONS_Printf(M_GetText("Number of laps set to %d\n"), cv_numlaps.value); } @@ -5194,23 +5194,23 @@ static void Command_ShowTime_f(void) static void KartFrantic_OnChange(void) { if (cv_kartfrantic.value != franticitems && gamestate == GS_LEVEL) - CONS_Printf(M_GetText("Frantic Items will be turned %s next round.\n"), cv_kartfrantic.value ? M_GetText("on") : M_GetText("off")); + CONS_Printf(M_GetText("Frantic items will be turned %s next round.\n"), cv_kartfrantic.value ? M_GetText("on") : M_GetText("off")); } static void KartSpeed_OnChange(void) { - if (cv_kartspeed.value != gamespeed && gametype == GT_RACE && gamestate == GS_LEVEL) + if (cv_kartspeed.value != gamespeed && G_RaceGametype() && gamestate == GS_LEVEL) CONS_Printf(M_GetText("Game speed will be changed to \"%s\" next round.\n"), cv_kartspeed.string); } static void KartMirror_OnChange(void) { - if (cv_kartmirror.value != mirrormode && gametype == GT_RACE && gamestate == GS_LEVEL) + if (cv_kartmirror.value != mirrormode && G_RaceGametype() && gamestate == GS_LEVEL) CONS_Printf(M_GetText("Mirror Mode will be turned %s next round.\n"), cv_kartmirror.value ? M_GetText("on") : M_GetText("off")); } static void KartComeback_OnChange(void) { - if (cv_kartcomeback.value != comeback && gametype == GT_MATCH && gamestate == GS_LEVEL) + if (cv_kartcomeback.value != comeback && G_BattleGametype() && gamestate == GS_LEVEL) CONS_Printf(M_GetText("Karma Comeback will be turned %s next round.\n"), cv_kartcomeback.value ? M_GetText("on") : M_GetText("off")); } \ No newline at end of file diff --git a/src/g_game.c b/src/g_game.c index f71e9e15..2013d77e 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3099,11 +3099,11 @@ boolean G_BattleGametype(void) // // G_RaceGametype // -// Returns true in racing gamemodes, previously was G_PlatformGametype. +// Returns true in Race gamemodes, previously was G_PlatformGametype. // boolean G_RaceGametype(void) { - return (gametype == GT_RACE); //(gametype == GT_COOP || gametype == GT_RACE || gametype == GT_COMPETITION); + return (gametype == GT_RACE); } // @@ -3313,7 +3313,7 @@ static void G_DoCompleted(void) I_Error("Followed map %d to invalid map %d\n", prevmap + 1, nextmap + 1); // wrap around in race - if (nextmap >= 1100-1 && nextmap <= 1102-1 && (gametype == GT_RACE || gametype == GT_COMPETITION)) + if (nextmap >= 1100-1 && nextmap <= 1102-1 && G_RaceGametype()) nextmap = (INT16)(spstage_start-1); if (gametype == GT_COOP && token) @@ -3408,8 +3408,8 @@ static void G_DoWorldDone(void) { if (server) { - if (gametype == GT_RACE) // SRB2kart - // don't reset player between maps + if (G_RaceGametype()) + // SRB2kart: don't reset player between maps D_MapChange(nextmap+1, gametype, ultimatemode, false, 0, false, false); else // resetplayer in match/tag/CTF for more equality diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 3941e6c1..c3c04bed 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -1394,7 +1394,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I V_DrawSmallScaledPatch(x-32, y-4, 0, tagico); } - if (gametype == GT_RACE) + if (G_RaceGametype()) { if (circuitmap) { @@ -1564,7 +1564,7 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline } // All data drawn with thin string for space. - if (gametype == GT_RACE) + if (G_RaceGametype()) { if (circuitmap) { @@ -1708,7 +1708,7 @@ static void HU_DrawRankings(void) V_DrawCenteredString(192, 16, 0, va("%u", redscore)); } - if (gametype != GT_RACE && gametype != GT_COMPETITION && gametype != GT_COOP) + if (!G_RaceGametype()) { if (cv_timelimit.value && timelimitintics > 0) { @@ -1768,7 +1768,7 @@ static void HU_DrawRankings(void) tab[i].num = -1; tab[i].name = 0; - if (gametype == GT_RACE && !circuitmap) + if (G_RaceGametype() && !circuitmap) tab[i].count = INT32_MAX; } @@ -1781,7 +1781,7 @@ static void HU_DrawRankings(void) { if (playeringame[i] && !players[i].spectator) { - if (gametype == GT_RACE) + if (G_RaceGametype()) { if (circuitmap) { diff --git a/src/k_kart.c b/src/k_kart.c index 409f2afe..b0519f82 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -514,7 +514,7 @@ static INT32 K_KartGetItemOdds(INT32 pos, INT32 itemnum) { INT32 newodds; - if (gametype == GT_MATCH) + if (G_BattleGametype()) newodds = K_KartItemOddsBalloons[itemnum-1][pos]; else newodds = K_KartItemOddsDistance_Retro[itemnum-1][pos]; @@ -594,7 +594,7 @@ static void K_KartItemRouletteByDistance(player_t *player, ticcmd_t *cmd) player->kartstuff[k_itemclose] = 0; // Reset the item window closer. - if (gametype == GT_MATCH || gametype == GT_TEAMMATCH || gametype == GT_CTF) // Battle Mode + if (G_BattleGametype()) // Battle Mode { useodds = (player->kartstuff[k_balloon]-avgballoon)+2; // 0 is two balloons below average, 2 is average, 4 is two balloons above average if (useodds > 4) @@ -1088,7 +1088,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (player->kartstuff[k_lapanimation]) player->kartstuff[k_lapanimation]--; - if (gametype != GT_RACE && (player->exiting || player->kartstuff[k_comebacktimer])) + if (G_BattleGametype() && (player->exiting || player->kartstuff[k_comebacktimer])) { if (player->exiting) { @@ -1298,7 +1298,7 @@ fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower) break; } - if (gametype != GT_RACE && player->kartstuff[k_balloon] <= 0) + if (G_BattleGametype() && player->kartstuff[k_balloon] <= 0) kartspeed = 1; k_speed += kartspeed*3; // 153 - 177 @@ -1315,7 +1315,7 @@ fixed_t K_GetKartAccel(player_t *player) fixed_t k_accel = 32; // 36; UINT8 kartspeed = player->kartspeed; - if (gametype != GT_RACE && player->kartstuff[k_balloon] <= 0) + if (G_BattleGametype() && player->kartstuff[k_balloon] <= 0) kartspeed = 1; //k_accel += 3 * (9 - kartspeed); // 36 - 60 @@ -1327,7 +1327,7 @@ fixed_t K_GetKartAccel(player_t *player) UINT16 K_GetKartFlashing(void) { UINT16 tics = flashingtics; - if (gametype != GT_RACE) + if (G_BattleGametype()) { tics *= 2; //tics += (3*TICRATE/8) * (player->kartspeed-1); @@ -1376,7 +1376,7 @@ void K_SpinPlayer(player_t *player, mobj_t *source) if (player->powers[pw_flashing] > 0 || player->kartstuff[k_squishedtimer] > 0 || (player->kartstuff[k_spinouttimer] > 0 && player->kartstuff[k_spinout] > 0) || player->kartstuff[k_startimer] > 0 || player->kartstuff[k_growshrinktimer] > 0 || player->kartstuff[k_bootimer] > 0 - || (gametype != GT_RACE && ((player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]) || player->kartstuff[k_comebackmode] == 1))) + || (G_BattleGametype() && ((player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]) || player->kartstuff[k_comebackmode] == 1))) return; if (source && source != player->mo && source->player && !source->player->kartstuff[k_sounds]) @@ -1388,7 +1388,7 @@ void K_SpinPlayer(player_t *player, mobj_t *source) player->kartstuff[k_mushroomtimer] = 0; player->kartstuff[k_driftboost] = 0; - if (gametype != GT_RACE) + if (G_BattleGametype()) { if (source && source->player && player != source->player) P_AddPlayerScore(source->player, 1); @@ -1440,13 +1440,13 @@ void K_SquishPlayer(player_t *player, mobj_t *source) if (player->powers[pw_flashing] > 0 || player->kartstuff[k_squishedtimer] > 0 || player->kartstuff[k_startimer] > 0 || player->kartstuff[k_growshrinktimer] > 0 || player->kartstuff[k_bootimer] > 0 - || (gametype != GT_RACE && ((player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]) || player->kartstuff[k_comebackmode] == 1))) + || (G_BattleGametype() && ((player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]) || player->kartstuff[k_comebackmode] == 1))) return; player->kartstuff[k_mushroomtimer] = 0; player->kartstuff[k_driftboost] = 0; - if (gametype != GT_RACE) + if (G_BattleGametype()) { if (source && source->player && player != source->player) P_AddPlayerScore(source->player, 1); @@ -1484,7 +1484,7 @@ void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we ju if (player->powers[pw_flashing] > 0 || player->kartstuff[k_squishedtimer] > 0 || (player->kartstuff[k_spinouttimer] > 0 && player->kartstuff[k_spinout] > 0) || player->kartstuff[k_startimer] > 0 || player->kartstuff[k_growshrinktimer] > 0 || player->kartstuff[k_bootimer] > 0 - || (gametype != GT_RACE && ((player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]) || player->kartstuff[k_comebackmode] == 1))) + || (G_BattleGametype() && ((player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]) || player->kartstuff[k_comebackmode] == 1))) return; player->mo->momz = 18*(mapheaderinfo[gamemap-1]->mobj_scale); @@ -1493,7 +1493,7 @@ void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we ju player->kartstuff[k_mushroomtimer] = 0; player->kartstuff[k_driftboost] = 0; - if (gametype != GT_RACE) + if (G_BattleGametype()) { if (source && source->player && player != source->player) { @@ -1549,7 +1549,7 @@ void K_StealBalloon(player_t *player, player_t *victim, boolean force) fixed_t newx, newy; mobj_t *newmo; - if (gametype == GT_RACE) + if (!G_BattleGametype()) return; if (player->health <= 0 || victim->health <= 0) @@ -1849,7 +1849,7 @@ void K_SpawnDriftTrail(player_t *player) if (!P_IsObjectOnGround(player->mo) || player->kartstuff[k_bootimer] != 0 - || (gametype != GT_RACE && player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]))) + || (G_BattleGametype() && player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer])) return; if (player->mo->eflags & MFE_VERTICALFLIP) @@ -2085,8 +2085,8 @@ static void K_DoBooSteal(player_t *player) && player != &players[i] && !players[i].exiting && !players[i].spectator // Player in-game // Can steal from this player - && ((gametype == GT_RACE && players[i].kartstuff[k_position] < player->kartstuff[k_position]) - || (gametype != GT_RACE && players[i].kartstuff[k_balloon] > 0)) + && ((G_RaceGametype() && players[i].kartstuff[k_position] < player->kartstuff[k_position]) + || (G_BattleGametype() && players[i].kartstuff[k_balloon] > 0)) // Has an item && (players[i].kartstuff[k_magnet] @@ -2115,7 +2115,7 @@ static void K_DoBooSteal(player_t *player) prandom = P_RandomFixed(); - if ((gametype == GT_RACE && player->kartstuff[k_position] == 1) || numplayers == 0) // No-one can be stolen from? Get longer invisibility for nothing + if ((G_RaceGametype() && player->kartstuff[k_position] == 1) || numplayers == 0) // No-one can be stolen from? Get longer invisibility for nothing { player->kartstuff[k_bootimer] = bootime; player->kartstuff[k_bootaketimer] = boostealtime; @@ -2422,7 +2422,7 @@ static void K_KartDrift(player_t *player, boolean onground) UINT8 kartspeed = player->kartspeed; fixed_t dsone, dstwo; - if (gametype != GT_RACE && player->kartstuff[k_balloon] <= 0) + if (G_BattleGametype() && player->kartstuff[k_balloon] <= 0) kartspeed = 1; // IF YOU CHANGE THESE: MAKE SURE YOU UPDATE THE SAME VALUES IN p_mobjc, "case MT_DRIFT:" @@ -2558,7 +2558,7 @@ static void K_KartUpdatePosition(player_t *player) if (!playeringame[i] || players[i].spectator || !players[i].mo) continue; - if (gametype == GT_RACE) + if (G_RaceGametype()) { if ((((players[i].starpostnum) + (numstarposts + 1) * players[i].laps) > ((player->starpostnum) + (numstarposts + 1) * player->laps))) @@ -2634,7 +2634,7 @@ static void K_KartUpdatePosition(player_t *player) } } } - else if (gametype == GT_MATCH) + else if (G_BattleGametype()) { if (player->exiting) return; @@ -2763,7 +2763,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) // Race Spectator if (netgame && player->jointime < 1 - && gametype == GT_RACE && countdown) + && G_RaceGametype() && countdown) { player->spectator = true; player->powers[pw_nocontrol] = 5; @@ -2841,7 +2841,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) player->kartstuff[k_startimer] = itemtime; // Activate it K_PlayTauntSound(player->mo); player->kartstuff[k_star] = 0; - if (gametype != GT_RACE) + if (G_BattleGametype()) player->kartstuff[k_poweritemtimer] = 10*TICRATE; player->kartstuff[k_itemclose] = 10; player->pflags |= PF_ATTACKDOWN; @@ -3158,7 +3158,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) S_StartSound(player->mo, sfx_mario3); player->pflags |= PF_ATTACKDOWN; player->kartstuff[k_megashroom] = 0; - if (gametype != GT_RACE) + if (G_BattleGametype()) player->kartstuff[k_poweritemtimer] = 10*TICRATE; player->kartstuff[k_itemclose] = 10; } @@ -3221,7 +3221,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) if (player->kartstuff[k_growshrinktimer] == 26) S_StartSound(player->mo, sfx_mario8); - if ((gametype != GT_RACE) + if ((G_BattleGametype()) && (player->kartstuff[k_star] || player->kartstuff[k_megashroom] || player->kartstuff[k_startimer] || player->kartstuff[k_growshrinktimer] > 0)) player->kartstuff[k_poweritemtimer] = 10*TICRATE; @@ -3253,7 +3253,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) player->mo->flags2 &= ~MF2_DONTDRAW; } - if (gametype != GT_RACE && player->kartstuff[k_balloon] <= 0) // dead in match? you da bomb + if (G_BattleGametype() && player->kartstuff[k_balloon] <= 0) // dead in match? you da bomb { K_StripItems(player); player->mo->flags2 |= MF2_SHADOW; @@ -3281,7 +3281,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) else player->mo->tracer->flags2 &= ~MF2_DONTDRAW; } - else if (gametype == GT_RACE || player->kartstuff[k_balloon] > 0) + else if (G_RaceGametype() || player->kartstuff[k_balloon] > 0) { player->mo->flags2 &= ~MF2_SHADOW; if (player->mo->tracer && player->mo->tracer->state == &states[S_PLAYERBOMB]) @@ -3297,7 +3297,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) player->mo->friction += 4608; if (player->speed > 0 && cmd->forwardmove < 0 && player->mo->friction == 59392) player->mo->friction += 1608; - if (gametype != GT_RACE && player->kartstuff[k_balloon] <= 0) + if (G_BattleGametype() && player->kartstuff[k_balloon] <= 0) { player->mo->friction += 1228; @@ -3389,7 +3389,7 @@ void K_CheckBalloons(void) if (!multiplayer) return; - if (gametype != GT_MATCH) + if (!G_BattleGametype()) return; if (gameaction == ga_completed) @@ -4340,7 +4340,7 @@ static void K_drawKartPositionFaces(void) if (rankplayer[i] != myplayer) { V_DrawSmallTranslucentPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, faceprefix[players[rankplayer[i]].skin]); - if (gametype == GT_MATCH && players[rankplayer[i]].kartstuff[k_balloon] > 0) + if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_balloon] > 0) { for (j = 0; j < players[rankplayer[i]].kartstuff[k_balloon]; j++) { @@ -4352,7 +4352,7 @@ static void K_drawKartPositionFaces(void) else { V_DrawSmallScaledPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, faceprefix[players[rankplayer[i]].skin]); - if (gametype == GT_MATCH && players[rankplayer[i]].kartstuff[k_balloon] > 0) + if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_balloon] > 0) { for (j = 0; j < players[rankplayer[i]].kartstuff[k_balloon]; j++) { @@ -4377,7 +4377,7 @@ static void K_drawKartPositionFaces(void) if (rankplayer[i] != myplayer) { V_DrawSmallTranslucentMappedPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, faceprefix[players[rankplayer[i]].skin], colormap); - if (gametype == GT_MATCH && players[rankplayer[i]].kartstuff[k_balloon] > 0) + if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_balloon] > 0) { for (j = 0; j < players[rankplayer[i]].kartstuff[k_balloon]; j++) { @@ -4389,7 +4389,7 @@ static void K_drawKartPositionFaces(void) else { V_DrawSmallMappedPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, faceprefix[players[rankplayer[i]].skin], colormap); - if (gametype == GT_MATCH && players[rankplayer[i]].kartstuff[k_balloon] > 0) + if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_balloon] > 0) { for (j = 0; j < players[rankplayer[i]].kartstuff[k_balloon]; j++) { @@ -4412,14 +4412,14 @@ static void K_drawKartPositionFaces(void) if (rankplayer[i] != myplayer) { - if (gametype == GT_MATCH && players[rankplayer[i]].kartstuff[k_balloon] <= 0) + if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_balloon] <= 0) V_DrawSmallTranslucentPatch(FACE_X-2, Y, V_HUDTRANS|V_SNAPTOLEFT, kp_ranknoballoons); else V_DrawSmallTranslucentPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, localpatch); } else { - if (gametype == GT_MATCH && players[rankplayer[i]].kartstuff[k_balloon] <= 0) + if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_balloon] <= 0) V_DrawSmallScaledPatch(FACE_X-2, Y, V_HUDTRANS|V_SNAPTOLEFT, kp_ranknoballoons); else V_DrawSmallScaledPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, localpatch); @@ -4559,9 +4559,11 @@ static void K_drawKartPlayerCheck(void) for (i = 0; i < MAXPLAYERS; i++) { - if (&players[i] == stplyr) + if (!playeringame[i] || players[i].spectator) continue; - if (!(players[i].mo)) + if (!players[i].mo) + continue; + if (&players[i] == stplyr) continue; if ((players[i].kartstuff[k_startimer] <= 0) && (leveltime & 2)) @@ -4968,7 +4970,7 @@ void K_drawKartHUD(void) K_initKartHUD(); // Draw full screen stuff that turns off the rest of the HUD - if ((gametype != GT_RACE) + if ((G_BattleGametype()) && (stplyr->exiting || (stplyr->kartstuff[k_balloon] <= 0 && stplyr->kartstuff[k_comebacktimer] @@ -5029,7 +5031,7 @@ void K_drawKartHUD(void) if (!stplyr->spectator) // Bottom of the screen elements, don't need in spectate mode { - if (gametype == GT_RACE) // Race-only elements + if (G_RaceGametype()) // Race-only elements { // Draw the lap counter K_drawKartLaps(); @@ -5047,7 +5049,7 @@ void K_drawKartHUD(void) K_DrawKartPositionNum(stplyr->kartstuff[k_position]); } } - else if (gametype == GT_MATCH) // Battle-only + else if (G_BattleGametype()) // Battle-only { // Draw the hits left! K_drawKartBalloonsOrKarma(); diff --git a/src/p_enemy.c b/src/p_enemy.c index 380e60a3..7508b39c 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3926,7 +3926,7 @@ static inline boolean PIT_GrenadeRing(mobj_t *thing) return true; if (thing->player && (thing->player->kartstuff[k_bootimer] - || (gametype == GT_MATCH && thing->player && thing->player->kartstuff[k_balloon] <= 0 && thing->player->kartstuff[k_comebacktimer]))) + || (G_BattleGametype() && thing->player && thing->player->kartstuff[k_balloon] <= 0 && thing->player->kartstuff[k_comebacktimer]))) return true; if ((gametype == GT_CTF || gametype == GT_TEAMMATCH) @@ -8143,7 +8143,7 @@ void A_ItemPop(mobj_t *actor) remains->flags2 &= ~MF2_AMBUSH; - if (gametype != GT_RACE) + if (G_BattleGametype()) numgotboxes++; P_RemoveMobj(actor); @@ -8213,14 +8213,14 @@ void A_RedShellChase(mobj_t *actor) && actor->target->player->ctfteam == player->ctfteam) continue; - if (gametype == GT_RACE) // Only in races, in match and CTF you should go after any nearby players + if (G_RaceGametype()) // Only in races, in match and CTF you should go after any nearby players { // USER TARGET if (actor->target->player->kartstuff[k_position] != (player->kartstuff[k_position] + 1)) // Red Shells only go after the person directly ahead of you -Sryder continue; } - if (gametype != GT_RACE) + if (G_BattleGametype()) { if (player->kartstuff[k_balloon] <= 0) continue; @@ -8231,7 +8231,7 @@ void A_RedShellChase(mobj_t *actor) } } - if ((gametype == GT_RACE) || (gametype != GT_RACE // If in match etc. only home in when you get close enough, in race etc. home in all the time + if ((G_RaceGametype()) || (G_BattleGametype() // If in match etc. only home in when you get close enough, in race etc. home in all the time && P_AproxDistance(P_AproxDistance(player->mo->x-actor->x, player->mo->y-actor->y), player->mo->z-actor->z) < RING_DIST && player->kartstuff[k_balloon] > 0)) @@ -8242,7 +8242,7 @@ void A_RedShellChase(mobj_t *actor) // done looking if (actor->lastlook == stop) { - if (gametype == GT_RACE) + if (G_RaceGametype()) actor->lastlook = -2; return; } @@ -8289,7 +8289,7 @@ void A_BobombExplode(mobj_t *actor) if (mo2 == actor || mo2->type == MT_BOMBEXPLOSIONSOUND) // Don't explode yourself! Endless loop! continue; - if (gametype == GT_MATCH && actor->target && actor->target->player && actor->target->player->kartstuff[k_balloon] <= 0 && mo2 == actor->target) + if (G_BattleGametype() && actor->target && actor->target->player && actor->target->player->kartstuff[k_balloon] <= 0 && mo2 == actor->target) continue; if (P_AproxDistance(P_AproxDistance(mo2->x - actor->x, mo2->y - actor->y), mo2->z - actor->z) > actor->info->painchance) diff --git a/src/p_inter.c b/src/p_inter.c index 84c602de..7d4b70c7 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -158,7 +158,7 @@ boolean P_CanPickupItem(player_t *player, boolean weapon) //if (player->powers[pw_flashing] > (flashingtics/4)*3 && player->powers[pw_flashing] <= flashingtics) // return false; - if (gametype != GT_RACE && player->kartstuff[k_balloon] <= 0) // No balloons in Match + if (G_BattleGametype() && player->kartstuff[k_balloon] <= 0) // No balloons in Match return false; if (player->kartstuff[k_magnettimer]) // You should probably collect stuff when you're attracting it :V @@ -418,7 +418,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) { case MT_RANDOMITEM: // SRB2kart case MT_FLINGRANDOMITEM: - if (gametype != GT_RACE && player->kartstuff[k_balloon] <= 0) + if (G_BattleGametype() && player->kartstuff[k_balloon] <= 0) { if (player->kartstuff[k_comebackmode] == 0 && !player->kartstuff[k_comebacktimer]) { @@ -433,7 +433,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (!P_CanPickupItem(player, false) && special->tracer != toucher) return; - if (gametype != GT_RACE && special->tracer && special->tracer->player) + if (G_BattleGametype() && special->tracer && special->tracer->player) { special->tracer->player->kartstuff[k_comebackmode] = 0; @@ -2294,7 +2294,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source) } } } - else if (gametype == GT_MATCH) + else if (G_BattleGametype()) { K_CheckBalloons(); } @@ -2576,7 +2576,7 @@ static inline void P_NiGHTSDamage(mobj_t *target, mobj_t *source) player->flyangle += 180; // Shuffle's BETTERNIGHTSMOVEMENT? player->flyangle %= 360; - if (gametype == GT_RACE || gametype == GT_COMPETITION) + if (G_RaceGametype()) player->drillmeter -= 5*20; else { @@ -2750,7 +2750,7 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage) player->pflags &= ~(PF_CARRIED|PF_SLIDING|PF_ITEMHANG|PF_MACESPIN|PF_ROPEHANG|PF_NIGHTSMODE); // Burst weapons and emeralds in Match/CTF only - if (source && (gametype == GT_MATCH || gametype == GT_TEAMMATCH || gametype == GT_CTF)) + if (source && (G_BattleGametype())) { P_PlayerRingBurst(player, player->health - 1); P_PlayerEmeraldBurst(player, false); @@ -2794,7 +2794,7 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage) HU_DoCEcho(va("%s\\is no longer super.\\\\\\\\", player_names[player-players])); }*/ - if (gametype != GT_RACE) + if (G_BattleGametype()) { if (player->kartstuff[k_balloon] > 0) { @@ -3190,7 +3190,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da // Sudden-Death mode if (source && source->type == MT_PLAYER) { - if ((gametype == GT_MATCH || gametype == GT_TEAMMATCH || gametype == GT_CTF) && cv_suddendeath.value + if ((G_BattleGametype()) && cv_suddendeath.value && !player->powers[pw_flashing] && !player->powers[pw_invulnerability]) damage = 10000; } diff --git a/src/p_map.c b/src/p_map.c index aac39c86..15557ed4 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -383,7 +383,7 @@ static void P_DoTailsCarry(player_t *sonic, player_t *tails) || (gametype == GT_MATCH) || (G_GametypeHasTeams() && tails->ctfteam != sonic->ctfteam)) sonic->pflags &= ~PF_CARRIED; */ - if (tails->spectator || sonic->spectator || gametype == GT_RACE) // SRB2kart + if (tails->spectator || sonic->spectator || G_RaceGametype()) // SRB2kart sonic->pflags &= ~PF_CARRIED; else { @@ -1652,18 +1652,18 @@ static boolean PIT_CheckThing(mobj_t *thing) if (thing->player->kartstuff[k_growshrinktimer] || thing->player->kartstuff[k_squishedtimer] || thing->player->kartstuff[k_bootimer] || thing->player->kartstuff[k_spinouttimer] || thing->player->kartstuff[k_startimer] || thing->player->kartstuff[k_justbumped] - || (gametype != GT_RACE && (thing->player->kartstuff[k_balloon] <= 0 + || (G_BattleGametype() && (thing->player->kartstuff[k_balloon] <= 0 && (thing->player->kartstuff[k_comebacktimer] || thing->player->kartstuff[k_comebackmode] == 1))) || tmthing->player->kartstuff[k_growshrinktimer] || tmthing->player->kartstuff[k_squishedtimer] || tmthing->player->kartstuff[k_bootimer] || tmthing->player->kartstuff[k_spinouttimer] || tmthing->player->kartstuff[k_startimer] || tmthing->player->kartstuff[k_justbumped] - || (gametype != GT_RACE && (tmthing->player->kartstuff[k_balloon] <= 0 + || (G_BattleGametype() && (tmthing->player->kartstuff[k_balloon] <= 0 && (tmthing->player->kartstuff[k_comebacktimer] || tmthing->player->kartstuff[k_comebackmode] == 1)))) { return true; } - if (gametype != GT_RACE) + if (G_BattleGametype()) { if ((thing->player->kartstuff[k_balloon] <= 0 && thing->player->kartstuff[k_comebackmode] == 0) || (tmthing->player->kartstuff[k_balloon] <= 0 && tmthing->player->kartstuff[k_comebackmode] == 0)) @@ -1686,7 +1686,7 @@ static boolean PIT_CheckThing(mobj_t *thing) if (P_IsObjectOnGround(thing) && tmthing->momz < 0) { K_KartBouncing(tmthing, thing, true, false); - if (gametype != GT_RACE && tmthing->player->kartstuff[k_feather] & 2) + if (G_BattleGametype() && tmthing->player->kartstuff[k_feather] & 2) { K_StealBalloon(tmthing->player, thing->player, false); K_SpinPlayer(thing->player, tmthing); @@ -1695,7 +1695,7 @@ static boolean PIT_CheckThing(mobj_t *thing) else if (P_IsObjectOnGround(tmthing) && thing->momz < 0) { K_KartBouncing(thing, tmthing, true, false); - if (gametype != GT_RACE && thing->player->kartstuff[k_feather] & 2) + if (G_BattleGametype() && thing->player->kartstuff[k_feather] & 2) { K_StealBalloon(thing->player, tmthing->player, false); K_SpinPlayer(tmthing->player, thing); @@ -1704,7 +1704,7 @@ static boolean PIT_CheckThing(mobj_t *thing) else K_KartBouncing(tmthing, thing, false, false); - if (gametype != GT_RACE) + if (G_BattleGametype()) { if (thing->player->kartstuff[k_mushroomtimer] && !(tmthing->player->kartstuff[k_mushroomtimer])) { diff --git a/src/p_mobj.c b/src/p_mobj.c index c113d3d0..2f6cb42f 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6525,7 +6525,7 @@ void P_MobjThinker(mobj_t *mobj) INT32 HEIGHT; fixed_t radius; - if (gametype != GT_RACE && mobj->target->player->kartstuff[k_balloon] <= 0) + if (G_BattleGametype() && mobj->target->player->kartstuff[k_balloon] <= 0) kartspeed = 1; dsone = 26*4 + kartspeed*2 + (9 - mobj->target->player->kartweight); @@ -6845,7 +6845,7 @@ void P_MobjThinker(mobj_t *mobj) fixed_t scale = mobj->target->scale; mobj->color = mobj->target->color; - if (!netgame || gametype == GT_RACE + if (!netgame || G_RaceGametype() || mobj->target->player == &players[displayplayer] || mobj->target->player->kartstuff[k_balloon] <= 0 || (mobj->target->player->mo->flags2 & MF2_DONTDRAW)) @@ -7787,9 +7787,9 @@ void P_MobjThinker(mobj_t *mobj) P_SpawnGhostMobj(mobj); if (gamespeed == 0) - finalspeed = FixedMul(finalspeed, (mapheaderinfo[gamemap-1]->mobj_scale)-(mapheaderinfo[gamemap-1]->mobj_scale/4)); + finalspeed = FixedMul(finalspeed, FRACUNIT-FRACUNIT/4); else if (gamespeed == 2) - finalspeed = FixedMul(finalspeed, (mapheaderinfo[gamemap-1]->mobj_scale)+(mapheaderinfo[gamemap-1]->mobj_scale/4)); + finalspeed = FixedMul(finalspeed, FRACUNIT+FRACUNIT/4); mobj->angle = R_PointToAngle2(mobj->x, mobj->y, mobj->x+mobj->momx, mobj->y+mobj->momy); if (mobj->health <= 5) @@ -7797,12 +7797,14 @@ void P_MobjThinker(mobj_t *mobj) INT32 i; for (i = 5; i >= mobj->health; i--) { - finalspeed = FixedMul(finalspeed, (mapheaderinfo[gamemap-1]->mobj_scale)-(mapheaderinfo[gamemap-1]->mobj_scale/4)); + finalspeed = FixedMul(finalspeed, FRACUNIT-FRACUNIT/4); } + finalspeed = FixedMul(finalspeed, mapheaderinfo[gamemap-1]->mobj_scale); P_InstaThrust(mobj, mobj->angle, finalspeed); } else { + finalspeed = FixedMul(finalspeed, mapheaderinfo[gamemap-1]->mobj_scale); P_InstaThrust(mobj, mobj->angle, finalspeed); } @@ -7822,8 +7824,8 @@ void P_MobjThinker(mobj_t *mobj) case MT_REDITEM: { sector_t *sec2; - fixed_t topspeed = 64*(mapheaderinfo[gamemap-1]->mobj_scale); - fixed_t distbarrier = 512*(mapheaderinfo[gamemap-1]->mobj_scale); + fixed_t topspeed = 64*FRACUNIT; + fixed_t distbarrier = 512*FRACUNIT; fixed_t distaway; P_SpawnGhostMobj(mobj); @@ -7835,16 +7837,19 @@ void P_MobjThinker(mobj_t *mobj) if (gamespeed == 0) { - topspeed = FixedMul(topspeed, (mapheaderinfo[gamemap-1]->mobj_scale)-(mapheaderinfo[gamemap-1]->mobj_scale/4)); - distbarrier = FixedMul(distbarrier, (mapheaderinfo[gamemap-1]->mobj_scale)-(mapheaderinfo[gamemap-1]->mobj_scale/4)); + topspeed = FixedMul(topspeed, FRACUNIT-FRACUNIT/4); + distbarrier = FixedMul(distbarrier, FRACUNIT-FRACUNIT/4); } else if (gamespeed == 2) { - topspeed = FixedMul(topspeed, (mapheaderinfo[gamemap-1]->mobj_scale)+(mapheaderinfo[gamemap-1]->mobj_scale/4)); - distbarrier = FixedMul(distbarrier, (mapheaderinfo[gamemap-1]->mobj_scale)+(mapheaderinfo[gamemap-1]->mobj_scale/4); + topspeed = FixedMul(topspeed, FRACUNIT+FRACUNIT/4); + distbarrier = FixedMul(distbarrier, FRACUNIT+FRACUNIT/4); } - if (gametype == GT_RACE && mobj->tracer) + distbarrier = FixedMul(distbarrier, mapheaderinfo[gamemap-1]->mobj_scale); + topspeed = FixedMul(topspeed, mapheaderinfo[gamemap-1]->mobj_scale); + + if (G_RaceGametype() && mobj->tracer) { distaway = P_AproxDistance(mobj->tracer->x - mobj->x, mobj->tracer->y - mobj->y); if (distaway < distbarrier) @@ -7857,7 +7862,7 @@ void P_MobjThinker(mobj_t *mobj) } } - if (gametype != GT_RACE) + if (G_BattleGametype()) { mobj->friction -= 1228; if (mobj->friction > FRACUNIT) @@ -9310,7 +9315,7 @@ void P_RespawnSpecials(void) mobj_t *mo = NULL; mapthing_t *mthing = NULL; - if (gametype != GT_RACE) // Battle Mode vers + if (G_BattleGametype()) // Battle Mode vers { P_RespawnBattleSpecials(); return; @@ -9600,7 +9605,7 @@ void P_SpawnPlayer(INT32 playernum) overheadarrow->flags2 |= MF2_DONTDRAW; P_SetScale(overheadarrow, mobj->destscale); - if (gametype != GT_RACE) + if (G_BattleGametype()) { /*INT32 i; INT32 pcount = 0; @@ -10005,7 +10010,7 @@ void P_SpawnMapThing(mapthing_t *mthing) if (!cv_powerstones.value) return; - if (!(gametype == GT_MATCH || gametype == GT_CTF)) + if (!G_BattleGametype()) return; runemeraldmanager = true; diff --git a/src/p_setup.c b/src/p_setup.c index cc707baf..7f722548 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2871,7 +2871,7 @@ boolean P_SetupLevel(boolean skipprecip) CONS_Printf(M_GetText("No player currently available to become IT. Awaiting available players.\n")); } - else if (gametype == GT_RACE && server && cv_usemapnumlaps.value) + else if (G_RaceGametype() && server && cv_usemapnumlaps.value) CV_StealthSetValue(&cv_numlaps, mapheaderinfo[gamemap - 1]->numlaps); // =========== @@ -2978,12 +2978,12 @@ boolean P_SetupLevel(boolean skipprecip) // SRB2Kart: map load variables if (modeattacking) gamespeed = 2; - else if (gametype == GT_MATCH) + else if (G_BattleGametype()) gamespeed = 0; else gamespeed = cv_kartspeed.value; - if (gametype == GT_MATCH) + if (G_BattleGametype()) mirrormode = false; else mirrormode = cv_kartmirror.value; diff --git a/src/p_spec.c b/src/p_spec.c index 2042e492..46e6685d 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4133,10 +4133,10 @@ DoneSection2: case 10: // Finish Line // SRB2kart - 150117 - if (gametype == GT_RACE && (player->starpostcount >= numstarposts/2 || player->exiting)) + if (G_RaceGametype() && (player->starpostcount >= numstarposts/2 || player->exiting)) player->kartstuff[k_starpostwp] = player->kartstuff[k_waypoint] = 0; // - if (gametype == GT_RACE && !player->exiting) + if (G_RaceGametype() && !player->exiting) { if (player->starpostcount >= numstarposts/2) // srb2kart: must have touched *enough* starposts (was originally "(player->starpostnum == numstarposts)") { @@ -5617,7 +5617,7 @@ void P_SpawnSpecials(INT32 fromnetsave) switch(GETSECSPECIAL(sector->special, 4)) { case 10: // Circuit finish line - if (gametype == GT_RACE) + if (G_RaceGametype()) circuitmap = true; break; } @@ -6378,7 +6378,7 @@ void P_SpawnSpecials(INT32 fromnetsave) break; case 308: // Race-only linedef executor. Triggers once. - if (gametype != GT_RACE && gametype != GT_COMPETITION) + if (!G_RaceGametype()) lines[i].special = 0; break; diff --git a/src/p_user.c b/src/p_user.c index f873f1a3..155694fa 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -350,7 +350,7 @@ UINT8 P_FindLowestMare(void) mobj_t *mo2; UINT8 mare = UINT8_MAX; - if (gametype == GT_RACE || gametype == GT_COMPETITION) + if (G_RaceGametype()) return 0; // scan the thinkers @@ -685,7 +685,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) P_RestoreMusic(player); P_SetMobjState(player->mo->tracer, S_SUPERTRANS1); - if (gametype == GT_RACE || gametype == GT_COMPETITION) + if (G_RaceGametype()) { if (player->drillmeter < 48*20) player->drillmeter = 48*20; @@ -1653,7 +1653,7 @@ void P_DoPlayerExit(player_t *player) && (!player->spectator && ((!modifiedgame || savemoddata) && !demoplayback))) legitimateexit = true; - if (gametype == GT_RACE || gametype == GT_COMPETITION) // If in Race Mode, allow + if (G_RaceGametype()) // If in Race Mode, allow { // SRB2kart 120217 if (!countdown && !(netgame || multiplayer)) @@ -1696,7 +1696,7 @@ void P_DoPlayerExit(player_t *player) if (P_CheckRacers()) player->exiting = (14*TICRATE)/5 + 1; } - else if (gametype != GT_RACE) + else if (G_BattleGametype()) player->exiting = 8*TICRATE + 1; // Battle Mode exiting else player->exiting = (14*TICRATE)/5 + 2; // Accidental death safeguard??? @@ -5794,7 +5794,7 @@ static void P_NiGHTSMovement(player_t *player) && !player->exiting) player->nightstime--; } - else if (gametype != GT_RACE && gametype != GT_COMPETITION + else if (!G_RaceGametype() && !(player->mo->tracer->state >= &states[S_SUPERTRANS1] && player->mo->tracer->state <= &states[S_SUPERTRANS9]) && !(player->capsule && player->capsule->reactiontime) && !player->exiting) @@ -5947,7 +5947,7 @@ static void P_NiGHTSMovement(player_t *player) { player->mo->momx = player->mo->momy = 0; - if (gametype != GT_RACE && gametype != GT_COMPETITION) + if (!G_RaceGametype()) P_SetObjectMomZ(player->mo, 30*FRACUNIT, false); player->mo->tracer->angle += ANGLE_11hh; @@ -8111,7 +8111,7 @@ static void P_DeathThink(player_t *player) } } - if ((gametype == GT_RACE || gametype == GT_COMPETITION || (gametype == GT_COOP && (multiplayer || netgame))) && (player->lives <= 0)) + if ((G_RaceGametype() || (gametype == GT_COOP && (multiplayer || netgame))) && (player->lives <= 0)) { // Return to level music if (netgame) @@ -9251,7 +9251,7 @@ void P_PlayerThink(player_t *player) I_Error("player %s is in PST_REBORN\n", sizeu1(playeri)); #endif - if (gametype == GT_RACE || gametype == GT_COMPETITION) + if (G_RaceGametype()) { INT32 i; @@ -9304,7 +9304,7 @@ void P_PlayerThink(player_t *player) // If it is set, start subtracting // Don't allow it to go back to 0 - if (player->exiting > 1 && (player->exiting < 3*TICRATE || gametype != GT_RACE)) // SRB2kart - "&& player->exiting > 1" + if (player->exiting > 1 && (player->exiting < 3*TICRATE || !G_RaceGametype())) // SRB2kart - "&& player->exiting > 1" player->exiting--; if (player->exiting && countdown2) @@ -9667,7 +9667,7 @@ void P_PlayerThink(player_t *player) || (splitscreen > 1 && player == &players[thirddisplayplayer]) || (splitscreen > 2 && player == &players[fourthdisplayplayer])) && player->kartstuff[k_bootimer] == 0 && player->kartstuff[k_growshrinktimer] <= 0 - && (player->kartstuff[k_comebacktimer] == 0 || (gametype == GT_RACE || player->kartstuff[k_balloon] > 0))) + && (player->kartstuff[k_comebacktimer] == 0 || (G_RaceGametype() || player->kartstuff[k_balloon] > 0))) { if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < K_GetKartFlashing() && (leveltime & 1)) player->mo->flags2 |= MF2_DONTDRAW; From b29ad1e80437be3cacd049ef5c22ece5efa66bf7 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 4 Mar 2018 15:59:51 -0500 Subject: [PATCH 31/41] mobjscale: MT_FIREDITEM fix --- src/p_mobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 2f6cb42f..4fa18fdb 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -7082,7 +7082,7 @@ void P_MobjThinker(mobj_t *mobj) { x = mobj->target->x; y = mobj->target->y; - z = mobj->target->z + 80*FRACUNIT; + z = mobj->target->z + 80*(mapheaderinfo[gamemap-1]->mobj_scale); } P_TeleportMove(mobj, x, y, z); break; From 4d62fbf50991777e668faaff02024c5c9de85899 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 4 Mar 2018 18:42:06 -0500 Subject: [PATCH 32/41] Unlock all cheat no longer sets game modified if it can't find anything to unlock Sound test is also in the Options menu now. --- src/m_cheat.c | 20 ++++++++++++++++---- src/m_cond.c | 2 -- src/m_menu.c | 15 +++++++++++++-- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/src/m_cheat.c b/src/m_cheat.c index f7476fca..fed76edd 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -75,6 +75,7 @@ typedef struct static UINT8 cheatf_warp(void) { UINT8 i; + boolean success = false; /*if (modifiedgame) return 0;*/ @@ -82,12 +83,23 @@ static UINT8 cheatf_warp(void) if (menuactive && currentMenu != &MainDef) return 0; // Only on the main menu! - S_StartSound(0, sfx_kc42); - // Temporarily unlock EVERYTHING. - G_SetGameModified(false); for (i = 0; i < MAXUNLOCKABLES; i++) - unlockables[i].unlocked = true; + { + if (!unlockables[i].conditionset) + continue; + if (!unlockables[i].unlocked) + { + unlockables[i].unlocked = true; + success = true; + } + } + + if (success) + { + G_SetGameModified(false); + S_StartSound(0, sfx_kc42); + } // Refresh secrets menu existing. M_ClearMenus(true); diff --git a/src/m_cond.c b/src/m_cond.c index 2dfb502a..72932365 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -117,8 +117,6 @@ unlockable_t unlockables[MAXUNLOCKABLES] = /* 02 */ {"Chaotic Kart Cup", "Collect 15 Emblems", 0, 2, SECRET_NONE, 0, false, false, 0}, /* 03 */ {"Record Attack", "", 0, -1, SECRET_RECORDATTACK, 0, true, true, 0}, - /* 04 */ {"Play Credits", "", 10, -1, SECRET_CREDITS, 0, true, true, 0}, - /* 05 */ {"Sound Test", "", 20, -1, SECRET_SOUNDTEST, 0, true, true, 0}, }; // Default number of emblems and extra emblems diff --git a/src/m_menu.c b/src/m_menu.c index 1775dc9e..6c5e71f1 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1042,7 +1042,7 @@ static menuitem_t OP_MainMenu[] = {IT_SUBMENU | IT_STRING, NULL, "Server Options...", &OP_ServerOptionsDef, 80}, {IT_CALL | IT_STRING, NULL, "Play Credits", M_Credits, 100}, - //{IT_KEYHANDLER | IT_STRING, NULL, "Sound Test", M_HandleSoundTest, 110}, + {IT_KEYHANDLER | IT_STRING, NULL, "Sound Test", M_HandleSoundTest, 110}, }; static menuitem_t OP_ControlsMenu[] = @@ -1792,7 +1792,18 @@ menu_t MP_PlayerSetupDef = }; // Options -menu_t OP_MainDef = DEFAULTMENUSTYLE("M_OPTTTL", OP_MainMenu, &MainDef, 60, 30); +menu_t OP_MainDef = +{ + "M_OPTTTL", + sizeof (OP_MainMenu)/sizeof (menuitem_t), + &MainDef, + OP_MainMenu, + M_DrawSkyRoom, + 60, 30, + 0, + NULL +}; + menu_t OP_ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_ControlsMenu, &OP_MainDef, 60, 30); //menu_t OP_ControlListDef = DEFAULTMENUSTYLE("M_CONTRO", OP_ControlListMenu, &OP_ControlsDef, 60, 30); menu_t OP_MoveControlsDef = CONTROLMENUSTYLE(OP_MoveControlsMenu, &OP_ControlsDef); From 23d19e39da4f5e211c916e7c8277adf11a45b1f6 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 4 Mar 2018 18:57:34 -0500 Subject: [PATCH 33/41] whoop, minor thing --- src/m_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index 6c5e71f1..88fcd33b 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -688,7 +688,7 @@ static menuitem_t SR_LevelSelectMenu[] = static menuitem_t SR_UnlockChecklistMenu[] = { - {IT_SUBMENU | IT_STRING, NULL, "NEXT", &SR_MainDef, 192}, + {IT_SUBMENU | IT_STRING, NULL, "NEXT", &MainDef, 192}, }; static menuitem_t SR_EmblemHintMenu[] = From 6650e6c49ced3becaaa2e8a19d31db7591ad7445 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 5 Mar 2018 19:55:39 -0500 Subject: [PATCH 34/41] Maybe fixed dedicated? --- src/y_inter.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/y_inter.c b/src/y_inter.c index ed651ce3..d2fe08e9 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -2192,6 +2192,9 @@ void Y_VoteDrawer(void) for (i = 0; i < MAXPLAYERS; i++) { + if (dedicated && i == 0) // While leaving blank spots for non-existent players is largely intentional, the first spot *always* being blank looks a tad silly :V + continue; + if ((playeringame[i] && !players[i].spectator) && votes[i] != -1) { patch_t *pic; @@ -2298,6 +2301,13 @@ void Y_VoteTicker(void) numvotes++; } + if (numvotes < 1) // Whoops! Get outta here. + { + Y_UnloadVoteData(); + Y_FollowIntermission(); + return; + } + voteclient.rtics--; if (voteclient.rtics <= 0) From 53ef60584b9caefe8128ff8d73d68079f3590904 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 5 Mar 2018 20:14:50 -0500 Subject: [PATCH 35/41] Adjusted Sonic's stats (also made new characters default to 5-5 instead of using Sonic's stats) --- src/m_menu.c | 2 +- src/r_things.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 88fcd33b..69f6135c 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -111,7 +111,7 @@ const char *quitmsg[NUM_QUITMESSAGES]; // Stuff for customizing the player select screen Tails 09-22-2003 description_t description[32] = { - {"\x82Sonic\x80\n\x82Speed:\x80 6\n\x82Weight:\x80 4", "", "sonic"}, + {"\x82Sonic\x80\n\x82Speed:\x80 7\n\x82Weight:\x80 3", "", "sonic"}, {"???", "", ""}, {"???", "", ""}, {"???", "", ""}, diff --git a/src/r_things.c b/src/r_things.c index bac05b2f..541a7816 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -2467,8 +2467,8 @@ static void Sk_SetDefaultValue(skin_t *skin) skin->prefcolor = SKINCOLOR_GREEN; // SRB2kart - skin->kartspeed = 6; - skin->kartweight = 4; + skin->kartspeed = 5; + skin->kartweight = 5; // skin->normalspeed = 36<ability = CA_THOK; skin->actionspd = 60<kartspeed = 7; + skin->kartweight = 3; + // + skin->normalspeed = 36<runspeed = 28<thrustfactor = 5; From 7e007c28323d39f90005e811cd2247c5f1d422d8 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 6 Mar 2018 01:31:49 -0500 Subject: [PATCH 36/41] Restored bounce pad strafe --- src/k_kart.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index b0519f82..d1c563a6 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1342,7 +1342,7 @@ fixed_t K_3dKartMovement(player_t *player, boolean onground, fixed_t forwardmove fixed_t p_speed = K_GetKartSpeed(player, true); fixed_t p_accel = K_GetKartAccel(player); - if (!onground && !(player->kartstuff[k_feather] & 2)) return 0; // If the player isn't on the ground, there is no change in speed + if (!onground) return 0; // If the player isn't on the ground, there is no change in speed // ACCELCODE!!!1!11! oldspeed = R_PointToDist2(0, 0, player->rmomx, player->rmomy); // FixedMul(P_AproxDistance(player->rmomx, player->rmomy), player->mo->scale); @@ -2391,9 +2391,6 @@ INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue) if (player->spectator) return turnvalue; - if (player->kartstuff[k_feather] & 2 && !P_IsObjectOnGround(player->mo)) - adjustangle /= 2; - if (player->kartstuff[k_drift] != 0 && P_IsObjectOnGround(player->mo)) { // If we're drifting we have a completely different turning value @@ -3319,6 +3316,19 @@ void K_MoveKartPlayer(player_t *player, boolean onground) K_KartDrift(player, onground); + // Feather strafing + if (player->kartstuff[k_feather] & 2) + { + fixed_t strafe = 0; + fixed_t strength = FRACUNIT/32; + if (cmd->buttons & BT_DRIFTLEFT) + strafe--; + if (cmd->buttons & BT_DRIFTRIGHT) + strafe++; + strength += FixedDiv(player->speed, K_GetKartSpeed(player, true)); + P_Thrust(player->mo, player->mo->angle-ANGLE_90, strafe*strength); + } + // Quick Turning // You can't turn your kart when you're not moving. // So now it's time to burn some rubber! From 10f04aea52258eb358c80abc7c5e0a3c9dcaeda4 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Fri, 9 Mar 2018 20:57:13 -0500 Subject: [PATCH 37/41] Disable "Play Credits" if you're in a game I have no clue if it'd break or not if you used this in a netgame (my gut feeling is "it would break"), but even if it worked it'd be stupid :V --- src/m_menu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/m_menu.c b/src/m_menu.c index 69f6135c..22f5c29d 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -4159,6 +4159,8 @@ static void M_Options(INT32 choice) // if the player is playing _at all_, disable the erase data options OP_DataOptionsMenu[1].status = (Playing()) ? (IT_GRAYEDOUT) : (IT_STRING|IT_SUBMENU); + // SRB2Kart: Same with the "Play Credits" option + OP_MainMenu[6].status = (Playing()) ? (IT_GRAYEDOUT) : (IT_STRING|IT_CALL); OP_MainDef.prevMenu = currentMenu; M_SetupNextMenu(&OP_MainDef); From 367b037c4a8f38d20fcc22bf6c13c49a087d5e94 Mon Sep 17 00:00:00 2001 From: Sryder Date: Sun, 11 Mar 2018 06:38:22 +0000 Subject: [PATCH 38/41] Lower kart engine sound distance --- src/sounds.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sounds.c b/src/sounds.c index ec8ceea0..6a20d65a 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -470,9 +470,9 @@ sfxinfo_t S_sfx[NUMSFX] = {"lkt1", true, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"lkt2", true, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"lkt3", true, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"kart1", false, 48, 16, -1, NULL, 0, -1, -1, LUMPERROR}, - {"kart2", false, 48, 16, -1, NULL, 0, -1, -1, LUMPERROR}, - {"kart3", false, 48, 16, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kart1", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kart2", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kart3", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"mlap", true, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"sboost", true, 90, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"mush", false, 90, 0, -1, NULL, 0, -1, -1, LUMPERROR}, From 0d0e8566197b69a1e767acd843eab4e147987443 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 11 Mar 2018 12:58:33 -0400 Subject: [PATCH 39/41] Remove unused mousemove snippet --- src/g_game.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 2013d77e..430c511f 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1465,9 +1465,6 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) cmd->aiming = G_ClipAimingPitch(&laim); } - if (!mouseaiming && cv_mousemove.value) - forward += mousey; - if (analog || (!demoplayback && (player->climbing || (player->pflags & PF_SLIDING)))) // Analog for mouse From 8cb73c8d25158e6186a92528be29dcb6eef31ff4 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 11 Mar 2018 13:12:09 -0400 Subject: [PATCH 40/41] Fixed mouse turning Only works with spectating, and is affected by mirror --- src/g_game.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 430c511f..7dd30e79 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1465,12 +1465,8 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) cmd->aiming = G_ClipAimingPitch(&laim); } - if (analog || - (!demoplayback && (player->climbing - || (player->pflags & PF_SLIDING)))) // Analog for mouse - side += mousex*2; - else - cmd->angleturn = (INT16)(cmd->angleturn - (mousex*8)); + if (player->spectator) + cmd->angleturn = (INT16)(cmd->angleturn - (mousex*(mirrormode ? -1 : 1)*8)); mousex = mousey = mlooky = 0; From 517fcd4366fcb7e2eff78ea72379702de28b7563 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 11 Mar 2018 18:07:28 -0400 Subject: [PATCH 41/41] Better gamepad axis support --- src/d_netcmd.c | 20 +++-- src/g_game.c | 236 +++++++++++++++++++++++-------------------------- src/g_game.h | 13 +-- src/g_input.c | 13 +++ src/m_menu.c | 60 +++++++------ 5 files changed, 174 insertions(+), 168 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index fbf2dee0..d7972bd8 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -794,10 +794,6 @@ void D_RegisterClientCommands(void) //CV_RegisterVar(&cv_alwaysfreelook2); // g_input.c - CV_RegisterVar(&cv_sideaxis); - CV_RegisterVar(&cv_sideaxis2); - CV_RegisterVar(&cv_sideaxis3); - CV_RegisterVar(&cv_sideaxis4); CV_RegisterVar(&cv_turnaxis); CV_RegisterVar(&cv_turnaxis2); CV_RegisterVar(&cv_turnaxis3); @@ -806,6 +802,14 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_moveaxis2); CV_RegisterVar(&cv_moveaxis3); CV_RegisterVar(&cv_moveaxis4); + CV_RegisterVar(&cv_brakeaxis); + CV_RegisterVar(&cv_brakeaxis2); + CV_RegisterVar(&cv_brakeaxis3); + CV_RegisterVar(&cv_brakeaxis4); + CV_RegisterVar(&cv_aimaxis); + CV_RegisterVar(&cv_aimaxis2); + CV_RegisterVar(&cv_aimaxis3); + CV_RegisterVar(&cv_aimaxis4); CV_RegisterVar(&cv_lookaxis); CV_RegisterVar(&cv_lookaxis2); CV_RegisterVar(&cv_lookaxis3); @@ -814,10 +818,10 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_fireaxis2); CV_RegisterVar(&cv_fireaxis3); CV_RegisterVar(&cv_fireaxis4); - CV_RegisterVar(&cv_firenaxis); - CV_RegisterVar(&cv_firenaxis2); - CV_RegisterVar(&cv_firenaxis3); - CV_RegisterVar(&cv_firenaxis4); + CV_RegisterVar(&cv_driftaxis); + CV_RegisterVar(&cv_driftaxis2); + CV_RegisterVar(&cv_driftaxis3); + CV_RegisterVar(&cv_driftaxis4); // WARNING: the order is important when initialising mouse2 // we need the mouse2port diff --git a/src/g_game.c b/src/g_game.c index 7dd30e79..87d8953a 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -416,81 +416,37 @@ consvar_t cv_useranalog3 = {"useranalog3", "Off", CV_SAVE|CV_CALL, CV_OnOff, Use consvar_t cv_useranalog4 = {"useranalog4", "Off", CV_SAVE|CV_CALL, CV_OnOff, UserAnalog4_OnChange, 0, NULL, NULL, 0, 0, NULL}; #endif -#if defined (_WII) || defined (WMINPUT) -consvar_t cv_turnaxis = {"joyaxis_turn", "LStick.X", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_moveaxis = {"joyaxis_move", "LStick.Y", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_sideaxis = {"joyaxis_side", "RStick.X", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_lookaxis = {"joyaxis_look", "RStick.Y", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_fireaxis = {"joyaxis_fire", "LAnalog", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_firenaxis = {"joyaxis_firenormal", "RAnalog", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#else consvar_t cv_turnaxis = {"joyaxis_turn", "X-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#ifdef PSP consvar_t cv_moveaxis = {"joyaxis_move", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#else -consvar_t cv_moveaxis = {"joyaxis_move", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#endif -#ifdef _arch_dreamcast -consvar_t cv_sideaxis = {"joyaxis_side", "Triggers", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#elif defined (_XBOX) -consvar_t cv_sideaxis = {"joyaxis_side", "Alt X-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_lookaxis = {"joyaxis_look", "Alt Y-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#elif defined (PSP) -consvar_t cv_sideaxis = {"joyaxis_side", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#else -consvar_t cv_sideaxis = {"joyaxis_side", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#endif -#ifndef _XBOX -#ifdef PSP -consvar_t cv_lookaxis = {"joyaxis_look", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#else +consvar_t cv_brakeaxis = {"joyaxis_brake", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_aimaxis = {"joyaxis_aim", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_lookaxis = {"joyaxis_look", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#endif -#endif -consvar_t cv_fireaxis = {"joyaxis_fire", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_firenaxis = {"joyaxis_firenormal", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#endif +consvar_t cv_fireaxis = {"joyaxis_fire", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_driftaxis = {"joyaxis_drift", "Z-Axis-", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#if defined (_WII) || defined (WMINPUT) -consvar_t cv_turnaxis2 = {"joyaxis2_turn", "LStick.X", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_moveaxis2 = {"joyaxis2_move", "LStick.Y", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_sideaxis2 = {"joyaxis2_side", "RStick.X", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_lookaxis2 = {"joyaxis2_look", "RStick.Y", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_fireaxis2 = {"joyaxis2_fire", "LAnalog", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_firenaxis2 = {"joyaxis2_firenormal", "RAnalog", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#else consvar_t cv_turnaxis2 = {"joyaxis2_turn", "X-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_moveaxis2 = {"joyaxis2_move", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#ifdef _arch_dreamcast -consvar_t cv_sideaxis2 = {"joyaxis2_side", "Triggers", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#elif defined (_XBOX) -consvar_t cv_sideaxis2 = {"joyaxis2_side", "Alt X-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_lookaxis2 = {"joyaxis2_look", "Alt Y-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#elif defined (_PSP) -consvar_t cv_sideaxis2 = {"joyaxis2_side", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#else -consvar_t cv_sideaxis2 = {"joyaxis2_side", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#endif -#ifndef _XBOX +consvar_t cv_moveaxis2 = {"joyaxis2_move", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_brakeaxis2 = {"joyaxis2_brake", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_aimaxis2 = {"joyaxis2_aim", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_lookaxis2 = {"joyaxis2_look", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#endif -consvar_t cv_fireaxis2 = {"joyaxis2_fire", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_firenaxis2 = {"joyaxis2_firenormal", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#endif +consvar_t cv_fireaxis2 = {"joyaxis2_fire", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_driftaxis2 = {"joyaxis2_drift", "Z-Axis-", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_turnaxis3 = {"joyaxis3_turn", "X-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_moveaxis3 = {"joyaxis3_move", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_sideaxis3 = {"joyaxis3_side", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_moveaxis3 = {"joyaxis3_move", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_brakeaxis3 = {"joyaxis3_brake", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_aimaxis3 = {"joyaxis3_aim", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_lookaxis3 = {"joyaxis3_look", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_fireaxis3 = {"joyaxis3_fire", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_firenaxis3 = {"joyaxis3_firenormal", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_fireaxis3 = {"joyaxis3_fire", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_driftaxis3 = {"joyaxis3_drift", "Z-Axis-", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_turnaxis4 = {"joyaxis4_turn", "X-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_moveaxis4 = {"joyaxis4_move", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_sideaxis4 = {"joyaxis4_side", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_moveaxis4 = {"joyaxis4_move", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_brakeaxis4 = {"joyaxis4_brake", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_aimaxis4 = {"joyaxis4_aim", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_lookaxis4 = {"joyaxis4_look", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_fireaxis4 = {"joyaxis4_fire", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_firenaxis4 = {"joyaxis4_firenormal", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_fireaxis4 = {"joyaxis4_fire", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_driftaxis4 = {"joyaxis4_drift", "Z-Axis-", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; #if MAXPLAYERS > 16 @@ -843,17 +799,20 @@ static INT32 Joy1Axis(axis_input_e axissel) case AXISMOVE: axisval = cv_moveaxis.value; break; + case AXISBRAKE: + axisval = cv_brakeaxis.value; + break; + case AXISAIM: + axisval = cv_aimaxis.value; + break; case AXISLOOK: axisval = cv_lookaxis.value; break; - case AXISSTRAFE: - axisval = cv_sideaxis.value; - break; case AXISFIRE: axisval = cv_fireaxis.value; break; - case AXISFIRENORMAL: - axisval = cv_firenaxis.value; + case AXISDRIFT: + axisval = cv_driftaxis.value; break; default: return 0; @@ -920,17 +879,20 @@ static INT32 Joy2Axis(axis_input_e axissel) case AXISMOVE: axisval = cv_moveaxis2.value; break; + case AXISBRAKE: + axisval = cv_brakeaxis2.value; + break; + case AXISAIM: + axisval = cv_aimaxis2.value; + break; case AXISLOOK: axisval = cv_lookaxis2.value; break; - case AXISSTRAFE: - axisval = cv_sideaxis2.value; - break; case AXISFIRE: axisval = cv_fireaxis2.value; break; - case AXISFIRENORMAL: - axisval = cv_firenaxis2.value; + case AXISDRIFT: + axisval = cv_driftaxis2.value; break; default: return 0; @@ -992,26 +954,29 @@ static INT32 Joy3Axis(axis_input_e axissel) //find what axis to get switch (axissel) { - case AXISTURN: - axisval = cv_turnaxis3.value; - break; - case AXISMOVE: - axisval = cv_moveaxis3.value; - break; - case AXISLOOK: - axisval = cv_lookaxis3.value; - break; - case AXISSTRAFE: - axisval = cv_sideaxis3.value; - break; - case AXISFIRE: - axisval = cv_fireaxis3.value; - break; - case AXISFIRENORMAL: - axisval = cv_firenaxis3.value; - break; - default: - return 0; + case AXISTURN: + axisval = cv_turnaxis3.value; + break; + case AXISMOVE: + axisval = cv_moveaxis3.value; + break; + case AXISBRAKE: + axisval = cv_brakeaxis3.value; + break; + case AXISAIM: + axisval = cv_aimaxis3.value; + break; + case AXISLOOK: + axisval = cv_lookaxis3.value; + break; + case AXISFIRE: + axisval = cv_fireaxis3.value; + break; + case AXISDRIFT: + axisval = cv_driftaxis3.value; + break; + default: + return 0; } @@ -1070,26 +1035,29 @@ static INT32 Joy4Axis(axis_input_e axissel) //find what axis to get switch (axissel) { - case AXISTURN: - axisval = cv_turnaxis4.value; - break; - case AXISMOVE: - axisval = cv_moveaxis4.value; - break; - case AXISLOOK: - axisval = cv_lookaxis4.value; - break; - case AXISSTRAFE: - axisval = cv_sideaxis4.value; - break; - case AXISFIRE: - axisval = cv_fireaxis4.value; - break; - case AXISFIRENORMAL: - axisval = cv_firenaxis4.value; - break; - default: - return 0; + case AXISTURN: + axisval = cv_turnaxis4.value; + break; + case AXISMOVE: + axisval = cv_moveaxis4.value; + break; + case AXISBRAKE: + axisval = cv_brakeaxis4.value; + break; + case AXISAIM: + axisval = cv_aimaxis4.value; + break; + case AXISLOOK: + axisval = cv_lookaxis4.value; + break; + case AXISFIRE: + axisval = cv_fireaxis4.value; + break; + case AXISDRIFT: + axisval = cv_driftaxis4.value; + break; + default: + return 0; } @@ -1365,11 +1333,11 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) if (player->spectator || objectplacing) // SRB2Kart: spectators need special controls { - if (InputDown(gc_accelerate, ssplayer)) + if (InputDown(gc_accelerate, ssplayer) || (cv_usejoystick.value && axis > 0)) cmd->buttons |= BT_ACCELERATE; - if (InputDown(gc_brake, ssplayer)) + if (InputDown(gc_brake, ssplayer) || (cv_usejoystick.value && axis > 0)) cmd->buttons |= BT_BRAKE; - axis = JoyAxis(AXISMOVE, ssplayer); + axis = JoyAxis(AXISAIM, ssplayer); if (InputDown(gc_aimforward, ssplayer) || (gamepadjoystickmove && axis < 0) || (analogjoystickmove && axis < 0)) forward += forwardmove[1]; if (InputDown(gc_aimbackward, ssplayer) || (gamepadjoystickmove && axis > 0) || (analogjoystickmove && axis > 0)) @@ -1378,24 +1346,39 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) else { // forward with key or button // SRB2kart - we use an accel/brake instead of forward/backward. - if (InputDown(gc_accelerate, ssplayer) || player->kartstuff[k_mushroomtimer]) + axis = JoyAxis(AXISMOVE, ssplayer); + if (InputDown(gc_accelerate, ssplayer) || (gamepadjoystickmove && axis > 0) || player->kartstuff[k_mushroomtimer]) { cmd->buttons |= BT_ACCELERATE; forward = forwardmove[1]; // 50 } + else if (analogjoystickmove && axis > 0) + { + cmd->buttons |= BT_ACCELERATE; + // JOYAXISRANGE is supposed to be 1023 (divide by 1024) + forward += ((axis * forwardmove[1]) >> 10)*2; + } - if (InputDown(gc_brake, ssplayer)) + axis = JoyAxis(AXISBRAKE, ssplayer); + if (InputDown(gc_brake, ssplayer) || (gamepadjoystickmove && axis > 0)) { cmd->buttons |= BT_BRAKE; if (cmd->buttons & BT_ACCELERATE || cmd->forwardmove <= 0) forward -= forwardmove[0]; // 25 - Halved value so clutching is possible } + else if (analogjoystickmove && axis > 0) + { + cmd->buttons |= BT_BRAKE; + // JOYAXISRANGE is supposed to be 1023 (divide by 1024) + if (cmd->buttons & BT_ACCELERATE || cmd->forwardmove <= 0) + forward -= ((axis * forwardmove[0]) >> 10); + } // But forward/backward IS used for aiming. - axis = JoyAxis(AXISMOVE, ssplayer); - if (InputDown(gc_aimforward, ssplayer) || (gamepadjoystickmove && axis < 0) || (analogjoystickmove && axis < 0)) + axis = JoyAxis(AXISAIM, ssplayer); + if (InputDown(gc_aimforward, ssplayer) || (cv_usejoystick.value && axis < 0)) cmd->buttons |= BT_FORWARD; - if (InputDown(gc_aimbackward, ssplayer) || (gamepadjoystickmove && axis > 0) || (analogjoystickmove && axis > 0)) + if (InputDown(gc_aimbackward, ssplayer) || (cv_usejoystick.value && axis > 0)) cmd->buttons |= BT_BACKWARD; } @@ -1405,7 +1388,8 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) cmd->buttons |= BT_ATTACK; // drift button - if (InputDown(gc_drift, ssplayer)) + axis = JoyAxis(AXISDRIFT, ssplayer); + if (InputDown(gc_drift, ssplayer) || (cv_usejoystick.value && axis > 0)) cmd->buttons |= BT_DRIFT; // Lua scriptable buttons @@ -1503,12 +1487,12 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) else { cmd->forwardmove = (SINT8)(cmd->forwardmove + forward); - cmd->sidemove = (SINT8)(cmd->sidemove + side); + if (mirrormode) + cmd->sidemove = (SINT8)(cmd->sidemove - side); + else + cmd->sidemove = (SINT8)(cmd->sidemove + side); } - if (mirrormode) - cmd->sidemove = -cmd->sidemove; - if (ssplayer == 2 && player->bot == 1) { if (!player->powers[pw_tailsfly] && (cmd->forwardmove || cmd->sidemove || cmd->buttons)) { diff --git a/src/g_game.h b/src/g_game.h index 9e11727f..78f08e36 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -56,10 +56,10 @@ extern INT16 rw_maximums[NUM_WEAPONS]; // used in game menu extern consvar_t cv_crosshair, cv_crosshair2, cv_crosshair3, cv_crosshair4; extern consvar_t cv_invertmouse, cv_alwaysfreelook, cv_mousemove; -extern consvar_t cv_sideaxis,cv_turnaxis,cv_moveaxis,cv_lookaxis,cv_fireaxis,cv_firenaxis; -extern consvar_t cv_sideaxis2,cv_turnaxis2,cv_moveaxis2,cv_lookaxis2,cv_fireaxis2,cv_firenaxis2; -extern consvar_t cv_sideaxis3,cv_turnaxis3,cv_moveaxis3,cv_lookaxis3,cv_fireaxis3,cv_firenaxis3; -extern consvar_t cv_sideaxis4,cv_turnaxis4,cv_moveaxis4,cv_lookaxis4,cv_fireaxis4,cv_firenaxis4; +extern consvar_t cv_turnaxis,cv_moveaxis,cv_brakeaxis,cv_aimaxis,cv_lookaxis,cv_fireaxis,cv_driftaxis; +extern consvar_t cv_turnaxis2,cv_moveaxis2,cv_brakeaxis2,cv_aimaxis2,cv_lookaxis2,cv_fireaxis2,cv_driftaxis2; +extern consvar_t cv_turnaxis3,cv_moveaxis3,cv_brakeaxis3,cv_aimaxis3,cv_lookaxis3,cv_fireaxis3,cv_driftaxis3; +extern consvar_t cv_turnaxis4,cv_moveaxis4,cv_brakeaxis4,cv_aimaxis4,cv_lookaxis4,cv_fireaxis4,cv_driftaxis4; extern consvar_t cv_ghost_besttime, cv_ghost_bestlap, cv_ghost_last, cv_ghost_guest, cv_ghost_staff; typedef enum @@ -67,11 +67,12 @@ typedef enum AXISNONE = 0, AXISTURN, AXISMOVE, + AXISBRAKE, + AXISAIM, AXISLOOK, - AXISSTRAFE, AXISDEAD, //Axises that don't want deadzones AXISFIRE, - AXISFIRENORMAL, + AXISDRIFT, } axis_input_e; // mouseaiming (looking up/down with the mouse or keyboard) diff --git a/src/g_input.c b/src/g_input.c index cb5f189b..485263cb 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -1282,6 +1282,16 @@ void G_Controldefault(void) gamecontrol[gc_fire ][0] = KEY_SPACE; gamecontrol[gc_lookback ][0] = KEY_LSHIFT; + gamecontrol[gc_aimforward ][1] = KEY_HAT1+0; + gamecontrol[gc_aimbackward][1] = KEY_HAT1+1; + gamecontrol[gc_turnleft ][1] = KEY_HAT1+2; + gamecontrol[gc_turnright ][1] = KEY_HAT1+3; + gamecontrol[gc_accelerate ][1] = KEY_JOY1+0; // A + gamecontrol[gc_drift ][1] = KEY_JOY1+1; // X + gamecontrol[gc_brake ][1] = KEY_JOY1+2; // B + gamecontrol[gc_fire ][1] = KEY_JOY1+4; // LB + gamecontrol[gc_lookback ][1] = KEY_JOY1+5; // RB + // Extra controls gamecontrol[gc_camtoggle ][0] = KEY_BACKSPACE; gamecontrol[gc_pause ][0] = KEY_PAUSE; @@ -1291,6 +1301,9 @@ void G_Controldefault(void) gamecontrol[gc_scores ][0] = KEY_TAB; gamecontrol[gc_spectate ][0] = '\''; + gamecontrol[gc_scores ][1] = KEY_JOY1+6; // Back + gamecontrol[gc_spectate ][1] = KEY_JOY1+7; // Start (This is sort of like MP's pause...?) + // Spectator controls gamecontrol[gc_lookup ][0] = KEY_PGUP; gamecontrol[gc_lookdown ][0] = KEY_PGDN; diff --git a/src/m_menu.c b/src/m_menu.c index 22f5c29d..72f7bc58 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1194,47 +1194,51 @@ static menuitem_t OP_MiscControlsMenu[] = static menuitem_t OP_Joystick1Menu[] = { - {IT_STRING | IT_CALL, NULL, "Select Joystick...", M_Setup1PJoystickMenu, 10}, - {IT_STRING | IT_CVAR, NULL, "Axis For Turning" , &cv_turnaxis , 30}, - {IT_STRING | IT_CVAR, NULL, "Axis For Moving" , &cv_moveaxis , 40}, - {IT_STRING | IT_CVAR, NULL, "Axis For Strafe" , &cv_sideaxis , 50}, - {IT_STRING | IT_CVAR, NULL, "Axis For Looking" , &cv_lookaxis , 60}, - {IT_STRING | IT_CVAR, NULL, "Axis For Firing" , &cv_fireaxis , 70}, - {IT_STRING | IT_CVAR, NULL, "Axis For NFiring" , &cv_firenaxis , 80}, + {IT_STRING | IT_CALL, NULL, "Select Joystick..." , M_Setup1PJoystickMenu, 10}, + {IT_STRING | IT_CVAR, NULL, "Aim Forward/Back" , &cv_aimaxis , 30}, + {IT_STRING | IT_CVAR, NULL, "Turn Left/Right" , &cv_turnaxis , 40}, + {IT_STRING | IT_CVAR, NULL, "Accelerate" , &cv_moveaxis , 50}, + {IT_STRING | IT_CVAR, NULL, "Brake" , &cv_brakeaxis , 60}, + {IT_STRING | IT_CVAR, NULL, "Drift" , &cv_driftaxis , 70}, + {IT_STRING | IT_CVAR, NULL, "Use Item" , &cv_fireaxis , 80}, + {IT_STRING | IT_CVAR, NULL, "Look Up/Down" , &cv_lookaxis , 90}, }; static menuitem_t OP_Joystick2Menu[] = { - {IT_STRING | IT_CALL, NULL, "Select Joystick...", M_Setup2PJoystickMenu, 10}, - {IT_STRING | IT_CVAR, NULL, "Axis For Turning" , &cv_turnaxis2 , 30}, - {IT_STRING | IT_CVAR, NULL, "Axis For Moving" , &cv_moveaxis2 , 40}, - {IT_STRING | IT_CVAR, NULL, "Axis For Strafe" , &cv_sideaxis2 , 50}, - {IT_STRING | IT_CVAR, NULL, "Axis For Looking" , &cv_lookaxis2 , 60}, - {IT_STRING | IT_CVAR, NULL, "Axis For Firing" , &cv_fireaxis2 , 70}, - {IT_STRING | IT_CVAR, NULL, "Axis For NFiring" , &cv_firenaxis2 , 80}, + {IT_STRING | IT_CALL, NULL, "Select Joystick..." , M_Setup2PJoystickMenu, 10}, + {IT_STRING | IT_CVAR, NULL, "Aim Forward/Back" , &cv_aimaxis2 , 30}, + {IT_STRING | IT_CVAR, NULL, "Turn Left/Right" , &cv_turnaxis2 , 40}, + {IT_STRING | IT_CVAR, NULL, "Accelerate" , &cv_moveaxis2 , 50}, + {IT_STRING | IT_CVAR, NULL, "Brake" , &cv_brakeaxis2 , 60}, + {IT_STRING | IT_CVAR, NULL, "Drift" , &cv_driftaxis2 , 70}, + {IT_STRING | IT_CVAR, NULL, "Use Item" , &cv_fireaxis2 , 80}, + {IT_STRING | IT_CVAR, NULL, "Look Up/Down" , &cv_lookaxis2 , 90}, }; #ifndef NOFOURPLAYER static menuitem_t OP_Joystick3Menu[] = { - {IT_STRING | IT_CALL, NULL, "Select Joystick...", M_Setup3PJoystickMenu, 10}, - {IT_STRING | IT_CVAR, NULL, "Axis For Turning" , &cv_turnaxis3 , 30}, - {IT_STRING | IT_CVAR, NULL, "Axis For Moving" , &cv_moveaxis3 , 40}, - {IT_STRING | IT_CVAR, NULL, "Axis For Strafe" , &cv_sideaxis3 , 50}, - {IT_STRING | IT_CVAR, NULL, "Axis For Looking" , &cv_lookaxis3 , 60}, - {IT_STRING | IT_CVAR, NULL, "Axis For Firing" , &cv_fireaxis3 , 70}, - {IT_STRING | IT_CVAR, NULL, "Axis For NFiring" , &cv_firenaxis3 , 80}, + {IT_STRING | IT_CALL, NULL, "Select Joystick..." , M_Setup3PJoystickMenu, 10}, + {IT_STRING | IT_CVAR, NULL, "Aim Forward/Back" , &cv_aimaxis3 , 30}, + {IT_STRING | IT_CVAR, NULL, "Turn Left/Right" , &cv_turnaxis3 , 40}, + {IT_STRING | IT_CVAR, NULL, "Accelerate" , &cv_moveaxis3 , 50}, + {IT_STRING | IT_CVAR, NULL, "Brake" , &cv_brakeaxis3 , 60}, + {IT_STRING | IT_CVAR, NULL, "Drift" , &cv_driftaxis3 , 70}, + {IT_STRING | IT_CVAR, NULL, "Use Item" , &cv_fireaxis3 , 80}, + {IT_STRING | IT_CVAR, NULL, "Look Up/Down" , &cv_lookaxis3 , 90}, }; static menuitem_t OP_Joystick4Menu[] = { - {IT_STRING | IT_CALL, NULL, "Select Joystick...", M_Setup4PJoystickMenu, 10}, - {IT_STRING | IT_CVAR, NULL, "Axis For Turning" , &cv_turnaxis4 , 30}, - {IT_STRING | IT_CVAR, NULL, "Axis For Moving" , &cv_moveaxis4 , 40}, - {IT_STRING | IT_CVAR, NULL, "Axis For Strafe" , &cv_sideaxis4 , 50}, - {IT_STRING | IT_CVAR, NULL, "Axis For Looking" , &cv_lookaxis4 , 60}, - {IT_STRING | IT_CVAR, NULL, "Axis For Firing" , &cv_fireaxis4 , 70}, - {IT_STRING | IT_CVAR, NULL, "Axis For NFiring" , &cv_firenaxis4 , 80}, + {IT_STRING | IT_CALL, NULL, "Select Joystick..." , M_Setup4PJoystickMenu, 10}, + {IT_STRING | IT_CVAR, NULL, "Aim Forward/Back" , &cv_aimaxis4 , 30}, + {IT_STRING | IT_CVAR, NULL, "Turn Left/Right" , &cv_turnaxis4 , 40}, + {IT_STRING | IT_CVAR, NULL, "Accelerate" , &cv_moveaxis4 , 50}, + {IT_STRING | IT_CVAR, NULL, "Brake" , &cv_brakeaxis4 , 60}, + {IT_STRING | IT_CVAR, NULL, "Drift" , &cv_driftaxis4 , 70}, + {IT_STRING | IT_CVAR, NULL, "Use Item" , &cv_fireaxis4 , 80}, + {IT_STRING | IT_CVAR, NULL, "Look Up/Down" , &cv_lookaxis4 , 90}, }; #endif