feel-tuning

todo: make holding brake before going airborne not activate heavy drop (maybe allow 2 ticks of leeway?)
This commit is contained in:
minenice55 2026-02-04 20:55:35 -05:00
parent 0d7d6a60eb
commit 667616ed0c
4 changed files with 55 additions and 32 deletions

View file

@ -93,7 +93,7 @@
#define ASSET_HASH_TEXTURES_KART 0xb4211b2f32b6a291
#define ASSET_HASH_CHARS_KART 0x1e68a3e01aa5c68b
#define ASSET_HASH_MAPS_KART 0x38558ed00da41ce9
#define ASSET_HASH_MAIN_PK3 0xebb499f36118246b
#define ASSET_HASH_MAIN_PK3 0x7af447cd2ac5ee74
#define ASSET_HASH_MAPPATCH_PK3 0xbbc2c6a7a685da3a
#define ASSET_HASH_BONUSCHARS_KART 0x60e6f13d822a7461
#ifdef USE_PATCH_FILE

View file

@ -205,6 +205,8 @@ typedef enum
khud_boostcam, // Camera push forward on boost
khud_destboostcam, // Ditto
khud_timeovercam, // Camera timer for leaving behind or not
khud_heavydropcam, // Camera timer for heavy air drop
khud_postdropcam, // Camera timer for landing after heavy air drop (both timers superposition for feel)
// Sounds
khud_enginesnd, // Engine sound offset this player is using.
@ -512,9 +514,6 @@ struct player_t
// See pflags_t, above.
pflags_t pflags;
// Airdrop-exclusive bitflags.
p_airdropflags_t airdropflags;
// playing animation.
panim_t panim;
@ -681,8 +680,8 @@ struct player_t
UINT8 ringvolume; // When consuming lots of rings, lower the sound a little.
UINT8 ringtransparency; // When consuming lots of rings, fade out the rings again.
fixed_t airdroptime; // Tracks how long airdrop has been active, used for delay before airdrop kicks in.
//boolean ringdrop; // Set when having ringdrop applied.
tic_t airdroptime; // Tracks how long airdrop has been active, used for delay before airdrop kicks in.
p_airdropflags_t airdropflags; // Airdrop-exclusive bitflags.
mobj_t *shieldtracer; // Blankart: Shield mobj

View file

@ -6982,6 +6982,43 @@ static void K_AirDrop(player_t *player, ticcmd_t *cmd)
{
player->airdropflags &= ~PAF_WANTSAIRDROP;
}
if (!(player->airdropflags & PAF_AIRDROP))
{
if (player->karthud[khud_heavydropcam] > 0)
{
player->karthud[khud_heavydropcam] = max(player->karthud[khud_heavydropcam] - 5, 0);
}
}
if (player->karthud[khud_postdropcam] > 0)
{
player->karthud[khud_postdropcam]--;
}
if (P_IsObjectOnGround(player->mo))
{
if (K_AirDropActive() && (player->airdropflags & PAF_AIRDROP))
{
if (airdropactive == AIRDROP_HEAVY)
{
if (player->rings > 0 && player->airdroptime > TICRATE/4)
{
P_PlayerRingBurst(player, min(2, player->rings));
}
if (player->airdroptime > 1)
{
player->startboost = TICRATE/2;
// Take off!
S_StartSound(player->mo, sfx_shrpgo);
}
// POOMP!
S_StartSound(player->mo, sfx_vclgna);
player->karthud[khud_postdropcam] = min(2*player->karthud[khud_heavydropcam], TICRATE/4);
}
}
}
if (!K_AirDropActive() || P_IsObjectOnGround(player->mo)
|| P_PlayerInPain(player) || player->loop.radius
@ -6989,23 +7026,6 @@ static void K_AirDrop(player_t *player, ticcmd_t *cmd)
|| player->respawn
)
{
if ((player->airdropflags & PAF_AIRDROP))
{
if (airdropactive == AIRDROP_HEAVY)
{
if (player->rings > 0)
{
P_PlayerRingBurst(player, min(2, player->rings));
}
player->startboost = TICRATE/2;
// Take off!
S_StartSound(player->mo, sfx_s3k81);
// POOMP!
S_StartSound(player->mo, sfx_vclgna);
}
}
player->airdroptime = 0;
player->airdropflags &= ~PAF_AIRDROP;
return;
@ -7016,7 +7036,7 @@ static void K_AirDrop(player_t *player, ticcmd_t *cmd)
if (airdropactive == AIRDROP_HEAVY && !(player->airdropflags & (PAF_AIRDROP)))
{
// TODO: heavy air drop should allow keeping current boost stack
S_StartSound(player->mo, sfx_s3k66);
S_StartSound(player->mo, sfx_s3k77);
S_StartSound(player->mo, sfx_s3k51);
player->mo->momx = FixedMul(player->mo->momx, 90*FRACUNIT/100);
@ -7038,14 +7058,18 @@ static void K_AirDrop(player_t *player, ticcmd_t *cmd)
if (airdropactive == AIRDROP_HEAVY)
{
if (player->airdroptime < UINT8_MAX)
player->airdroptime++;
if (player->airdroptime <= TICRATE/4)
{
player->mo->momz -= FixedMul(4*gravity, mapobjectscale)*P_MobjFlip(player->mo);
K_SpawnAirdropTrail(player);
}
else
{
player->mo->momz -= FixedMul(2*gravity, mapobjectscale)*P_MobjFlip(player->mo);
}
if (player->karthud[khud_heavydropcam] < TICRATE)
player->karthud[khud_heavydropcam]++;
}
else if (airdropactive == AIRDROP_LIGHT)
{
@ -7055,10 +7079,9 @@ static void K_AirDrop(player_t *player, ticcmd_t *cmd)
player->mo->momz -= FixedMul(gravity, mapobjectscale)*P_MobjFlip(player->mo);
K_SpawnAirdropTrail(player);
}
if (player->airdroptime < UINT8_MAX)
player->airdroptime++;
}
if (player->airdroptime < UINT8_MAX)
player->airdroptime++;
}
}

View file

@ -3364,6 +3364,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
}
z += player->cameraOffset;
z -= 2*(player->karthud[khud_heavydropcam] + player->karthud[khud_postdropcam])*FRACUNIT*P_MobjFlip(mo);
// point viewed by the camera
// this point is just 64 unit forward the player
@ -3415,13 +3416,13 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
if (mo->eflags & MFE_VERTICALFLIP)
{
angle = R_PointToAngle2(0, thiscam->z + thiscam->height, dist, mo->z + mo->height - player->mo->height + player->cameraOffset);
angle = R_PointToAngle2(0, thiscam->z + thiscam->height, dist, mo->z + mo->height - player->mo->height + player->cameraOffset + 2*player->karthud[khud_heavydropcam]*FRACUNIT);
if (thiscam->pitch < ANGLE_180 && thiscam->pitch > angle)
angle += (thiscam->pitch - angle)/2;
}
else
{
angle = R_PointToAngle2(0, thiscam->z, dist, mo->z + player->mo->height + player->cameraOffset);
angle = R_PointToAngle2(0, thiscam->z, dist, mo->z + player->mo->height + player->cameraOffset - 2*player->karthud[khud_heavydropcam]*FRACUNIT);
if (thiscam->pitch >= ANGLE_180 && thiscam->pitch < angle)
angle -= (angle - thiscam->pitch)/2;
}