diff --git a/src/g_game.c b/src/g_game.c index b653d259..6698af16 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4080,7 +4080,8 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean players[i].starpostx = players[i].starposty = players[i].starpostz = 0; players[i].starpostcount = 0; // srb2kart - /*if (netgame || multiplayer) +#if 0 + if (netgame || multiplayer) { players[i].lives = cv_startinglives.value; players[i].continues = 0; @@ -4096,7 +4097,10 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean players[i].continues = 1; } - players[i].xtralife = 0;*/ + players[i].xtralife = 0; +#else + players[i].lives = 1; // SRB2Kart +#endif // The latter two should clear by themselves, but just in case players[i].pflags &= ~(PF_TAGIT|PF_TAGGED|PF_FULLSTASIS); diff --git a/src/hardware/hw_main.h b/src/hardware/hw_main.h index 5af88dcd..c6a42d45 100644 --- a/src/hardware/hw_main.h +++ b/src/hardware/hw_main.h @@ -46,7 +46,6 @@ void HWR_SetViewSize(void); void HWR_DrawPatch(GLPatch_t *gpatch, INT32 x, INT32 y, INT32 option); void HWR_DrawFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t scale, INT32 option, const UINT8 *colormap); void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t scale, INT32 option, fixed_t sx, fixed_t sy, fixed_t w, fixed_t h); -void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, INT32 option, fixed_t scale, fixed_t sx, fixed_t sy, fixed_t w, fixed_t h); void HWR_MakePatch (const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipmap, boolean makebitmap); void HWR_CreatePlanePolygons(INT32 bspnum); void HWR_CreateStaticLightmaps(INT32 bspnum); diff --git a/src/k_kart.c b/src/k_kart.c index eec11a7e..0d91aa45 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1146,8 +1146,8 @@ void K_RespawnChecker(player_t *player) fixed_t newx, newy, newz; newangle = FixedAngle(((360/8)*i)*FRACUNIT); - newx = player->mo->x + P_ReturnThrustX(player->mo, newangle, 31*FRACUNIT); - newy = player->mo->y + P_ReturnThrustY(player->mo, newangle, 31*FRACUNIT); + newx = player->mo->x + P_ReturnThrustX(player->mo, newangle, 31*player->mo->scale); + newy = player->mo->y + P_ReturnThrustY(player->mo, newangle, 31*player->mo->scale); if (player->mo->eflags & MFE_VERTICALFLIP) newz = player->mo->z + player->mo->height; else @@ -3039,17 +3039,18 @@ INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue) return turnvalue; } +fixed_t K_GetKartDriftSparkValue(player_t *player) +{ + UINT8 kartspeed = (G_BattleGametype() && player->kartstuff[k_bumper] <= 0) + ? 1 + : player->kartspeed; + return (26*4 + kartspeed*2 + (9 - player->kartweight))*8; +} + static void K_KartDrift(player_t *player, boolean onground) { - UINT8 kartspeed = player->kartspeed; - fixed_t dsone, dstwo; - - if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0) - kartspeed = 1; - - // IF YOU CHANGE THESE: MAKE SURE YOU UPDATE THE SAME VALUES IN p_mobjc, "case MT_DRIFT:" - dsone = (26*4 + kartspeed*2 + (9 - player->kartweight))*8; - dstwo = dsone*2; + fixed_t dsone = K_GetKartDriftSparkValue(player); + fixed_t dstwo = dsone*2; // Drifting is actually straffing + automatic turning. // Holding the Jump button will enable drifting. @@ -4620,7 +4621,8 @@ static void K_drawKartTimestamp(void) if (modeattacking) // emblem time! { - INT32 workx; + INT32 workx = TIME_XB + 96, worky = TIME_Y+18; + UINT8 curemb = 0; emblem_t *emblem = M_GetLevelEmblems(gamemap); while (emblem) { @@ -4630,7 +4632,7 @@ static void K_drawKartTimestamp(void) { case ET_TIME: { - static boolean canplaysound = true; + static boolean canplaysound[3] = {true, true, true}; tic_t timetoreach = emblem->var; snprintf(targettext, 9, "%i:%02i.%02i", G_TicsToMinutes(timetoreach, false), @@ -4640,14 +4642,14 @@ static void K_drawKartTimestamp(void) if (stplyr->realtime > timetoreach) { splitflags = (splitflags &~ V_HUDTRANS)|V_HUDTRANSHALF; - if (canplaysound) + if (canplaysound[curemb]) { S_StartSound(NULL, sfx_s3k72); //sfx_s26d); -- you STOLE fizzy lifting drinks - canplaysound = false; + canplaysound[curemb] = false; } } - else if (!canplaysound) - canplaysound = true; + else if (!canplaysound[curemb]) + canplaysound[curemb] = true; targettext[8] = 0; } @@ -4656,16 +4658,18 @@ static void K_drawKartTimestamp(void) goto bademblem; } - workx = TIME_XB + 96 - V_StringWidth(targettext, 0); - V_DrawString(workx, TIME_Y+18, splitflags, targettext); - workx -= 16; if (emblem->collected) - V_DrawSmallMappedPatch(workx, TIME_Y+18, splitflags, W_CachePatchName(M_GetEmblemPatch(emblem), PU_CACHE), + V_DrawSmallMappedPatch(workx - 65, worky, splitflags, W_CachePatchName(M_GetEmblemPatch(emblem), PU_CACHE), R_GetTranslationColormap(TC_DEFAULT, M_GetEmblemColor(emblem), GTC_CACHE)); else - V_DrawSmallScaledPatch(workx, TIME_Y+18, splitflags, W_CachePatchName("NEEDIT", PU_CACHE)); + V_DrawSmallScaledPatch(workx, worky, splitflags, W_CachePatchName("NEEDIT", PU_CACHE)); - break; + V_DrawRightAlignedString(workx, worky, splitflags, targettext); + + if (!emblem->collected || ++curemb >= 3) + break; + + worky += 10; bademblem: emblem = M_GetLevelEmblems(-1); @@ -5464,8 +5468,13 @@ static void K_drawKartFirstPerson(void) static INT32 pnum1 = 0, pnum2 = 0, pnum3 = 0, pnum4 = 0; INT32 pn = 0, target = 0, splitflags = K_calcSplitFlags(V_SNAPTOBOTTOM); INT32 x = BASEVIDWIDTH/2, y = BASEVIDHEIGHT; + fixed_t scale; + UINT8 *colmap = NULL; ticcmd_t *cmd = &stplyr->cmd; + if (stplyr->mo && stplyr->mo->flags2 & MF2_DONTDRAW) + return; + if (stplyr == &players[secondarydisplayplayer] && splitscreen) pn = pnum2; else if (stplyr == &players[thirddisplayplayer] && splitscreen > 1) @@ -5477,15 +5486,20 @@ static void K_drawKartFirstPerson(void) if (splitscreen) { - y /= 2; + y >>= 1; if (splitscreen > 1) - x /= 2; + x >>= 1; } if (stplyr->spectator || !stplyr->mo) - splitflags |= FF_TRANS50; - else if (stplyr->speed < FixedMul(stplyr->runspeed, stplyr->mo->scale) && (leveltime & 1)) - y++; + splitflags |= FF_TRANS50; // this isn't EXPLICITLY right, it just gets the result we want, but i'm too lazy to look up the right way to do it + else + { + if (stplyr->speed < FixedMul(stplyr->runspeed, stplyr->mo->scale) && (leveltime & 1) && !splitscreen) + y++; + if (stplyr->mo->frame & FF_TRANSMASK) + splitflags |= (stplyr->mo->frame & FF_TRANSMASK); // ditto + } if (cmd->driftturn > 400) // strong left turn target = 2; @@ -5510,10 +5524,68 @@ static void K_drawKartFirstPerson(void) if (target > 2) target = 2; - if (splitscreen) - V_DrawSmallScaledPatch(x, y, splitflags, kp_fpview[target]); + x <<= FRACBITS; + y <<= FRACBITS; + + if (splitscreen == 1) + { + scale = (2*FRACUNIT)/3; + y += FRACUNIT/(vid.dupx < vid.dupy ? vid.dupx : vid.dupy); // correct a one-pixel gap on the screen view (not the basevid view) + } + else if (splitscreen) + scale = FRACUNIT/2; else - V_DrawScaledPatch(x, y, splitflags, kp_fpview[target]); + scale = FRACUNIT; + + if (stplyr->mo) + { + fixed_t dsone = K_GetKartDriftSparkValue(stplyr); + fixed_t dstwo = dsone*2; + +#ifndef DONTLIKETOASTERSFPTWEAKS + if (stplyr->rmomx || stplyr->rmomy || stplyr->frameangle != stplyr->mo->angle) // an approximation of drifting! + { + const angle_t ang = ((stplyr->frameangle != stplyr->mo->angle) + ? stplyr->frameangle + : R_PointToAngle2(0, 0, stplyr->rmomx, stplyr->rmomy)) + - stplyr->mo->angle; + // yes, the follwing is correct. no, you do not need to swap the x and y. + fixed_t xoffs = -P_ReturnThrustY(stplyr->mo, ang, BASEVIDWIDTH<<(FRACBITS-2)); + fixed_t yoffs = (splitscreen ? 0 : -(P_ReturnThrustX(stplyr->mo, ang, 4*FRACUNIT) - 4*FRACUNIT)); + + if (splitscreen) + xoffs = FixedMul(xoffs, scale); + + if (stplyr->frameangle == stplyr->mo->angle) + { + const fixed_t mag = FixedDiv(stplyr->speed, 10*stplyr->mo->scale); + + if (mag < FRACUNIT) + { + xoffs = FixedMul(xoffs, mag); + if (!splitscreen) + yoffs = FixedMul(yoffs, mag); + } + } + + x += xoffs; + if (!splitscreen) + y += yoffs; + } + + // drift sparks! + if ((leveltime & 1) && (stplyr->kartstuff[k_driftcharge] >= dstwo)) + colmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_TANGERINE, 0); + else if ((leveltime & 1) && (stplyr->kartstuff[k_driftcharge] >= dsone)) + colmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_SAPPHIRE, 0); + else +#endif + // invincibility/grow/shrink! + if (stplyr->mo->colorized && stplyr->mo->color) + colmap = R_GetTranslationColormap(TC_RAINBOW, stplyr->mo->color, 0); + } + + V_DrawFixedPatch(x, y, scale, splitflags, kp_fpview[target], colmap); if (stplyr == &players[secondarydisplayplayer] && splitscreen) pnum2 = pn; @@ -5578,7 +5650,7 @@ static void K_drawInput(void) target = 0; else // turning of multiple strengths! { - target = (abs(cmd->driftturn)+99)/100; + target = ((abs(cmd->driftturn) - 1)/125)+1; if (target > 4) target = 4; if (cmd->driftturn < 0) @@ -5722,10 +5794,22 @@ void K_drawKartHUD(void) K_drawInput(); } - // Draw the starting countdown after everything else. + // Draw the countdowns after everything else. if (leveltime >= starttime-(3*TICRATE) && leveltime < starttime+TICRATE) K_drawStartCountdown(); + else if (countdown && !stplyr->exiting) + { + char *countstr = va("%d", countdown/TICRATE); + + if (splitscreen > 1) + V_DrawCenteredString(BASEVIDWIDTH/4, LAPS_Y+1, K_calcSplitFlags(0), countstr); + else + { + INT32 karlen = strlen(countstr)*6; // half of 12 + V_DrawKartString((BASEVIDWIDTH/2)-karlen, LAPS_Y+3, K_calcSplitFlags(0), countstr); + } + } if (cv_kartdebugcheckpoint.value) K_drawCheckpointDebugger(); diff --git a/src/k_kart.h b/src/k_kart.h index 8a1fd9a3..ce8c6634 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -40,6 +40,7 @@ void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source); void K_RepairOrbitChain(mobj_t *orbit); boolean K_CheckPlayersRespawnColliding(INT32 playernum, fixed_t x, fixed_t y); INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue); +fixed_t K_GetKartDriftSparkValue(player_t *player); void K_StripItems(player_t *player); void K_MomentumToFacing(player_t *player); fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower); diff --git a/src/p_enemy.c b/src/p_enemy.c index ffe2bf47..ae39e196 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3239,8 +3239,10 @@ void A_WaterShield(mobj_t *actor) P_SpawnShieldOrb(player); } + /* // SRB2kart - Can't drown. if (player->powers[pw_underwater] && player->powers[pw_underwater] <= 12*TICRATE + 1) P_RestoreMusic(player); + */ player->powers[pw_underwater] = 0; diff --git a/src/p_inter.c b/src/p_inter.c index f7ce3fdb..1164aca7 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1547,12 +1547,14 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) || special->z > toucher->z + (toucher->height*2/3)) return; // Only go in the mouth + /* // SRB2kart - Can't drown. // Eaten by player! if (player->powers[pw_underwater] && player->powers[pw_underwater] <= 12*TICRATE + 1) P_RestoreMusic(player); if (player->powers[pw_underwater] < underwatertics + 1) player->powers[pw_underwater] = underwatertics + 1; + */ /* if (!player->climbing) @@ -2254,7 +2256,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source) { target->flags &= ~(MF_SOLID|MF_SHOOTABLE); // does not block P_UnsetThingPosition(target); - target->flags |= MF_NOBLOCKMAP; + target->flags |= MF_NOBLOCKMAP|MF_NOCLIPHEIGHT; P_SetThingPosition(target); if (!target->player->bot && !G_IsSpecialStage(gamemap) @@ -2329,9 +2331,9 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source) } } else if (G_BattleGametype()) - { K_CheckBumpers(); - } + + target->player->kartstuff[k_pogospring] = 0; } if (source && target && target->player && source->player) diff --git a/src/p_local.h b/src/p_local.h index eeb5bc1e..1534397e 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -150,6 +150,7 @@ boolean P_InQuicksand(mobj_t *mo); void P_SetObjectMomZ(mobj_t *mo, fixed_t value, boolean relative); void P_RestoreMusic(player_t *player); +void P_EndingMusic(player_t *player); void P_SpawnShieldOrb(player_t *player); mobj_t *P_SpawnGhostMobj(mobj_t *mobj); void P_GivePlayerRings(player_t *player, INT32 num_rings); diff --git a/src/p_mobj.c b/src/p_mobj.c index 4e520b1e..f16ffc61 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1343,7 +1343,7 @@ fixed_t P_GetMobjGravity(mobj_t *mo) // || (mo->state >= &states[S_PLAY_SPC1] && mo->state <= &states[S_PLAY_SPC4])))) // gravityadd = gravityadd/3; // less gravity while flying/gliding if (mo->player->climbing || (mo->player->pflags & PF_NIGHTSMODE)) - gravityadd = 0; + return 0; if (!(mo->flags2 & MF2_OBJECTFLIP) != !(mo->player->powers[pw_gravityboots])) // negated to turn numeric into bool - would be double negated, but not needed if both would be { @@ -6587,16 +6587,11 @@ void P_MobjThinker(mobj_t *mobj) { if (mobj->target && mobj->target->player && mobj->target->player->mo && mobj->target->player->health > 0 && !mobj->target->player->spectator) { - UINT8 kartspeed = mobj->target->player->kartspeed; - fixed_t dsone, dstwo; INT32 HEIGHT; fixed_t radius; - if (G_BattleGametype() && mobj->target->player->kartstuff[k_bumper] <= 0) - kartspeed = 1; - - dsone = (26*4 + kartspeed*2 + (9 - mobj->target->player->kartweight))*8; - dstwo = dsone*2; + fixed_t dsone = K_GetKartDriftSparkValue(mobj->target->player); + fixed_t dstwo = dsone*2; if (mobj->target->player->kartstuff[k_driftcharge] < dsone) { @@ -7427,7 +7422,11 @@ void P_MobjThinker(mobj_t *mobj) } } else // Apply gravity to fall downwards. + { P_SetObjectMomZ(mobj, -2*FRACUNIT/3, true); + if (mobj->player) + mobj->player->frameangle -= ANGLE_22h; + } } break; //{ SRB2kart Items - Death States diff --git a/src/p_setup.c b/src/p_setup.c index 4e763254..8a1d0d3f 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2197,11 +2197,15 @@ static void P_LevelInitStuff(void) for (i = 0; i < MAXPLAYERS; i++) { +#if 0 if ((netgame || multiplayer) && (gametype == GT_COMPETITION || players[i].lives <= 0)) { // In Co-Op, replenish a user's lives if they are depleted. players[i].lives = cv_startinglives.value; } +#else + players[i].lives = 1; +#endif players[i].realtime = countdown = countdown2 = 0; curlap = bestlap = 0; // SRB2Kart diff --git a/src/p_spec.c b/src/p_spec.c index 80ca8391..f3b62a64 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4231,23 +4231,7 @@ DoneSection2: if (player->laps >= (unsigned)cv_numlaps.value) { - if (P_IsLocalPlayer(player)) - { - // SRB2kart 200117 - if (splitscreen) - S_ChangeMusicInternal("krok", true); - else - { - if (player->kartstuff[k_position] == 1) - S_ChangeMusicInternal("krwin", true); - else if (K_IsPlayerLosing(player)) - S_ChangeMusicInternal("krlose", true); - else - S_ChangeMusicInternal("krok", true); - } - } - - if (P_IsLocalPlayer(player)) + if (!splitscreen && P_IsLocalPlayer(player)) S_StartSound(NULL, sfx_s3k6a); else if (player->kartstuff[k_position] == 1) S_StartSound(NULL, sfx_s253); diff --git a/src/p_user.c b/src/p_user.c index c2d190f8..d59a0990 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1121,6 +1121,59 @@ void P_PlayLivesJingle(player_t *player) } } +// +// P_EndingMusic +// +// Consistently sets ending music! +// +void P_EndingMusic(player_t *player) +{ + // Event - Level Finish + if (splitscreen + && (players[displayplayer].exiting || !players[displayplayer].lives) + && (players[secondarydisplayplayer].exiting || !players[secondarydisplayplayer].lives) + && ((splitscreen < 2) || players[thirddisplayplayer].exiting || !players[thirddisplayplayer].lives) + && ((splitscreen < 3) || players[fourthdisplayplayer].exiting || !players[fourthdisplayplayer].lives)) + { + if (G_RaceGametype()) + S_ChangeMusicInternal("krok", true); + else if (G_BattleGametype()) + S_ChangeMusicInternal("kbok", false); + } + else if (!splitscreen && !player->lives) // outta lives, outta time + { + if (G_RaceGametype()) + S_ChangeMusicInternal("krlose", true); + else if (G_BattleGametype()) + S_ChangeMusicInternal("kblose", false); + } + else if (player->exiting) + { + if (splitscreen) + return; + else if (G_RaceGametype()) + { + if (player->kartstuff[k_position] == 1) + S_ChangeMusicInternal("krwin", true); + else if (K_IsPlayerLosing(player)) + S_ChangeMusicInternal("krlose", true); + else + S_ChangeMusicInternal("krok", true); + } + else if (G_BattleGametype()) + { + if (player->kartstuff[k_position] == 1) + S_ChangeMusicInternal("kbwin", false); + else if (K_IsPlayerLosing(player)) + S_ChangeMusicInternal("kblose", false); + else + S_ChangeMusicInternal("kbok", false); + } + } + + S_SpeedMusic(1.0f); +} + // // P_RestoreMusic // @@ -1131,51 +1184,22 @@ void P_RestoreMusic(player_t *player) if (!P_IsLocalPlayer(player)) // Only applies to a local player return; - if (player->powers[pw_extralife] > 1) + if (player->exiting) return; + + if (countdown && countdown <= 11*TICRATE - 1) + return; + S_SpeedMusic(1.0f); // SRB2kart - We have some different powers than vanilla, some of which tweak the music. // Event - Level Start if (leveltime < (starttime + (TICRATE/2))) S_ChangeMusicInternal("kstart", false); //S_StopMusic(); - else + else // see also where time overs are handled - search for "lives = 2" in this file { - // Event - Level Finish - if (splitscreen - && (players[displayplayer].exiting - || players[secondarydisplayplayer].exiting - || players[thirddisplayplayer].exiting - || players[fourthdisplayplayer].exiting)) - { - if (G_RaceGametype()) - S_ChangeMusicInternal("krok", true); - else if (G_BattleGametype()) - S_ChangeMusicInternal("kbok", false); - } - else if (!splitscreen && player->exiting) - { - if (G_RaceGametype()) - { - if (player->kartstuff[k_position] == 1) - S_ChangeMusicInternal("krwin", true); - else if (K_IsPlayerLosing(player)) - S_ChangeMusicInternal("krlose", true); - else - S_ChangeMusicInternal("krok", true); - } - else if (G_BattleGametype()) - { - if (player->kartstuff[k_position] == 1) - S_ChangeMusicInternal("kbwin", false); - else if (K_IsPlayerLosing(player)) - S_ChangeMusicInternal("kblose", false); - else - S_ChangeMusicInternal("kbok", false); - } - } // Item - Grow - else if (player->kartstuff[k_growshrinktimer] > 1 && player->playerstate == PST_LIVE) + if (player->kartstuff[k_growshrinktimer] > 1 && player->playerstate == PST_LIVE) S_ChangeMusicInternal("kgrow", true); // Item - Invincibility else if (player->kartstuff[k_invincibilitytimer] > 1 && player->playerstate == PST_LIVE) @@ -1688,26 +1712,14 @@ void P_DoPlayerExit(player_t *player) else S_StartSound(player->mo, sfx_kwin); - if (P_IsLocalPlayer(player) && cv_inttime.value > 0) - { - if (!splitscreen) - { - if (player->kartstuff[k_position] == 1) - S_ChangeMusicInternal("krwin", true); - else if (K_IsPlayerLosing(player)) - S_ChangeMusicInternal("krlose", true); - else - S_ChangeMusicInternal("krok", true); - } - else - S_ChangeMusicInternal("krok", true); - } - player->exiting = 3*TICRATE; + if (P_IsLocalPlayer(player) && cv_inttime.value > 0) + P_EndingMusic(player); + // SRB2kart 120217 if (!countdown2 && !(netgame || multiplayer)) - countdown2 = (66)*TICRATE + 1; // 6 seconds past the time over + countdown2 = (68)*TICRATE + 1; // 8 seconds past the time over... so close to nice else if (!countdown2) countdown2 = (8 + cv_countdowntime.value)*TICRATE + 1; // 8 sec more than countdowntime -- 11 is too much @@ -1716,24 +1728,10 @@ void P_DoPlayerExit(player_t *player) } else if (G_BattleGametype()) // Battle Mode exiting { - //S_StopMusic(); + player->exiting = 8*TICRATE + 1; if (P_IsLocalPlayer(player)) - { - if (!splitscreen) - { - if (player->kartstuff[k_position] == 1) - S_ChangeMusicInternal("kbwin", false); - else if (K_IsPlayerLosing(player)) - S_ChangeMusicInternal("kblose", false); - else - S_ChangeMusicInternal("kbok", false); - } - else - S_ChangeMusicInternal("kbok", false); - } - - player->exiting = 8*TICRATE + 1; + P_EndingMusic(player); } else player->exiting = (14*TICRATE)/5 + 2; // Accidental death safeguard??? @@ -1750,7 +1748,6 @@ void P_DoPlayerExit(player_t *player) player->powers[pw_underwater] = 0; player->powers[pw_spacetime] = 0; player->kartstuff[k_cardanimation] = 0; // srb2kart: reset battle animation - P_RestoreMusic(player); /*if (playeringame[player-players] && netgame && !circuitmap) CONS_Printf(M_GetText("%s has completed the level.\n"), player_names[player-players]);*/ @@ -2173,6 +2170,7 @@ static void P_CheckQuicksand(player_t *player) // // Restores music from sneaker and life fanfares // +/* // SRB2kart - Can't drown. static void P_CheckSneakerAndLivesTimer(player_t *player) { if ((player->powers[pw_underwater] <= 11*TICRATE + 1) @@ -2185,12 +2183,14 @@ static void P_CheckSneakerAndLivesTimer(player_t *player) //if (player->powers[pw_sneakers] == 1) // SRB2kart // P_RestoreMusic(player); } +*/ // // P_CheckUnderwaterAndSpaceTimer // // Restores music from underwater and space warnings, and handles number generation // +/* // SRB2kart - Can't drown. static void P_CheckUnderwaterAndSpaceTimer(player_t *player) { fixed_t height; @@ -2299,7 +2299,7 @@ static void P_CheckUnderwaterAndSpaceTimer(player_t *player) player->powers[pw_spacetime] = 0; } -} +}*/ // // P_CheckInvincibilityTimer @@ -2343,11 +2343,11 @@ static void P_CheckInvincibilityTimer(player_t *player) P_SpawnShieldOrb(player); } - if ((player->powers[pw_underwater] <= 11*TICRATE + 1) + /*if ((player->powers[pw_underwater] <= 11*TICRATE + 1) && (player->powers[pw_underwater] > 1)) return; // don't restore music if drowning music is playing - if (!player->powers[pw_super] || (mapheaderinfo[gamemap-1]->levelflags & LF_NOSSMUSIC)) + if (!player->powers[pw_super] || (mapheaderinfo[gamemap-1]->levelflags & LF_NOSSMUSIC))*/ P_RestoreMusic(player); } } @@ -6490,8 +6490,8 @@ static void P_MovePlayer(player_t *player) { player->pflags |= PF_FULLSTASIS; // If you're in stasis in tag, you don't drown. - if (player->powers[pw_underwater] <= 12*TICRATE + 1) - P_RestoreMusic(player); + /*if (player->powers[pw_underwater] <= 12*TICRATE + 1) + P_RestoreMusic(player);*/ player->powers[pw_underwater] = player->powers[pw_spacetime] = 0; } } @@ -7864,44 +7864,34 @@ void P_FindEmerald(void) // static void P_DeathThink(player_t *player) { - ticcmd_t *cmd = &player->cmd; + //ticcmd_t *cmd = &player->cmd; //player->deltaviewheight = 0; if (player->deadtimer < INT32_MAX) player->deadtimer++; // continue logic - if (!(netgame || multiplayer) && player->lives <= 0) + /*if (!(netgame || multiplayer) && player->lives <= 0) { if (player->deadtimer > TICRATE && (cmd->buttons & BT_BRAKE || cmd->buttons & BT_ACCELERATE || cmd->buttons & BT_DRIFT) && player->continues > 0) G_UseContinue(); else if (player->deadtimer >= gameovertics) G_UseContinue(); // Even if we don't have one this handles ending the game - } + }*/ // Force respawn if idle for more than 30 seconds in shooter modes. - if (player->deadtimer > 30*TICRATE && !G_RaceGametype()) + /*if (player->deadtimer > 30*TICRATE && !G_RaceGametype()) player->playerstate = PST_REBORN; - else if (player->lives > 0 && !G_IsSpecialStage(gamemap) && leveltime >= starttime) // Don't allow "click to respawn" in special stages! + else if (player->lives > 0 && !G_IsSpecialStage(gamemap)*/ + if (player->lives > 0 && leveltime >= starttime) // *could* you respawn? { - // SRB2kart-- But wait, why'd we add this? :eggthinking: - /*if (player->spectator) - { - CONS_Printf("%s entered the game.\n", player_names[player-players]); - player->spectator = false; - }*/ - - //player->kartstuff[k_respawn] = 48; // See G_PlayerReborn in g_game.c - // SRB2kart - spawn automatically after 1 second - if (player->deadtimer > cv_respawntime.value*TICRATE) - player->playerstate = PST_REBORN; - - // Single player auto respawn - if (!(netgame || multiplayer) && player->deadtimer > 5*TICRATE) - player->playerstate = PST_REBORN; + if (player->deadtimer > ((netgame || multiplayer) + ? cv_respawntime.value*TICRATE + : TICRATE)) // don't let them change it in record attack + player->playerstate = PST_REBORN; } - else if ((netgame || multiplayer) && player->deadtimer == 8*TICRATE) + /*else if ((netgame || multiplayer) && player->deadtimer == 8*TICRATE) { // In a net/multiplayer game, and out of lives if (gametype == GT_COMPETITION) @@ -7937,13 +7927,11 @@ static void P_DeathThink(player_t *player) countdown2 = 1*TICRATE; skipstats = true; - /* // SRB2kart 010217 - Score doesn't need to be reset in Kart. for (i = 0; i < MAXPLAYERS; i++) { if (playeringame[i]) players[i].score = 0; } - */ //emeralds = 0; tokenbits = 0; @@ -7951,7 +7939,7 @@ static void P_DeathThink(player_t *player) token = 0; } } - } + }*/ // Keep time rolling if (!(countdown2 && !countdown) && !player->exiting && !(player->pflags & PF_TIMEOVER)) @@ -7975,9 +7963,12 @@ static void P_DeathThink(player_t *player) } } - if ((G_RaceGametype() || (gametype == GT_COOP && (multiplayer || netgame))) && (player->lives <= 0)) + if (G_RaceGametype() && (player->lives <= 0)) { - // Return to level music + // to the lose music! + if (player->deadtimer == 4*TICRATE && P_IsLocalPlayer(player)) + P_EndingMusic(player); + /*// Return to level music if (netgame) { if (player->deadtimer == gameovertics && P_IsLocalPlayer(player)) @@ -8012,7 +8003,7 @@ static void P_DeathThink(player_t *player) break; } } - } + }*/ } if (!player->mo) @@ -9183,7 +9174,7 @@ void P_PlayerThink(player_t *player) // If 10 seconds are left on the timer, // begin the drown music for countdown! - /* + if (countdown == 11*TICRATE - 1) { if (P_IsLocalPlayer(player)) @@ -9192,8 +9183,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->spectator && player->lives > 0) + else 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]); @@ -9213,7 +9203,12 @@ void P_PlayerThink(player_t *player) S_StartScreamSound(player->mo, sfx_s3k66); } - player->lives = 2; // Don't start the game over music! + //player->lives = 2; // Don't start the game over music! -- it's never going to play in srb2kart you numpnut + S_StopSound(player->mo); + if (player->playerstate == PST_LIVE + && (player->kartstuff[k_growshrinktimer] > 1 + || player->kartstuff[k_invincibilitytimer] > 1)) + S_StopMusic(); P_DamageMobj(player->mo, NULL, NULL, 10000); player->lives = 0; @@ -9296,12 +9291,16 @@ void P_PlayerThink(player_t *player) player->health = 1; } +#if 0 if ((netgame || multiplayer) && player->lives <= 0) { // In Co-Op, replenish a user's lives if they are depleted. // of course, this is just a cheap hack, meh... player->lives = cv_startinglives.value; } +#else + player->lives = 1; // SRB2Kart +#endif if (player == &players[displayplayer]) playerdeadview = false; @@ -9430,9 +9429,9 @@ void P_PlayerThink(player_t *player) #endif //P_DoSuperStuff(player); - P_CheckSneakerAndLivesTimer(player); + //P_CheckSneakerAndLivesTimer(player); P_DoBubbleBreath(player); // Spawn Sonic's bubbles - P_CheckUnderwaterAndSpaceTimer(player); // Display the countdown drown numbers! + //P_CheckUnderwaterAndSpaceTimer(player); // Display the countdown drown numbers! P_CheckInvincibilityTimer(player); // Spawn Invincibility Sparkles P_DoPlayerHeadSigns(player); // Spawn Tag/CTF signs over player's head @@ -9500,6 +9499,7 @@ void P_PlayerThink(player_t *player) if (player->powers[pw_tailsfly] && player->powers[pw_tailsfly] < UINT16_MAX && player->charability != CA_SWIM && !(player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]))) // tails fly counter player->powers[pw_tailsfly]--; + /* // SRB2kart - Can't drown. if (player->powers[pw_underwater] && (player->pflags & PF_GODMODE || (player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL)) { if (player->powers[pw_underwater] <= 12*TICRATE+1) @@ -9514,6 +9514,7 @@ void P_PlayerThink(player_t *player) player->powers[pw_spacetime] = 0; else if (player->powers[pw_spacetime] && !(maptol & TOL_NIGHTS) && !((netgame || multiplayer) && player->spectator)) // underwater timer player->powers[pw_spacetime]--; + */ if (player->powers[pw_gravityboots] && player->powers[pw_gravityboots] < UINT16_MAX) player->powers[pw_gravityboots]--; diff --git a/src/st_stuff.c b/src/st_stuff.c index 331e7b32..aec715d7 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1843,18 +1843,7 @@ static void ST_overlayDrawer(void) if (!hu_showscores) // hide the following if TAB is held { // Countdown timer for Race Mode - if (countdown) - { - INT32 x = BASEVIDWIDTH/2; - INT32 y = BASEVIDHEIGHT-24; - if (splitscreen) - { - y = (BASEVIDHEIGHT/2)-12; - if (splitscreen > 1) - x = BASEVIDWIDTH/4; - } - V_DrawCenteredString(x, y, K_calcSplitFlags(0), va("%d", countdown/TICRATE)); - } + // ...moved to k_kart.c so we can take advantage of the LAPS_Y value K_drawKartHUD(); diff --git a/src/y_inter.c b/src/y_inter.c index 06f2e2da..f2e10985 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -480,7 +480,7 @@ void Y_IntermissionDrawer(void) } } } - else if (intertype == int_ctf || intertype == int_teammatch) + /*else if (intertype == int_ctf || intertype == int_teammatch) { INT32 x = 4, y = 0; INT32 redplayers = 0, blueplayers = 0; @@ -636,7 +636,7 @@ void Y_IntermissionDrawer(void) if (y > 176) break; } - } + }*/ if (timer) V_DrawCenteredString(BASEVIDWIDTH/2, 188, hilicol,