From 07818d07b4b94ff7631e97b8565d20746a294dff Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Mon, 15 Mar 2021 22:32:26 +0100 Subject: [PATCH] Dash bump condition fixes. --- language.version | 4 ++-- zscript/swwm_player.zsc | 20 +++++++++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/language.version b/language.version index 557dbcb57..25f7403ba 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r357 \cu(Mon 15 Mar 22:04:08 CET 2021)\c-"; -SWWM_SHORTVER="\cw0.9.11b-pre r357 \cu(2021-03-15 22:04:08)\c-"; +SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r357 \cu(Mon 15 Mar 22:32:26 CET 2021)\c-"; +SWWM_SHORTVER="\cw0.9.11b-pre r357 \cu(2021-03-15 22:32:26)\c-"; diff --git a/zscript/swwm_player.zsc b/zscript/swwm_player.zsc index 1e3bca50f..27c9b6a2a 100644 --- a/zscript/swwm_player.zsc +++ b/zscript/swwm_player.zsc @@ -1002,8 +1002,22 @@ Class Demolitionist : PlayerPawn if ( !CheckSight(a,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) continue; Vector3 diff = level.Vec3Diff(pos,a.pos); Vector3 dirto = diff.unit(); - if ( dir dot dirto < .1 ) continue; - if ( a.bACTLIKEBRIDGE && (diff.z <= -a.Height) ) continue; // don't bump bridges if hit by above + Vector3 otherdir = (a.vel.length()>0.)?a.vel.unit():-dirto; + if ( (dir dot dirto < .1) || (dir dot otherdir > .35) ) continue; + if ( (diff.z <= -a.height) && (lastvelz < -25) ) continue; + if ( (diff.z <= -a.height) && !isdashing ) continue; + // don't bump bridges if hit at a specific angle + if ( a.bACTLIKEBRIDGE ) + { + Vector3 bnorm = -dirto; + if ( diff.z <= -a.height ) continue; // no bump from above + else if ( diff.z >= Height ) bnorm = (0,0,-1); + else if ( diff.x > a.Radius+Radius ) bnorm = (-1,0,0); + else if ( diff.x < -(a.Radius+Radius) ) bnorm = (1,0,0); + else if ( diff.y > a.Radius+Radius ) bnorm = (0,-1,0); + else if ( diff.y < -(a.Radius+Radius) ) bnorm = (0,1,0); + if ( dir dot bnorm > -.6 ) continue; + } // large monsters will stop the player (unless hit from above if we're going at ground pound speed) A_QuakeEx(4,4,4,10,0,128,"",QF_RELATIVE|QF_SCALEDOWN); A_AlertMonsters(swwm_uncapalert?0:800); @@ -1011,7 +1025,7 @@ Class Demolitionist : PlayerPawn a.A_StartSound("demolitionist/bump",CHAN_DAMAGE,CHANF_OVERLAP); bumptic = gametic+int(20+spd/4.); lastbump *= .8; - if ( (diff.z < a.height) && (lastvelz >= -25) && (a.bDONTTHRUST || a.bACTLIKEBRIDGE || (a.Mass >= maxmass) || (!a.bSHOOTABLE && !a.bPUSHABLE && (a.Health > 0))) && a.bSOLID && (dir dot dirto > .65) ) + if ( (a.bDONTTHRUST || a.bACTLIKEBRIDGE || (a.Mass >= maxmass) || (!a.bSHOOTABLE && !a.bPUSHABLE && (a.Health > 0))) && a.bSOLID && (dir dot dirto > .65) ) { if ( bumped ) continue; bumped = true;