From d0fddbf8a39e30af5bbbce3028177ea1c7be9150 Mon Sep 17 00:00:00 2001 From: Marisa the Magician Date: Sun, 8 Jan 2023 14:58:06 +0100 Subject: [PATCH] Testing changes for GZDoom 4.11/5.0. --- LICENSE.code | 2 +- language.def_lore | 2 + language.es_lore | 2 + language.version | 4 +- lore/default/rafankos.txt | 2 + lore/es/rafankos.txt | 2 + readme.txt | 2 +- ultdoom2.lst | 2 +- zscript.txt | 4 +- zscript/handler/swwm_handler.zsc | 2 +- zscript/handler/swwm_handler_worldload.zsc | 67 -------- zscript/handler/swwm_statichandler.zsc | 5 +- zscript/hud/swwm_hud_topstuff.zsc | 2 +- zscript/items/swwm_funstuff.zsc | 4 +- zscript/items/swwm_lamp.zsc | 2 +- zscript/player/swwm_player.zsc | 168 ++++++++------------- zscript/player/swwm_player_think.zsc | 20 +-- zscript/player/swwm_player_tick.zsc | 4 +- zscript/swwm_gesture_fx.zsc | 4 +- zscript/swwm_thinkers.zsc | 52 ------- zscript/utility/swwm_utility_map.zsc | 77 +--------- zscript/weapons/swwm_cbt_fx.zsc | 2 +- zscript/weapons/swwm_danmaku_fx.zsc | 2 +- zscript/weapons/swwm_splode_fx.zsc | 2 +- 24 files changed, 104 insertions(+), 331 deletions(-) diff --git a/LICENSE.code b/LICENSE.code index efd190704..c11e25b8d 100644 --- a/LICENSE.code +++ b/LICENSE.code @@ -1,4 +1,4 @@ -Copyright (c) 2020-2022 Marisa the Magician, UnSX Team +Copyright (c) 2020-2023 Marisa the Magician, UnSX Team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/language.def_lore b/language.def_lore index e2adcce51..2e9436309 100644 --- a/language.def_lore +++ b/language.def_lore @@ -3318,6 +3318,8 @@ SWWM_LORETXT_RAFANKOS = "\n" "\cfReload:\c- Loads in a new magazine, each holding four pods. The currently loaded pod must be fully discharged before a new one can be chambered in.\n" "\n" +"\cfTechniques:\c- Due to using a singular trigger at different pressures, alternating between both fire modes is completely seamless.\n" +"\n" "\cxSaya's Notes:\c-\n" "\cf\"Ultimate Weapon\"? Talk about pretentious... But you know, something about this was making my brains itch, and then it clicked. This is basically like that one spellcard, the Master Spark. Hell, it almost even sounds and looks the same...\c-\n" "\n" diff --git a/language.es_lore b/language.es_lore index 7f28729c9..e0bec63b1 100644 --- a/language.es_lore +++ b/language.es_lore @@ -3087,6 +3087,8 @@ SWWM_LORETXT_RAFANKOS = "\n" "\cfRecarga:\c- Coloca un nuevo cargador, cada uno almacenando cuatro cápsulas. La cápsula cargada debe gastarse completamente antes de poder insertar una nueva en la recámara.\n" "\n" +"\cfTécnicas:\c- Al usar un solo gatillo con diferentes grados de presión, la acción de alternar entre ambos modos de disparo es completamente fluida.\n" +"\n" "\cxNotas de Saya:\c-\n" "\cf¿\"Arma Definitiva\"? Menuda cursilada... Pero sabes, algo de todo esto hacía que me picotearan los sesos, y entonces todo encajó. Esta cosa es básicamente como esa carta de hechizo, la Chispa Maestra. Hostia, es que hasta suena y pinta igual...\c-\n" "\n" diff --git a/language.version b/language.version index f813e100c..499ff3ff0 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r723 \cu(Sat 31 Dec 13:08:09 CET 2022)\c-"; -SWWM_SHORTVER="\cw1.3pre r723 \cu(2022-12-31 13:08:09)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r724 \cu(Sun 8 Jan 14:58:06 CET 2023)\c-"; +SWWM_SHORTVER="\cw1.3pre r724 \cu(2023-01-08 14:58:06)\c-"; diff --git a/lore/default/rafankos.txt b/lore/default/rafankos.txt index 61f335d9c..fb5353bea 100644 --- a/lore/default/rafankos.txt +++ b/lore/default/rafankos.txt @@ -24,6 +24,8 @@ The weapon employs **Kabbadon** as fuel, a common byproduct of **Nokorokinylum** \cfReload:\c- Loads in a new magazine, each holding four pods. The currently loaded pod must be fully discharged before a new one can be chambered in. +\cfTechniques:\c- Due to using a singular trigger at different pressures, alternating between both fire modes is completely seamless. + \cxSaya's Notes:\c- \cf"Ultimate Weapon"? Talk about pretentious... But you know, something about this was making my brains itch, and then it clicked. This is basically like that one spellcard, the Master Spark. Hell, it almost even sounds and looks the same...\c- diff --git a/lore/es/rafankos.txt b/lore/es/rafankos.txt index 242ad29d2..ebfdc7bf1 100644 --- a/lore/es/rafankos.txt +++ b/lore/es/rafankos.txt @@ -18,6 +18,8 @@ El arma emplea **Kabbadon** como combustible, un subproducto común de la fusió \cfRecarga:\c- Coloca un nuevo cargador, cada uno almacenando cuatro cápsulas. La cápsula cargada debe gastarse completamente antes de poder insertar una nueva en la recámara. +\cfTécnicas:\c- Al usar un solo gatillo con diferentes grados de presión, la acción de alternar entre ambos modos de disparo es completamente fluida. + \cxNotas de Saya:\c- \cf¿"Arma Definitiva"? Menuda cursilada... Pero sabes, algo de todo esto hacía que me picotearan los sesos, y entonces todo encajó. Esta cosa es básicamente como esa carta de hechizo, la Chispa Maestra. Hostia, es que hasta suena y pinta igual...\c- diff --git a/readme.txt b/readme.txt index c0f675fdb..9a22350b3 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ a.k.a. Some Weird Weapons Mod: GZDoom Edition -------------------------------------------- -(C)2020-2022 Marisa the Magician - UnSX Team +(C)2020-2023 Marisa the Magician - UnSX Team diff --git a/ultdoom2.lst b/ultdoom2.lst index a3e525565..e13473f7a 100644 --- a/ultdoom2.lst +++ b/ultdoom2.lst @@ -12,6 +12,7 @@ 6BFABEBF4497E46370D5724D5D638989 757249FBAD1706214F9AEF0E210EFE44 78E51D7ACD8AD50076AC658255DBFF14 +7E371B881D9F7060A2F5F9A24B8EF1C1 845D77DBE053DD03CBDD5D343E792603 8E4798C0CC58E27F62EBE83B4BA19D8A 96C5914A9B4A2383DE6BBE363940DF2F @@ -21,4 +22,3 @@ BC8F9A1EA116535A1D48ED8DB0A5FAC8 DC32F182CF747FD70A1C43671A7294D2 DF6A001A6C42DB5CCA599EE5883B294A F396B7A7B43BCCCFC37B761A4DADDDDC -F49892913C542EDE85E15B52AF1F21A5 diff --git a/zscript.txt b/zscript.txt index bbabc8018..0ca25c3fd 100644 --- a/zscript.txt +++ b/zscript.txt @@ -1,8 +1,8 @@ -version "4.10" +version "4.11" /* DEMOLITIONIST Main Codebase - (C)2020-2022 Marisa the Magician, UnSX Team + (C)2020-2023 Marisa the Magician, UnSX Team This copyright and the attached LICENSE.code file apply to all files included from here, with the exception of any third party libraries */ diff --git a/zscript/handler/swwm_handler.zsc b/zscript/handler/swwm_handler.zsc index ee879eaba..e06857a7a 100644 --- a/zscript/handler/swwm_handler.zsc +++ b/zscript/handler/swwm_handler.zsc @@ -274,7 +274,7 @@ Class SWWMHandler : EventHandler { if ( !lastlock || (gametic > lastlock+20) ) { - if ( SWWMUtility.IsValidLockNum(locknum) ) + if ( Key.IsLockDefined(locknum) ) lastlock = AddOneliner("locked",2); else lastlock = AddOneliner("jammed",2); } diff --git a/zscript/handler/swwm_handler_worldload.zsc b/zscript/handler/swwm_handler_worldload.zsc index 2ecd55611..af1194bb6 100644 --- a/zscript/handler/swwm_handler_worldload.zsc +++ b/zscript/handler/swwm_handler_worldload.zsc @@ -146,70 +146,6 @@ extend Class SWWMHandler SWWMUtility.MarkAchievement("hurry",players[consoleplayer]); } - private void SetupLockdefsCache( SWWMCachedLockInfo cli ) - { - for ( int i=0; i lines; - lines.Clear(); - data.Split(lines,"\n"); - bool valid = false; - for ( int j=0; j spl; - spl.Clear(); - lines[j].Split(spl," ",TOK_SKIPEMPTY); - // check game string (if any) - if ( spl.Size() > 2 ) - { - if ( (spl[2] ~== "DOOM") && !(gameinfo.gametype&GAME_Doom) ) continue; - else if ( (spl[2] ~== "HERETIC") && !(gameinfo.gametype&GAME_Heretic) ) continue; - else if ( (spl[2] ~== "HEXEN") && !(gameinfo.gametype&GAME_Hexen) ) continue; - else if ( (spl[2] ~== "STRIFE") && !(gameinfo.gametype&GAME_Strife) ) continue; - else if ( (spl[2] ~== "CHEX") && !(gameinfo.gametype&GAME_Chex) ) continue; - } - // valid lock, prepare it - let li = new("LIEntry"); - li.locknumber = spl[1].ToInt(); - li.hascolor = false; - // see if there's a Mapcolor defined - int k = j+1; - for ( int k=j+2; k skipme; skipme.Clear(); diff --git a/zscript/handler/swwm_statichandler.zsc b/zscript/handler/swwm_statichandler.zsc index 3c6de6058..68bee0efa 100644 --- a/zscript/handler/swwm_statichandler.zsc +++ b/zscript/handler/swwm_statichandler.zsc @@ -89,7 +89,8 @@ Class SWWMStaticHandler : StaticEventHandler for ( int i=0; i 0) && (lock < 256) ) { - let lcol = SWWMUtility.GetLockColor(lock); + let lcol = Key.GetMapColorForLock(lock); if ( !lcol ) { // "all keys" locks lack a color diff --git a/zscript/items/swwm_funstuff.zsc b/zscript/items/swwm_funstuff.zsc index db436c581..037182a53 100644 --- a/zscript/items/swwm_funstuff.zsc +++ b/zscript/items/swwm_funstuff.zsc @@ -704,7 +704,7 @@ Class ChanceboxSpawner : Actor if ( tbox[3] < l.bbox[2] ) continue; if ( tbox[0] < l.bbox[1] ) continue; if ( tbox[1] > l.bbox[0] ) continue; - if ( SWWMUtility.BoxOnLineSide(tbox[0],tbox[1],tbox[2],tbox[3],l) != -1 ) continue; + if ( Level.BoxOnLineSide(pos.xy,32,l) != -1 ) continue; // there isn't enough space to spawn a box here let b = Spawn("HealthNuggetItem",pos); SWWMUtility.TransferItemProp(self,b); @@ -1032,7 +1032,7 @@ Class Chancebox : Actor if ( tbox[3] < l.bbox[2] ) continue; if ( tbox[0] < l.bbox[1] ) continue; if ( tbox[1] > l.bbox[0] ) continue; - if ( SWWMUtility.BoxOnLineSide(tbox[0],tbox[1],tbox[2],tbox[3],l) != -1 ) continue; + if ( Level.BoxOnLineSide(testpos.xy,32,l) != -1 ) continue; blocked = true; break; } diff --git a/zscript/items/swwm_lamp.zsc b/zscript/items/swwm_lamp.zsc index dba37f2ee..89305f0c9 100644 --- a/zscript/items/swwm_lamp.zsc +++ b/zscript/items/swwm_lamp.zsc @@ -457,7 +457,7 @@ Class CompanionLamp : Actor { // push away from wall Vector3 normal = (-BlockingLine.delta.y,BlockingLine.delta.x,0).unit(); - if ( !SWWMUtility.PointOnLineSide(pos.xy,BlockingLine) ) normal *= -1; + if ( !Level.PointOnLineSide(pos.xy,BlockingLine) ) normal *= -1; vel += 4.*normal; blocked = true; } diff --git a/zscript/player/swwm_player.zsc b/zscript/player/swwm_player.zsc index 01bc312b6..4f81d2db2 100644 --- a/zscript/player/swwm_player.zsc +++ b/zscript/player/swwm_player.zsc @@ -42,13 +42,14 @@ Class Demolitionist : PlayerPawn double guideangle, guidepitch, guideroll; - // for weapon bobbing stuff + // for weapon bobbing and stuff double bumpvelz, bumpangle, bumppitch, bumproll; - double oldangle, oldpitch, oldroll; - double oldlagangle, oldlagpitch, oldlagroll, oldlagready; - Vector3 oldlagvel; - double lagangle, lagpitch, lagroll, lagready; - Vector3 lagvel; + + Vector3 oldangles; + Vector3 oldlagangles, lagangles; + Vector3 oldlagdangles, lagdangles; + Vector3 oldlagvel, lagvel; + double oldlagready, lagready; enum EUnderType { @@ -143,6 +144,8 @@ Class Demolitionist : PlayerPawn Player.ForwardMove 1., 1.; Player.SideMove 1., 1.; Player.SoundClass "demolitionist"; + Player.FlyBob 0.; + Player.WaterClimbSpeed 0.; DamageFactor "Drowning", 0.; DamageFactor "Poison", 0.; DamageFactor "PoisonCloud", 0.; @@ -180,6 +183,8 @@ Class Demolitionist : PlayerPawn Super.PostBeginPlay(); lastground = true; // prevent sudden landing sound on map start blinktime = 30; + // prevent jumpy weapon bob on game start + oldangles = (angle,pitch,roll); // swap ourselves for a voodoo doll if ( !player || (player.mo != self) ) { @@ -327,7 +332,7 @@ Class Demolitionist : PlayerPawn if ( tbox[3] < l.bbox[2] ) continue; if ( tbox[0] < l.bbox[1] ) continue; if ( tbox[1] > l.bbox[0] ) continue; - if ( SWWMUtility.BoxOnLineSide(tbox[0],tbox[1],tbox[2],tbox[3],l) != -1 ) continue; + if ( Level.BoxOnLineSide(pos.xy,radius+8,l) != -1 ) continue; touching.Push(l); } let pi = swwm_PolyobjectIterator.Create(); @@ -441,8 +446,8 @@ Class Demolitionist : PlayerPawn return SWWMUtility.LerpVector2(prevbob,bob,ticfrac)*bobstr*clamp(viewbob,0.,1.5); } - // [4.11] proper 3D/2D weapon bob separation - /*override Vector3, Vector3 BobWeapon3D( double ticfrac ) + // proper 3D weapon bob + override Vector3, Vector3 BobWeapon3D( double ticfrac ) { if ( !player || !player.ReadyWeapon || player.ReadyWeapon.bDontBob ) return (0,0,0), (0,0,0); @@ -450,33 +455,26 @@ Class Demolitionist : PlayerPawn player.WeaponState |= WF_WEAPONBOBBING; // always bob Vector2 cur = BobWeaponAngle(ticfrac); if ( !oldbob ) player.WeaponState &= ~WF_WEAPONBOBBING; - double fangle = SWWMUtility.Lerp(oldangle,angle,ticfrac); - double fpitch = SWWMUtility.Lerp(oldpitch,pitch,ticfrac); - double froll = SWWMUtility.Lerp(oldroll,roll,ticfrac); - double flagangle = SWWMUtility.Lerp(oldlagangle,lagangle,ticfrac); - double flagpitch = SWWMUtility.Lerp(oldlagpitch,lagpitch,ticfrac); - double flagroll = SWWMUtility.Lerp(oldlagroll,lagroll,ticfrac); - double diffang = fangle-flagangle; - double diffpitch = fpitch-flagpitch; - double diffroll = froll-flagroll; - if ( abs(diffang) > 1. ) + Vector3 angles = SWWMUtility.LerpVector3(oldlagangles,lagangles,ticfrac); + Vector3 dangles = SWWMUtility.LerpVector3(oldlagdangles,lagdangles,ticfrac); + if ( abs(dangles.x) > 1. ) { - int sgn = (diffang>0)?1:-1; - diffang = abs(diffang)**.7*sgn; + int sgn = (dangles.x>0)?1:-1; + dangles.x = abs(dangles.x)**.75*sgn; } - if ( abs(diffpitch) > 1. ) + if ( abs(dangles.y) > 1. ) { - int sgn = (diffpitch>0)?1:-1; - diffpitch = abs(diffpitch)**.7*sgn; + int sgn = (dangles.y>0)?1:-1; + dangles.y = abs(dangles.y)**.75*sgn; } - if ( abs(diffroll) > 1. ) + if ( abs(dangles.z) > 1. ) { - int sgn = (diffroll>0)?1:-1; - diffroll = abs(diffroll)**.7*sgn; + int sgn = (dangles.z>0)?1:-1; + dangles.z = abs(dangles.z)**.75*sgn; } Vector3 flagvel = SWWMUtility.LerpVector3(oldlagvel,lagvel,ticfrac); - let [x, y, z] = SWWMUtility.GetAxes(flagangle,flagpitch,flagroll); - let [x2, y2, z2] = SWWMUtility.GetAxes(flagangle,0,flagroll); + let [x, y, z] = SWWMUtility.GetAxes(angles.x,angles.y,angles.z); + let [x2, y2, z2] = SWWMUtility.GetAxes(angles.x,0,angles.z); double diffx = flagvel dot x; double diffy = flagvel dot y; double diffz = flagvel dot z; @@ -485,35 +483,35 @@ Class Demolitionist : PlayerPawn if ( abs(diffx) > 1. ) { int sgn = (diffx>0)?1:-1; - diffx = abs(diffx)**.5*sgn; + diffx = abs(diffx)**.75*sgn; } if ( abs(diffy) > 1. ) { int sgn = (diffy>0)?1:-1; - diffy = abs(diffy)**.5*sgn; + diffy = abs(diffy)**.75*sgn; } if ( abs(diffz) > 1. ) { int sgn = (diffz>0)?1:-1; - diffz = abs(diffz)**.5*sgn; + diffz = abs(diffz)**.75*sgn; } if ( abs(diffy2) > 1. ) { int sgn = (diffy2>0)?1:-1; - diffy2 = abs(diffy2)**.5*sgn; + diffy2 = abs(diffy2)**.75*sgn; } if ( abs(diffz2) > 1. ) { int sgn = (diffz2>0)?1:-1; - diffz2 = abs(diffz2)**.5*sgn; + diffz2 = abs(diffz2)**.75*sgn; } - Vector3 bobvec = (diffy,-diffz,diffx)*20. + (cur.x,-cur.y,0)*10.; - Vector3 bobang = (diffang,diffpitch,diffroll)*.1 - (cur.x,cur.y,0)*.04 - (diffy2,diffz2,0)*.2; + Vector3 bobvec = (diffy,-diffz,diffx)*20. + (cur.x,-cur.y,cur.y)*15.; + Vector3 bobang = (dangles.x,dangles.y,dangles.z)*.15 - (cur.x,cur.y,-cur.x*2.)*.05 - (diffy2,diffz2,0)*.02; double fready = SWWMUtility.Lerp(oldlagready,lagready,ticfrac); return bobvec*fready, bobang*fready; } - // compatibility with 2D weapons + // compatibility with 2D weapons (may cause sprite cutoff) override Vector2 BobWeapon( double ticfrac ) { if ( !player || !player.ReadyWeapon || player.ReadyWeapon.bDontBob ) @@ -522,88 +520,36 @@ Class Demolitionist : PlayerPawn player.WeaponState |= WF_WEAPONBOBBING; // always bob Vector2 cur = BobWeaponAngle(ticfrac); if ( !oldbob ) player.WeaponState &= ~WF_WEAPONBOBBING; - double fangle = SWWMUtility.Lerp(oldangle,angle,ticfrac); - double fpitch = SWWMUtility.Lerp(oldpitch,pitch,ticfrac); - double flagangle = SWWMUtility.Lerp(oldlagangle,lagangle,ticfrac); - double flagpitch = SWWMUtility.Lerp(oldlagpitch,lagpitch,ticfrac); - double diffang = fangle-flagangle; - double diffpitch = fpitch-flagpitch; - if ( abs(diffang) > 1. ) + Vector3 angles = SWWMUtility.LerpVector3(oldlagangles,lagangles,ticfrac); + Vector3 dangles = SWWMUtility.LerpVector3(oldlagdangles,lagdangles,ticfrac); + if ( abs(dangles.x) > 1. ) { - int sgn = (diffang>0)?1:-1; - diffang = abs(diffang)**.7*sgn; + int sgn = (dangles.x>0)?1:-1; + dangles.x = abs(dangles.x)**.75*sgn; } - if ( abs(diffpitch) > 1. ) + if ( abs(dangles.y) > 1. ) { - int sgn = (diffpitch>0)?1:-1; - diffpitch = abs(diffpitch)**.7*sgn; + int sgn = (dangles.y>0)?1:-1; + dangles.y = abs(dangles.y)**.75*sgn; } - cur.x += diffang*.4; - cur.y -= diffpitch*.4; + cur.x += dangles.x*.4; + cur.y -= dangles.y*.4; Vector3 flagvel = SWWMUtility.LerpVector3(oldlagvel,lagvel,ticfrac); - double flagroll = SWWMUtility.Lerp(oldlagroll,lagroll,ticfrac); - let [x, y, z] = SWWMUtility.GetAxes(flagangle,0,flagroll); + let [x, y, z] = SWWMUtility.GetAxes(angles.x,0,angles.z); double diffy = flagvel dot y; double diffz = flagvel dot z; if ( abs(diffy) > 1. ) { int sgn = (diffy>0)?1:-1; - diffy = abs(diffy)**.5*sgn; + diffy = abs(diffy)**.75*sgn; } if ( abs(diffz) > 1. ) { int sgn = (diffz>0)?1:-1; - diffz = abs(diffz)**.5*sgn; + diffz = abs(diffz)**.75*sgn; } - cur.x -= diffy*.8; - cur.y += diffz*.8; - return cur*SWWMUtility.Lerp(oldlagready,lagready,ticfrac); - }*/ - - override Vector2 BobWeapon( double ticfrac ) - { - if ( !player || !player.ReadyWeapon || player.ReadyWeapon.bDontBob ) - return (0,0); - bool oldbob = !!(player.WeaponState&WF_WEAPONBOBBING); - player.WeaponState |= WF_WEAPONBOBBING; // always bob - Vector2 cur = BobWeaponAngle(ticfrac); - if ( !oldbob ) player.WeaponState &= ~WF_WEAPONBOBBING; - double fangle = SWWMUtility.Lerp(oldangle,angle,ticfrac); - double fpitch = SWWMUtility.Lerp(oldpitch,pitch,ticfrac); - double flagangle = SWWMUtility.Lerp(oldlagangle,lagangle,ticfrac); - double flagpitch = SWWMUtility.Lerp(oldlagpitch,lagpitch,ticfrac); - double diffang = fangle-flagangle; - double diffpitch = fpitch-flagpitch; - if ( abs(diffang) > 1. ) - { - int sgn = (diffang>0)?1:-1; - diffang = abs(diffang)**.7*sgn; - } - if ( abs(diffpitch) > 1. ) - { - int sgn = (diffpitch>0)?1:-1; - diffpitch = abs(diffpitch)**.7*sgn; - } - cur.x += diffang*.4; - cur.y -= diffpitch*.4; - Vector3 flagvel = SWWMUtility.LerpVector3(oldlagvel,lagvel,ticfrac); - double flagroll = SWWMUtility.Lerp(oldlagroll,lagroll,ticfrac); - Vector3 x, y, z; - [x, y, z] = SWWMUtility.GetAxes(flagangle,0,flagroll); - double diffy = flagvel dot y; - double diffz = flagvel dot z; - if ( abs(diffy) > 1. ) - { - int sgn = (diffy>0)?1:-1; - diffy = abs(diffy)**.5*sgn; - } - if ( abs(diffz) > 1. ) - { - int sgn = (diffz>0)?1:-1; - diffz = abs(diffz)**.5*sgn; - } - cur.x -= diffy*.8; - cur.y += diffz*.8; + cur.x -= diffy*.4; + cur.y += diffz*.4; return cur*SWWMUtility.Lerp(oldlagready,lagready,ticfrac); } @@ -752,6 +698,13 @@ Class Demolitionist : PlayerPawn dashboost = 0.; // prevent sudden stomping if we were previously falling lastvelz = vel.z; + // clear bob data + oldlagangles = lagangles = oldangles = (angle,pitch,roll); + oldlagdangles = lagdangles = (0.,0.,0.); + oldlagvel = lagvel = vel; + bumpvelz = bumpangle = bumppitch = bumproll = 0.; + ViewAngle = ViewPitch = ViewRoll = 0.; + SetViewPos((0.,0.,0.)); // early cancel gestures if ( player ) { @@ -783,14 +736,15 @@ Class Demolitionist : PlayerPawn // reset all smooth bob variables if angles/velocity aren't carried over if ( !(flags&TELF_KEEPORIENTATION) ) { - oldlagangle = lagangle = oldangle = angle; - oldlagpitch = lagpitch = oldpitch = pitch; - oldlagroll = lagroll = oldroll = roll; + oldlagangles = lagangles = oldangles = (angle,pitch,roll); + oldlagdangles = lagdangles = (0.,0.,0.); + bumpangle = bumppitch = bumproll = 0.; } if ( !(flags&TELF_KEEPVELOCITY) ) { oldlagvel = lagvel = vel; lastvelz = vel.z; + bumpvelz = 0.; } // notify carried lamp that we just moved let l = SWWMLamp(FindInventory("SWWMLamp")); diff --git a/zscript/player/swwm_player_think.zsc b/zscript/player/swwm_player_think.zsc index 2e32608eb..86d6e014c 100644 --- a/zscript/player/swwm_player_think.zsc +++ b/zscript/player/swwm_player_think.zsc @@ -185,9 +185,7 @@ extend Class Demolitionist override void PlayerThink() { - oldangle = angle; - oldpitch = pitch; - oldroll = roll; + oldangles = (angle,pitch,roll); if ( player && (player.mo == self) && (player.playerstate != PST_DEAD) && (player.cmd.buttons&BT_USE) ) { if ( !player.usedown ) lastuse = gametic; @@ -219,12 +217,10 @@ extend Class Demolitionist } } else if ( gametic > lastuse+50 ) failcounter = 0; - oldlagangle = lagangle; - oldlagpitch = lagpitch; - oldlagroll = lagroll; - lagangle = lagangle*.8+angle*.2; - lagpitch = lagpitch*.8+pitch*.2; - lagroll = lagroll*.8+roll*.2; + oldlagangles = lagangles; + lagangles = lagangles*.8+(angle,pitch,roll)*.2; + oldlagdangles = lagdangles; + lagdangles = lagdangles*.8+(deltaangle(oldangles.x,angle),deltaangle(oldangles.y,pitch),deltaangle(oldangles.z,roll))*.2; if ( !player || (player.mo != self) ) return; if ( (player.playerstate != PST_DEAD) && (player.jumptics != 0) ) { @@ -246,6 +242,7 @@ extend Class Demolitionist override void DeathThink() { + oldangles = (angle,pitch,roll); player.Uncrouch(); TickPSprites(); player.onground = (pos.Z<=floorz); @@ -261,6 +258,11 @@ extend Class Demolitionist double droll = clamp(deltaangle(roll,50)*.5,-5,5); if ( abs(droll) < 2. ) roll = 50.; else A_SetRoll(roll+droll,SPF_INTERPOLATE); + // bob interpolation still active + oldlagangles = lagangles; + lagangles = lagangles*.8+(angle,pitch,roll)*.2; + oldlagdangles = lagdangles; + lagdangles = lagdangles*.8+(deltaangle(oldangles.x,angle),deltaangle(oldangles.y,pitch),deltaangle(oldangles.z,roll))*.2; player.mo.CalcHeight(); if ( player.damagecount ) player.damagecount--; if ( player.poisoncount ) player.poisoncount--; diff --git a/zscript/player/swwm_player_tick.zsc b/zscript/player/swwm_player_tick.zsc index 9a617dc12..7a4dabd60 100644 --- a/zscript/player/swwm_player_tick.zsc +++ b/zscript/player/swwm_player_tick.zsc @@ -427,7 +427,7 @@ extend Class Demolitionist } if ( abs(bumpvelz) > double.epsilon ) { - lagvel.z += bumpvelz*.2; + lagvel.z += bumpvelz*.5; bumpvelz *= .8; } Vector3 temp = (ViewAngle,ViewPitch,ViewRoll); @@ -712,7 +712,7 @@ extend Class Demolitionist { Vector3 wallnorm = (-BlockingLine.delta.y,BlockingLine.delta.x,0).unit(); int lside = 1; - if ( !BlockingLine.sidedef[1] || !SWWMUtility.PointOnLineSide(pos.xy,BlockingLine) ) + if ( !BlockingLine.sidedef[1] || !Level.PointOnLineSide(pos.xy,BlockingLine) ) { lside = 0; wallnorm *= -1; diff --git a/zscript/swwm_gesture_fx.zsc b/zscript/swwm_gesture_fx.zsc index 9bf308778..a96ea3f30 100644 --- a/zscript/swwm_gesture_fx.zsc +++ b/zscript/swwm_gesture_fx.zsc @@ -216,7 +216,7 @@ Class LoveHeart : Actor { HitLine = BlockingLine; // which side and part we hit? - LineSide = SWWMUtility.PointOnLineSide(pos.xy,BlockingLine); + LineSide = Level.PointOnLineSide(pos.xy,BlockingLine); double fl, cl; if ( BlockingLine.sidedef[1] ) { @@ -433,7 +433,7 @@ Class LoveHeart : Actor // use line if ( BlockingLine ) { - int s = SWWMUtility.PointOnLineSide(pos.xy,BlockingLine); + int s = Level.PointOnLineSide(pos.xy,BlockingLine); int locknum = SWWMUtility.GetLineLock(BlockingLine); if ( !locknum || (target && target.CheckKeys(locknum,false,true)) ) BlockingLine.RemoteActivate(target,s,SPAC_Use,pos); diff --git a/zscript/swwm_thinkers.zsc b/zscript/swwm_thinkers.zsc index a939a4d6a..6d2cc44b1 100644 --- a/zscript/swwm_thinkers.zsc +++ b/zscript/swwm_thinkers.zsc @@ -169,58 +169,6 @@ Class SWWMCrusherBroken : Thinker } } -// cache data for manual lockdefs parsing nonsense -Class LIEntry -{ - int locknumber; - bool hascolor; - Color mapcolor; -} - -Class SWWMCachedLockInfo : SWWMStaticThinker -{ - Array ent; - - static clearscope bool IsValidLock( int l ) - { - let ti = ThinkerIterator.Create("SWWMCachedLockInfo",STAT_STATIC); - SWWMCachedLockInfo cli = SWWMCachedLockInfo(ti.Next()); - if ( !cli ) return false; - foreach ( e:cli.ent ) - { - if ( e.locknumber == l ) - return true; - } - return false; - } - - static clearscope Color GetLockColor( int l ) - { - let ti = ThinkerIterator.Create("SWWMCachedLockInfo",STAT_STATIC); - SWWMCachedLockInfo cli = SWWMCachedLockInfo(ti.Next()); - if ( !cli ) return -1; - foreach ( e:cli.ent ) - { - if ( e.locknumber == l ) - { - if ( e.hascolor ) return e.mapcolor; - return 0; - } - } - return -1; - } - - static SWWMCachedLockInfo GetInstance() - { - let ti = ThinkerIterator.Create("SWWMCachedLockInfo",STAT_STATIC); - SWWMCachedLockInfo cli = SWWMCachedLockInfo(ti.Next()); - if ( cli ) return cli; - cli = new("SWWMCachedLockInfo"); - cli.ChangeStatNum(STAT_STATIC); - return cli; - } -} - Class SWWMCorpseCleaner : Thinker { transient ThinkerIterator ti; diff --git a/zscript/utility/swwm_utility_map.zsc b/zscript/utility/swwm_utility_map.zsc index 89234278b..6705a78e3 100644 --- a/zscript/utility/swwm_utility_map.zsc +++ b/zscript/utility/swwm_utility_map.zsc @@ -9,68 +9,6 @@ enum EExitType extend Class SWWMUtility { - // how the fuck is this not available to ZScript? - // copied from P_PointOnLineSidePrecise() - deprecated("4.11", "Use Level.PointOnLineSide() instead") static int PointOnLineSide( Vector2 p, Line l ) - { - if ( !l ) return 0; - return (((p.y-l.v1.p.y)*l.delta.x+(l.v1.p.x-p.x)*l.delta.y) > double.epsilon); - } - - // haha another one - // copied from BoxOnLineSide() - deprecated("4.11", "Use Level.BoxOnLineSide() instead") static int BoxOnLineSide( double top, double bottom, double left, double right, Line l ) - { - if ( !l ) return 0; - int p1, p2; - if ( l.delta.x == 0 ) - { - // ST_VERTICAL: - p1 = (right < l.v1.p.x); - p2 = (left < l.v1.p.x); - if ( l.delta.y < 0 ) - { - p1 ^= 1; - p2 ^= 1; - } - } - else if ( l.delta.y == 0 ) - { - // ST_HORIZONTAL: - p1 = (top > l.v1.p.y); - p2 = (bottom > l.v1.p.y); - if ( l.delta.x < 0 ) - { - p1 ^= 1; - p2 ^= 1; - } - } - else if ( (l.delta.x*l.delta.y) >= 0 ) - { - // ST_POSITIVE: - p1 = PointOnLineSide((left,top),l); - p2 = PointOnLineSide((right,bottom),l); - } - else - { - // ST_NEGATIVE: - p1 = PointOnLineSide((right,top),l); - p2 = PointOnLineSide((left,bottom),l); - } - return (p1==p2)?p1:-1; - } - - // wrapper - deprecated("4.11", "Use Level.ActorOnLineSide() instead") static int ActorOnLineSide( Actor a, Line l ) - { - double box[4]; - box[0] = a.pos.y+a.radius; - box[1] = a.pos.y-a.radius; - box[2] = a.pos.x-a.radius; - box[3] = a.pos.x+a.radius; - return BoxOnLineSide(box[0],box[1],box[2],box[3],l); - } - // Thanks to ZZYZX and Nash static play void SetToSlopeSpecific( Actor a, double dang, SecPlane plane, bool flipnorm ) { @@ -208,17 +146,6 @@ extend Class SWWMUtility return false; } - deprecated("4.11","Use Key.IsLockDefined() instead") static bool IsValidLockNum( int l ) - { - if ( (l < 1) || (l > 255) ) return true; - return SWWMCachedLockInfo.IsValidLock(l); - } - - deprecated("4.11","Use Key.GetMapColorForLock() instead") static Color GetLockColor( int l ) - { - return SWWMCachedLockInfo.GetLockColor(l); - } - static bool IsDoorSector( Sector s, int part ) { // super-easy mode: check for boss special sectors @@ -586,7 +513,7 @@ extend Class SWWMUtility else if ( a.BlockingLine && BlockingLineIsBlocking(a,Line.ML_BLOCKEVERYTHING|Line.ML_BLOCKPROJECTILE,a.BlockingLine) ) { HitNormal = (-a.BlockingLine.delta.y,a.BlockingLine.delta.x,0).unit(); - if ( !SWWMUtility.PointOnLineSide(a.pos.xy,a.BlockingLine) ) + if ( !Level.PointOnLineSide(a.pos.xy,a.BlockingLine) ) HitNormal *= -1; } else @@ -747,6 +674,6 @@ extend Class SWWMUtility } } // is the point behind both lines? - return (PointOnLineSide(p,a) && PointOnLineSide(p,b)); + return (Level.PointOnLineSide(p,a) && Level.PointOnLineSide(p,b)); } } diff --git a/zscript/weapons/swwm_cbt_fx.zsc b/zscript/weapons/swwm_cbt_fx.zsc index 52979ad2c..b449e7a18 100644 --- a/zscript/weapons/swwm_cbt_fx.zsc +++ b/zscript/weapons/swwm_cbt_fx.zsc @@ -223,7 +223,7 @@ Class BusterWall : Thinker else if ( a.BlockingLine && SWWMUtility.BlockingLineIsBlocking(a,Line.ML_BLOCKEVERYTHING|Line.ML_BLOCKPROJECTILE,a.BlockingLine) ) { HitNormal = (-a.BlockingLine.delta.y,a.BlockingLine.delta.x,0).unit(); - int wside = SWWMUtility.PointOnLineSide(a.pos.xy,a.BlockingLine); + int wside = Level.PointOnLineSide(a.pos.xy,a.BlockingLine); if ( !wside ) HitNormal *= -1; faketracer.Results.HitType = TRACE_HitWall; faketracer.Results.HitLine = a.BlockingLine; diff --git a/zscript/weapons/swwm_danmaku_fx.zsc b/zscript/weapons/swwm_danmaku_fx.zsc index f4ae708ee..14408b577 100644 --- a/zscript/weapons/swwm_danmaku_fx.zsc +++ b/zscript/weapons/swwm_danmaku_fx.zsc @@ -440,7 +440,7 @@ Class EvisceratorProj : Actor else if ( BlockingLine ) { spawnofs = (-BlockingLine.delta.y,BlockingLine.delta.x,0).unit()*4; - if ( !SWWMUtility.PointOnLineSide(pos.xy,BlockingLine) ) + if ( !Level.PointOnLineSide(pos.xy,BlockingLine) ) spawnofs *= -1; } int trail = 0; diff --git a/zscript/weapons/swwm_splode_fx.zsc b/zscript/weapons/swwm_splode_fx.zsc index bd365a774..3fd48b71a 100644 --- a/zscript/weapons/swwm_splode_fx.zsc +++ b/zscript/weapons/swwm_splode_fx.zsc @@ -393,7 +393,7 @@ Class ExplodiumMagAttach : ExplodiumMagProj { atline = BlockingLine; normal = (-BlockingLine.delta.y,BlockingLine.delta.x,0).unit(); - atside = SWWMUtility.PointOnLineSide(pos.xy,BlockingLine); + atside = Level.PointOnLineSide(pos.xy,BlockingLine); if ( !atside ) normal *= -1; Vector3 orig = (BlockingLine.v1.p.x,BlockingLine.v1.p.y,0); Vector3 onwall = pos-(normal dot (pos-orig))*normal;