diff --git a/language.version b/language.version index c307232a5..f33f372f4 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r1021 \cu(Sat 25 Nov 23:10:51 CET 2023)\c-"; -SWWM_SHORTVER="\cw1.3pre r1021 \cu(2023-11-25 23:10:51)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r1022 \cu(Sun 26 Nov 16:32:09 CET 2023)\c-"; +SWWM_SHORTVER="\cw1.3pre r1022 \cu(2023-11-26 16:32:09)\c-"; diff --git a/zscript/menu/swwm_inter.zsc b/zscript/menu/swwm_inter.zsc index e6a90df88..6659fa389 100644 --- a/zscript/menu/swwm_inter.zsc +++ b/zscript/menu/swwm_inter.zsc @@ -31,7 +31,6 @@ Class SWWMStatScreen : StatusScreen int flashcolor, tipflashcolor; int hs, oldhs, oldwidth; - Font mSmallFont; double bgfade; bool bFade; diff --git a/zscript/player/swwm_player_move.zsc b/zscript/player/swwm_player_move.zsc index 791f9fa67..6de185246 100644 --- a/zscript/player/swwm_player_move.zsc +++ b/zscript/player/swwm_player_move.zsc @@ -180,6 +180,21 @@ extend Class Demolitionist return true; } + private Vector3 GetGroundNormal() + { + // find closest 3d floor for its normal + F3DFloor ff; + for ( int i=0; i 0) || (dashfuel < 20.) ) + return; + if ( !player.onground && !bNOGRAVITY && !(player.cheats&CF_NOCLIP2) && !level.IsJumpingAllowed() ) + return; Vector3 dodge = (0,0,0); let [x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll); int fm = player.cmd.forwardmove; @@ -383,38 +402,40 @@ extend Class Demolitionist if ( !(fm|sm) ) fm = 1; if ( fm ) dodge += (fm>0)?X:-X; if ( sm ) dodge += (sm>0)?Y:-Y; - if ( player.cmd.buttons&BT_CROUCH ) dodge = (0,0,-1); // death from above - if ( dodge == (0,0,0) ) - { - if ( !player.onground || bNOGRAVITY || (player.cheats&CF_NOCLIP2) ) dodge = X; - else dodge.xy = RotateVector((1,0),angle); - } + if ( dodge == (0,0,0) ) dodge = X; // do we really need this? if ( player.onground && !bNOGRAVITY && !(player.cheats&CF_NOCLIP2) ) { - dodge.z = max(0,dodge.z); - if ( !level.IsJumpingAllowed() ) dodge.z = min(0,dodge.z); - } - if ( (dodge.length() > 0) && (dashcooldown <= 0) && (dashfuel > 20.) && player.cmd.buttons&BT_USER2 && (player.onground || level.IsJumpingAllowed() || (player.cmd.buttons&BT_CROUCH)) && (gamestate == GS_LEVEL) ) - { - fullfuel = (dashfuel >= default.dashfuel); - dashdir = dodge.unit(); - dashcooldown = 10; - dashboost = 20.; - bOnMobj = false; - if ( player.cheats & CF_REVERTPLEASE ) + Vector3 fnorm = GetGroundNormal(); + if ( !level.IsJumpingAllowed() || (dodge dot fnorm <= 0.) ) { - player.cheats &= ~CF_REVERTPLEASE; - player.camera = player.mo; + // recalc and project onto floor normal + dodge = (0,0,0); + Vector2 xdir = (cos(angle),sin(angle)); + Vector2 ydir = (sin(angle),-cos(angle)); + if ( fm ) dodge.xy += (fm>0)?xdir:-xdir; + if ( sm ) dodge.xy += (sm>0)?ydir:-ydir; + dodge = dodge-(dodge dot fnorm)*fnorm; } - vel += dashdir*dashboost; - vel.z += clamp(-vel.z*.4,0.,30.); - player.jumptics = -1; - SetStateLabel("Dash"); - A_StartSound("demolitionist/jet",CHAN_JETPACK,CHANF_LOOP); - lastbump *= .95; - mystats.dashcount++; - BumpView(5.,vel); } + if ( dodge.length() <= 0. ) return; // not sure if this can happen, really + fullfuel = (dashfuel >= default.dashfuel); + dashdir = dodge.unit(); + dashcooldown = 10; + dashboost = 20.; + bOnMobj = false; + if ( player.cheats & CF_REVERTPLEASE ) + { + player.cheats &= ~CF_REVERTPLEASE; + player.camera = player.mo; + } + vel += dashdir*dashboost; + vel.z += clamp(-vel.z*.4,0.,30.); + player.jumptics = -1; + SetStateLabel("Dash"); + A_StartSound("demolitionist/jet",CHAN_JETPACK,CHANF_LOOP); + lastbump *= .95; + mystats.dashcount++; + BumpView(5.,vel); } override void CheckJump()