Fixed position code, added some item numbers

This commit is contained in:
ZTsukei 2017-02-16 21:33:00 -05:00
parent b0b51f9a61
commit 370f290a08
6 changed files with 210 additions and 195 deletions

View file

@ -149,9 +149,9 @@ extern FILE *logstream;
// we use comprevision and compbranch instead. // we use comprevision and compbranch instead.
#else #else
#define VERSION 100 // Game version #define VERSION 100 // Game version
#define SUBVERSION 0 // more precise version number #define SUBVERSION 3 // more precise version number
#define VERSIONSTRING "v1.0.00" #define VERSIONSTRING "v1.0.03"
#define VERSIONSTRINGW L"v1.0.00" #define VERSIONSTRINGW L"v1.0.03"
// Hey! If you change this, add 1 to the MODVERSION below! // Hey! If you change this, add 1 to the MODVERSION below!
// Otherwise we can't force updates! // Otherwise we can't force updates!
#endif #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. // 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!). // Please change to apply to your modification (we don't want everyone asking where your mod is on SRB2.org!).
#define UPDATE_ALERT_STRING \ #define UPDATE_ALERT_STRING \
"A new update is available for SRB2.\n"\ "A new update is available for SRB2kart.\n"\
"Please visit SRB2.org to download it.\n"\ "Please visit the forums on SRB2.org to download it.\n"\
"\n"\ "\n"\
"You are using version: %s\n"\ "You are using version: %s\n"\
"The newest version is: %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. // 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. // Generally less filled with newlines, since Windows gives you lots more room to work with.
#define UPDATE_ALERT_STRING_CONSOLE \ #define UPDATE_ALERT_STRING_CONSOLE \
"A new update is available for SRB2.\n"\ "A new update is available for SRB2kart.\n"\
"Please visit SRB2.org to download it.\n"\ "Please visit the forums on SRB2.org to download it.\n"\
"\n"\ "\n"\
"You are using version: %s\n"\ "You are using version: %s\n"\
"The newest version is: %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. // 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. // 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". // 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
// ========================================================================= // =========================================================================

View file

@ -14951,7 +14951,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
}, },
{ // MT_POKEY { // MT_POKEY
2002, // doomednum 2100, // doomednum
S_POKEY1, // spawnstate S_POKEY1, // spawnstate
1000, // spawnhealth 1000, // spawnhealth
S_POKEY1, // seestate S_POKEY1, // seestate
@ -14978,7 +14978,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
}, },
{ // MT_ENEMYFLIP { // MT_ENEMYFLIP
2003, // doomednum 2101, // doomednum
S_NULL, // spawnstate S_NULL, // spawnstate
1000, // spawnhealth 1000, // spawnhealth
S_NULL, // seestate S_NULL, // seestate

View file

@ -310,9 +310,9 @@ static fixed_t K_KartItemOdds_Retro[MAXPLAYERS][NUMKARTITEMS][MAXPLAYERS] =
{ {
// 1 Active Player // 1 Active Player
{ //1st // { //1st //
{ 0 }, // Magnet { 40 }, // Magnet
{ 0 }, // Boo { 0 }, // Boo
{ 40 }, // Mushroom { 0 }, // Mushroom
{ 0 }, // Triple Mushroom { 0 }, // Triple Mushroom
{ 0 }, // Mega Mushroom { 0 }, // Mega Mushroom
{ 0 }, // Gold Mushroom { 0 }, // Gold Mushroom
@ -332,21 +332,21 @@ static fixed_t K_KartItemOdds_Retro[MAXPLAYERS][NUMKARTITEMS][MAXPLAYERS] =
// 2 Active Players // 2 Active Players
{ //1st 2nd // { //1st 2nd //
{ 0, 0 }, // Magnet { 1, 0 }, // Magnet
{ 0, 0 }, // Boo { 0, 0 }, // Boo
{ 0, 0 }, // Mushroom { 6, 11 }, // Mushroom
{ 0, 0 }, // Triple Mushroom { 0, 3 }, // Triple Mushroom
{ 0, 0 }, // Mega Mushroom { 0, 1 }, // Mega Mushroom
{ 0, 0 }, // Gold Mushroom { 0, 1 }, // Gold Mushroom
{ 0, 0 }, // Star { 0, 0 }, // Star
{ 0, 0 }, // Triple Banana { 4, 0 }, // Triple Banana
{ 0, 0 }, // Fake Item { 7, 0 }, // Fake Item
{ 0, 0 }, // Banana { 12, 0 }, // Banana
{ 0, 0 }, // Green Shell { 8, 6 }, // Green Shell
{ 0, 0 }, // Red Shell { 2, 12 }, // Red Shell
{ 0, 0 }, // Triple Green Shell { 0, 4 }, // Triple Green Shell
{ 0, 0 }, // Bob-omb { 0, 0 }, // Bob-omb
{ 0, 0 }, // Blue Shell { 0, 2 }, // Blue Shell
{ 0, 0 }, // Fire Flower { 0, 0 }, // Fire Flower
{ 0, 0 }, // Triple Red Shell { 0, 0 }, // Triple Red Shell
{ 0, 0 } // Lightning { 0, 0 } // Lightning
@ -354,90 +354,90 @@ static fixed_t K_KartItemOdds_Retro[MAXPLAYERS][NUMKARTITEMS][MAXPLAYERS] =
// 3 Active Players // 3 Active Players
{ //1st 2nd 3rd // { //1st 2nd 3rd //
{ 0, 0, 0 }, // Magnet { 1, 0, 0 }, // Magnet
{ 0, 0, 0 }, // Boo { 0, 1, 0 }, // Boo
{ 0, 0, 0 }, // Mushroom { 4, 10, 0 }, // Mushroom
{ 0, 0, 0 }, // Triple Mushroom { 0, 4, 11 }, // Triple Mushroom
{ 0, 0, 0 }, // Mega Mushroom { 0, 0, 2 }, // Mega Mushroom
{ 0, 0, 0 }, // Gold Mushroom { 0, 0, 16 }, // Gold Mushroom
{ 0, 0, 0 }, // Star { 0, 0, 6 }, // Star
{ 0, 0, 0 }, // Triple Banana { 4, 0, 0 }, // Triple Banana
{ 0, 0, 0 }, // Fake Item { 7, 2, 0 }, // Fake Item
{ 0, 0, 0 }, // Banana { 13, 4, 0 }, // Banana
{ 0, 0, 0 }, // Green Shell { 9, 4, 0 }, // Green Shell
{ 0, 0, 0 }, // Red Shell { 2, 8, 0 }, // Red Shell
{ 0, 0, 0 }, // Triple Green Shell { 0, 3, 0 }, // Triple Green Shell
{ 0, 0, 0 }, // Bob-omb { 0, 2, 0 }, // Bob-omb
{ 0, 0, 0 }, // Blue Shell { 0, 2, 0 }, // Blue Shell
{ 0, 0, 0 }, // Fire Flower { 0, 0, 0 }, // Fire Flower
{ 0, 0, 0 }, // Triple Red Shell { 0, 0, 0 }, // Triple Red Shell
{ 0, 0, 0 } // Lightning { 0, 0, 5 } // Lightning
}, //1st 2nd 3rd // }, //1st 2nd 3rd //
// 4 Active Players // 4 Active Players
{ //1st 2nd 3rd 4th // { //1st 2nd 3rd 4th //
{ 0, 0, 0, 0 }, // Magnet { 1, 1, 0, 0 }, // Magnet
{ 0, 0, 0, 0 }, // Boo { 0, 3, 0, 0 }, // Boo
{ 0, 0, 0, 0 }, // Mushroom { 2, 10, 0, 0 }, // Mushroom
{ 0, 0, 0, 0 }, // Triple Mushroom { 0, 3, 9, 10 }, // Triple Mushroom
{ 0, 0, 0, 0 }, // Mega Mushroom { 0, 0, 3, 0 }, // Mega Mushroom
{ 0, 0, 0, 0 }, // Gold Mushroom { 0, 0, 9, 16 }, // Gold Mushroom
{ 0, 0, 0, 0 }, // Star { 0, 0, 0, 8 }, // Star
{ 0, 0, 0, 0 }, // Triple Banana { 4, 0, 0, 0 }, // Triple Banana
{ 0, 0, 0, 0 }, // Fake Item { 7, 2, 0, 0 }, // Fake Item
{ 0, 0, 0, 0 }, // Banana { 14, 4, 0, 0 }, // Banana
{ 0, 0, 0, 0 }, // Green Shell { 9, 5, 0, 0 }, // Green Shell
{ 0, 0, 0, 0 }, // Red Shell { 3, 8, 6, 0 }, // Red Shell
{ 0, 0, 0, 0 }, // Triple Green Shell { 0, 2, 4, 0 }, // Triple Green Shell
{ 0, 0, 0, 0 }, // Bob-omb { 0, 2, 0, 0 }, // Bob-omb
{ 0, 0, 0, 0 }, // Blue Shell { 0, 0, 3, 0 }, // Blue Shell
{ 0, 0, 0, 0 }, // Fire Flower { 0, 0, 3, 0 }, // Fire Flower
{ 0, 0, 0, 0 }, // Triple Red Shell { 0, 0, 3, 0 }, // Triple Red Shell
{ 0, 0, 0, 0 } // Lightning { 0, 0, 0, 6 } // Lightning
}, //1st 2nd 3rd 4th // }, //1st 2nd 3rd 4th //
// 5 Active Players // 5 Active Players
{ //1st 2nd 3rd 4th 5th // { //1st 2nd 3rd 4th 5th //
{ 0, 0, 0, 0, 0 }, // Magnet { 1, 2, 0, 0, 0 }, // Magnet
{ 0, 0, 0, 0, 0 }, // Boo { 0, 3, 0, 0, 0 }, // Boo
{ 0, 0, 0, 0, 0 }, // Mushroom { 0, 9, 7, 0, 0 }, // Mushroom
{ 0, 0, 0, 0, 0 }, // Triple Mushroom { 0, 0, 8, 12, 12 }, // Triple Mushroom
{ 0, 0, 0, 0, 0 }, // Mega Mushroom { 0, 0, 2, 2, 0 }, // Mega Mushroom
{ 0, 0, 0, 0, 0 }, // Gold Mushroom { 0, 0, 0, 9, 20 }, // Gold Mushroom
{ 0, 0, 0, 0, 0 }, // Star { 0, 0, 0, 3, 8 }, // Star
{ 0, 0, 0, 0, 0 }, // Triple Banana { 4, 2, 0, 0, 0 }, // Triple Banana
{ 0, 0, 0, 0, 0 }, // Fake Item { 7, 3, 0, 0, 0 }, // Fake Item
{ 0, 0, 0, 0, 0 }, // Banana { 15, 4, 0, 0, 0 }, // Banana
{ 0, 0, 0, 0, 0 }, // Green Shell { 10, 6, 3, 0, 0 }, // Green Shell
{ 0, 0, 0, 0, 0 }, // Red Shell { 3, 9, 6, 0, 0 }, // Red Shell
{ 0, 0, 0, 0, 0 }, // Triple Green Shell { 0, 2, 4, 0, 0 }, // Triple Green Shell
{ 0, 0, 0, 0, 0 }, // Bob-omb { 0, 0, 3, 0, 0 }, // Bob-omb
{ 0, 0, 0, 0, 0 }, // Blue Shell { 0, 0, 4, 0, 0 }, // Blue Shell
{ 0, 0, 0, 0, 0 }, // Fire Flower { 0, 0, 3, 4, 0 }, // Fire Flower
{ 0, 0, 0, 0, 0 }, // Triple Red Shell { 0, 0, 0, 3, 0 }, // Triple Red Shell
{ 0, 0, 0, 0, 0 } // Lightning { 0, 0, 0, 7, 0 } // Lightning
}, //1st 2nd 3rd 4th 5th // }, //1st 2nd 3rd 4th 5th //
// 6 Active Players // 6 Active Players
{ //1st 2nd 3rd 4th 5th 6th // { //1st 2nd 3rd 4th 5th 6th //
{ 0, 0, 0, 0, 0, 0 }, // Magnet { 1, 2, 0, 0, 0, 0 }, // Magnet
{ 0, 0, 0, 0, 0, 0 }, // Boo { 0, 2, 2, 0, 0, 0 }, // Boo
{ 0, 0, 0, 0, 0, 0 }, // Mushroom { 0, 9, 8, 0, 0, 0 }, // Mushroom
{ 0, 0, 0, 0, 0, 0 }, // Triple Mushroom { 0, 0, 5, 11, 14, 12 }, // Triple Mushroom
{ 0, 0, 0, 0, 0, 0 }, // Mega Mushroom { 0, 0, 0, 2, 2, 0 }, // Mega Mushroom
{ 0, 0, 0, 0, 0, 0 }, // Gold Mushroom { 0, 0, 0, 6, 11, 20 }, // Gold Mushroom
{ 0, 0, 0, 0, 0, 0 }, // Star { 0, 0, 0, 0, 3, 8 }, // Star
{ 0, 0, 0, 0, 0, 0 }, // Triple Banana { 4, 2, 0, 0, 0, 0 }, // Triple Banana
{ 0, 0, 0, 0, 0, 0 }, // Fake Item { 7, 3, 0, 0, 0, 0 }, // Fake Item
{ 0, 0, 0, 0, 0, 0 }, // Banana { 15, 5, 3, 0, 0, 0 }, // Banana
{ 0, 0, 0, 0, 0, 0 }, // Green Shell { 10, 6, 4, 0, 0, 0 }, // Green Shell
{ 0, 0, 0, 0, 0, 0 }, // Red Shell { 3, 9, 8, 6, 0, 0 }, // Red Shell
{ 0, 0, 0, 0, 0, 0 }, // Triple Green Shell { 0, 2, 4, 5, 0, 0 }, // Triple Green Shell
{ 0, 0, 0, 0, 0, 0 }, // Bob-omb { 0, 0, 3, 0, 0, 0 }, // Bob-omb
{ 0, 0, 0, 0, 0, 0 }, // Blue Shell { 0, 0, 3, 3, 0, 0 }, // Blue Shell
{ 0, 0, 0, 0, 0, 0 }, // Fire Flower { 0, 0, 0, 4, 0, 0 }, // Fire Flower
{ 0, 0, 0, 0, 0, 0 }, // Triple Red Shell { 0, 0, 0, 3, 3, 0 }, // Triple Red Shell
{ 0, 0, 0, 0, 0, 0 } // Lightning { 0, 0, 0, 0, 7, 0 } // Lightning
}, //1st 2nd 3rd 4th 5th 6th // }, //1st 2nd 3rd 4th 5th 6th //
// 7 Active Players // 7 Active Players
@ -618,24 +618,24 @@ static fixed_t K_KartItemOdds_Retro[MAXPLAYERS][NUMKARTITEMS][MAXPLAYERS] =
// 15 Active Players // 15 Active Players
{ //1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10t 11t 12t 13t 14t 15t // { //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 { 1, 2, 3, 2, 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, 2, 4, 4, 3, 2, 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, 4, 6, 8, 10, 9, 8, 4, 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, 2, 4, 8, 11, 13, 17, 18, 15, 13, 9, 8, 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, 2, 5, 6, 8, 7, 3, 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, 3, 5, 8, 11, 13, 22, 27 }, // 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, 2, 3, 5, 7, 10, 13 }, // Star
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Triple Banana { 4, 2, 1, 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 { 7, 4, 3, 2, 1, 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 { 15, 8, 6, 4, 2, 1, 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 { 10, 8, 6, 4, 3, 2, 1, 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 { 3, 10, 9, 8, 7, 6, 4, 3, 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, 2, 4, 5, 7, 6, 5, 3, 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, 2, 3, 2, 1, 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, 2, 3, 4, 3, 2, 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, 3, 5, 6, 2, 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, 2, 3, 3, 2, 0, 0, 0, 0 }, // Triple Red Shell
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } // Lightning { 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 // }, //1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10t 11t 12t 13t 14t 15t //
// 16 Active Players // 16 Active Players
@ -1109,7 +1109,7 @@ fixed_t K_GetKartAccel(player_t *player)
return k_accel; 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 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); newspeed = FixedDiv(FixedDiv(FixedMul(oldspeed, accelmax - p_accel) + FixedMul(p_speed, p_accel), accelmax), ORIG_FRICTION);
finalspeed = newspeed - oldspeed; finalspeed = newspeed - oldspeed;
if (!forwardmovement && finalspeed > FRACUNIT*2)
return FRACUNIT/8;
else if (!forwardmovement)
return FRACUNIT/2;
return finalspeed; return finalspeed;
} }
@ -1827,73 +1832,80 @@ static void K_KartUpdatePosition(player_t *player)
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
{ {
if (!playeringame[i] || players[i].spectator) // If you don't exist, you aren't in the race. if (playeringame[i] && !players[i].spectator &&
continue; (((players[i].starpostnum) + (numstarposts + 1) * players[i].laps) >
((player->starpostnum) + (numstarposts + 1) * player->laps)))
if (((players[i].starpostnum) + (numstarposts + 1) * players[i].laps) >
((player->starpostnum) + (numstarposts + 1) * player->laps))
position++; position++;
else if (playeringame[i] && !players[i].spectator
ppcd = pncd = ipcd = incd = 0; && (((players[i].starpostnum) + (numstarposts+1)*players[i].laps) ==
((player->starpostnum) + (numstarposts+1)*player->laps)))
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)
{ {
if (th->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj at all, shoo ppcd = pncd = ipcd = incd = 0;
continue;
mo = (mobj_t *)th; player->kartstuff[k_prevcheck] = players[i].kartstuff[k_prevcheck] = 0;
player->kartstuff[k_nextcheck] = players[i].kartstuff[k_nextcheck] = 0;
pmo = P_AproxDistance(P_AproxDistance(mo->x - player->mo->x, mo->y - player->mo->y), mo->z - player->mo->z) / FRACUNIT; // This checks every thing on the map, and looks for MT_BOSS3WAYPOINT (the thing we're using for checkpoint wp's, for now)
imo = P_AproxDistance(P_AproxDistance(mo->x - players[i].mo->x, mo->y - players[i].mo->y), mo->z - players[i].mo->z) / FRACUNIT; for (th = thinkercap.next; th != &thinkercap; th = th->next)
if (mo->type != MT_BOSS3WAYPOINT)
continue;
if (mo->health == player->starpostnum)
{ {
player->kartstuff[k_prevcheck] += pmo; if (th->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj at all, shoo
ppcd++; continue;
}
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; mo = (mobj_t *)th;
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) pmo = P_AproxDistance(P_AproxDistance( mo->x - player->mo->x,
{ mo->y - player->mo->y),
if ((players[i].kartstuff[k_nextcheck] - players[i].kartstuff[k_prevcheck]) < (player->kartstuff[k_nextcheck] - player->kartstuff[k_prevcheck])) mo->z - player->mo->z) / FRACUNIT;
position++; imo = P_AproxDistance(P_AproxDistance( mo->x - players[i].mo->x,
} mo->y - players[i].mo->y),
else if (!player->exiting) mo->z - players[i].mo->z) / FRACUNIT;
{
if (players[i].kartstuff[k_prevcheck] > player->kartstuff[k_prevcheck]) if (mo->type != MT_BOSS3WAYPOINT) // TODO: Change to 'MT_WAYPOINT'?
position++; continue;
}
else if (mo->health == player->starpostnum)
{ {
if (players[i].starposttime < player->starposttime) player->kartstuff[k_prevcheck] += pmo;
position++; 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; player->kartstuff[k_position] = position;
@ -3198,21 +3210,21 @@ static void K_DrawKartPositionNum(INT32 num)
{ {
case 1: case 2: case 3: case 1: case 2: case 3:
if (stplyr->kartstuff[k_position] >= 4) if (stplyr->kartstuff[k_position] >= 4)
localpatch = kp_positionnum[num % 10][1];
else
localpatch = kp_positionnum[num % 10][4]; localpatch = kp_positionnum[num % 10][4];
else
localpatch = kp_positionnum[num % 10][1];
break; break;
case 4: case 5: case 6: case 4: case 5: case 6:
if (stplyr->kartstuff[k_position] >= 4) if (stplyr->kartstuff[k_position] >= 4)
localpatch = kp_positionnum[num % 10][2];
else
localpatch = kp_positionnum[num % 10][5]; localpatch = kp_positionnum[num % 10][5];
else
localpatch = kp_positionnum[num % 10][2];
break; break;
case 7: case 8: case 9: case 7: case 8: case 9:
if (stplyr->kartstuff[k_position] >= 4) if (stplyr->kartstuff[k_position] >= 4)
localpatch = kp_positionnum[num % 10][3];
else
localpatch = kp_positionnum[num % 10][6]; localpatch = kp_positionnum[num % 10][6];
else
localpatch = kp_positionnum[num % 10][3];
break; break;
default: default:
localpatch = kp_positionnum[num % 10][0]; localpatch = kp_positionnum[num % 10][0];

View file

@ -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_SpawnDriftTrail(player_t *player);
void K_DoMushroom(player_t *player, boolean doPFlag); void K_DoMushroom(player_t *player, boolean doPFlag);
fixed_t K_GetKartSpeed(player_t *player); 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_MoveKartPlayer(player_t *player, ticcmd_t *cmd, boolean onground);
void K_LoadKartHUDGraphics(void); void K_LoadKartHUDGraphics(void);

View file

@ -8793,7 +8793,8 @@ void P_MovePlayerToStarpost(INT32 playernum)
#endif #endif
sector->ceilingheight; 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) if (z < floor)
z = floor; z = floor;
else if (z > ceiling - mobjinfo[MT_PLAYER].height) else if (z > ceiling - mobjinfo[MT_PLAYER].height)
@ -8808,10 +8809,12 @@ void P_MovePlayerToStarpost(INT32 playernum)
mobj->angle = p->starpostangle; mobj->angle = p->starpostangle;
p->kartstuff[k_waypoint] = p->kartstuff[k_starpostwp]; // SRB2kart
P_AfterPlayerSpawn(playernum); P_AfterPlayerSpawn(playernum);
if (!(netgame || multiplayer)) //if (!(netgame || multiplayer))
leveltime = p->starposttime; // leveltime = p->starposttime;
} }
#define MAXHUNTEMERALDS 64 #define MAXHUNTEMERALDS 64

View file

@ -4747,9 +4747,9 @@ static void P_3dMovement(player_t *player)
{ {
//movepushforward = cmd->forwardmove * (thrustfactor * acceleration); //movepushforward = cmd->forwardmove * (thrustfactor * acceleration);
if (cmd->forwardmove > 0) if (cmd->forwardmove > 0)
movepushforward = K_3dKartMovement(player, onground); movepushforward = K_3dKartMovement(player, onground, true);
else else
movepushforward = -(K_3dKartMovement(player, onground)); movepushforward = -(K_3dKartMovement(player, onground, false));
// allow very small movement while in air for gameplay // allow very small movement while in air for gameplay
if (!onground) if (!onground)
@ -4768,8 +4768,8 @@ static void P_3dMovement(player_t *player)
movepushforward = FixedMul(movepushforward, player->mo->scale); movepushforward = FixedMul(movepushforward, player->mo->scale);
if (mforward && cmd->forwardmove < 0) // SRB2kart - braking isn't instant //if (mforward && cmd->forwardmove < 0) // SRB2kart - braking isn't instant
movepushforward /= 32; // movepushforward /= 32;
#ifdef ESLOPE #ifdef ESLOPE
totalthrust.x += P_ReturnThrustX(player->mo, movepushangle, movepushforward); 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); //movepushforward = max(abs(cmd->sidemove), abs(cmd->forwardmove)) * (thrustfactor * acceleration);
if (max(abs(cmd->sidemove), abs(cmd->forwardmove)) > 0) if (max(abs(cmd->sidemove), abs(cmd->forwardmove)) > 0)
movepushforward = K_3dKartMovement(player, onground); movepushforward = K_3dKartMovement(player, onground, true);
else else
movepushforward = -(K_3dKartMovement(player, onground)); movepushforward = -(K_3dKartMovement(player, onground, false));
// allow very small movement while in air for gameplay // allow very small movement while in air for gameplay
if (!onground) if (!onground)
@ -4825,8 +4825,8 @@ static void P_3dMovement(player_t *player)
movepushforward = FixedMul(movepushforward, player->mo->scale); movepushforward = FixedMul(movepushforward, player->mo->scale);
if (mforward && cmd->forwardmove < 0) // SRB2kart - braking isn't instant //if (mforward && cmd->forwardmove < 0) // SRB2kart - braking isn't instant
movepushforward /= 32; // movepushforward /= 32;
#ifdef ESLOPE #ifdef ESLOPE
totalthrust.x += P_ReturnThrustX(player->mo, controldirection, movepushforward); totalthrust.x += P_ReturnThrustX(player->mo, controldirection, movepushforward);
@ -4840,9 +4840,9 @@ static void P_3dMovement(player_t *player)
{ {
//movepushside = cmd->sidemove * (thrustfactor * acceleration); //movepushside = cmd->sidemove * (thrustfactor * acceleration);
if (cmd->sidemove > 0) if (cmd->sidemove > 0)
movepushside = K_3dKartMovement(player, onground); movepushside = K_3dKartMovement(player, onground, true);
else else
movepushside = -(K_3dKartMovement(player, onground)); movepushside = -(K_3dKartMovement(player, onground, true));
if (!onground) if (!onground)
{ {