Low floor friction fix and other things.

- Unbreak inventory resets in Eviternity.
- Hotfix for Eviternity II MAP33, lava sections should be beatable now.
This commit is contained in:
Mari the Deer 2023-12-23 15:33:20 +01:00
commit bc00b01a0f
3 changed files with 21 additions and 6 deletions

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r1065 \cu(Sat 23 Dec 15:33:09 CET 2023)\c-";
SWWM_SHORTVER="\cw1.3pre r1065 \cu(2023-12-23 15:33:09)\c-";
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r1066 \cu(Sat 23 Dec 15:33:20 CET 2023)\c-";
SWWM_SHORTVER="\cw1.3pre r1066 \cu(2023-12-23 15:33:20)\c-";

View file

@ -50,6 +50,8 @@ extend Class SWWMHandler
{
bool maphaskeys;
bool nogroundanchor;
// weird optimization
Array<SectorBounds> sbounds;
@ -132,6 +134,10 @@ extend Class SWWMHandler
if ( !playeringame[i] || !players[i].mo ) continue;
let demo = Demolitionist(players[i].mo);
if ( !demo ) continue;
// Death exit counter breaks Eviternity's episode transitions
// so we need this little patch-up work here
if ( (players[i].playerstate == PST_DEAD) && nextlv && (nextlv.flags2&LEVEL2_RESETINVENTORY) )
demo.invwipe |= Demolitionist.WIPE_EPISODE;
if ( level.nextsecretmap.Left(6) == "enDSeQ" ) demo.invwipe |= Demolitionist.WIPE_EPISODE;
if ( nextlv && (level.cluster!=nextlv.cluster) ) demo.invwipe |= (Demolitionist.WIPE_CLUSTER|Demolitionist.WIPE_MAP);
if ( !(level.clusterflags&LevelLocals.CLUSTER_HUB) ) demo.invwipe |= Demolitionist.WIPE_MAP;
@ -405,6 +411,12 @@ extend Class SWWMHandler
}
break;
}
// Eviternity II MAP33 fix. Player movement physics need to
// have ground anchoring disabled, as it will make some
// segments impossible due to the player's feet immediately
// touching the instant-kill lava
if ( level.GetChecksum() ~== "043FE06534270E95882CA128AF7B0402" )
nogroundanchor = true;
// for skipping over merged exit lines (sharing vertices)
Array<Line> skipme;
skipme.Clear();

View file

@ -175,7 +175,7 @@ extend Class Demolitionist
return false; // we don't have friction at all (e.g.: while dashing)
if ( bWINDTHRUST && (s.special >= 40) && (s.special <= 51) )
return false; // wind
if ( (s.special == 84) || (s.special == 118) || (s.special >= 201) && (s.special <= 244) )
if ( (s.special == 84) || (s.special == 118) || ((s.special >= 201) && (s.special <= 244)) )
return false; // current
return true;
}
@ -354,8 +354,10 @@ extend Class Demolitionist
else if ( player.onground && ShouldDecelerate(floorsector) )
{
// quickly decelerate if we're not holding movement keys
// (account for slippery floors, and assume approx .9 friction as "midpoint" for 70% reduction)
double fact = clamp(floorsector.GetFriction(0)*.8,.5,1.);
// the default friction is mapped to a 70% reduction,
// while slippery floors (above 95%) will have no reduction at all
double fact = SWWMUtility.MapRange(.90625,.97265625,.7,1.,floorsector.GetFriction(0));
fact = clamp(fact,.6,1.); // ensure this doesn't go too far out of range (especially, prevent endless acceleration)
vel *= fact;
player.vel *= fact;
}
@ -365,7 +367,8 @@ extend Class Demolitionist
guidepitch *= .9;
guideroll *= .9;
// anchor to ground when going down steps
if ( lastground && !player.onground && !bFly && !bFlyCheat && (abs(pos.z-floorz) <= maxdropoffheight) && (player.jumptics == 0) && (vel.z <= 0) && !isdashing )
if ( !hnd ) hnd = SWWMHandler(EventHandler.Find("SWWMHandler"));
if ( lastground && !player.onground && !bFly && !bFlyCheat && (abs(pos.z-floorz) <= maxdropoffheight) && (player.jumptics == 0) && (vel.z <= 0) && !isdashing && !hnd.nogroundanchor )
{
// test for gap crossing (i.e: climbing up platforms with holes between them)
Vector3 storepos = pos;