mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-17 23:21:05 +00:00
Driftboosting now increases player accleration
Consolidated the turning and drifting values to k_kart functions for easier editing Removed 200cc. 50/100/150ccs are a weird amalgamation of the prior values.
This commit is contained in:
parent
226e7ead59
commit
66a206cc55
6 changed files with 88 additions and 41 deletions
|
@ -67,7 +67,7 @@ CV_PossibleValue_t karthud_cons_t[] = {
|
|||
{0, "Off"}, {1, "Default"}, {2, "SNES"}, {3, "MK64"},
|
||||
{0, NULL}};
|
||||
CV_PossibleValue_t kartcc_cons_t[] = {
|
||||
{50, "50cc"}, {100, "100cc"}, {150, "150cc"}, {200, "200cc"},
|
||||
{50, "50cc"}, {100, "100cc"}, {150, "150cc"},
|
||||
{0, NULL}};
|
||||
|
||||
#define COM_BUF_SIZE 8192 // command buffer size
|
||||
|
|
|
@ -140,19 +140,19 @@
|
|||
extern FILE *logstream;
|
||||
#endif
|
||||
|
||||
//#define DEVELOP // Disable this for release builds to remove excessive cheat commands and enable MD5 checking and stuff, all in one go. :3
|
||||
#define DEVELOP // Disable this for release builds to remove excessive cheat commands and enable MD5 checking and stuff, all in one go. :3
|
||||
#ifdef DEVELOP
|
||||
#define VERSION 101 // Game version
|
||||
#define SUBVERSION 0 // more precise version number
|
||||
#define SUBVERSION 2 // more precise version number
|
||||
#define VERSIONSTRING "Development EXE"
|
||||
#define VERSIONSTRINGW "v1.1.00"
|
||||
#define VERSIONSTRINGW "v1.1.02"
|
||||
// most interface strings are ignored in development mode.
|
||||
// we use comprevision and compbranch instead.
|
||||
#else
|
||||
#define VERSION 101 // Game version
|
||||
#define SUBVERSION 0 // more precise version number
|
||||
#define VERSIONSTRING "DevEXE v1.1.00"
|
||||
#define VERSIONSTRINGW L"v1.1.00"
|
||||
#define SUBVERSION 2 // more precise version number
|
||||
#define VERSIONSTRING "DevEXE v1.1.02"
|
||||
#define VERSIONSTRINGW L"v1.1.02"
|
||||
// Hey! If you change this, add 1 to the MODVERSION below!
|
||||
// Otherwise we can't force updates!
|
||||
#endif
|
||||
|
|
20
src/g_game.c
20
src/g_game.c
|
@ -1267,21 +1267,19 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics)
|
|||
}
|
||||
else
|
||||
{
|
||||
// SRB2kart
|
||||
INT32 turnspeed;
|
||||
cmd->angleturn = K_GetKartTurnValue(cmd, player);
|
||||
|
||||
if (players[consoleplayer].mo && (players[consoleplayer].speed == 0))
|
||||
turnspeed = 0;
|
||||
else
|
||||
turnspeed = 16;
|
||||
//cmd->angleturn = FixedMul(cmd->angleturn, FixedDiv(80 - (players[consoleplayer].speed >> 16), 80));
|
||||
|
||||
cmd->angleturn = FixedMul(cmd->angleturn, FixedDiv(80 - (players[consoleplayer].speed >> 16), 80));
|
||||
//if (players[consoleplayer].kartstuff[k_startimer]
|
||||
// || players[consoleplayer].kartstuff[k_mushroomtimer]
|
||||
// || players[consoleplayer].kartstuff[k_growshrinktimer] > 0)
|
||||
// cmd->angleturn = FixedMul(cmd->angleturn, FixedDiv(5*FRACUNIT, 4*FRACUNIT));
|
||||
|
||||
if (players[consoleplayer].kartstuff[k_startimer] || players[consoleplayer].kartstuff[k_mushroomtimer]
|
||||
|| players[consoleplayer].kartstuff[k_growshrinktimer] > 0)
|
||||
cmd->angleturn = FixedMul(cmd->angleturn, FixedDiv(5*FRACUNIT, 4*FRACUNIT));
|
||||
// SRB2kart - no additional angle if not moving
|
||||
if (!(player->mo && player->speed == 0))
|
||||
localangle += (cmd->angleturn<<16);
|
||||
|
||||
localangle += (cmd->angleturn<<turnspeed); // << 16
|
||||
cmd->angleturn = (INT16)(localangle >> 16);
|
||||
}
|
||||
|
||||
|
|
87
src/k_kart.c
87
src/k_kart.c
|
@ -836,6 +836,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
|
|||
if (cv_megashroom.value) K_KartSetItemResult(ppos, 5); // Mega Mushroom
|
||||
if (cv_goldshroom.value) K_KartSetItemResult(ppos, 6); // Gold Mushroom
|
||||
if (cv_star.value) K_KartSetItemResult(ppos, 7); // Star
|
||||
/*
|
||||
if (cv_triplebanana.value) K_KartSetItemResult(ppos, 8); // Triple Banana
|
||||
if (cv_fakeitem.value) K_KartSetItemResult(ppos, 9); // Fake Item
|
||||
if (cv_banana.value) K_KartSetItemResult(ppos, 10); // Banana
|
||||
|
@ -847,6 +848,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
|
|||
if (cv_fireflower.value) K_KartSetItemResult(ppos, 16); // Fire Flower
|
||||
if (cv_tripleredshell.value) K_KartSetItemResult(ppos, 17); // Triple Red Shell
|
||||
if (cv_lightning.value && pingame > pexiting) K_KartSetItemResult(ppos, 18); // Lightning
|
||||
*/
|
||||
|
||||
// Award the player whatever power is rolled
|
||||
if (numchoices > 0)
|
||||
|
@ -1035,6 +1037,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
K_KartItemRoulette(player, cmd); // Roulette Code
|
||||
|
||||
// Looping and stopping of the horrible horrible star SFX ~Sryder
|
||||
/*
|
||||
if (player->mo->health > 0 && player->mo->player->kartstuff[k_startimer])// If you have invincibility
|
||||
{
|
||||
if (!P_IsLocalPlayer(player)) // If it isn't the current player
|
||||
|
@ -1063,6 +1066,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
if (S_SoundPlaying(player->mo, sfx_mega)) // But the sound is playing
|
||||
S_StopSoundByID(player->mo, sfx_mega); // Stop it
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void K_PlayTauntSound(mobj_t *source)
|
||||
|
@ -1081,7 +1085,7 @@ void K_PlayTauntSound(mobj_t *source)
|
|||
S_StartSound(source, sfx_taunt4);
|
||||
}
|
||||
|
||||
fixed_t K_GetKartBoostPower(player_t *player)
|
||||
fixed_t K_GetKartBoostPower(player_t *player, boolean speedonly)
|
||||
{
|
||||
fixed_t boostpower = FRACUNIT;
|
||||
fixed_t boostvalue = 0;
|
||||
|
@ -1089,33 +1093,33 @@ fixed_t K_GetKartBoostPower(player_t *player)
|
|||
|
||||
// Offroad is separate, it's difficult to factor it in with a variable value anyway.
|
||||
if (!(player->kartstuff[k_startimer] || player->kartstuff[k_bootaketimer] || player->kartstuff[k_mushroomtimer])
|
||||
&& player->kartstuff[k_offroad] >= 0)
|
||||
&& player->kartstuff[k_offroad] >= 0 && speedonly)
|
||||
boostpower = FixedDiv(boostpower, player->kartstuff[k_offroad] + FRACUNIT);
|
||||
|
||||
if (player->kartstuff[k_growshrinktimer] < -1)
|
||||
if (player->kartstuff[k_growshrinktimer] < -1 && speedonly)
|
||||
{ // Shrink
|
||||
boostvalue += 6; // 6/8 speed (*0.750)
|
||||
numboosts++;
|
||||
}
|
||||
if (player->kartstuff[k_squishedtimer] > 0)
|
||||
if (player->kartstuff[k_squishedtimer] > 0 && speedonly)
|
||||
{ // Squished
|
||||
boostvalue += 7; // 7/8 speed (*0.875)
|
||||
numboosts++;
|
||||
}
|
||||
if (player->kartstuff[k_growshrinktimer] > 1
|
||||
&& (player->kartstuff[k_growshrinktimer] > (bonustime - 25)
|
||||
|| player->kartstuff[k_growshrinktimer] <= 26))
|
||||
|| player->kartstuff[k_growshrinktimer] <= 26) && speedonly)
|
||||
{ // Mega Mushroom - Mid-size
|
||||
boostvalue += 9; // 9/8 speed (*1.125)
|
||||
numboosts++;
|
||||
}
|
||||
if (player->kartstuff[k_growshrinktimer] < (bonustime - 25)
|
||||
&& player->kartstuff[k_growshrinktimer] > 26)
|
||||
&& player->kartstuff[k_growshrinktimer] > 26 && speedonly)
|
||||
{ // Mega Mushroom
|
||||
boostvalue += 10; // 10/8 speed (*1.250)
|
||||
numboosts++;
|
||||
}
|
||||
if (player->kartstuff[k_startimer])
|
||||
if (player->kartstuff[k_startimer] && speedonly)
|
||||
{ // Star
|
||||
boostvalue += 11; // 11/8 speed (*1.375)
|
||||
numboosts++;
|
||||
|
@ -1125,7 +1129,7 @@ fixed_t K_GetKartBoostPower(player_t *player)
|
|||
boostvalue += 12; // 12/8 speed (*1.500)
|
||||
numboosts++;
|
||||
}
|
||||
if (player->kartstuff[k_mushroomtimer])
|
||||
if (player->kartstuff[k_mushroomtimer] && speedonly)
|
||||
{ // Mushroom
|
||||
boostvalue += 14; // 14/8 speed (*1.750)
|
||||
numboosts++;
|
||||
|
@ -1141,11 +1145,24 @@ fixed_t K_GetKartBoostPower(player_t *player)
|
|||
fixed_t K_GetKartSpeed(player_t *player)
|
||||
{
|
||||
fixed_t k_speed = 151;
|
||||
fixed_t g_cc = (cv_kartcc.value/50 + 6)*FRACUNIT/8; // Game CC - 50cc = 0, 100cc = 1, etc.
|
||||
fixed_t g_cc;
|
||||
|
||||
switch (cv_kartcc.value)
|
||||
{
|
||||
case 50:
|
||||
g_cc = 27*FRACUNIT/32; // 50cc - 0.84375
|
||||
break;
|
||||
case 150:
|
||||
g_cc = 39*FRACUNIT/32; // 150cc - 1.21875
|
||||
break;
|
||||
default:
|
||||
g_cc = 33*FRACUNIT/32; // 100cc - 1.03125
|
||||
break;
|
||||
}
|
||||
|
||||
k_speed += player->kartspeed; // 152 - 160
|
||||
|
||||
return FixedMul(FixedMul(k_speed<<14, g_cc), K_GetKartBoostPower(player));
|
||||
return FixedMul(FixedMul(k_speed<<14, g_cc), K_GetKartBoostPower(player, true));
|
||||
}
|
||||
fixed_t K_GetKartAccel(player_t *player)
|
||||
{
|
||||
|
@ -1153,7 +1170,7 @@ fixed_t K_GetKartAccel(player_t *player)
|
|||
|
||||
k_accel += 3 * (9 - player->kartspeed); // 36 - 60
|
||||
|
||||
return k_accel;
|
||||
return FixedMul(k_accel, K_GetKartBoostPower(player, false));
|
||||
}
|
||||
fixed_t K_3dKartMovement(player_t *player, boolean onground, boolean forwardmovement)
|
||||
{
|
||||
|
@ -1760,6 +1777,38 @@ void K_DoLightning(player_t *player, boolean bluelightning)
|
|||
player->kartstuff[k_sounds] = 50;
|
||||
}
|
||||
|
||||
fixed_t K_GetKartTurnValue(ticcmd_t *cmd, player_t *player)
|
||||
{
|
||||
fixed_t p_angle = cmd->angleturn;
|
||||
|
||||
p_angle = FixedMul(p_angle, FixedDiv(80 - (player->speed >> 16), 80));
|
||||
|
||||
if (player->kartstuff[k_startimer] || player->kartstuff[k_mushroomtimer] || player->kartstuff[k_growshrinktimer] > 0)
|
||||
p_angle = FixedMul(p_angle, FixedDiv(5*FRACUNIT, 4*FRACUNIT));
|
||||
|
||||
return p_angle;
|
||||
}
|
||||
|
||||
fixed_t K_GetKartDriftValue(fixed_t turntype)
|
||||
{
|
||||
fixed_t driftangle = FRACUNIT;
|
||||
|
||||
switch (turntype)
|
||||
{
|
||||
case 1:
|
||||
driftangle = 600*FRACUNIT; // Drifting outward
|
||||
break;
|
||||
case 2:
|
||||
driftangle = 225*FRACUNIT; // Drifting inward
|
||||
break;
|
||||
case 3:
|
||||
driftangle = 450*FRACUNIT; // Drifting with no input
|
||||
break;
|
||||
}
|
||||
|
||||
return driftangle;
|
||||
}
|
||||
|
||||
void K_KartDrift(player_t *player, ticcmd_t *cmd, boolean onground)
|
||||
{
|
||||
// Drifting is actually straffing + automatic turning.
|
||||
|
@ -1828,11 +1877,11 @@ void K_KartDrift(player_t *player, ticcmd_t *cmd, boolean onground)
|
|||
if (player == &players[consoleplayer])
|
||||
{
|
||||
if (player->kartstuff[k_turndir] == -1) // Turning Left while Drifting Right
|
||||
localangle -= 600*FRACUNIT;
|
||||
localangle -= K_GetKartDriftValue(1);
|
||||
else if (player->kartstuff[k_turndir] == 1) // Turning Right while Drifting Right
|
||||
localangle -= 225*FRACUNIT;
|
||||
localangle -= K_GetKartDriftValue(2);
|
||||
else // No Direction while Drifting Right
|
||||
localangle -= 450*FRACUNIT;
|
||||
localangle -= K_GetKartDriftValue(3);
|
||||
}
|
||||
|
||||
// Player 2
|
||||
|
@ -1851,12 +1900,12 @@ void K_KartDrift(player_t *player, ticcmd_t *cmd, boolean onground)
|
|||
// Player 1
|
||||
if (player == &players[consoleplayer])
|
||||
{
|
||||
if (player->kartstuff[k_turndir] == 1) // Turning Right while Drifting Left
|
||||
localangle += 600*FRACUNIT;
|
||||
else if (player->kartstuff[k_turndir] == -1) // Turning Left while Drifting Left
|
||||
localangle += 225*FRACUNIT;
|
||||
if (player->kartstuff[k_turndir] == 1) // Turning Right while Drifting Left
|
||||
localangle += K_GetKartDriftValue(1);
|
||||
else if (player->kartstuff[k_turndir] == -1) // Turning Left while Drifting Left
|
||||
localangle += K_GetKartDriftValue(2);
|
||||
else // No Direction while Drifting Left
|
||||
localangle += 450*FRACUNIT;
|
||||
localangle += K_GetKartDriftValue(3);
|
||||
}
|
||||
|
||||
// Player 2
|
||||
|
|
|
@ -22,6 +22,7 @@ void K_ExplodePlayer(player_t *player, mobj_t *source);
|
|||
void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 number, mobjtype_t type, angle_t rotangle, boolean spawncenter, boolean ghostit);
|
||||
void K_SpawnDriftTrail(player_t *player);
|
||||
void K_DoMushroom(player_t *player, boolean doPFlag);
|
||||
fixed_t K_GetKartTurnValue(ticcmd_t *cmd, player_t *player);
|
||||
fixed_t K_GetKartSpeed(player_t *player);
|
||||
fixed_t K_3dKartMovement(player_t *player, boolean onground, boolean forwardmovement);
|
||||
void K_MoveKartPlayer(player_t *player, ticcmd_t *cmd, boolean onground);
|
||||
|
|
|
@ -2792,7 +2792,6 @@ static void P_DoClimbing(player_t *player) // SRB2kart - unused
|
|||
P_SetPlayerMobjState(player->mo, S_KART_STND); // SRB2kart
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
//
|
||||
// PIT_CheckSolidsTeeter
|
||||
|
@ -2807,7 +2806,6 @@ static boolean couldteeter;
|
|||
static fixed_t teeterxl, teeterxh;
|
||||
static fixed_t teeteryl, teeteryh;
|
||||
|
||||
/*
|
||||
static boolean PIT_CheckSolidsTeeter(mobj_t *thing) // SRB2kart - unused.
|
||||
{
|
||||
fixed_t blockdist;
|
||||
|
@ -3182,7 +3180,8 @@ teeterdone:
|
|||
//
|
||||
// Sets weapon delay. Properly accounts for Knux's firing rate bonus.
|
||||
//
|
||||
static void P_SetWeaponDelay(player_t *player, INT32 delay)
|
||||
/*
|
||||
static void P_SetWeaponDelay(player_t *player, INT32 delay) // SRB2kart - unused.
|
||||
{
|
||||
player->weapondelay = delay;
|
||||
|
||||
|
@ -3200,7 +3199,6 @@ static void P_SetWeaponDelay(player_t *player, INT32 delay)
|
|||
//
|
||||
// Handles firing ring weapons and Mario fireballs.
|
||||
//
|
||||
/*
|
||||
static void P_DoFiring(player_t *player, ticcmd_t *cmd) // SRB2kart - unused.
|
||||
{
|
||||
INT32 i;
|
||||
|
@ -4785,6 +4783,7 @@ 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, true);
|
||||
else
|
||||
movepushforward = -(K_3dKartMovement(player, onground, false));
|
||||
|
||||
// allow very small movement while in air for gameplay
|
||||
|
|
Loading…
Reference in a new issue