mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-30 21:11:00 +00:00
Some accelcode changes to let CC's work.
This commit is contained in:
parent
580f909c6c
commit
fadcd17022
5 changed files with 47 additions and 44 deletions
|
@ -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,
|
||||
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_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)
|
||||
return true;
|
||||
|
||||
// Can change skin during initial countdown. // SRB2kart - Can always change skin in the level
|
||||
if (gametype == GT_RACE || gametype == GT_COMPETITION) // if ((gametype == GT_RACE || gametype == GT_COMPETITION) && leveltime < 4*TICRATE)
|
||||
// Can change skin during initial countdown.
|
||||
if ((gametype == GT_RACE || gametype == GT_COMPETITION) && leveltime < 4*TICRATE)
|
||||
return true;
|
||||
|
||||
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
|
||||
player->kartstuff[k_spinouttimer] = 3*TICRATE/2;
|
||||
|
||||
if (player->speed < player->normalspeed/4)
|
||||
P_InstaThrust(player->mo, player->mo->angle, FixedMul(player->normalspeed/4, player->mo->scale));
|
||||
if (player->speed < K_GetKartSpeed(player)/4) // player->normalspeed/4)
|
||||
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);
|
||||
}
|
||||
|
@ -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*FRACUNIT/2;
|
||||
k_speed += player->kartspeed; // 152 - 160
|
||||
|
||||
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*player->kartspeed;
|
||||
k_accel += 3 * (9 - player->kartspeed); // 36 - 60
|
||||
|
||||
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 (!onground) return 0;
|
||||
|
||||
fixed_t accelmax = 2000; // 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 accelmax = 4000; // AccelMax
|
||||
fixed_t newspeed, oldspeed, finalspeed;
|
||||
fixed_t boostpower = 1*FRACUNIT;
|
||||
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.
|
||||
// Applying to the calculation fails due to friction never getting beaten, or getting overshot really far.
|
||||
// It's easier this way.
|
||||
// Similarly, the CC of the game is also multiplied directly.
|
||||
// This assures a growth in speed without affecting acceleration curving.
|
||||
p_speed = FixedMul(FixedMul(p_speed, boostpower), g_cc);
|
||||
p_accel = FixedMul(FixedMul(p_accel, boostpower), g_cc);
|
||||
accelmax = FixedMul(FixedMul(accelmax, boostpower), g_cc);
|
||||
p_speed = FixedMul(p_speed, boostpower);
|
||||
p_accel = FixedMul(p_accel, boostpower);
|
||||
accelmax = FixedMul(accelmax, boostpower);
|
||||
|
||||
// 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);
|
||||
newspeed = FixedMul(FixedDiv(FixedMul(oldspeed, accelmax - p_accel) + FixedMul(p_speed, p_accel), accelmax), f_beater);
|
||||
oldspeed = FixedMul(P_AproxDistance(player->rmomx, player->rmomy), player->mo->scale);
|
||||
newspeed = FixedDiv(FixedDiv(FixedMul(oldspeed, accelmax - p_accel) + FixedMul(p_speed, p_accel), accelmax), ORIG_FRICTION);
|
||||
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)
|
||||
|
|
|
@ -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_GetKartSpeed(player_t *player);
|
||||
fixed_t K_3dKartMovement(player_t *player, 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!
|
||||
// -Shadow Hog
|
||||
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;
|
||||
if (oldMagnitude > topspeed)
|
||||
if (oldMagnitude > K_GetKartSpeed(player)) //topspeed)
|
||||
{
|
||||
if (newMagnitude > oldMagnitude)
|
||||
{
|
||||
|
@ -4892,8 +4892,8 @@ static void P_3dMovement(player_t *player)
|
|||
}
|
||||
else
|
||||
{
|
||||
tempmomx = FixedMul(FixedDiv(player->mo->momx - player->cmomx, newMagnitude), topspeed);
|
||||
tempmomy = FixedMul(FixedDiv(player->mo->momy - player->cmomy, newMagnitude), topspeed);
|
||||
tempmomx = FixedMul(FixedDiv(player->mo->momx - player->cmomx, newMagnitude), K_GetKartSpeed(player)); //topspeed)
|
||||
tempmomy = FixedMul(FixedDiv(player->mo->momy - player->cmomy, newMagnitude), K_GetKartSpeed(player)); //topspeed)
|
||||
player->mo->momx = tempmomx + player->cmomx;
|
||||
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))
|
||||
player->playerstate = PST_REBORN;
|
||||
|
||||
// One second respawn in coop.
|
||||
if ((cmd->buttons & BT_JUMP || cmd->buttons & BT_ACCELERATE) && player->deadtimer > TICRATE && (gametype == GT_COOP || gametype == GT_COMPETITION))
|
||||
// One second respawn in coop. // SRB2kart - Race maybe?
|
||||
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;
|
||||
|
||||
// Single player auto respawn
|
||||
|
|
Loading…
Reference in a new issue