From 0974d6d1f47c125f25ca51fee8b4ae55c5d3847f Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sun, 28 Nov 2021 00:08:50 -0500 Subject: [PATCH 01/20] Reduced hitlag jitter Makes a little easier to parse. I might have gone overboard but I really wanted to test my hunch if Ivo's issue was mostly the fact it jitters so hard :V --- src/hardware/hw_main.c | 5 +++-- src/hardware/hw_md2.c | 3 ++- src/k_hud.c | 2 +- src/k_kart.h | 1 + src/r_things.c | 7 +++++-- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 3e113bd76..ecb7f7436 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -39,6 +39,7 @@ #include "../f_finale.h" #include "../r_things.h" // R_GetShadowZ #include "../p_slopes.h" +#include "../k_kart.h" // HITLAGJITTERS #include "hw_md2.h" #ifdef NEWCLIP @@ -3645,7 +3646,7 @@ static void HWR_DrawDropShadow(mobj_t *thing, fixed_t scale) // hitlag vibrating if (thing->hitlag > 0 && (thing->eflags & MFE_DAMAGEHITLAG)) { - fixed_t mul = thing->hitlag * (FRACUNIT / 10); + fixed_t mul = thing->hitlag * HITLAGJITTERS; if (leveltime & 1) { @@ -5064,7 +5065,7 @@ static void HWR_ProjectSprite(mobj_t *thing) // hitlag vibrating if (thing->hitlag > 0 && (thing->eflags & MFE_DAMAGEHITLAG)) { - fixed_t mul = thing->hitlag * (FRACUNIT / 10); + fixed_t mul = thing->hitlag * HITLAGJITTERS; if (leveltime & 1) { diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 4b8d1de6f..69f00d898 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -45,6 +45,7 @@ // SRB2Kart #include "../k_color.h" +#include "../k_kart.h" // HITLAGJITTERS #ifdef HAVE_PNG @@ -1374,7 +1375,7 @@ boolean HWR_DrawModel(gl_vissprite_t *spr) // hitlag vibrating if (spr->mobj->hitlag > 0 && (spr->mobj->eflags & MFE_DAMAGEHITLAG)) { - fixed_t mul = spr->mobj->hitlag * (FRACUNIT / 10); + fixed_t mul = spr->mobj->hitlag * HITLAGJITTERS; if (leveltime & 1) { diff --git a/src/k_hud.c b/src/k_hud.c index 25b437f5c..39ce118e8 100644 --- a/src/k_hud.c +++ b/src/k_hud.c @@ -3744,7 +3744,7 @@ static void K_drawKartFirstPerson(void) // hitlag vibrating if (stplyr->mo->hitlag > 0 && (stplyr->mo->eflags & MFE_DAMAGEHITLAG)) { - fixed_t mul = stplyr->mo->hitlag * (FRACUNIT / 10); + fixed_t mul = stplyr->mo->hitlag * HITLAGJITTERS; if (r_splitscreen && mul > FRACUNIT) mul = FRACUNIT; diff --git a/src/k_kart.h b/src/k_kart.h index 540e6845c..1efc5fb2f 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -20,6 +20,7 @@ Make sure this matches the actual number of states #define KART_NUMINVSPARKLESANIM 12 #define MAXHITLAGTICS 18 //12 +#define HITLAGJITTERS (FRACUNIT / 32) player_t *K_GetItemBoxPlayer(mobj_t *mobj); angle_t K_ReflectAngle(angle_t angle, angle_t against, fixed_t maxspeed, fixed_t yourspeed); diff --git a/src/r_things.c b/src/r_things.c index defd02a5f..197100470 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -35,7 +35,6 @@ #include "p_slopes.h" #include "d_netfil.h" // blargh. for nameonly(). #include "m_cheat.h" // objectplace -#include "k_color.h" // SRB2kart #include "p_local.h" // stplyr #ifdef HWRENDER #include "hardware/hw_md2.h" @@ -44,6 +43,10 @@ #include "hardware/hw_drv.h" #endif +// SRB2kart +#include "k_color.h" +#include "k_kart.h" // HITLAGJITTERS + #define MINZ (FRACUNIT*4) #define BASEYCENTER (BASEVIDHEIGHT/2) @@ -1438,7 +1441,7 @@ static void R_ProjectSprite(mobj_t *thing) // hitlag vibrating if (thing->hitlag > 0 && (thing->eflags & MFE_DAMAGEHITLAG)) { - fixed_t mul = thing->hitlag * (FRACUNIT / 10); + fixed_t mul = thing->hitlag * HITLAGJITTERS; if (leveltime & 1) { From 15556dce0bcaec8105b5891bb3a6a738cf7ba0bd Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sun, 28 Nov 2021 00:25:40 -0500 Subject: [PATCH 02/20] Quakes are scaled with map scale Finally --- src/p_enemy.c | 4 ++-- src/p_spec.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 9f5fc86d8..2fdbc6f58 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -12205,9 +12205,9 @@ void A_Boss5BombExplode(mobj_t *actor) P_DustRing(locvar1, 4, actor->x, actor->y, actor->z+actor->height, 2*actor->radius, 0, FRACUNIT, actor->scale); P_DustRing(locvar1, 6, actor->x, actor->y, actor->z+actor->height/2, 3*actor->radius, FRACUNIT, FRACUNIT, actor->scale); - //P_StartQuake(9*actor->scale, TICRATE/6, {actor->x, actor->y, actor->z}, 20*actor->radius); + //P_StartQuake(9*FRACUNIT, TICRATE/6, {actor->x, actor->y, actor->z}, 20*actor->radius); // the above does not exist, so we set the quake values directly instead - quake.intensity = 9*actor->scale; + quake.intensity = 9*FRACUNIT; quake.time = TICRATE/6; // the following quake values have no effect atm? ah well, may as well set them anyway { diff --git a/src/p_spec.c b/src/p_spec.c index 16823916e..764f9c738 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -8746,6 +8746,6 @@ static void P_SpawnPushers(void) // epicenter and radius are not yet used. void P_StartQuake(fixed_t intensity, tic_t time) { - quake.intensity = intensity; + quake.intensity = FixedMul(intensity, mapobjectscale); quake.time = time; } From c1b34d4d4ff276826713d619b62630c32a1661db Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sun, 28 Nov 2021 00:32:07 -0500 Subject: [PATCH 03/20] A few more instances --- src/p_enemy.c | 3 +++ src/p_spec.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 2fdbc6f58..7a67fc2af 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -11195,10 +11195,13 @@ void A_MineExplode(mobj_t *actor) A_Scream(actor); actor->flags = MF_NOGRAVITY|MF_NOCLIP; + /* quake.epicenter = NULL; quake.radius = 512*FRACUNIT; quake.intensity = 8*FRACUNIT; quake.time = TICRATE/3; + */ + P_StartQuake(8<tracer, 192*FRACUNIT, 0, true); P_MobjCheckWater(actor); diff --git a/src/p_spec.c b/src/p_spec.c index 764f9c738..d428444a3 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2976,9 +2976,9 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) // reasonable defaults. if (!quake.intensity) - quake.intensity = 8< Date: Sun, 28 Nov 2021 13:31:25 -0500 Subject: [PATCH 04/20] Bring back more jitter --- src/k_kart.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.h b/src/k_kart.h index 1efc5fb2f..53e0e8bc1 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -20,7 +20,7 @@ Make sure this matches the actual number of states #define KART_NUMINVSPARKLESANIM 12 #define MAXHITLAGTICS 18 //12 -#define HITLAGJITTERS (FRACUNIT / 32) +#define HITLAGJITTERS (FRACUNIT / 20) player_t *K_GetItemBoxPlayer(mobj_t *mobj); angle_t K_ReflectAngle(angle_t angle, angle_t against, fixed_t maxspeed, fixed_t yourspeed); From 2a74ee07f101e450fb30c6fd09e5524277aa8366 Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 5 Dec 2021 20:10:52 -0800 Subject: [PATCH 05/20] Update underwater physics - Reduce steering effect and remove increased friction. - Strafe into turns and tilt the inside wheels up. --- src/d_player.h | 2 ++ src/k_kart.c | 23 ++++++++++++++++++++--- src/k_kart.h | 1 + src/p_saveg.c | 4 ++++ src/p_user.c | 40 ++++++++++++++++++++++++++++++++++++++++ src/r_patchrotation.c | 6 +++++- 6 files changed, 72 insertions(+), 4 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 0a406f785..0578e0301 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -394,6 +394,8 @@ typedef struct player_s INT32 aizdrifttilt; INT32 aizdriftturn; + INT32 underwatertilt; + fixed_t offroad; // In Super Mario Kart, going offroad has lee-way of about 1 second before you start losing speed UINT8 waterskip; // Water skipping counter diff --git a/src/k_kart.c b/src/k_kart.c index 73661c018..a516f996b 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -7565,7 +7565,7 @@ static INT16 K_GetKartDriftValue(player_t *player, fixed_t countersteer) basedrift += (basedrift / greasetics) * player->tiregrease; } - if (player->mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER)) + if (player->mo->eflags & (MFE_TOUCHWATER)) { countersteer = FixedMul(countersteer, 3*FRACUNIT/2); } @@ -7672,7 +7672,11 @@ INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue) turnfixed = FixedMul(turnfixed, FRACUNIT + player->handleboost); } - if (player->mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER)) + if (player->mo->eflags & MFE_UNDERWATER) + { + turnfixed /= 2; + } + else if (player->mo->eflags & MFE_TOUCHWATER) { turnfixed = FixedMul(turnfixed, 3*FRACUNIT/2); } @@ -7683,6 +7687,19 @@ INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue) return (turnfixed / FRACUNIT); } +INT32 K_GetUnderwaterTurnAdjust(player_t *player) +{ + if (player->mo->eflags & MFE_UNDERWATER) + { + INT32 steer = (K_GetKartTurnValue(player, + player->steering) << TICCMD_REDUCE); + return FixedMul(steer, 8 * FixedDiv(player->speed, + 2 * K_GetKartSpeed(player, false) / 3)); + } + else + return 0; +} + INT32 K_GetKartDriftSparkValue(player_t *player) { return (26*4 + player->kartspeed*2 + (9 - player->kartweight))*8; @@ -8449,7 +8466,7 @@ void K_AdjustPlayerFriction(player_t *player) */ // Water gets ice physics too - if (player->mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER)) + if (player->mo->eflags & MFE_TOUCHWATER) { player->mo->friction += 614; } diff --git a/src/k_kart.h b/src/k_kart.h index 8b0f755d6..af8751e6a 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -92,6 +92,7 @@ void K_UpdateDistanceFromFinishLine(player_t *const player); boolean K_CheckPlayersRespawnColliding(INT32 playernum, fixed_t x, fixed_t y); void K_UpdateSteeringValue(player_t *player, INT16 destSteering); INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue); +INT32 K_GetUnderwaterTurnAdjust(player_t *player); INT32 K_GetKartDriftSparkValue(player_t *player); INT32 K_StairJankFlip(INT32 value); INT32 K_GetKartDriftSparkValueForStage(player_t *player, UINT8 stage); diff --git a/src/p_saveg.c b/src/p_saveg.c index 83625026d..39a4fec28 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -239,6 +239,8 @@ static void P_NetArchivePlayers(void) WRITEINT32(save_p, players[i].aizdrifttilt); WRITEINT32(save_p, players[i].aizdriftturn); + WRITEINT32(save_p, players[i].underwatertilt); + WRITEFIXED(save_p, players[i].offroad); WRITEUINT8(save_p, players[i].waterskip); @@ -495,6 +497,8 @@ static void P_NetUnArchivePlayers(void) players[i].aizdrifttilt = READINT32(save_p); players[i].aizdriftturn = READINT32(save_p); + players[i].underwatertilt = READINT32(save_p); + players[i].offroad = READFIXED(save_p); players[i].waterskip = READUINT8(save_p); diff --git a/src/p_user.c b/src/p_user.c index c36ef75f0..9c1e87a53 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1769,6 +1769,42 @@ static void P_3dMovement(player_t *player) if (player->mo->movefactor != FRACUNIT) // Friction-scaled acceleration... movepushforward = FixedMul(movepushforward, player->mo->movefactor); + { + INT32 a = K_GetUnderwaterTurnAdjust(player); + INT32 adj = 0; + + if (a) + { + adj = a / 4; + + if (abs(player->underwatertilt + adj) > abs(a)) + adj = (a - player->underwatertilt); + + if (abs(a) < abs(player->underwatertilt)) + adj = 0; + + movepushangle += a; + } + + if (adj) + { + player->underwatertilt += adj; + + if (abs(player->underwatertilt) > ANG30) + { + player->underwatertilt = + player->underwatertilt > 0 ? ANG30 + : -(ANG30); + } + } + else + { + player->underwatertilt = + FixedMul(player->underwatertilt, + 7*FRACUNIT/8); + } + } + totalthrust.x += P_ReturnThrustX(player->mo, movepushangle, movepushforward); totalthrust.y += P_ReturnThrustY(player->mo, movepushangle, movepushforward); } @@ -2055,6 +2091,10 @@ void P_MovePlayer(player_t *player) else if (player->drift != 0) { INT32 a = (ANGLE_45 / 5) * player->drift; + + if (player->mo->eflags & MFE_UNDERWATER) + a /= 2; + player->drawangle += a; } } diff --git a/src/r_patchrotation.c b/src/r_patchrotation.c index 3744dfce2..24c1de5d2 100644 --- a/src/r_patchrotation.c +++ b/src/r_patchrotation.c @@ -42,7 +42,11 @@ static angle_t R_PlayerSpriteRotation(player_t *player, player_t *viewPlayer) angle_t rollAngle = 0; - if (sliptideLift) + if (player->mo->eflags & MFE_UNDERWATER) + { + rollAngle -= player->underwatertilt; + } + else if (sliptideLift) { /* (from side) tilt downward if turning toward camera, upward if away. */ From aebe6dd59ca61b485851c333f639a0dcb6c16876 Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 5 Dec 2021 20:13:20 -0800 Subject: [PATCH 06/20] Don't apply shallow water effects while in offroad --- src/k_kart.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index a516f996b..40ca0ca8f 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -7676,7 +7676,8 @@ INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue) { turnfixed /= 2; } - else if (player->mo->eflags & MFE_TOUCHWATER) + else if ((player->mo->eflags & MFE_TOUCHWATER) && + !player->offroad) { turnfixed = FixedMul(turnfixed, 3*FRACUNIT/2); } @@ -8466,7 +8467,8 @@ void K_AdjustPlayerFriction(player_t *player) */ // Water gets ice physics too - if (player->mo->eflags & MFE_TOUCHWATER) + if ((player->mo->eflags & MFE_TOUCHWATER) && + !player->offroad) { player->mo->friction += 614; } From f0c9e49a2baacb3c9032a8582912814e79e4775f Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 5 Dec 2021 22:38:59 -0800 Subject: [PATCH 07/20] Clip watertop and waterbottom between other sector and FOFs --- src/p_mobj.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 491b371b3..96beed530 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2956,6 +2956,8 @@ void P_MobjCheckWater(mobj_t *mobj) player_t *p = mobj->player; // Will just be null if not a player. fixed_t height = mobj->height; boolean wasgroundpounding = false; + fixed_t top2 = P_GetSectorCeilingZAt(sector, mobj->x, mobj->y); + fixed_t bot2 = P_GetSectorFloorZAt(sector, mobj->x, mobj->y); // Default if no water exists. mobj->watertop = mobj->waterbottom = mobj->z - 1000*FRACUNIT; @@ -2966,14 +2968,21 @@ void P_MobjCheckWater(mobj_t *mobj) for (rover = sector->ffloors; rover; rover = rover->next) { fixed_t topheight, bottomheight; - if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE) - || (((rover->flags & FF_BLOCKPLAYER) && mobj->player) - || ((rover->flags & FF_BLOCKOTHERS) && !mobj->player))) - continue; topheight = P_GetFFloorTopZAt (rover, mobj->x, mobj->y); bottomheight = P_GetFFloorBottomZAt(rover, mobj->x, mobj->y); + if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE) + || (((rover->flags & FF_BLOCKPLAYER) && mobj->player) + || ((rover->flags & FF_BLOCKOTHERS) && !mobj->player))) + { + if (topheight < top2 && topheight > thingtop) + top2 = topheight; + if (bottomheight > bot2 && bottomheight < mobj->z) + bot2 = bottomheight; + continue; + } + if (mobj->eflags & MFE_VERTICALFLIP) { if (topheight < (thingtop - (height>>1)) @@ -3011,6 +3020,12 @@ void P_MobjCheckWater(mobj_t *mobj) } } + if (mobj->watertop > top2) + mobj->watertop = top2; + + if (mobj->waterbottom < bot2) + mobj->waterbottom = bot2; + // Spectators and dead players don't get to do any of the things after this. if (p && (p->spectator || p->playerstate != PST_LIVE)) return; From 9bde266f9f210a82a1a5e6460e5e259436d01ce2 Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 5 Dec 2021 22:41:25 -0800 Subject: [PATCH 08/20] Water running You can run on water in any case where you would have slope resistance AND your speed is over 100%. You may run on water regardless if you're speed is above 200%. --- src/p_local.h | 1 + src/p_map.c | 2 +- src/p_maputl.c | 4 ++-- src/p_mobj.c | 39 ++++++++++++++++++++++++++++++++++----- 4 files changed, 38 insertions(+), 8 deletions(-) diff --git a/src/p_local.h b/src/p_local.h index 631920bb6..037e9aa50 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -329,6 +329,7 @@ void P_Attract(mobj_t *source, mobj_t *enemy, boolean nightsgrab); mobj_t *P_GetClosestAxis(mobj_t *source); boolean P_CanRunOnWater(player_t *player, ffloor_t *rover); +boolean P_CheckSolidFFloorSurface(player_t *player, ffloor_t *rover); void P_MaceRotate(mobj_t *center, INT32 baserot, INT32 baseprevrot); diff --git a/src/p_map.c b/src/p_map.c index d0716790b..f78a0b402 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1848,7 +1848,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) continue; } - if (thing->player && P_CheckSolidLava(rover)) + if (thing->player && P_CheckSolidFFloorSurface(thing->player, rover)) ; else if (thing->type == MT_SKIM && (rover->flags & FF_SWIMMABLE)) ; diff --git a/src/p_maputl.c b/src/p_maputl.c index 2e21f5ee3..5acddf09c 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -730,7 +730,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) if (!(rover->flags & FF_EXISTS)) continue; - if (mobj->player && P_CheckSolidLava(rover)) + if (mobj->player && P_CheckSolidFFloorSurface(mobj->player, rover)) ; else if (!((rover->flags & FF_BLOCKPLAYER && mobj->player) || (rover->flags & FF_BLOCKOTHERS && !mobj->player))) @@ -772,7 +772,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) if (!(rover->flags & FF_EXISTS)) continue; - if (mobj->player && P_CheckSolidLava(rover)) + if (mobj->player && P_CheckSolidFFloorSurface(mobj->player, rover)) ; else if (!((rover->flags & FF_BLOCKPLAYER && mobj->player) || (rover->flags & FF_BLOCKOTHERS && !mobj->player))) diff --git a/src/p_mobj.c b/src/p_mobj.c index 96beed530..6853c06f9 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1879,7 +1879,7 @@ void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motype) topheight = P_GetFOFTopZ(mo, sector, rover, mo->x, mo->y, NULL); bottomheight = P_GetFOFBottomZ(mo, sector, rover, mo->x, mo->y, NULL); - if (mo->player && P_CheckSolidLava(rover)) // only the player should stand on lava + if (mo->player && P_CheckSolidFFloorSurface(mo->player, rover)) // only the player should stand on lava or run on water ; else if (motype != 0 && rover->flags & FF_SWIMMABLE) // "scenery" only continue; @@ -2940,6 +2940,34 @@ boolean P_SceneryZMovement(mobj_t *mo) return true; } +// P_CanRunOnWater +// +// Returns true if player can waterrun on the 3D floor +// +boolean P_CanRunOnWater(player_t *player, ffloor_t *rover) +{ + boolean flip = player->mo->eflags & MFE_VERTICALFLIP; + fixed_t topspeed = K_GetKartSpeed(player, false); + fixed_t surfaceheight = flip ? player->mo->waterbottom : player->mo->watertop; + fixed_t playerbottom = flip ? (player->mo->z + player->mo->height) : player->mo->z; + fixed_t clip = flip ? (surfaceheight - playerbottom) : (playerbottom - surfaceheight); + fixed_t span = player->mo->watertop - player->mo->waterbottom; + + return + clip > -(player->mo->height / 2) && + span > player->mo->height && + player->speed / 3 > abs(player->mo->momz) && + (player->speed > 2 * topspeed || (player->speed > + topspeed && K_SlopeResistance(player))) && + (rover->flags & FF_SWIMMABLE); +} + +boolean P_CheckSolidFFloorSurface(player_t *player, ffloor_t *rover) +{ + return P_CheckSolidLava(rover) || + P_CanRunOnWater(player, rover); +} + // // P_MobjCheckWater // @@ -2955,6 +2983,7 @@ void P_MobjCheckWater(mobj_t *mobj) ffloor_t *rover; player_t *p = mobj->player; // Will just be null if not a player. fixed_t height = mobj->height; + fixed_t halfheight = height / 2; boolean wasgroundpounding = false; fixed_t top2 = P_GetSectorCeilingZAt(sector, mobj->x, mobj->y); fixed_t bot2 = P_GetSectorFloorZAt(sector, mobj->x, mobj->y); @@ -2985,14 +3014,14 @@ void P_MobjCheckWater(mobj_t *mobj) if (mobj->eflags & MFE_VERTICALFLIP) { - if (topheight < (thingtop - (height>>1)) - || bottomheight > thingtop) + if (topheight < (thingtop - halfheight) + || bottomheight > (thingtop + halfheight)) continue; } else { - if (topheight < mobj->z - || bottomheight > (mobj->z + (height>>1))) + if (topheight < (mobj->z - halfheight) + || bottomheight > (mobj->z + halfheight)) continue; } From a7a572a7eab280bcafa9f5c11d06bf7d5ddfb157 Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 5 Dec 2021 23:23:43 -0800 Subject: [PATCH 09/20] Water-run if you are above 100% speed and would cross a tripwire --- src/p_mobj.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 6853c06f9..b52522a75 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2947,7 +2947,6 @@ boolean P_SceneryZMovement(mobj_t *mo) boolean P_CanRunOnWater(player_t *player, ffloor_t *rover) { boolean flip = player->mo->eflags & MFE_VERTICALFLIP; - fixed_t topspeed = K_GetKartSpeed(player, false); fixed_t surfaceheight = flip ? player->mo->waterbottom : player->mo->watertop; fixed_t playerbottom = flip ? (player->mo->z + player->mo->height) : player->mo->z; fixed_t clip = flip ? (surfaceheight - playerbottom) : (playerbottom - surfaceheight); @@ -2957,8 +2956,8 @@ boolean P_CanRunOnWater(player_t *player, ffloor_t *rover) clip > -(player->mo->height / 2) && span > player->mo->height && player->speed / 3 > abs(player->mo->momz) && - (player->speed > 2 * topspeed || (player->speed > - topspeed && K_SlopeResistance(player))) && + player->speed > K_GetKartSpeed(player, false) && + K_TripWirePass(player) && (rover->flags & FF_SWIMMABLE); } From 58446441fe5db01b5720e9687134229c2b442fe7 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 6 Dec 2021 16:14:56 -0800 Subject: [PATCH 10/20] Don't water-run while in grow Also there was a typo lmao --- src/k_kart.c | 13 +++++++++++++ src/k_kart.h | 1 + src/p_mobj.c | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index 73661c018..a66f34d32 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2700,6 +2700,19 @@ boolean K_TripwirePass(player_t *player) return false; } +boolean K_WaterRun(player_t *player) +{ + if ( + player->invincibilitytimer || + player->sneakertimer || + player->tiregrease || + player->flamedash || + player->speed > 2 * K_GetKartSpeed(player, false) + ) + return true; + return false; +} + static fixed_t K_FlameShieldDashVar(INT32 val) { // 1 second = 75% + 50% top speed diff --git a/src/k_kart.h b/src/k_kart.h index 8b0f755d6..0b60d521a 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -108,6 +108,7 @@ void K_MomentumToFacing(player_t *player); boolean K_ApplyOffroad(player_t *player); boolean K_SlopeResistance(player_t *player); boolean K_TripwirePass(player_t *player); +boolean K_WaterRun(player_t *player); void K_ApplyTripWire(player_t *player, tripwirestate_t state); INT16 K_GetSpindashChargeTime(player_t *player); fixed_t K_GetSpindashChargeSpeed(player_t *player); diff --git a/src/p_mobj.c b/src/p_mobj.c index b52522a75..dba88de15 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2957,7 +2957,7 @@ boolean P_CanRunOnWater(player_t *player, ffloor_t *rover) span > player->mo->height && player->speed / 3 > abs(player->mo->momz) && player->speed > K_GetKartSpeed(player, false) && - K_TripWirePass(player) && + K_WaterRun(player) && (rover->flags & FF_SWIMMABLE); } From 8484ba929472ec1373a087a7b5c80dd50dc87fe9 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Mon, 6 Dec 2021 20:38:30 -0500 Subject: [PATCH 11/20] Alpha value for fade colormaps --- src/r_data.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/r_data.c b/src/r_data.c index 04b6c232b..46ae0dbd2 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -615,6 +615,7 @@ lighttable_t *R_CreateLightTable(extracolormap_t *extra_colormap) { double cmaskr, cmaskg, cmaskb, cdestr, cdestg, cdestb, cdestbright; double maskamt = 0, othermask = 0; + double fmaskamt = 0, fothermask = 0; UINT8 cr = R_GetRgbaR(extra_colormap->rgba), cg = R_GetRgbaG(extra_colormap->rgba), @@ -622,8 +623,8 @@ lighttable_t *R_CreateLightTable(extracolormap_t *extra_colormap) ca = R_GetRgbaA(extra_colormap->rgba), cfr = R_GetRgbaR(extra_colormap->fadergba), cfg = R_GetRgbaG(extra_colormap->fadergba), - cfb = R_GetRgbaB(extra_colormap->fadergba); -// cfa = R_GetRgbaA(extra_colormap->fadergba); // unused in software + cfb = R_GetRgbaB(extra_colormap->fadergba), + cfa = R_GetRgbaA(extra_colormap->fadergba); UINT8 fadestart = extra_colormap->fadestart, fadedist = extra_colormap->fadeend - extra_colormap->fadestart; @@ -654,14 +655,11 @@ lighttable_t *R_CreateLightTable(extracolormap_t *extra_colormap) cdestb = cfb; cdestbright = sqrt((cfr*cfr) + (cfg*cfg) + (cfb*cfb)); - // fade alpha unused in software - // maskamt = (double)(cfa/24.0l); - // othermask = 1 - maskamt; - // maskamt /= 0xff; + fmaskamt = (double)(cfa/24.0l); + fothermask = 1 - fmaskamt; + //fmaskamt /= 0xff; - // cdestr *= maskamt; - // cdestg *= maskamt; - // cdestb *= maskamt; + (void)fothermask; // unused, but don't feel like commenting it out ///////////////////// // This code creates the colormap array used by software renderer @@ -710,7 +708,7 @@ lighttable_t *R_CreateLightTable(extracolormap_t *extra_colormap) } // Add/subtract this value during fading. - brightChange[i] = fabs(cbest - cdist) / (double)fadedist; + brightChange[i] = (fabs(cbest - cdist) / (double)fadedist) * fmaskamt; } // Now allocate memory for the actual colormap array itself! From b03cfe302d0850a77e36d6186ad3007eb87dc783 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Mon, 6 Dec 2021 20:58:31 -0500 Subject: [PATCH 12/20] OGL fade alpha support --- src/hardware/hw_defs.h | 2 +- src/hardware/r_opengl/r_opengl.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hardware/hw_defs.h b/src/hardware/hw_defs.h index 3f6ad01e5..b4dc1accb 100644 --- a/src/hardware/hw_defs.h +++ b/src/hardware/hw_defs.h @@ -284,7 +284,7 @@ struct FSurfaceInfo typedef struct FSurfaceInfo FSurfaceInfo; #define GL_DEFAULTMIX 0x00000000 -#define GL_DEFAULTFOG 0xFF000000 +#define GL_DEFAULTFOG 0x19000000 //Hurdler: added for backward compatibility enum hwdsetspecialstate diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 367ce8331..51a4dd99d 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -723,6 +723,7 @@ static GLRGBAFloat shader_defaultcolor = {1.0f, 1.0f, 1.0f, 1.0f}; "colorIntensity = abs(colorIntensity - (fogBrightness));\n" \ "}\n" \ "colorIntensity *= darkness;\n" \ + "colorIntensity *= fade_color.a * 10.0;\n" \ "if (abs(final_color.r - fade_color.r) <= colorIntensity) {\n" \ "final_color.r = fade_color.r;\n" \ "} else if (final_color.r < fade_color.r) {\n" \ From dbefc8fe5810d13f690c0549a1df8df1749e3bf3 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Mon, 6 Dec 2021 22:47:15 -0500 Subject: [PATCH 13/20] Fix yellow persist fade colormap bug I did the equivalent change to OpenGL and it broke Zoned City, despite it being fine in Software ... not sure what's up with that, since the color math is pretty similar. Just gonna leave that alone for now... --- src/hardware/r_opengl/r_opengl.c | 6 +++--- src/r_data.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 51a4dd99d..84d6ded6e 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -715,12 +715,12 @@ static GLRGBAFloat shader_defaultcolor = {1.0f, 1.0f, 1.0f, 1.0f}; "float colorBrightness = sqrt((final_color.r * final_color.r) + (final_color.g * final_color.g) + (final_color.b * final_color.b));\n" \ "float fogBrightness = sqrt((fade_color.r * fade_color.r) + (fade_color.g * fade_color.g) + (fade_color.b * fade_color.b));\n" \ "float colorIntensity = 0.0;\n" \ - "if (fogBrightness > colorBrightness) {\n" \ + "if (colorBrightness < fogBrightness) {\n" \ "colorIntensity = 1.0 - min(final_color.r, min(final_color.g, final_color.b));\n" \ - "colorIntensity = abs(colorIntensity - (1.0 - fogBrightness));\n" \ + "colorIntensity = abs(colorIntensity - (1.0 - max(fade_color.r, max(fade_color.g, fade_color.b))));\n" \ "} else {\n" \ "colorIntensity = max(final_color.r, max(final_color.g, final_color.b));\n" \ - "colorIntensity = abs(colorIntensity - (fogBrightness));\n" \ + "colorIntensity = abs(colorIntensity - min(fade_color.r, min(fade_color.g, fade_color.b)));\n" \ "}\n" \ "colorIntensity *= darkness;\n" \ "colorIntensity *= fade_color.a * 10.0;\n" \ diff --git a/src/r_data.c b/src/r_data.c index 46ae0dbd2..bb2e508ba 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -699,12 +699,12 @@ lighttable_t *R_CreateLightTable(extracolormap_t *extra_colormap) if (cbrightness < cdestbright) { cbest = 255.0l - min(r, min(g, b)); - cdist = 255.0l - cdestbright; + cdist = 255.0l - max(cdestr, max(cdestg, cdestb)); } else { cbest = max(r, max(g, b)); - cdist = cdestbright; + cdist = min(cdestr, min(cdestg, cdestb)); } // Add/subtract this value during fading. From ab77bceb886ff92afd08ecaaebe33968a452564e Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 6 Dec 2021 20:33:41 -0800 Subject: [PATCH 14/20] Adjust underwater strafing - 3/4 steering ability while underwater (not drifting). - A little less friction while underwater. --- src/k_kart.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/k_kart.c b/src/k_kart.c index 40ca0ca8f..e4761ef59 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -7694,6 +7694,10 @@ INT32 K_GetUnderwaterTurnAdjust(player_t *player) { INT32 steer = (K_GetKartTurnValue(player, player->steering) << TICCMD_REDUCE); + + if (!player->drift) + steer = 3 * steer / 2; + return FixedMul(steer, 8 * FixedDiv(player->speed, 2 * K_GetKartSpeed(player, false) / 3)); } @@ -8472,6 +8476,10 @@ void K_AdjustPlayerFriction(player_t *player) { player->mo->friction += 614; } + else if (player->mo->eflags & MFE_UNDERWATER) + { + player->mo->friction += 312; + } // Wipeout slowdown if (player->spinouttimer && player->wipeoutslow) From 84170a59fa5d09658e554c41b8aeb79fee6f9398 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 6 Dec 2021 20:35:26 -0800 Subject: [PATCH 15/20] Cap underwater steering tilting --- src/p_user.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 9c1e87a53..591bdd8f7 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1775,7 +1775,20 @@ static void P_3dMovement(player_t *player) if (a) { - adj = a / 4; + const fixed_t maxadj = ANG10/4; + + adj = a / 4; + + if (adj > 0) + { + if (adj > maxadj) + adj = maxadj; + } + else if (adj < 0) + { + if (adj < -(maxadj)) + adj = -(maxadj); + } if (abs(player->underwatertilt + adj) > abs(a)) adj = (a - player->underwatertilt); From ce366099b008711c8c240155a088d95c3b14db51 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 6 Dec 2021 21:07:34 -0800 Subject: [PATCH 16/20] Make horizontal versus vertical momentum more strict when deciding water-run --- src/p_mobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index dba88de15..23aa0cb13 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2955,7 +2955,7 @@ boolean P_CanRunOnWater(player_t *player, ffloor_t *rover) return clip > -(player->mo->height / 2) && span > player->mo->height && - player->speed / 3 > abs(player->mo->momz) && + player->speed / 5 > abs(player->mo->momz) && player->speed > K_GetKartSpeed(player, false) && K_WaterRun(player) && (rover->flags & FF_SWIMMABLE); From 4a0d0f224f8ef8dafd131c247a3e14675cab1a33 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Tue, 7 Dec 2021 01:01:00 -0500 Subject: [PATCH 17/20] Fuck crazy turning --- src/k_kart.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 73661c018..2887ad32a 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -7565,10 +7565,12 @@ static INT16 K_GetKartDriftValue(player_t *player, fixed_t countersteer) basedrift += (basedrift / greasetics) * player->tiregrease; } - if (player->mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER)) +#if 0 + if (player->mo->eflags & MFE_UNDERWATER) { countersteer = FixedMul(countersteer, 3*FRACUNIT/2); } +#endif return basedrift + (FixedMul(driftadjust * FRACUNIT, countersteer) / FRACUNIT); } @@ -7672,11 +7674,6 @@ INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue) turnfixed = FixedMul(turnfixed, FRACUNIT + player->handleboost); } - if (player->mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER)) - { - turnfixed = FixedMul(turnfixed, 3*FRACUNIT/2); - } - // Weight has a small effect on turning turnfixed = FixedMul(turnfixed, weightadjust); From 2b3da168cb417f3ae4d33745fe08e91d576889ee Mon Sep 17 00:00:00 2001 From: SinnamonLat Date: Tue, 7 Dec 2021 09:54:00 +0100 Subject: [PATCH 18/20] New landmine explosion --- src/deh_tables.c | 1 + src/info.c | 2 +- src/info.h | 3 +++ src/k_kart.c | 21 ++++++++++++------ src/k_kart.h | 1 + src/p_enemy.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 78 insertions(+), 8 deletions(-) diff --git a/src/deh_tables.c b/src/deh_tables.c index aae6f660c..7e309c33f 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -323,6 +323,7 @@ actionpointer_t actionpointers[] = {{A_SPBChase}, "A_SPBCHASE"}, {{A_SSMineSearch}, "A_SSMINESEARCH"}, {{A_SSMineExplode}, "A_SSMINEEXPLODE"}, + {{A_LandMineExplode}, "A_LANDMINEEXPLODE"}, {{A_BallhogExplode}, "A_BALLHOGEXPLODE"}, {{A_LightningFollowPlayer}, "A_LIGHTNINGFOLLOWPLAYER"}, {{A_FZBoomFlash}, "A_FZBOOMFLASH"}, diff --git a/src/info.c b/src/info.c index 915702380..b4a8a8012 100644 --- a/src/info.c +++ b/src/info.c @@ -4358,7 +4358,7 @@ state_t states[NUMSTATES] = {SPR_KRBM, FF_FULLBRIGHT|9, 5, {NULL}, 0, 0, S_NULL}, // S_SLOWBOOM10 {SPR_LNDM, 0, -1, {NULL}, 0, 0, S_LANDMINE}, // S_LANDMINE - {SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_LANDMINE_EXPLODE + {SPR_NULL, 0, 1, {A_LandMineExplode}, 0, 0, S_NULL}, // S_LANDMINE_EXPLODE {SPR_BHOG, 0, 3, {A_PlaySound}, sfx_s1bd, 1, S_BALLHOG2}, // S_BALLHOG1 {SPR_BHOG, FF_FULLBRIGHT|1, 1, {NULL}, 0, 0, S_BALLHOG3}, // S_BALLHOG2 diff --git a/src/info.h b/src/info.h index c9998c498..115948905 100644 --- a/src/info.h +++ b/src/info.h @@ -276,6 +276,7 @@ enum actionnum A_SPBCHASE, A_SSMINESEARCH, A_SSMINEEXPLODE, + A_LANDMINEEXPLODE, A_BALLHOGEXPLODE, A_LIGHTNINGFOLLOWPLAYER, A_FZBOOMFLASH, @@ -546,6 +547,8 @@ void A_JawzExplode(); void A_SPBChase(); void A_SSMineSearch(); void A_SSMineExplode(); +void A_LandMineExplode(); +void A_LandMineExplode(); void A_BallhogExplode(); void A_LightningFollowPlayer(); void A_FZBoomFlash(); diff --git a/src/k_kart.c b/src/k_kart.c index 73661c018..71255a8f8 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3623,14 +3623,9 @@ void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 #define MINEQUAKEDIST 4096 -// Spawns the purely visual explosion -void K_SpawnMineExplosion(mobj_t *source, UINT8 color) +// Does the proximity screen flash and quake for explosions +void K_MineFlashScreen(mobj_t *source) { - INT32 i, radius, height; - mobj_t *smoldering = P_SpawnMobj(source->x, source->y, source->z, MT_SMOLDERING); - mobj_t *dust; - mobj_t *truc; - INT32 speed, speed2; INT32 pnum; player_t *p; @@ -3653,6 +3648,18 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color) break; // we can break right now because quakes are global to all split players somehow. } } +} + +// Spawns the purely visual explosion +void K_SpawnMineExplosion(mobj_t *source, UINT8 color) +{ + INT32 i, radius, height; + mobj_t *smoldering = P_SpawnMobj(source->x, source->y, source->z, MT_SMOLDERING); + mobj_t *dust; + mobj_t *truc; + INT32 speed, speed2; + + K_MineFlashScreen(source); K_MatchGenericExtraFlags(smoldering, source); smoldering->tics = TICRATE*3; diff --git a/src/k_kart.h b/src/k_kart.h index 8b0f755d6..bf648dcf5 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -69,6 +69,7 @@ void K_HandleBumperChanges(player_t *player, UINT8 prevBumpers); void K_DestroyBumpers(player_t *player, UINT8 amount); void K_TakeBumpersFromPlayer(player_t *player, player_t *victim, UINT8 amount); 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, mobj_t *source); +void K_MineFlashScreen(mobj_t *source); void K_SpawnMineExplosion(mobj_t *source, UINT8 color); void K_RunFinishLineBeam(void); UINT16 K_DriftSparkColor(player_t *player, INT32 charge); diff --git a/src/p_enemy.c b/src/p_enemy.c index 5417d3293..a0cf09820 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -310,6 +310,7 @@ void A_JawzExplode(mobj_t *actor); void A_SPBChase(mobj_t *actor); void A_SSMineSearch(mobj_t *actor); void A_SSMineExplode(mobj_t *actor); +void A_LandMineExplode(mobj_t *actor); void A_BallhogExplode(mobj_t *actor); void A_LightningFollowPlayer(mobj_t *actor); void A_FZBoomFlash(mobj_t *actor); @@ -14132,6 +14133,63 @@ void A_SSMineExplode(mobj_t *actor) actor->flags2 |= MF2_DEBRIS; // Set this flag to ensure that the explosion won't be effective more than 1 frame. } +void A_LandMineExplode(mobj_t *actor) +{ + + mobj_t *expl; + INT32 colour = SKINCOLOR_KETCHUP; // we spell words properly here + INT32 i; + mobj_t *smoldering; + mobj_t *dust; + + if (LUA_CallAction(A_LANDMINEEXPLODE, actor)) + return; + + // we'll base the explosion "timer" off of some stupid variable like uh... cvmem! + // Yeah let's use cvmem since nobody uses that + + if (actor->target && !P_MobjWasRemoved(actor->target)) + colour = actor->target->color; + + K_MineFlashScreen(actor); + + // Spawn smoke remains: + smoldering = P_SpawnMobj(actor->x, actor->y, actor->z, MT_SMOLDERING); + P_SetScale(smoldering, actor->scale); + smoldering->tics = TICRATE*3; + + // Spawn a ring: + for (i = 0; i < 32; i++) + { + dust = P_SpawnMobj(actor->x, actor->y, actor->z, MT_SMOKE); + P_SetMobjState(dust, S_OPAQUESMOKE1); + dust->angle = (ANGLE_180/16) * i; + P_SetScale(dust, actor->scale); + dust->destscale = actor->scale*4; + dust->scalespeed = actor->scale/4; + P_InstaThrust(dust, dust->angle, FixedMul(20*FRACUNIT, actor->scale)); + } + + actor->fuse = actor->tics; // disappear when this state ends. + + // spawn a few physics explosions + for (i = 0; i < 15; i++) + { + expl = P_SpawnMobj(actor->x, actor->y, actor->z + actor->scale, MT_BOOMEXPLODE); + expl->color = colour; + expl->tics = (i+1); + + //K_MatchGenericExtraFlags(expl, actor); + P_SetScale(expl, actor->scale*4); + + expl->momx = P_RandomRange(-3, 3)*actor->scale/2; + expl->momy = P_RandomRange(-3, 3)*actor->scale/2; + + // 100/45 = 2.22 fu/t + expl->momz = ((i+1)*actor->scale*5/2)*P_MobjFlip(expl); + } +} + void A_BallhogExplode(mobj_t *actor) { mobj_t *mo2; From a1e8cdf8c5dee9f1f1abe64282230bf2175b5fdf Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 7 Dec 2021 15:33:45 -0800 Subject: [PATCH 19/20] Adjust underwater steering again - 1.5x strafe -> 1.8. - Do not nerf steering at 11 FU or below. --- src/k_kart.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index e4761ef59..58a82d128 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -7672,7 +7672,8 @@ INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue) turnfixed = FixedMul(turnfixed, FRACUNIT + player->handleboost); } - if (player->mo->eflags & MFE_UNDERWATER) + if ((player->mo->eflags & MFE_UNDERWATER) && + player->speed > 11 * player->mo->scale) { turnfixed /= 2; } @@ -7690,13 +7691,14 @@ INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue) INT32 K_GetUnderwaterTurnAdjust(player_t *player) { - if (player->mo->eflags & MFE_UNDERWATER) + if ((player->mo->eflags & MFE_UNDERWATER) && + player->speed > 11 * player->mo->scale) { INT32 steer = (K_GetKartTurnValue(player, player->steering) << TICCMD_REDUCE); if (!player->drift) - steer = 3 * steer / 2; + steer = 9 * steer / 5; return FixedMul(steer, 8 * FixedDiv(player->speed, 2 * K_GetKartSpeed(player, false) / 3)); From f2e8d7d469128efa5db3ee5f53436fd2edca337b Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 7 Dec 2021 16:26:52 -0800 Subject: [PATCH 20/20] Increase step up with water-running just like water-skipping --- src/p_map.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/p_map.c b/src/p_map.c index f78a0b402..bcecb1dfa 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2414,6 +2414,20 @@ boolean PIT_PushableMoved(mobj_t *thing) return true; } +static boolean P_WaterRunning(mobj_t *thing) +{ + ffloor_t *rover = thing->floorrover; + return rover && (rover->flags & FF_SWIMMABLE) && + P_IsObjectOnGround(thing); +} + +static boolean P_WaterStepUp(mobj_t *thing) +{ + player_t *player = thing->player; + return (player && player->waterskip) || + P_WaterRunning(thing); +} + // // P_TryMove // Attempt to move to a new position. @@ -2478,7 +2492,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) const fixed_t maxstepmove = FixedMul(MAXSTEPMOVE, mapobjectscale); fixed_t maxstep = maxstepmove; - if (thing->player && thing->player->waterskip) + if (thing->player && P_WaterStepUp(thing)) maxstep += maxstepmove; // Add some extra stepmove when waterskipping // If using type Section1:13, double the maxstep.