Some accelcode changes to let CC's work.
This commit is contained in:
parent
580f909c6c
commit
fadcd17022
|
@ -207,7 +207,7 @@ static consvar_t cv_fishcake = {"fishcake", "Off", CV_CALL|CV_NOSHOWHELP|CV_REST
|
||||||
static consvar_t cv_dummyconsvar = {"dummyconsvar", "Off", CV_CALL|CV_NOSHOWHELP, CV_OnOff,
|
static consvar_t cv_dummyconsvar = {"dummyconsvar", "Off", CV_CALL|CV_NOSHOWHELP, CV_OnOff,
|
||||||
DummyConsvar_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
DummyConsvar_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
consvar_t cv_restrictskinchange = {"restrictskinchange", "Yes", CV_NETVAR|CV_CHEAT, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_restrictskinchange = {"restrictskinchange", "No", CV_NETVAR|CV_CHEAT, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_allowteamchange = {"allowteamchange", "Yes", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_allowteamchange = {"allowteamchange", "Yes", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
consvar_t cv_startinglives = {"startinglives", "3", CV_NETVAR|CV_CHEAT, startingliveslimit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_startinglives = {"startinglives", "3", CV_NETVAR|CV_CHEAT, startingliveslimit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
@ -1017,8 +1017,8 @@ UINT8 CanChangeSkin(INT32 playernum)
|
||||||
if (gametype == GT_COOP)
|
if (gametype == GT_COOP)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Can change skin during initial countdown. // SRB2kart - Can always change skin in the level
|
// Can change skin during initial countdown.
|
||||||
if (gametype == GT_RACE || gametype == GT_COMPETITION) // if ((gametype == GT_RACE || gametype == GT_COMPETITION) && leveltime < 4*TICRATE)
|
if ((gametype == GT_RACE || gametype == GT_COMPETITION) && leveltime < 4*TICRATE)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (G_TagGametype())
|
if (G_TagGametype())
|
||||||
|
|
48
src/k_kart.c
48
src/k_kart.c
|
@ -1051,8 +1051,8 @@ void K_SpinPlayer(player_t *player, mobj_t *source)
|
||||||
else
|
else
|
||||||
player->kartstuff[k_spinouttimer] = 3*TICRATE/2;
|
player->kartstuff[k_spinouttimer] = 3*TICRATE/2;
|
||||||
|
|
||||||
if (player->speed < player->normalspeed/4)
|
if (player->speed < K_GetKartSpeed(player)/4) // player->normalspeed/4)
|
||||||
P_InstaThrust(player->mo, player->mo->angle, FixedMul(player->normalspeed/4, player->mo->scale));
|
P_InstaThrust(player->mo, player->mo->angle, FixedMul(K_GetKartSpeed(player)/4, player->mo->scale)); // FixedMul(player->normalspeed/4, player->mo->scale));
|
||||||
|
|
||||||
S_StartSound(player->mo, sfx_slip);
|
S_StartSound(player->mo, sfx_slip);
|
||||||
}
|
}
|
||||||
|
@ -1722,22 +1722,23 @@ void K_KartDrift(player_t *player, ticcmd_t *cmd, boolean onground)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT64 K_GetKartSpeed(player_t *player)
|
// Game CC - This will become a netgame variable, just here for testing now
|
||||||
|
fixed_t g_cc = ((2) + 6)*FRACUNIT/8;
|
||||||
|
|
||||||
|
fixed_t K_GetKartSpeed(player_t *player)
|
||||||
{
|
{
|
||||||
UINT64 k_speed = 47*FRACUNIT + FRACUNIT/2;
|
fixed_t k_speed = 151;
|
||||||
|
|
||||||
// Speed is a value between 48 and 52, incremented by halves
|
k_speed += player->kartspeed; // 152 - 160
|
||||||
k_speed += player->kartspeed*FRACUNIT/2;
|
|
||||||
|
|
||||||
return k_speed;
|
return FixedMul(k_speed<<14, g_cc);
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT64 K_GetKartAccel(player_t *player)
|
fixed_t K_GetKartAccel(player_t *player)
|
||||||
{
|
{
|
||||||
UINT64 k_accel = 45;
|
fixed_t k_accel = 36;
|
||||||
|
|
||||||
// Acceleration is a given base, minus the speed value.
|
k_accel += 3 * (9 - player->kartspeed); // 36 - 60
|
||||||
k_accel -= 3*player->kartspeed;
|
|
||||||
|
|
||||||
return k_accel;
|
return k_accel;
|
||||||
}
|
}
|
||||||
|
@ -1747,10 +1748,7 @@ fixed_t K_3dKartMovement(player_t *player, boolean onground)
|
||||||
// If the player isn't on the ground, there is no change in speed
|
// If the player isn't on the ground, there is no change in speed
|
||||||
if (!onground) return 0;
|
if (!onground) return 0;
|
||||||
|
|
||||||
fixed_t accelmax = 2000; // AccelMax
|
fixed_t accelmax = 4000; // AccelMax
|
||||||
fixed_t f_beater = 2*FRACUNIT - (0xE8<<(FRACBITS-8)); //1.10345f; // Friction Beater Friction = (0xE8 << (FRACBITS-8))
|
|
||||||
fixed_t g_cc = 1*FRACUNIT; // Game CC
|
|
||||||
|
|
||||||
fixed_t newspeed, oldspeed, finalspeed;
|
fixed_t newspeed, oldspeed, finalspeed;
|
||||||
fixed_t boostpower = 1*FRACUNIT;
|
fixed_t boostpower = 1*FRACUNIT;
|
||||||
fixed_t p_speed = K_GetKartSpeed(player);
|
fixed_t p_speed = K_GetKartSpeed(player);
|
||||||
|
@ -1773,18 +1771,22 @@ fixed_t K_3dKartMovement(player_t *player, boolean onground)
|
||||||
// Boostpower is applied to each stat individually, and NOT the calculation.
|
// Boostpower is applied to each stat individually, and NOT the calculation.
|
||||||
// Applying to the calculation fails due to friction never getting beaten, or getting overshot really far.
|
// Applying to the calculation fails due to friction never getting beaten, or getting overshot really far.
|
||||||
// It's easier this way.
|
// It's easier this way.
|
||||||
// Similarly, the CC of the game is also multiplied directly.
|
p_speed = FixedMul(p_speed, boostpower);
|
||||||
// This assures a growth in speed without affecting acceleration curving.
|
p_accel = FixedMul(p_accel, boostpower);
|
||||||
p_speed = FixedMul(FixedMul(p_speed, boostpower), g_cc);
|
accelmax = FixedMul(accelmax, boostpower);
|
||||||
p_accel = FixedMul(FixedMul(p_accel, boostpower), g_cc);
|
|
||||||
accelmax = FixedMul(FixedMul(accelmax, boostpower), g_cc);
|
|
||||||
|
|
||||||
// Now, the code that made Iceman's eyes rub erotically against a toaster.
|
// Now, the code that made Iceman's eyes rub erotically against a toaster.
|
||||||
oldspeed = FixedMul(FixedMul(P_AproxDistance(player->rmomx, player->rmomy), player->mo->scale), f_beater);
|
oldspeed = FixedMul(P_AproxDistance(player->rmomx, player->rmomy), player->mo->scale);
|
||||||
newspeed = FixedMul(FixedDiv(FixedMul(oldspeed, accelmax - p_accel) + FixedMul(p_speed, p_accel), accelmax), f_beater);
|
newspeed = FixedDiv(FixedDiv(FixedMul(oldspeed, accelmax - p_accel) + FixedMul(p_speed, p_accel), accelmax), ORIG_FRICTION);
|
||||||
finalspeed = newspeed - oldspeed;
|
finalspeed = newspeed - oldspeed;
|
||||||
|
|
||||||
return (fixed_t)finalspeed;
|
CONS_Printf("Game CC = %d\n", g_cc);
|
||||||
|
CONS_Printf("finalspeed = %d\n", finalspeed);
|
||||||
|
|
||||||
|
// 245498
|
||||||
|
// 498024
|
||||||
|
|
||||||
|
return finalspeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
void K_MoveKartPlayer(player_t *player, ticcmd_t *cmd, boolean onground)
|
void K_MoveKartPlayer(player_t *player, ticcmd_t *cmd, boolean onground)
|
||||||
|
|
|
@ -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_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_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_3dKartMovement(player_t *player, boolean onground);
|
fixed_t K_3dKartMovement(player_t *player, boolean onground);
|
||||||
void K_MoveKartPlayer(player_t *player, ticcmd_t *cmd, boolean onground);
|
void K_MoveKartPlayer(player_t *player, ticcmd_t *cmd, boolean onground);
|
||||||
|
|
||||||
|
|
12
src/p_user.c
12
src/p_user.c
|
@ -4876,10 +4876,10 @@ static void P_3dMovement(player_t *player)
|
||||||
// If "no" to 1, we're not reaching any limits yet, so ignore this entirely!
|
// If "no" to 1, we're not reaching any limits yet, so ignore this entirely!
|
||||||
// -Shadow Hog
|
// -Shadow Hog
|
||||||
newMagnitude = R_PointToDist2(player->mo->momx - player->cmomx, player->mo->momy - player->cmomy, 0, 0);
|
newMagnitude = R_PointToDist2(player->mo->momx - player->cmomx, player->mo->momy - player->cmomy, 0, 0);
|
||||||
if (newMagnitude > topspeed)
|
if (newMagnitude > K_GetKartSpeed(player)) //topspeed)
|
||||||
{
|
{
|
||||||
fixed_t tempmomx, tempmomy;
|
fixed_t tempmomx, tempmomy;
|
||||||
if (oldMagnitude > topspeed)
|
if (oldMagnitude > K_GetKartSpeed(player)) //topspeed)
|
||||||
{
|
{
|
||||||
if (newMagnitude > oldMagnitude)
|
if (newMagnitude > oldMagnitude)
|
||||||
{
|
{
|
||||||
|
@ -4892,8 +4892,8 @@ static void P_3dMovement(player_t *player)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tempmomx = FixedMul(FixedDiv(player->mo->momx - player->cmomx, newMagnitude), topspeed);
|
tempmomx = FixedMul(FixedDiv(player->mo->momx - player->cmomx, newMagnitude), K_GetKartSpeed(player)); //topspeed)
|
||||||
tempmomy = FixedMul(FixedDiv(player->mo->momy - player->cmomy, newMagnitude), topspeed);
|
tempmomy = FixedMul(FixedDiv(player->mo->momy - player->cmomy, newMagnitude), K_GetKartSpeed(player)); //topspeed)
|
||||||
player->mo->momx = tempmomx + player->cmomx;
|
player->mo->momx = tempmomx + player->cmomx;
|
||||||
player->mo->momy = tempmomy + player->cmomy;
|
player->mo->momy = tempmomy + player->cmomy;
|
||||||
}
|
}
|
||||||
|
@ -7876,8 +7876,8 @@ static void P_DeathThink(player_t *player)
|
||||||
if ((cmd->buttons & BT_JUMP || cmd->buttons & BT_ACCELERATE) && (gametype == GT_RACE || player->spectator))
|
if ((cmd->buttons & BT_JUMP || cmd->buttons & BT_ACCELERATE) && (gametype == GT_RACE || player->spectator))
|
||||||
player->playerstate = PST_REBORN;
|
player->playerstate = PST_REBORN;
|
||||||
|
|
||||||
// One second respawn in coop.
|
// One second respawn in coop. // SRB2kart - Race maybe?
|
||||||
if ((cmd->buttons & BT_JUMP || cmd->buttons & BT_ACCELERATE) && player->deadtimer > TICRATE && (gametype == GT_COOP || gametype == GT_COMPETITION))
|
if ((cmd->buttons & BT_JUMP || cmd->buttons & BT_ACCELERATE) && player->deadtimer > TICRATE && gametype == GT_RACE)//(gametype == GT_COOP || gametype == GT_COMPETITION))
|
||||||
player->playerstate = PST_REBORN;
|
player->playerstate = PST_REBORN;
|
||||||
|
|
||||||
// Single player auto respawn
|
// Single player auto respawn
|
||||||
|
|
Loading…
Reference in a new issue