From 370f290a08b4cef8b16193f6b8028b42c9757593 Mon Sep 17 00:00:00 2001 From: ZTsukei Date: Thu, 16 Feb 2017 21:33:00 -0500 Subject: [PATCH] Fixed position code, added some item numbers --- src/doomdef.h | 16 +-- src/info.c | 4 +- src/k_kart.c | 352 ++++++++++++++++++++++++++------------------------ src/k_kart.h | 2 +- src/p_mobj.c | 9 +- src/p_user.c | 22 ++-- 6 files changed, 210 insertions(+), 195 deletions(-) diff --git a/src/doomdef.h b/src/doomdef.h index a07fdb6c..c9d521c2 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -149,9 +149,9 @@ extern FILE *logstream; // we use comprevision and compbranch instead. #else #define VERSION 100 // Game version -#define SUBVERSION 0 // more precise version number -#define VERSIONSTRING "v1.0.00" -#define VERSIONSTRINGW L"v1.0.00" +#define SUBVERSION 3 // more precise version number +#define VERSIONSTRING "v1.0.03" +#define VERSIONSTRINGW L"v1.0.03" // Hey! If you change this, add 1 to the MODVERSION below! // Otherwise we can't force updates! #endif @@ -171,8 +171,8 @@ extern FILE *logstream; // The string used in the alert that pops up in the event of an update being available. // Please change to apply to your modification (we don't want everyone asking where your mod is on SRB2.org!). #define UPDATE_ALERT_STRING \ -"A new update is available for SRB2.\n"\ -"Please visit SRB2.org to download it.\n"\ +"A new update is available for SRB2kart.\n"\ +"Please visit the forums on SRB2.org to download it.\n"\ "\n"\ "You are using version: %s\n"\ "The newest version is: %s\n"\ @@ -188,8 +188,8 @@ extern FILE *logstream; // The string used in the I_Error alert upon trying to host through command line parameters. // Generally less filled with newlines, since Windows gives you lots more room to work with. #define UPDATE_ALERT_STRING_CONSOLE \ -"A new update is available for SRB2.\n"\ -"Please visit SRB2.org to download it.\n"\ +"A new update is available for SRB2kart.\n"\ +"Please visit the forums on SRB2.org to download it.\n"\ "\n"\ "You are using version: %s\n"\ "The newest version is: %s\n"\ @@ -213,7 +213,7 @@ extern FILE *logstream; // it's only for detection of the version the player is using so the MS can alert them of an update. // Only set it higher, not lower, obviously. // Note that we use this to help keep internal testing in check; this is why v2.1.0 is not version "1". -#define MODVERSION 20 +#define MODVERSION 1 // ========================================================================= diff --git a/src/info.c b/src/info.c index 984fb250..f63e0c0d 100644 --- a/src/info.c +++ b/src/info.c @@ -14951,7 +14951,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_POKEY - 2002, // doomednum + 2100, // doomednum S_POKEY1, // spawnstate 1000, // spawnhealth S_POKEY1, // seestate @@ -14978,7 +14978,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_ENEMYFLIP - 2003, // doomednum + 2101, // doomednum S_NULL, // spawnstate 1000, // spawnhealth S_NULL, // seestate diff --git a/src/k_kart.c b/src/k_kart.c index 8a4e974f..bef6da91 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -310,9 +310,9 @@ static fixed_t K_KartItemOdds_Retro[MAXPLAYERS][NUMKARTITEMS][MAXPLAYERS] = { // 1 Active Player { //1st // - { 0 }, // Magnet + { 40 }, // Magnet { 0 }, // Boo - { 40 }, // Mushroom + { 0 }, // Mushroom { 0 }, // Triple Mushroom { 0 }, // Mega Mushroom { 0 }, // Gold Mushroom @@ -332,21 +332,21 @@ static fixed_t K_KartItemOdds_Retro[MAXPLAYERS][NUMKARTITEMS][MAXPLAYERS] = // 2 Active Players { //1st 2nd // - { 0, 0 }, // Magnet + { 1, 0 }, // Magnet { 0, 0 }, // Boo - { 0, 0 }, // Mushroom - { 0, 0 }, // Triple Mushroom - { 0, 0 }, // Mega Mushroom - { 0, 0 }, // Gold Mushroom + { 6, 11 }, // Mushroom + { 0, 3 }, // Triple Mushroom + { 0, 1 }, // Mega Mushroom + { 0, 1 }, // Gold Mushroom { 0, 0 }, // Star - { 0, 0 }, // Triple Banana - { 0, 0 }, // Fake Item - { 0, 0 }, // Banana - { 0, 0 }, // Green Shell - { 0, 0 }, // Red Shell - { 0, 0 }, // Triple Green Shell + { 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, 0 }, // Blue Shell + { 0, 2 }, // Blue Shell { 0, 0 }, // Fire Flower { 0, 0 }, // Triple Red Shell { 0, 0 } // Lightning @@ -354,90 +354,90 @@ static fixed_t K_KartItemOdds_Retro[MAXPLAYERS][NUMKARTITEMS][MAXPLAYERS] = // 3 Active Players { //1st 2nd 3rd // - { 0, 0, 0 }, // Magnet - { 0, 0, 0 }, // Boo - { 0, 0, 0 }, // Mushroom - { 0, 0, 0 }, // Triple Mushroom - { 0, 0, 0 }, // Mega Mushroom - { 0, 0, 0 }, // Gold Mushroom - { 0, 0, 0 }, // Star - { 0, 0, 0 }, // Triple Banana - { 0, 0, 0 }, // Fake Item - { 0, 0, 0 }, // Banana - { 0, 0, 0 }, // Green Shell - { 0, 0, 0 }, // Red Shell - { 0, 0, 0 }, // Triple Green Shell - { 0, 0, 0 }, // Bob-omb - { 0, 0, 0 }, // Blue Shell + { 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, 0 } // Lightning + { 0, 0, 5 } // Lightning }, //1st 2nd 3rd // // 4 Active Players { //1st 2nd 3rd 4th // - { 0, 0, 0, 0 }, // Magnet - { 0, 0, 0, 0 }, // Boo - { 0, 0, 0, 0 }, // Mushroom - { 0, 0, 0, 0 }, // Triple Mushroom - { 0, 0, 0, 0 }, // Mega Mushroom - { 0, 0, 0, 0 }, // Gold Mushroom - { 0, 0, 0, 0 }, // Star - { 0, 0, 0, 0 }, // Triple Banana - { 0, 0, 0, 0 }, // Fake Item - { 0, 0, 0, 0 }, // Banana - { 0, 0, 0, 0 }, // Green Shell - { 0, 0, 0, 0 }, // Red Shell - { 0, 0, 0, 0 }, // Triple Green Shell - { 0, 0, 0, 0 }, // Bob-omb - { 0, 0, 0, 0 }, // Blue Shell - { 0, 0, 0, 0 }, // Fire Flower - { 0, 0, 0, 0 }, // Triple Red Shell - { 0, 0, 0, 0 } // Lightning + { 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 // - { 0, 0, 0, 0, 0 }, // Magnet - { 0, 0, 0, 0, 0 }, // Boo - { 0, 0, 0, 0, 0 }, // Mushroom - { 0, 0, 0, 0, 0 }, // Triple Mushroom - { 0, 0, 0, 0, 0 }, // Mega Mushroom - { 0, 0, 0, 0, 0 }, // Gold Mushroom - { 0, 0, 0, 0, 0 }, // Star - { 0, 0, 0, 0, 0 }, // Triple Banana - { 0, 0, 0, 0, 0 }, // Fake Item - { 0, 0, 0, 0, 0 }, // Banana - { 0, 0, 0, 0, 0 }, // Green Shell - { 0, 0, 0, 0, 0 }, // Red Shell - { 0, 0, 0, 0, 0 }, // Triple Green Shell - { 0, 0, 0, 0, 0 }, // Bob-omb - { 0, 0, 0, 0, 0 }, // Blue Shell - { 0, 0, 0, 0, 0 }, // Fire Flower - { 0, 0, 0, 0, 0 }, // Triple Red Shell - { 0, 0, 0, 0, 0 } // Lightning + { 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 // - { 0, 0, 0, 0, 0, 0 }, // Magnet - { 0, 0, 0, 0, 0, 0 }, // Boo - { 0, 0, 0, 0, 0, 0 }, // Mushroom - { 0, 0, 0, 0, 0, 0 }, // Triple Mushroom - { 0, 0, 0, 0, 0, 0 }, // Mega Mushroom - { 0, 0, 0, 0, 0, 0 }, // Gold Mushroom - { 0, 0, 0, 0, 0, 0 }, // Star - { 0, 0, 0, 0, 0, 0 }, // Triple Banana - { 0, 0, 0, 0, 0, 0 }, // Fake Item - { 0, 0, 0, 0, 0, 0 }, // Banana - { 0, 0, 0, 0, 0, 0 }, // Green Shell - { 0, 0, 0, 0, 0, 0 }, // Red Shell - { 0, 0, 0, 0, 0, 0 }, // Triple Green Shell - { 0, 0, 0, 0, 0, 0 }, // Bob-omb - { 0, 0, 0, 0, 0, 0 }, // Blue Shell - { 0, 0, 0, 0, 0, 0 }, // Fire Flower - { 0, 0, 0, 0, 0, 0 }, // Triple Red Shell - { 0, 0, 0, 0, 0, 0 } // Lightning + { 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 @@ -618,24 +618,24 @@ static fixed_t K_KartItemOdds_Retro[MAXPLAYERS][NUMKARTITEMS][MAXPLAYERS] = // 15 Active Players { //1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10t 11t 12t 13t 14t 15t // - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Magnet - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Boo - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Mushroom - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Triple Mushroom - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Mega Mushroom - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Gold Mushroom - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Star - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Triple Banana - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Fake Item - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Banana - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Green Shell - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Red Shell - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Triple Green Shell - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Bob-omb - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Blue Shell - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Fire Flower - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Triple Red Shell - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } // Lightning + { 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 @@ -1109,7 +1109,7 @@ fixed_t K_GetKartAccel(player_t *player) return k_accel; } -fixed_t K_3dKartMovement(player_t *player, boolean onground) +fixed_t K_3dKartMovement(player_t *player, boolean onground, boolean forwardmovement) { if (!onground) return 0; // If the player isn't on the ground, there is no change in speed @@ -1123,6 +1123,11 @@ fixed_t K_3dKartMovement(player_t *player, boolean onground) newspeed = FixedDiv(FixedDiv(FixedMul(oldspeed, accelmax - p_accel) + FixedMul(p_speed, p_accel), accelmax), ORIG_FRICTION); finalspeed = newspeed - oldspeed; + if (!forwardmovement && finalspeed > FRACUNIT*2) + return FRACUNIT/8; + else if (!forwardmovement) + return FRACUNIT/2; + return finalspeed; } @@ -1827,73 +1832,80 @@ static void K_KartUpdatePosition(player_t *player) for (i = 0; i < MAXPLAYERS; i++) { - if (!playeringame[i] || players[i].spectator) // If you don't exist, you aren't in the race. - continue; - - if (((players[i].starpostnum) + (numstarposts + 1) * players[i].laps) > - ((player->starpostnum) + (numstarposts + 1) * player->laps)) + if (playeringame[i] && !players[i].spectator && + (((players[i].starpostnum) + (numstarposts + 1) * players[i].laps) > + ((player->starpostnum) + (numstarposts + 1) * player->laps))) position++; - - ppcd = pncd = ipcd = incd = 0; - - player->kartstuff[k_prevcheck] = players[i].kartstuff[k_prevcheck] = 0; - player->kartstuff[k_nextcheck] = players[i].kartstuff[k_nextcheck] = 0; - - // This checks every thing on the map, and looks for MT_BOSS3WAYPOINT (the thing we're using for checkpoint wp's, for now) - for (th = thinkercap.next; th != &thinkercap; th = th->next) + else if (playeringame[i] && !players[i].spectator + && (((players[i].starpostnum) + (numstarposts+1)*players[i].laps) == + ((player->starpostnum) + (numstarposts+1)*player->laps))) { - if (th->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj at all, shoo - continue; + ppcd = pncd = ipcd = incd = 0; - mo = (mobj_t *)th; - - pmo = P_AproxDistance(P_AproxDistance(mo->x - player->mo->x, mo->y - player->mo->y), mo->z - player->mo->z) / FRACUNIT; - imo = P_AproxDistance(P_AproxDistance(mo->x - players[i].mo->x, mo->y - players[i].mo->y), mo->z - players[i].mo->z) / FRACUNIT; - - if (mo->type != MT_BOSS3WAYPOINT) - continue; - - if (mo->health == player->starpostnum) + player->kartstuff[k_prevcheck] = players[i].kartstuff[k_prevcheck] = 0; + player->kartstuff[k_nextcheck] = players[i].kartstuff[k_nextcheck] = 0; + + // This checks every thing on the map, and looks for MT_BOSS3WAYPOINT (the thing we're using for checkpoint wp's, for now) + for (th = thinkercap.next; th != &thinkercap; th = th->next) { - player->kartstuff[k_prevcheck] += pmo; - ppcd++; - } - if (mo->health == (player->starpostnum + 1)) - { - player->kartstuff[k_nextcheck] += pmo; - pncd++; - } - if (mo->health == players[i].starpostnum) - { - players[i].kartstuff[k_prevcheck] += imo; - ipcd++; - } - if (mo->health == (players[i].starpostnum + 1)) - { - players[i].kartstuff[k_nextcheck] += imo; - incd++; - } - } + if (th->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj at all, shoo + continue; - if (ppcd > 1) player->kartstuff[k_prevcheck] /= ppcd; - if (pncd > 1) player->kartstuff[k_nextcheck] /= pncd; - if (ipcd > 1) players[i].kartstuff[k_prevcheck] /= ipcd; - if (incd > 1) players[i].kartstuff[k_nextcheck] /= incd; + mo = (mobj_t *)th; - if ((players[i].kartstuff[k_nextcheck] > 0 || player->kartstuff[k_nextcheck] > 0) && !player->exiting) - { - if ((players[i].kartstuff[k_nextcheck] - players[i].kartstuff[k_prevcheck]) < (player->kartstuff[k_nextcheck] - player->kartstuff[k_prevcheck])) - position++; - } - else if (!player->exiting) - { - if (players[i].kartstuff[k_prevcheck] > player->kartstuff[k_prevcheck]) - position++; - } - else - { - if (players[i].starposttime < player->starposttime) - position++; + pmo = P_AproxDistance(P_AproxDistance( mo->x - player->mo->x, + mo->y - player->mo->y), + mo->z - player->mo->z) / FRACUNIT; + imo = P_AproxDistance(P_AproxDistance( mo->x - players[i].mo->x, + mo->y - players[i].mo->y), + mo->z - players[i].mo->z) / FRACUNIT; + + if (mo->type != MT_BOSS3WAYPOINT) // TODO: Change to 'MT_WAYPOINT'? + continue; + + if (mo->health == player->starpostnum) + { + player->kartstuff[k_prevcheck] += pmo; + ppcd++; + } + if (mo->health == (player->starpostnum + 1)) + { + player->kartstuff[k_nextcheck] += pmo; + pncd++; + } + if (mo->health == players[i].starpostnum) + { + players[i].kartstuff[k_prevcheck] += imo; + ipcd++; + } + if (mo->health == (players[i].starpostnum + 1)) + { + players[i].kartstuff[k_nextcheck] += imo; + incd++; + } + } + + if (ppcd > 1) player->kartstuff[k_prevcheck] /= ppcd; + if (pncd > 1) player->kartstuff[k_nextcheck] /= pncd; + if (ipcd > 1) players[i].kartstuff[k_prevcheck] /= ipcd; + if (incd > 1) players[i].kartstuff[k_nextcheck] /= incd; + + if ((players[i].kartstuff[k_nextcheck] > 0 || player->kartstuff[k_nextcheck] > 0) && !player->exiting) + { + if ((players[i].kartstuff[k_nextcheck] - players[i].kartstuff[k_prevcheck]) < + (player->kartstuff[k_nextcheck] - player->kartstuff[k_prevcheck])) + position++; + } + else if (!player->exiting) + { + if (players[i].kartstuff[k_prevcheck] > player->kartstuff[k_prevcheck]) + position++; + } + else + { + if (players[i].starposttime < player->starposttime) + position++; + } } } player->kartstuff[k_position] = position; @@ -3198,21 +3210,21 @@ static void K_DrawKartPositionNum(INT32 num) { case 1: case 2: case 3: if (stplyr->kartstuff[k_position] >= 4) - localpatch = kp_positionnum[num % 10][1]; - else 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) - localpatch = kp_positionnum[num % 10][2]; - else 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) - localpatch = kp_positionnum[num % 10][3]; - else localpatch = kp_positionnum[num % 10][6]; + else + localpatch = kp_positionnum[num % 10][3]; break; default: localpatch = kp_positionnum[num % 10][0]; diff --git a/src/k_kart.h b/src/k_kart.h index 1feec644..296d663a 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -23,7 +23,7 @@ void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 void K_SpawnDriftTrail(player_t *player); void K_DoMushroom(player_t *player, boolean doPFlag); fixed_t K_GetKartSpeed(player_t *player); -fixed_t K_3dKartMovement(player_t *player, boolean onground); +fixed_t K_3dKartMovement(player_t *player, boolean onground, boolean forwardmovement); void K_MoveKartPlayer(player_t *player, ticcmd_t *cmd, boolean onground); void K_LoadKartHUDGraphics(void); diff --git a/src/p_mobj.c b/src/p_mobj.c index 0a2e3208..0c2f5a5e 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8793,7 +8793,8 @@ void P_MovePlayerToStarpost(INT32 playernum) #endif sector->ceilingheight; - z = p->starpostz << FRACBITS; + //z = p->starpostz << FRACBITS; + z = (p->starpostz + 128) << FRACBITS; // SRB2kart - Spawns off the ground for Lakitu if (z < floor) z = floor; else if (z > ceiling - mobjinfo[MT_PLAYER].height) @@ -8808,10 +8809,12 @@ void P_MovePlayerToStarpost(INT32 playernum) mobj->angle = p->starpostangle; + p->kartstuff[k_waypoint] = p->kartstuff[k_starpostwp]; // SRB2kart + P_AfterPlayerSpawn(playernum); - if (!(netgame || multiplayer)) - leveltime = p->starposttime; + //if (!(netgame || multiplayer)) + // leveltime = p->starposttime; } #define MAXHUNTEMERALDS 64 diff --git a/src/p_user.c b/src/p_user.c index 175ae00d..469b4dea 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4747,9 +4747,9 @@ static void P_3dMovement(player_t *player) { //movepushforward = cmd->forwardmove * (thrustfactor * acceleration); if (cmd->forwardmove > 0) - movepushforward = K_3dKartMovement(player, onground); + movepushforward = K_3dKartMovement(player, onground, true); else - movepushforward = -(K_3dKartMovement(player, onground)); + movepushforward = -(K_3dKartMovement(player, onground, false)); // allow very small movement while in air for gameplay if (!onground) @@ -4767,9 +4767,9 @@ static void P_3dMovement(player_t *player) } movepushforward = FixedMul(movepushforward, player->mo->scale); - - if (mforward && cmd->forwardmove < 0) // SRB2kart - braking isn't instant - movepushforward /= 32; + + //if (mforward && cmd->forwardmove < 0) // SRB2kart - braking isn't instant + // movepushforward /= 32; #ifdef ESLOPE totalthrust.x += P_ReturnThrustX(player->mo, movepushangle, movepushforward); @@ -4800,9 +4800,9 @@ static void P_3dMovement(player_t *player) //movepushforward = max(abs(cmd->sidemove), abs(cmd->forwardmove)) * (thrustfactor * acceleration); if (max(abs(cmd->sidemove), abs(cmd->forwardmove)) > 0) - movepushforward = K_3dKartMovement(player, onground); + movepushforward = K_3dKartMovement(player, onground, true); else - movepushforward = -(K_3dKartMovement(player, onground)); + movepushforward = -(K_3dKartMovement(player, onground, false)); // allow very small movement while in air for gameplay if (!onground) @@ -4825,8 +4825,8 @@ static void P_3dMovement(player_t *player) movepushforward = FixedMul(movepushforward, player->mo->scale); - if (mforward && cmd->forwardmove < 0) // SRB2kart - braking isn't instant - movepushforward /= 32; + //if (mforward && cmd->forwardmove < 0) // SRB2kart - braking isn't instant + // movepushforward /= 32; #ifdef ESLOPE totalthrust.x += P_ReturnThrustX(player->mo, controldirection, movepushforward); @@ -4840,9 +4840,9 @@ static void P_3dMovement(player_t *player) { //movepushside = cmd->sidemove * (thrustfactor * acceleration); if (cmd->sidemove > 0) - movepushside = K_3dKartMovement(player, onground); + movepushside = K_3dKartMovement(player, onground, true); else - movepushside = -(K_3dKartMovement(player, onground)); + movepushside = -(K_3dKartMovement(player, onground, true)); if (!onground) {