From 8e952f412ff07491722b3fcd2cfe67f24c211b65 Mon Sep 17 00:00:00 2001 From: Marisa the Magician Date: Mon, 5 Dec 2022 02:10:56 +0100 Subject: [PATCH] 4.10 support update (unfinished and untested). --- language.def_dlg | 10 +- language.es_dlg | 10 +- language.version | 4 +- shaders/glsl/Mykradvo2.fp | 5 +- shaders/glsl/PerfectlyGeneric.fp | 7 +- zscript.txt | 8 +- zscript/compat/swwm_compat.zsc | 13 +- zscript/compat/swwm_hdoom.zsc | 4 +- zscript/compat/swwm_shame.zsc | 6 +- zscript/dlc1/swwm_hammertime.zsc | 18 +- zscript/dlc1/swwm_heavymahsheengun.zsc | 40 +- zscript/dlc1/swwm_mister.zsc | 63 +- zscript/dlc1/swwm_mister_fx.zsc | 16 +- zscript/dlc1/swwm_notashotgun.zsc | 10 +- zscript/dlc1/swwm_notashotgun_fx.zsc | 2 +- zscript/games/swwm_madcat.zsc | 6 +- zscript/handler/swwm_handler_cheats.zsc | 20 +- zscript/handler/swwm_handler_crosshair.zsc | 2 +- zscript/handler/swwm_handler_debugrender.zsc | 4 +- zscript/handler/swwm_handler_iwantdie.zsc | 2 +- zscript/handler/swwm_handler_playerevents.zsc | 10 +- zscript/handler/swwm_handler_process.zsc | 55 +- zscript/handler/swwm_handler_shaders.zsc | 2 +- zscript/handler/swwm_handler_uitick.zsc | 561 ---------- zscript/handler/swwm_handler_vanillaboss.zsc | 23 +- zscript/handler/swwm_handler_worldload.zsc | 168 ++- zscript/handler/swwm_handler_worldthings.zsc | 5 +- zscript/handler/swwm_handler_worldtick.zsc | 111 +- .../swwm_statichandler_achievements.zsc | 66 +- zscript/hud/swwm_dialogue.zsc | 994 ++++++++++++++++++ zscript/hud/swwm_hud.zsc | 762 ++++---------- zscript/hud/swwm_hudextra.zsc | 26 +- zscript/items/swwm_ammoextra.zsc | 18 +- zscript/items/swwm_baseammo.zsc | 60 +- zscript/items/swwm_collectibles.zsc | 4 +- zscript/items/swwm_collectibles_gesture.zsc | 4 +- zscript/items/swwm_funstuff.zsc | 23 +- zscript/items/swwm_powerups.zsc | 61 +- zscript/kbase/swwm_kbase.zsc | 23 +- zscript/kbase/swwm_kbase_list.zsc | 14 +- zscript/kbase/swwm_kbasetab_chat.zsc | 4 +- zscript/kbase/swwm_kbasetab_games.zsc | 10 +- zscript/kbase/swwm_kbasetab_inventory.zsc | 30 +- zscript/kbase/swwm_kbasetab_library.zsc | 7 +- zscript/kbase/swwm_kbasetab_mission.zsc | 6 +- zscript/kbase/swwm_kbasetab_stats.zsc | 41 +- zscript/kbase/swwm_kbasetab_store.zsc | 28 +- zscript/menu/swwm_achievementmenu.zsc | 6 +- zscript/menu/swwm_credits.zsc | 64 +- zscript/menu/swwm_inter.zsc | 11 +- zscript/menu/swwm_menus.zsc | 29 +- zscript/swwm_common.zsc | 4 +- zscript/swwm_common_fx.zsc | 10 +- zscript/swwm_gesture.zsc | 27 +- zscript/swwm_gesture_fx.zsc | 31 +- zscript/swwm_handler.zsc | 43 +- zscript/swwm_player.zsc | 77 +- zscript/swwm_statichandler.zsc | 129 ++- zscript/swwm_thinkers.zsc | 10 +- zscript/swwm_thinkers_player.zsc | 24 +- zscript/{utility => }/swwm_utility.zsc | 87 +- zscript/utility/swwm_coordutil.zsc | 92 -- .../weapons/swwm_baseweapon_ammobuffer.zsc | 24 +- zscript/weapons/swwm_baseweapon_fx.zsc | 2 +- zscript/weapons/swwm_baseweapon_melee.zsc | 72 +- zscript/weapons/swwm_blazeit.zsc | 17 +- zscript/weapons/swwm_cbt.zsc | 40 +- zscript/weapons/swwm_cbt_fx.zsc | 34 +- zscript/weapons/swwm_danmaku.zsc | 12 +- zscript/weapons/swwm_danmaku_fx.zsc | 2 +- zscript/weapons/swwm_deathlydeathcannon.zsc | 8 +- .../weapons/swwm_deathlydeathcannon_fx.zsc | 136 ++- zscript/weapons/swwm_deepdarkimpact.zsc | 38 +- zscript/weapons/swwm_shot.zsc | 40 +- zscript/weapons/swwm_sparkyboi.zsc | 10 +- zscript/weapons/swwm_sparkyboi_fx.zsc | 91 +- zscript/weapons/swwm_splode.zsc | 20 +- zscript/weapons/swwm_tastytreat.zsc | 16 +- zscript/weapons/swwm_tastytreat_fx.zsc | 18 +- zscript/weapons/swwm_thiccboolet.zsc | 107 +- 80 files changed, 2342 insertions(+), 2355 deletions(-) delete mode 100644 zscript/handler/swwm_handler_uitick.zsc create mode 100644 zscript/hud/swwm_dialogue.zsc rename zscript/{utility => }/swwm_utility.zsc (97%) delete mode 100644 zscript/utility/swwm_coordutil.zsc diff --git a/language.def_dlg b/language.def_dlg index 5963d68f6..296649522 100644 --- a/language.def_dlg +++ b/language.def_dlg @@ -119,11 +119,11 @@ SWWM_SAYAMAW3 = "I think it's gonna be pretty interesting to visit another unive SWWM_SAYAMAW4 = "... And of course, it's going to be even more interesting to blow shit up in it, too, right?"; SWWM_SAYAMAW5 = "Just... Be on the lookout for whatever it is that's guarding the place."; // Heretic E2M8 -SWWM_SAYAMASTERS1 = "OK, so... We're one step closer to that serpent rider's home turf. But there's a problem."; -SWWM_SAYAMASTERS2 = "Specifically, several problems. Big, bulky, muscular problems."; -SWWM_SAYAMASTERS3 = "We're talking BIG MINOTAURS with BIG HAMMERS here."; -SWWM_SAYAMASTERS4 = "I don't know about you, but I'm already hearing the Pillar Men theme in my head."; -SWWM_SAYAMASTERS5 = "Go get them, \cdDemo Demostar\c-... ... ... OK maybe that's a terrible pun, forget about it."; +SWWM_SAYAPORTALS1 = "OK, so... We're one step closer to that serpent rider's home turf. But there's a problem."; +SWWM_SAYAPORTALS2 = "Specifically, several problems. Big, bulky, muscular problems."; +SWWM_SAYAPORTALS3 = "We're talking BIG MINOTAURS with BIG HAMMERS here."; +SWWM_SAYAPORTALS4 = "I don't know about you, but I'm already hearing the Pillar Men theme in my head."; +SWWM_SAYAPORTALS5 = "Go get them, \cdDemo Demostar\c-... ... ... OK maybe that's a terrible pun, forget about it."; // Heretic E3M8 SWWM_SAYADSPARIL1 = "This is it, \cdDemo-chan\c-. You're about to face that stupid-ass wizard."; SWWM_SAYADSPARIL2 = "You're gonna save another world, and all in record time. You're on a roll!"; diff --git a/language.es_dlg b/language.es_dlg index 8cf2ded59..5988529ec 100644 --- a/language.es_dlg +++ b/language.es_dlg @@ -110,11 +110,11 @@ SWWM_SAYAMAW3 = "Creo que va a ser interesante visitar el equivalente al infiern SWWM_SAYAMAW4 = "... Y por supuesto, va a ser mucho más interesante reventarlo todo también, ¿verdad?"; SWWM_SAYAMAW5 = "Solo... Ten cuidado con lo que sea que guarde el sitio este."; // Heretic E2M8 -SWWM_SAYAMASTERS1 = "Vale, a ver... Estamos a un paso más de la guarida del jinete de serpiente ese. Pero hay un problema."; -SWWM_SAYAMASTERS2 = "Específicamente, varios problemas. Problemas grandes, tochos, y todo musculosos."; -SWWM_SAYAMASTERS3 = "Es que estamos hablando de MINOTAUROS ENORMES con MAZOS ENORMES."; -SWWM_SAYAMASTERS4 = "No se tú, pero yo ya estoy escuchando el tema de los Hombres del Pilar en mi cabeza."; -SWWM_SAYAMASTERS5 = "A por ellos, \cdDemo Demostar\c-... ... ... Vale puede que ese haya sido un chiste muy malo, olvídalo."; +SWWM_SAYAPORTALS1 = "Vale, a ver... Estamos a un paso más de la guarida del jinete de serpiente ese. Pero hay un problema."; +SWWM_SAYAPORTALS2 = "Específicamente, varios problemas. Problemas grandes, tochos, y todo musculosos."; +SWWM_SAYAPORTALS3 = "Es que estamos hablando de MINOTAUROS ENORMES con MAZOS ENORMES."; +SWWM_SAYAPORTALS4 = "No se tú, pero yo ya estoy escuchando el tema de los Hombres del Pilar en mi cabeza."; +SWWM_SAYAPORTALS5 = "A por ellos, \cdDemo Demostar\c-... ... ... Vale puede que ese haya sido un chiste muy malo, olvídalo."; // Heretic E3M8 SWWM_SAYADSPARIL1 = "Ya está, \cdDemo-chan\c-. Vas a enfrentarte al brujo capullo ese."; SWWM_SAYADSPARIL2 = "Vas a salvar otro mundo, y todo en tiempo récord. ¡Estás en racha!"; diff --git a/language.version b/language.version index ed231c14b..118f809b1 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r657 \cu(Sat 3 Dec 15:05:09 CET 2022)\c-"; -SWWM_SHORTVER="\cw1.3pre r657 \cu(2022-12-03 15:05:09)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r658 \cu(Mon 5 Dec 02:10:56 CET 2022)\c-"; +SWWM_SHORTVER="\cw1.3pre r658 \cu(2022-12-05 02:10:56)\c-"; diff --git a/shaders/glsl/Mykradvo2.fp b/shaders/glsl/Mykradvo2.fp index 9f21a50d1..69da196b9 100644 --- a/shaders/glsl/Mykradvo2.fp +++ b/shaders/glsl/Mykradvo2.fp @@ -4,10 +4,7 @@ const float pi = 3.14159265358979323846; void SetupMaterial( inout Material mat ) { - // temp fix for OBJ bug - vec2 coord = vTexCoord.st; - if ( coord.t < 0 ) coord.t = 1.+coord.t; - vec2 p = 2.*(coord.st-.5); + vec2 p = 2.*(vTexCoord.st-.5); float a = atan(p.y,p.x); float a2 = atan(p.y,abs(p.x)); float r = length(p); diff --git a/shaders/glsl/PerfectlyGeneric.fp b/shaders/glsl/PerfectlyGeneric.fp index e46d669a7..93ec3c49f 100644 --- a/shaders/glsl/PerfectlyGeneric.fp +++ b/shaders/glsl/PerfectlyGeneric.fp @@ -8,14 +8,11 @@ void SetupMaterial( inout Material mat ) vec4 ProcessLight( Material mat, vec4 color ) { - // temp fix for OBJ bug - vec2 coord = vTexCoord.st; - if ( coord.t < 0 ) coord.t = 1.+coord.t; vec3 light = vec3(-.6,.7,.8); float val = max(dot(normalize(vEyeNormal.xyz),light),.25); val += .2*pow(max(dot(normalize(vEyeNormal.xyz),light),0.),4.); - float mixfct = mix(1.,.5,floor(abs(coord.s-.5)*2.133333)); - mixfct = mix(mixfct,.5,floor(abs(coord.t-.5)*2.13333)); + float mixfct = mix(1.,.5,floor(abs(vTexCoord.s-.5)*2.133333)); + mixfct = mix(mixfct,.5,floor(abs(vTexCoord.t-.5)*2.13333)); val *= mixfct; return vec4(vec3(val),color.a); } diff --git a/zscript.txt b/zscript.txt index b71ee204a..6f7c6480a 100644 --- a/zscript.txt +++ b/zscript.txt @@ -1,4 +1,4 @@ -version "4.9" +version "4.10" /* DEMOLITIONIST Main Codebase @@ -11,10 +11,8 @@ version "4.9" #include "zscript/swwm_Gutamatics/Include.zsc" // ZPolyobject #include "zscript/swwm_Polyobjects/Polyobjects.zs" -// utility code -#include "zscript/utility/swwm_coordutil.zsc" -#include "zscript/utility/swwm_utility.zsc" // base code +#include "zscript/swwm_utility.zsc" #include "zscript/swwm_common.zsc" #include "zscript/swwm_common_fx.zsc" #include "zscript/swwm_handler.zsc" @@ -40,7 +38,6 @@ version "4.9" #include "zscript/handler/swwm_handler_queues.zsc" #include "zscript/handler/swwm_handler_replacements.zsc" #include "zscript/handler/swwm_handler_shaders.zsc" -#include "zscript/handler/swwm_handler_uitick.zsc" #include "zscript/handler/swwm_handler_vanillaboss.zsc" #include "zscript/handler/swwm_handler_worldload.zsc" #include "zscript/handler/swwm_handler_worldthings.zsc" @@ -58,6 +55,7 @@ version "4.9" #include "zscript/compat/swwm_shame.zsc" #include "zscript/compat/swwm_hdoom.zsc" // hud +#include "zscript/hud/swwm_dialogue.zsc" #include "zscript/hud/swwm_hud.zsc" #include "zscript/hud/swwm_hudextra.zsc" #include "zscript/hud/swwm_hudobjects.zsc" diff --git a/zscript/compat/swwm_compat.zsc b/zscript/compat/swwm_compat.zsc index 22e873c4b..94873427b 100644 --- a/zscript/compat/swwm_compat.zsc +++ b/zscript/compat/swwm_compat.zsc @@ -161,7 +161,7 @@ Class SWWMLevelCompatibility : LevelPostProcessor SetThingArgument(nt,0,tiddy); nt = AddThing(4206930,(0,0,0)); SetThingID(nt,tiddy); - SetThingArgument(nt,0,0); + SetThingArgument(nt,0,SWWMDLG_GOTCHAEND); break; // EQUINOX: various boss brain setups that could be cheesed with the Ynykron or silver bullet // Equinox MAP04 @@ -348,24 +348,23 @@ Class SWWMLevelCompatibility : LevelPostProcessor case 'AA4CA3FC891D13821ACCABD836E29EB5': case '9AA7780B46EC4471F630572798943D71': // sound sequence handling - for ( int i=0; i 0 ) { - st.HitList[i].HitActor.TraceBleed(realdmg,self); - st.HitList[i].HitActor.SpawnBlood(st.HitList[i].HitLocation,atan2(st.HitList[i].x.y,st.HitList[i].x.x)+180,realdmg); - st.HitList[i].HitActor.A_StartSound("misc/slughitf",CHAN_DAMAGE,CHANF_OVERLAP,1.,2.); + hit.HitActor.TraceBleed(realdmg,self); + hit.HitActor.SpawnBlood(hit.HitLocation,atan2(hit.x.y,hit.x.x)+180,realdmg); + hit.HitActor.A_StartSound("misc/slughitf",CHAN_DAMAGE,CHANF_OVERLAP,1.,2.); } } if ( (st.Results.HitType != TRACE_HitNone) && (st.Results.HitType != TRACE_HasHitSky) && (st.Results.HitType != TRACE_HitActor) ) diff --git a/zscript/dlc1/swwm_mister.zsc b/zscript/dlc1/swwm_mister.zsc index e652e3b0d..63758ae2c 100644 --- a/zscript/dlc1/swwm_mister.zsc +++ b/zscript/dlc1/swwm_mister.zsc @@ -28,7 +28,6 @@ Class MisterRailTracer : LineTracer bool pastwall, fullstop; Array WallPenetrateList; Vector3 exitpoint; - transient Array ffloors; // needs to be done like this because HAHA SCOPE override ETraceStatus TraceCallback() { @@ -100,11 +99,12 @@ Class MisterRailTracer : LineTracer // double-check if we're piercing through a 3D floor (yes this is a thing that happens, oh boy) Sector s = level.PointInSector(ofs.xy); bool stop3d = false; - for ( int j=0; j maxz) ) continue; stop3d = true; break; @@ -182,9 +182,9 @@ Class MisterRailCounter : Thinker override void Tick() { int neff = 0; - for ( int i=0; i 0 ) return; @@ -364,7 +364,7 @@ Class MisterRifle : SWWMWeapon if ( !invoker.waschambered ) return; // brass it up (though it's not made of brass) Vector3 x, y, z; - [x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll); + [x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll); Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),2*x+3*y-18*z); let c = Spawn("MisterCasing",origin); c.angle = angle; @@ -408,7 +408,7 @@ Class MisterRifle : SWWMWeapon if ( swwm_nomagdrop ) return; // drop it Vector3 x, y, z; - [x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll); + [x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll); Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),6*x+3*y-18*z); let c = Spawn("MisterMag",origin); c.angle = angle; @@ -476,7 +476,7 @@ Class MisterRifle : SWWMWeapon } SWWMHandler.DoFlash(self,Color(48,64,224,255),3); Vector3 x, y, z; - [x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll); + [x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll); Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+2.8*y-2.4*z); if ( invoker.firemode == 1 ) { @@ -496,7 +496,7 @@ Class MisterRifle : SWWMWeapon s.SetShade(Color(0,3,4)*Random[ExploS](48,63)); } Vector3 x2, y2, z2; - [x2, y2, z2] = swwm_CoordUtil.GetAxes(BulletSlope(),angle,roll); + [x2, y2, z2] = SWWMUtility.GetAxes(angle,BulletSlope(),roll); double a, s; Vector3 dir; for ( int i=0; i<8; i++ ) @@ -581,8 +581,7 @@ Class MisterRifle : SWWMWeapon s.vel += vel*.5+x*FRandom[Mister](1.,2.); s.SetShade(Color(0,3,4)*Random[ExploS](48,63)); } - Vector3 dir; - dir = swwm_CoordUtil.GetAxes(BulletSlope(),angle,roll); + Vector3 dir = SWWMUtility.Vec3FromAngles(angle,BulletSlope()); FLineTraceData d; LineTrace(atan2(dir.y,dir.x),10000,asin(-dir.z),TRF_ABSPOSITION|TRF_NOSKY,origin.z,origin.x,origin.y,d); SWWMBulletTrail.DoTrail(self,origin,dir,10000,2); @@ -643,7 +642,7 @@ Class MisterRifle : SWWMWeapon A_SWWMFlash("FastFlash"); } Vector3 x, y, z; - [x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll); + [x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll); Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+2.8*y-2.4*z); SWWMUtility.DoKnockback(self,-x,5000.); A_QuakeEx(3,3,3,5,0,10,"",QF_RELATIVE|QF_SCALEDOWN|QF_3D,rollIntensity:.4); @@ -659,7 +658,7 @@ Class MisterRifle : SWWMWeapon s.SetShade(Color(0,3,4)*Random[ExploS](48,63)); } Vector3 x2, y2, z2; - [x2, y2, z2] = swwm_CoordUtil.GetAxes(BulletSlope(),angle,roll); + [x2, y2, z2] = SWWMUtility.GetAxes(angle,BulletSlope(),roll); static const double spd[] = {.00,.01,.03,.06,.10}; double a = FRandom[Mister](0,360), s = FRandom[Mister](spd[index],spd[index+1]); Vector3 dir = SWWMUtility.ConeSpread(x2,y2,z2,a,s); @@ -763,7 +762,7 @@ Class MisterRifle : SWWMWeapon A_StopSound(CHAN_WEAPONEXTRA); A_PlayerFire(); Vector3 x, y, z; - [x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll); + [x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll); Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+2.8*y-2.4*z); SWWMHandler.DoFlash(self,Color(64,64,224,255),9); A_SWWMFlash(); @@ -782,26 +781,15 @@ Class MisterRifle : SWWMWeapon s.SetShade(Color(0,3,4)*Random[ExploS](48,63)); } Vector3 dir, startdir; - startdir = dir = swwm_CoordUtil.GetAxes(BulletSlope(),angle,roll); + startdir = dir = SWWMUtility.Vec3FromAngles(angle,BulletSlope()); let mrt = new("MisterRailTracer"); // I pity the fool mrt.ignoreme = self; mrt.hitlist.Clear(); mrt.shootthroughlist.Clear(); mrt.waterhitlist.Clear(); mrt.wallpenetratelist.Clear(); - mrt.ffloors.Clear(); mrt.portalseg.Clear(); mrt.maxpen = 400; - for ( int i=0; i=4) ) A_StartSound("quadshot/pointblank",CHAN_WEAPON,CHANF_OVERLAP,.6+idx*.1,.4-idx*.05,1.2-idx*.05); Vector3 x2, y2, z2; - [x2, y2, z2] = swwm_CoordUtil.GetAxes(BulletSlope(),angle,roll); + [x2, y2, z2] = SWWMUtility.GetAxes(angle,BulletSlope(),roll); double a, s; Actor p; bool bExtra = ((idx>=4)&&invoker.chambered&&!invoker.charged); @@ -270,8 +270,8 @@ Class Quadravol : SWWMWeapon } else return; invoker.wastecycle = 0; - if ( (s.quadegg > 0) && (player == players[consoleplayer]) ) - Console.MidPrint(null,"swwmquadravoleasteregg"..s.quadegg); + if (( s.quadegg > 0) && (player == players[consoleplayer]) ) + EventHandler.SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_LEVER1+(s.quadegg-1)); } action void A_LoadOverlay() @@ -301,7 +301,7 @@ Class Quadravol : SWWMWeapon action void A_DropCasing() { Vector3 x, y, z; - [x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll); + [x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll); Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),-8*x+8*y-16*z); if ( invoker.wascharged ) { diff --git a/zscript/dlc1/swwm_notashotgun_fx.zsc b/zscript/dlc1/swwm_notashotgun_fx.zsc index ba9faf9f7..8cecb9562 100644 --- a/zscript/dlc1/swwm_notashotgun_fx.zsc +++ b/zscript/dlc1/swwm_notashotgun_fx.zsc @@ -228,7 +228,7 @@ Class QuadProj : Actor { A_QuadTrail(); Vector3 x, y, z; - [x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll); + [x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll); double a = FRandom[Quadravol](0.,360.), s = FRandom[Quadravol](0.,drift); vel += x*(accelrate/GameTicRate); vel += SWWMUtility.CircleOffset(y,z,a,s); diff --git a/zscript/games/swwm_madcat.zsc b/zscript/games/swwm_madcat.zsc index bc394afc2..00ac6637a 100644 --- a/zscript/games/swwm_madcat.zsc +++ b/zscript/games/swwm_madcat.zsc @@ -20,10 +20,10 @@ Class MadcatGameStateManager : Thinker { let gsm = MadcatGameStateManager(ThinkerIterator.Create("MadcatGameStateManager").Next()); if ( !gsm ) ThrowAbortException("Game State Manager not found."); - for ( int i=0; i)(AllActorClasses[i]); + let w = (Class)(cls); if ( !w || (w == 'SWWMWeapon') ) continue; let def = GetDefaultByType(w); if ( def.bCHEATNOTWEAPON ) continue; @@ -179,9 +179,9 @@ extend Class SWWMHandler if ( !(i is 'Ammo') ) continue; i.Amount = i.MaxAmount; } - for ( int i=0; i)(AllActorClasses[i]); + let w = (Class)(cls); if ( !w || (w == 'SWWMWeapon') ) continue; let def = GetDefaultByType(w); if ( def.bCHEATNOTWEAPON ) continue; @@ -411,17 +411,7 @@ extend Class SWWMHandler let s = SWWMStats.Find(players[consoleplayer]); if ( (i > 5) && !swwm_nomapmsg && (!s || !s.oldcheat) ) { - if ( !swwm_oldcheats ) - { - let m = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_ZNVSNAME"),StringTable.Localize("$SWWM_ZNVNAME"),"Znv"); - m.seqname = "ZNVTXT"; - m.seqcnt = 5; - m.znvspecial = true; - m.delay = 80; - m.enddelay = 90; - m.pausedelay = 40; - StatusBar.AttachMessage(m,-1232); - } + if ( !swwm_oldcheats ) SWWMDialogues.StartSeq(SWWMDLG_CHEATS); CVar.GetCVar('swwm_oldcheats').SetBool(true); SendNetworkEvent("swwmsetoldcheat",consoleplayer); } diff --git a/zscript/handler/swwm_handler_crosshair.zsc b/zscript/handler/swwm_handler_crosshair.zsc index a710be50b..6a72dd04f 100644 --- a/zscript/handler/swwm_handler_crosshair.zsc +++ b/zscript/handler/swwm_handler_crosshair.zsc @@ -58,7 +58,7 @@ extend Class SWWMHandler ctr.ignoreme = mo; Vector3 x, y, z, ofs, origin; Color col; - [x, y, z] = swwm_CoordUtil.GetAxes(e.ViewPitch,e.ViewAngle,e.ViewRoll); + [x, y, z] = SWWMUtility.GetAxes(e.ViewAngle,e.ViewPitch,e.ViewRoll); int chp = crosshairhealth; for ( int i=0; i k = kname; + if ( k ) + { + let kg = new("KeyGet"); + kg.got = k; + kg.flashtime = gametic+25; + bar.keyflash.Push(kg); + } + } + else if ( e.Name.Left(15) ~== "swwmwpntooltip." ) + { + let bar = SWWMStatusBar(StatusBar); + if ( !bar ) return; + String wname = e.Name.Mid(15); + Class w = wname; + if ( w ) + { + let tt = new("SWWMWeaponTooltip").Init(w); + bool appended = false; + for ( SWWMWeaponTooltip t=bar.ctip; t; t=t.next ) + { + if ( t.next ) continue; + appended = true; + t.next = tt; + break; + } + if ( !appended ) + { + bar.ctip = tt; + bar.AttachMessage(tt,-2910); + } + } + } + } + override void NetworkProcess( ConsoleEvent e ) { if ( e.Name ~== "swwmgesture" ) @@ -343,18 +388,18 @@ extend Class SWWMHandler // if it's an ammo, check the largest unit givable if ( i is 'Ammo' ) { - for ( int i=0; i)(AllActorClasses[i]); + let a = (Class)(cls); if ( !a || (a.GetParentClass() != item) || (GetDefaultByType(a).Amount < amt) ) continue; amt = GetDefaultByType(a).Amount; } } if ( i is 'MagAmmo' ) { - for ( int i=0; i)(AllActorClasses[i]); + let a = (Class)(cls); if ( !a || (a.GetParentClass() != item) || (GetDefaultByType(a).Amount < amt) ) continue; amt = GetDefaultByType(a).Amount; } @@ -457,8 +502,6 @@ extend Class SWWMHandler } else if ( e.Name ~== "swwmccstart" ) gdat.ccstartonce = true; - else if ( e.Name ~== "swwmcclilith" ) - gdat.cclilithonce = true; // cheats go here else CheatEvent(e); } diff --git a/zscript/handler/swwm_handler_shaders.zsc b/zscript/handler/swwm_handler_shaders.zsc index ddf11b134..1ef554e47 100644 --- a/zscript/handler/swwm_handler_shaders.zsc +++ b/zscript/handler/swwm_handler_shaders.zsc @@ -146,7 +146,7 @@ extend Class SWWMHandler PPShader.SetUniform1f("ZoomBlur","Fade",clamp((spd-20.)/60.,0.,1.)); double str = min(spd/40.,15.); Vector3 x, y, z; - [x, y, z] = swwm_CoordUtil.GetAxes(e.ViewPitch,e.ViewAngle,e.ViewRoll); + [x, y, z] = SWWMUtility.GetAxes(e.ViewAngle,e.ViewPitch,e.ViewRoll); Vector3 reldir = (worlddir dot y, worlddir dot z, worlddir dot x); Vector2 centerspot = (.5+reldir.x*.5,.5+reldir.y*.5); if ( reldir.z < 0 ) diff --git a/zscript/handler/swwm_handler_uitick.zsc b/zscript/handler/swwm_handler_uitick.zsc deleted file mode 100644 index 89e6556f0..000000000 --- a/zscript/handler/swwm_handler_uitick.zsc +++ /dev/null @@ -1,561 +0,0 @@ -// misc. UI Tick stuff - -extend Class SWWMHandler -{ - ui bool didstartmsg; - bool doextramsg; - ui bool didextramsg; - // april fools special - ui bool didaprmsg; - // corruption cards stuff - ui bool incardmenu, cardmessaged; - bool dolilithmsg, doromerobotmsg; - ui bool didlilithmsg, didromerobotmsg; - - private ui void MapstartUITick() - { - if ( !didextramsg && doextramsg ) - { - if ( !swwm_nomapmsg ) - { - // angry about phase two - let msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYAEVIB"; - msg.seqcnt = 2; - msg.delay = 20; - StatusBar.AttachMessage(msg,-1232); - } - didextramsg = true; - } - if ( !didlilithmsg && !gdat.cclilithonce && dolilithmsg ) - { - if ( !swwm_nomapmsg ) - { - // saya's live freakout™ - let msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYALILITHA"; - msg.seqcnt = 2; - msg.delay = 1050; // give it about 15 seconds for it to happen - StatusBar.AttachMessage(msg,-1232); - let msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_CYTHOSNAME"),StringTable.Localize("$SWWM_CYTHONAME"),"Cytho"); - msg2.seqname = "SAYALILITHB"; - msg2.seqcnt = 1; - msg2.delay = 30; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg2.seqname = "SAYALILITHC"; - msg2.seqcnt = 1; - msg2.delay = 20; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_CYTHOSNAME"),StringTable.Localize("$SWWM_CYTHONAME"),"Cytho"); - msg2.seqname = "SAYALILITHD"; - msg2.seqcnt = 1; - msg2.delay = 40; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg2.seqname = "SAYALILITHE"; - msg2.seqcnt = 1; - msg2.delay = 50; - msg.nextmsg = msg2; - msg.nextdirect = true; - } - didlilithmsg = true; - SendNetworkEvent("swwmcclilith"); - } - if ( !didromerobotmsg && doromerobotmsg ) - { - if ( !swwm_nomapmsg ) - { - // rom3r-0 is about to make you his bitch - let msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYAROMEROA"; - msg.seqcnt = 1; - msg.delay = 50; - StatusBar.AttachMessage(msg,-1232); - let msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_CYTHOSNAME"),StringTable.Localize("$SWWM_CYTHONAME"),"Cytho"); - msg2.seqname = "SAYAROMEROB"; - msg2.seqcnt = 1; - msg2.delay = 40; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg2.seqname = "SAYAROMEROC"; - msg2.seqcnt = 1; - msg2.delay = 30; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_CYTHOSNAME"),StringTable.Localize("$SWWM_CYTHONAME"),"Cytho"); - msg2.seqname = "SAYAROMEROD"; - msg2.seqcnt = 2; - msg2.delay = 50; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg2.seqname = "SAYAROMEROE"; - msg2.seqcnt = 1; - msg2.delay = 70; - msg.nextmsg = msg2; - msg.nextdirect = true; - } - didromerobotmsg = true; - } - if ( ccloaded && !gdat.ccstartonce && !cardmessaged && (gamestate == GS_LEVEL) ) - { - let m = Menu.GetCurrentMenu(); - if ( m && (m.GetClassName() == 'CorruptionCardsSelector') ) incardmenu = true; - else if ( incardmenu ) - { - if ( !swwm_ccmessage ) - { - let msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_CYTHOSNAME"),StringTable.Localize("$SWWM_CYTHONAME"),"Cytho"); - msg.seqname = "CYTHOCCA"; - msg.seqcnt = 4; - msg.delay = 120; - StatusBar.AttachMessage(msg,-1232); - let msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg2.seqname = "CYTHOCCB"; - msg2.seqcnt = 1; - msg2.delay = 30; - msg.nextmsg = msg2; - msg.nextdirect = true; - msg = msg2; - msg2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_CYTHOSNAME"),StringTable.Localize("$SWWM_CYTHONAME"),"Cytho"); - msg2.seqname = "CYTHOCCC"; - msg2.seqcnt = 1; - msg2.delay = 45; - msg.nextmsg = msg2; - msg.nextdirect = true; - } - CVar.GetCVar('swwm_ccmessage').SetBool(true); - cardmessaged = true; - SendNetworkEvent("swwmccstart"); - } - } - if ( didstartmsg ) return; - if ( swwm_nomapmsg ) - { - didstartmsg = true; - return; - } - if ( !didaprmsg && (gamestate == GS_LEVEL) ) - { - didaprmsg = true; - if ( SystemTime.Format("%d%m",SystemTime.Now()) == "0104" ) - { - let msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYAFOOL"; - msg.seqcnt = 5; - msg.delay = 120; - StatusBar.AttachMessage(msg,-1232); - didstartmsg = true; - return; - } - } - int whichboss = WhichVanillaBossMap(); - if ( bossmap == MAP_DE1M8 ) - { - let msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYAPHOBOS"; - msg.seqcnt = 4; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - } - else if ( bossmap == MAP_DE2M8 ) - { - let msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYADEIMOS"; - msg.seqcnt = 4; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - } - else if ( bossmap == MAP_DE3M8 ) - { - let msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYADIS"; - msg.seqcnt = 4; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - } - else if ( bossmap == MAP_DE4M8 ) - { - let msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYATHY"; - msg.seqcnt = 4; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - } - else if ( bossmap == MAP_DMAP07 ) - { - let msg = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - msg.seqname = "SAYADIMPLE"; - msg.seqcnt = 5; - msg.delay = 40; - StatusBar.AttachMessage(msg,-1232); - } - else if ( bossmap == MAP_DMAP30 ) - { - // rampancy check - bool rampancy = false; - for ( int i=0; i psectors; - - // for minimap - Array ffsectors; - bool maphaskeys; // level end stats @@ -217,9 +210,122 @@ extend Class SWWMHandler } } + private void MapStartDialogues() + { + int whichboss = WhichVanillaBossMap(); + switch ( whichboss ) + { + case MAP_DE1M8: + SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_PHOBOS); + break; + case MAP_DE2M8: + SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_DEIMOS); + break; + case MAP_DE3M8: + SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_DIS); + break; + case MAP_DE4M8: + SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_THY); + break; + case MAP_DMAP07: + SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_DIMPLE); + break; + case MAP_DMAP30: + bool rampancy = false; + foreach ( cls:AllActorClasses ) + { + if ( cls.GetClassName() != "Robot_BossBrain" ) continue; + rampancy = true; + break; + } + if ( rampancy ) SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_RAMPANCY); + else SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_IOS); + break; + case MAP_DLVL08: + SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_NERVE); + break; + case MAP_EVMAP30: + SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_EVIA); + break; + case MAP_HE1M8_HE4M8: + if ( level.mapname ~== "E1M8" ) SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_MAW); + else SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_HEADS); + break; + case MAP_HE2M8_HE5M8: + if ( level.mapname ~== "E2M8" ) SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_PORTALS); + else SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_BULLS); + break; + case MAP_HE3M8: + SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_DSPARIL); + break; + case MAP_HMAP38: + SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_CLERIC); + break; + case MAP_HMAP36: + SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_FIGHTER); + break; + case MAP_HMAP37: + SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_MAGE); + break; + case MAP_HMAP12: + SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_HYPO); + break; + case MAP_HMAP40: + SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_KORAX); + break; + case MAP_HMAP23_HMAP27_HMAP48_HMAP55: + if ( level.mapname ~== "MAP48" ) SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_CONSTABLE); + break; + case MAP_HMAP60: + SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_DEATHKINGS); + break; + case MAP_NONE: + String csum = level.GetChecksum(); + // SIGIL E5M8 + if ( (csum ~== "3D72FD17F36D2D43FD9A21E6E57EE357") + || (csum ~== "09B30C9DA9D73D3D5A709502FBB947AA") + || (csum ~== "6EAD80DA1F30B4B3546FA294EEF9F87C") ) + SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_SIGIL); + // Doom 2 MAP11 + else if ( (csum ~== "73D9E03CEE7BF1A97EFD2EAD86688EF8") + || (csum ~== "F4F2A769609988837458772AAE99008C") + || (csum ~== "DF6A001A6C42DB5CCA599EE5883B294A") ) + SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_CIRCLE); + // Doom 2 MAP20 + else if ( (csum ~== "8898F5EC9CBDCD98019A1BC1BF892A8A") + || (csum ~== "CC53CFFCB30E873669AA2F09DA0D3566") ) + SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_GOTCHA); + // Eviternity + // MAP05 + else if ( csum ~== "33B8501B10CE5E2555C03725F765A914" ) + SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_DMN); + // MAP10 + else if ( csum ~== "9E83602D325677B8D7C3BC44BEF9B03F" ) + SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_CRE); + // MAP15 + else if ( csum ~== "CA40E6DDAB6B5C924CDC36B1F851421E" ) + SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_CRY); + // MAP20 + else if ( csum ~== "F34B3FD4D13AC763469A8E0D7379B9D0" ) + SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_CON); + // MAP25 + else if ( csum ~== "196BC735473C593F924A59B238574C35" ) + SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_SLA); + // Deathkings + // Blight + else if ( csum ~== "E3EFB0156A20ADF2DF00915A0EA85DF5" ) + SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_BLIGHT); + // Nave + else if ( csum ~== "E2B5D1400279335811C1C1C0B437D9C8" ) + SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_NAVE); + break; + } + } + override void WorldLoaded( WorldEvent e ) { if ( e.IsReopen ) return; + MapStartDialogues(); if ( gamestate != GS_TITLELEVEL ) { if ( (level.GetChecksum() ~== "D0E5ECD94BD38DF33F25515C00148693") @@ -268,9 +374,9 @@ extend Class SWWMHandler // since KDiKDiZD requires software rendering, while this is a // hardware-only mod... but hey, they can sort-of-work together // (with broken visual effects, but still... somewhat working) - for ( int i=0; i skipme; skipme.Clear(); // find exit lines, and use lines that aren't exits - for ( int i=0; i 0 ); } Vector3 lpos = (0,0,0); - for ( int i=0; i viewdist ) @@ -317,9 +316,8 @@ extend Class SWWMHandler continue; SWWMSimpleTracker.Track(self,a); } - for ( int i=0; i 1 ) + // oh boy here we go + int thisgroup = players[consoleplayer].Camera.CurSector.portalgroup; + for ( int i=0; i viewdist ) - continue; - if ( a == players[consoleplayer].Camera ) - continue; - if ( a is 'GhostTarget' ) - continue; - if ( !a.player && !a.bSOLID && !a.bSHOOTABLE && !a.bISMONSTER && !a.bFRIENDLY && !(a is 'Inventory') && !(a is 'Chancebox') ) - continue; - if ( !level.allmap && !(deathmatch && (a is 'Inventory') && !a.bDROPPED) && !a.IsFriend(players[consoleplayer].mo) && !a.CheckSight(players[consoleplayer].Camera,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) - continue; - if ( a.bKILLED || (a.Health <= 0) || a.bUnmorphed ) - continue; - if ( (a is 'Inventory') && (!a.bSPECIAL || Inventory(a).Owner) ) - continue; - if ( (a is 'Chancebox') && (a.CurState != a.SpawnState) ) - continue; - SWWMSimpleTracker.Track(self,a); - } - // we need to refer to the suckables array to find missiles - for ( int i=0; i viewdist ) - continue; - if ( !level.allmap && !(a.target && a.target.IsFriend(players[consoleplayer].mo)) && !a.CheckSight(players[consoleplayer].Camera,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) - continue; - SWWMSimpleTracker.Track(self,a); - } - for ( int i=0; i viewdist ) - continue; - if ( !level.allmap && !(a.target && a.target.IsFriend(players[consoleplayer].mo)) && !a.CheckSight(players[consoleplayer].Camera,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) - continue; - SWWMSimpleTracker.Track(self,a); - } + let a = bt.Thing; + if ( !a ) continue; + Vector2 rv = a.pos.xy-relpos; + if ( max(abs(rv.x)-a.radius,abs(rv.y)-a.radius) > viewdist ) + continue; + if ( a == players[consoleplayer].Camera ) + continue; + if ( a is 'GhostTarget' ) + continue; + if ( !a.player && !a.bSOLID && !a.bSHOOTABLE && !a.bISMONSTER && !a.bFRIENDLY && !(a is 'Inventory') && !(a is 'Chancebox') ) + continue; + if ( !level.allmap && !(deathmatch && (a is 'Inventory') && !a.bDROPPED) && !a.IsFriend(players[consoleplayer].mo) && !a.CheckSight(players[consoleplayer].Camera,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) + continue; + if ( a.bKILLED || (a.Health <= 0) || a.bUnmorphed ) + continue; + if ( (a is 'Inventory') && (!a.bSPECIAL || Inventory(a).Owner) ) + continue; + if ( (a is 'Chancebox') && (a.CurState != a.SpawnState) ) + continue; + SWWMSimpleTracker.Track(self,a); + } + // we need to refer to the suckables array to find missiles + foreach ( a:suckableactors ) + { + if ( !a || !a.bMISSILE ) continue; + Vector2 rv = a.pos.xy-relpos; + if ( max(abs(rv.x)-a.radius,abs(rv.y)-a.radius) > viewdist ) + continue; + if ( !level.allmap && !(a.target && a.target.IsFriend(players[consoleplayer].mo)) && !a.CheckSight(players[consoleplayer].Camera,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) + continue; + SWWMSimpleTracker.Track(self,a); + } + foreach ( a:beams ) + { + if ( !a ) continue; + Vector2 rv = a.pos.xy-relpos; + double rad = SWWMUtility.IsYBeam(a)?(a.scale.y*cos(a.pitch-90)):(a.speed*cos(a.pitch)); + if ( max(abs(rv.x)-rad,abs(rv.y)-rad) > viewdist ) + continue; + if ( !level.allmap && !(a.target && a.target.IsFriend(players[consoleplayer].mo)) && !a.CheckSight(players[consoleplayer].Camera,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) + continue; + SWWMSimpleTracker.Track(self,a); } } SWWMSimpleTracker trk = strackers; diff --git a/zscript/handler/swwm_statichandler_achievements.zsc b/zscript/handler/swwm_statichandler_achievements.zsc index 822942986..701e02179 100644 --- a/zscript/handler/swwm_statichandler_achievements.zsc +++ b/zscript/handler/swwm_statichandler_achievements.zsc @@ -119,12 +119,12 @@ extend Class SWWMStaticHandler dat.Replace("\r",""); list.Clear(); dat.Split(list,"\n"); - for ( int i=0; i)(AllActorClasses[i]); + let c = (Class)(cls); if ( !c || (c == 'SWWMCollectible') ) continue; let def = GetDefaultByType(c); // check that we can collect it in this IWAD @@ -212,29 +212,29 @@ extend Class SWWMStaticHandler Array keys; keys.Clear(); statestr.Split(keys,","); - for ( int i=0; i= 2 ) Console.Printf("Adding missing achievement state %s",achievementinfo[i].basename); - achievementstate.Insert(achievementinfo[i].basename,"0"); + if ( developer >= 2 ) Console.Printf("Adding missing achievement state %s",inf.basename); + achievementstate.Insert(inf.basename,"0"); } - if ( achievementinfo[i].maxval && (achievementprogress.At(achievementinfo[i].basename) == "") ) + if ( inf.maxval && (achievementprogress.At(inf.basename) == "") ) { - if ( developer >= 2 ) Console.Printf("Adding missing achievement progress %s",achievementinfo[i].basename); - achievementprogress.Insert(achievementinfo[i].basename,"0"); + if ( developer >= 2 ) Console.Printf("Adding missing achievement progress %s",inf.basename); + achievementprogress.Insert(inf.basename,"0"); } } } @@ -334,11 +334,11 @@ extend Class SWWMStaticHandler achievementstate = Dictionary.Create(); achievementprogress = Dictionary.Create(); ParseAchievementList(achievementinfo); - for ( int i=0; i w = wname; - if ( w ) - { - let tt = new("SWWMWeaponTooltip").Init(w); - bool appended = false; - for ( SWWMWeaponTooltip t=ctip; t; t=t.next ) - { - if ( t.next ) continue; - appended = true; - t.next = tt; - break; - } - if ( !appended ) - { - ctip = tt; - AttachMessage(tt,-2910); - } - } - return true; - } - else if ( msg.Left(11) ~== "swwmkeyget." ) - { - String kname = msg.Mid(11); - Class k = kname; - if ( k ) - { - let kg = new("KeyGet"); - kg.got = k; - kg.flashtime = gametic+25; - keyflash.Push(kg); - } - return true; - } - SWWMDirectMessage m, m2; - // more hack - if ( msg ~== "swwmultdoom2map20dlg" ) - { - m = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - m.seqname = "SAYAGOTCHAEND"; - m.seqcnt = 5; - m.delay = 40; - AttachMessage(m,-1232); - return true; - } - else if ( msg.Left(25) ~== "swwmsilverbulleteasteregg" ) - { - m = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - let num = msg.Mid(25).ToInt(); - switch ( num ) - { - case 1: - default: - m.seqname = "SAYAWASTEA"; - m.seqcnt = 1; - m.delay = 5; - m.startdelay = 10; - m.enddelay = 25; - break; - case 2: - m.seqname = "SAYAWASTEB"; - m.seqcnt = 1; - m.delay = 10; - m.startdelay = 20; - m.enddelay = 30; - break; - case 3: - m.seqname = "SAYAWASTEC"; - m.seqcnt = 1; - m.delay = 30; - m.startdelay = 15; - m.enddelay = 25; - break; - case 4: - m.seqname = "SAYAWASTED"; - m.seqcnt = 2; - m.delay = 40; - m.startdelay = 10; - m.enddelay = 20; - break; - case 5: - m.seqname = "SAYAWASTEE"; - m.seqcnt = 1; - m.delay = 20; - m.startdelay = 10; - m.enddelay = 30; - break; - case 6: - m.seqname = "SAYAWASTEF"; - m.seqcnt = 1; - m.delay = 50; - m.startdelay = 20; - m.enddelay = 30; - break; - } - AttachMessage(m,-1232); - return true; - } - else if ( msg.Left(22) ~== "swwmquadravoleasteregg" ) - { - m = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - let num = msg.Mid(22).ToInt(); - switch ( num ) - { - case 1: - default: - m.seqname = "SAYALEVERA"; - m.seqcnt = 1; - m.delay = 5; - m.startdelay = 20; - m.enddelay = 50; - break; - case 2: - m.seqname = "SAYALEVERB"; - m.seqcnt = 1; - m.delay = 10; - m.startdelay = 30; - m.enddelay = 40; - break; - case 3: - m.seqname = "SAYALEVERC"; - m.seqcnt = 1; - m.delay = 30; - m.startdelay = 10; - m.enddelay = 25; - break; - case 4: - m.seqname = "SAYALEVERD"; - m.seqcnt = 1; - m.delay = 40; - m.startdelay = 10; - m.enddelay = 20; - break; - case 5: - m.seqname = "SAYALEVERE"; - m.seqcnt = 1; - m.delay = 20; - m.startdelay = 10; - m.enddelay = 30; - break; - case 6: - m.seqname = "SAYALEVERF"; - m.seqcnt = 1; - m.delay = 50; - m.startdelay = 20; - m.enddelay = 30; - break; - case 7: - m.seqname = "SAYALEVERG"; - m.seqcnt = 2; - m.delay = 50; - m.startdelay = 30; - m.enddelay = 50; - break; - } - AttachMessage(m,-1232); - return true; - } // check for Korax lines, add them to chat (and reply to some of them) bool koraxline = false; if ( msg == StringTable.Localize("$TXT_ACS_MAP02_9_GREET") ) @@ -403,81 +242,13 @@ Class SWWMStatusBar : BaseStatusBar { EventHandler.SendNetworkEvent("swwmkoraxline",0,consoleplayer); koraxline = true; - if ( !swwm_nomapmsg ) - { - m = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - m.seqname = "SAYAGREETA"; - m.seqcnt = 3; - m.delay = 150; - AttachMessage(m,-1232); - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - m2.seqname = "SAYAGREETB"; - m2.seqcnt = 1; - m2.delay = 20; - m.nextmsg = m2; - m.nextdirect = true; - m = m2; - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - m2.seqname = "SAYAGREETC"; - m2.seqcnt = 1; - m2.delay = 20; - m.nextmsg = m2; - m.nextdirect = true; - m = m2; - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - m2.seqname = "SAYAGREETD"; - m2.seqcnt = 1; - m2.delay = 30; - m.nextmsg = m2; - m.nextdirect = true; - m = m2; - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - m2.seqname = "SAYAGREETE"; - m2.seqcnt = 1; - m2.delay = 20; - m.nextmsg = m2; - m.nextdirect = true; - m = m2; - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - m2.seqname = "SAYAGREETF"; - m2.seqcnt = 1; - m2.delay = 30; - m.nextmsg = m2; - m.nextdirect = true; - } + SWWMDialogues.StartSeq(SWWMDLG_GREET); } else if ( msg == StringTable.Localize("$TXT_ACS_MAP13_11_MYSER") ) { EventHandler.SendNetworkEvent("swwmkoraxline",1,consoleplayer); koraxline = true; - if ( !swwm_nomapmsg ) - { - m = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - m.seqname = "SAYABLOODA"; - m.seqcnt = 2; - m.delay = 220; - AttachMessage(m,-1232); - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_IBUKISNAME"),StringTable.Localize("$SWWM_IBUKINAME"),"Ibuki"); - m2.seqname = "SAYABLOODB"; - m2.seqcnt = 1; - m2.delay = 20; - m.nextmsg = m2; - m.nextdirect = true; - m = m2; - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - m2.seqname = "SAYABLOODC"; - m2.seqcnt = 1; - m2.delay = 30; - m.nextmsg = m2; - m.nextdirect = true; - m = m2; - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_IBUKISNAME"),StringTable.Localize("$SWWM_IBUKINAME"),"Ibuki"); - m2.seqname = "SAYABLOODD"; - m2.seqcnt = 1; - m2.delay = 20; - m.nextmsg = m2; - m.nextdirect = true; - } + SWWMDialogues.StartSeq(SWWMDLG_BLOOD); } else if ( msg == StringTable.Localize("$TXT_ACS_MAP22_27_YOUHA") ) koraxline = true; @@ -485,27 +256,7 @@ Class SWWMStatusBar : BaseStatusBar { EventHandler.SendNetworkEvent("swwmkoraxline",2,consoleplayer); koraxline = true; - if ( !swwm_nomapmsg ) - { - m = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - m.seqname = "SAYAGAMEA"; - m.seqcnt = 2; - m.delay = 200; - AttachMessage(m,-1232); - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_IBUKISNAME"),StringTable.Localize("$SWWM_IBUKINAME"),"Ibuki"); - m2.seqname = "SAYAGAMEB"; - m2.seqcnt = 1; - m2.delay = 30; - m.nextmsg = m2; - m.nextdirect = true; - m = m2; - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - m2.seqname = "SAYAGAMEC"; - m2.seqcnt = 1; - m2.delay = 20; - m.nextmsg = m2; - m.nextdirect = true; - } + SWWMDialogues.StartSeq(SWWMDLG_GAME); } else if ( msg == StringTable.Localize("$TXT_ACS_MAP27_8_WORSH") ) koraxline = true; @@ -513,51 +264,7 @@ Class SWWMStatusBar : BaseStatusBar { EventHandler.SendNetworkEvent("swwmkoraxline",3,consoleplayer); koraxline = true; - if ( !swwm_nomapmsg ) - { - m = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - m.seqname = "KIRINWORSHIPA"; - m.seqcnt = 1; - m.delay = 150; - AttachMessage(m,-1232); - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - m2.seqname = "KIRINWORSHIPB"; - m2.seqcnt = 1; - m2.delay = 40; - m2.enddelay = 10; - m.nextmsg = m2; - m.nextdirect = true; - m = m2; - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - m2.seqname = "KIRINWORSHIPC"; - m2.seqcnt = 1; - m2.delay = 10; - m2.enddelay = 20; - m.nextmsg = m2; - m.nextdirect = true; - m = m2; - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - m2.seqname = "KIRINWORSHIPD"; - m2.seqcnt = 2; - m2.delay = 10; - m.nextmsg = m2; - m.nextdirect = true; - m = m2; - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - m2.seqname = "KIRINWORSHIPE"; - m2.seqcnt = 1; - m2.delay = 20; - m2.enddelay = 10; - m.nextmsg = m2; - m.nextdirect = true; - m = m2; - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - m2.seqname = "KIRINWORSHIPF"; - m2.seqcnt = 1; - m2.delay = 10; - m.nextmsg = m2; - m.nextdirect = true; - } + SWWMDialogues.StartSeq(SWWMDLG_WORSHIP); } else if ( msg == StringTable.Localize("$TXT_ACS_MAP35_12_AREYO") ) koraxline = true; @@ -565,49 +272,7 @@ Class SWWMStatusBar : BaseStatusBar { EventHandler.SendNetworkEvent("swwmkoraxline",4,consoleplayer); koraxline = true; - if ( !swwm_nomapmsg ) - { - m = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - m.seqname = "SAYAMASTERSA"; - m.seqcnt = 2; - m.delay = 150; - m.enddelay = 60; - AttachMessage(m,-1232); - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_IBUKISNAME"),StringTable.Localize("$SWWM_IBUKINAME"),"Ibuki"); - m2.seqname = "SAYAMASTERSB"; - m2.seqcnt = 1; - m2.delay = 20; - m.nextmsg = m2; - m.nextdirect = true; - m = m2; - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - m2.seqname = "SAYAMASTERSC"; - m2.seqcnt = 1; - m2.delay = 20; - m.nextmsg = m2; - m.nextdirect = true; - m = m2; - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_IBUKISNAME"),StringTable.Localize("$SWWM_IBUKINAME"),"Ibuki"); - m2.seqname = "SAYAMASTERSD"; - m2.seqcnt = 1; - m2.delay = 20; - m.nextmsg = m2; - m.nextdirect = true; - m = m2; - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - m2.seqname = "SAYAMASTERSE"; - m2.seqcnt = 1; - m2.delay = 40; - m.nextmsg = m2; - m.nextdirect = true; - m = m2; - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - m2.seqname = "SAYAMASTERSF"; - m2.seqcnt = 1; - m2.delay = 20; - m.nextmsg = m2; - m.nextdirect = true; - } + SWWMDialogues.StartSeq(SWWMDLG_MASTERS); } if ( koraxline ) { @@ -687,148 +352,31 @@ Class SWWMStatusBar : BaseStatusBar switch ( puzzlecnt ) { case 1: - m = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - m.seqname = "KIRINPUZZLEA"; - m.seqcnt = 2; - m.delay = 90; - AttachMessage(m,-1232); + SWWMDialogues.StartSeq(SWWMDLG_PUZZLE1); break; case 2: - m = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - m.seqname = "KIRINPUZZLEB"; - m.seqcnt = 1; - m.delay = 80; - AttachMessage(m,-1232); + SWWMDialogues.StartSeq(SWWMDLG_PUZZLE2); break; case 3: - m = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - m.seqname = "KIRINPUZZLEC"; - m.seqcnt = 2; - m.delay = 70; - AttachMessage(m,-1232); + SWWMDialogues.StartSeq(SWWMDLG_PUZZLE3); break; case 5: - m = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - m.seqname = "KIRINPUZZLED"; - m.seqcnt = 2; - m.delay = 70; - AttachMessage(m,-1232); + SWWMDialogues.StartSeq(SWWMDLG_PUZZLE4); break; case 8: - m = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - m.seqname = "KIRINPUZZLEE"; - m.seqcnt = 2; - m.delay = 60; - AttachMessage(m,-1232); + SWWMDialogues.StartSeq(SWWMDLG_PUZZLE5); break; case 11: - m = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - m.seqname = "KIRINPUZZLEF"; - m.seqcnt = 3; - m.delay = 60; - AttachMessage(m,-1232); - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - m2.seqname = "KIRINPUZZLEG"; - m2.seqcnt = 1; - m.delay = 20; - m.nextmsg = m2; - m.nextdirect = true; - m = m2; - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - m2.seqname = "KIRINPUZZLEH"; - m2.seqcnt = 1; - m.delay = 30; - m.nextmsg = m2; - m.nextdirect = true; - m = m2; - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - m2.seqname = "KIRINPUZZLEI"; - m2.seqcnt = 2; - m.delay = 20; - m.nextmsg = m2; - m.nextdirect = true; + SWWMDialogues.StartSeq(SWWMDLG_PUZZLE6); break; case 20: - m = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - m.seqname = "KIRINPUZZLEJ"; - m.seqcnt = 2; - m.delay = 80; - AttachMessage(m,-1232); + SWWMDialogues.StartSeq(SWWMDLG_PUZZLE7); break; case 30: - m = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - m.seqname = "KIRINPUZZLEK"; - m.seqcnt = 1; - m.delay = 60; - AttachMessage(m,-1232); - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_IBUKISNAME"),StringTable.Localize("$SWWM_IBUKINAME"),"Ibuki"); - m2.seqname = "KIRINPUZZLEL"; - m2.seqcnt = 1; - m2.delay = 20; - m.nextmsg = m2; - m.nextdirect = true; - m = m2; - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - m2.seqname = "KIRINPUZZLEM"; - m2.seqcnt = 1; - m2.delay = 10; - m.nextmsg = m2; - m.nextdirect = true; - m = m2; - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - m2.seqname = "KIRINPUZZLEN"; - m2.seqcnt = 1; - m2.delay = 30; - m.nextmsg = m2; - m.nextdirect = true; - m = m2; - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_IBUKISNAME"),StringTable.Localize("$SWWM_IBUKINAME"),"Ibuki"); - m2.seqname = "KIRINPUZZLEO"; - m2.seqcnt = 1; - m2.delay = 20; - m.nextmsg = m2; - m.nextdirect = true; - m = m2; - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - m2.seqname = "KIRINPUZZLEP"; - m2.seqcnt = 1; - m2.delay = 30; - m.nextmsg = m2; - m.nextdirect = true; - m = m2; - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_IBUKISNAME"),StringTable.Localize("$SWWM_IBUKINAME"),"Ibuki"); - m2.seqname = "KIRINPUZZLEQ"; - m2.seqcnt = 1; - m2.delay = 20; - m.nextmsg = m2; - m.nextdirect = true; + SWWMDialogues.StartSeq(SWWMDLG_PUZZLE8); break; case 31: - m = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - m.seqname = "KIRINPUZZLER"; - m.seqcnt = 3; - m.delay = 60; - AttachMessage(m,-1232); - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - m2.seqname = "KIRINPUZZLES"; - m2.seqcnt = 1; - m2.delay = 20; - m.nextmsg = m2; - m.nextdirect = true; - m = m2; - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_KIRINSNAME"),StringTable.Localize("$SWWM_KIRINNAME"),"Kirin"); - m2.seqname = "KIRINPUZZLET"; - m2.seqcnt = 1; - m2.delay = 30; - m.nextmsg = m2; - m.nextdirect = true; - m = m2; - m2 = new("SWWMDirectMessage").Init(StringTable.Localize("$SWWM_SAYASNAME"),StringTable.Localize("$SWWM_SAYANAME"),"Saya"); - m2.seqname = "KIRINPUZZLEU"; - m2.seqcnt = 1; - m2.delay = 20; - m.nextmsg = m2; - m.nextdirect = true; + SWWMDialogues.StartSeq(SWWMDLG_PUZZLE9); break; } } @@ -1120,22 +668,8 @@ Class SWWMStatusBar : BaseStatusBar } } lastwep = CPlayer.PendingWeapon; - // make sure vanilla nametags don't display - DetachMessageID(0x5745504e); // WEPN - DetachMessageID(0x53494e56); // SINV - // also try with different endianness, just in case - DetachMessageID(0x4e504557); // WEPN - DetachMessageID(0x564e4953); // SINV // deathmatch stuff if ( !deathmatch ) return; - // forcibly strip these messages - // (I decided to drop MP support, so even though there are no - // actual spree/multikill announcements in this mod, keeping - // the vanilla ones out is important for graphical consistency) - DetachMessageID(0x4b535052); // KSPR - DetachMessageID(0x5250534b); - DetachMessageID(0x4d4b494c); // MKIL - DetachMessageID(0x4c494b4d); if ( teamplay ) { if ( teamactive.Size() != Teams.Size() ) teamactive.Resize(Teams.Size()); @@ -2008,13 +1542,48 @@ Class SWWMStatusBar : BaseStatusBar } private bool CheckFFBoundary( Line l ) { - if ( !hnd || !hnd.ffsectors.Size() ) return false; - int frontidx = hnd.ffsectors.Find(l.frontsector.Index()); - int backidx = hnd.ffsectors.Find(l.backsector.Index()); + int fcount = l.frontsector.Get3DFloorCount(), + bcount = l.backsector.Get3DFloorCount(); // no 3D floors, no boundary - if ( (frontidx == hnd.ffsectors.Size()) && (backidx == frontidx) ) - return false; - return true; + if ( !fcount && !bcount ) return false; + int fvalid = 0, bvalid = 0; + for ( int i=0; i= -1; p-- ) { - Line l = level.lines[i]; - if ( !(l.flags&Line.ML_MAPPED) && !level.allmap && !am_cheat ) continue; - if ( (l.flags&Line.ML_DONTDRAW) && ((am_cheat == 0) || (am_cheat >= 4)) ) - continue; - Vector2 rv1 = l.v1.p-cpos, rv2 = l.v2.p-cpos; - bool isportal = false; - Sector linesector; - if ( l.sidedef[0].flags&Side.WALLF_POLYOBJ ) linesector = level.PointInSector(l.v1.p+l.delta/2.); - else linesector = l.frontsector; - isportal = (linesector.portalgroup!=csec.portalgroup); - if ( isportal ) + if ( p == thisgroup ) continue; + foreach ( l : level.lines ) { - // portal displacement - Vector2 pofs = SWWMUtility.PortalDisplacement(csec,linesector); - rv1 -= pofs; - rv2 -= pofs; - } - Vector2 mid = (rv1+rv2)/2.; - Vector2 siz = (abs(rv1.x-rv2.x),abs(rv1.y-rv2.y))/2.; - if ( (((siz.x+zoomview)-abs(mid.x)) <= 0) || (((siz.y+zoomview)-abs(mid.y)) <= 0) ) - continue; - // flip Y - rv1.y *= -1; - rv2.y *= -1; - // rotate by view - rv1 = Actor.RotateVector(rv1,ViewRot.x-90); - rv2 = Actor.RotateVector(rv2,ViewRot.x-90); - // clip to frame - bool visible; - [visible, rv1, rv2] = SWWMUtility.LiangBarsky((-1,-1)*zoomclip,(1,1)*zoomclip,rv1,rv2); - if ( !visible ) continue; - // scale to minimap frame - rv1 *= (HALFMAPSIZE/zoomclip)*hs; - rv2 *= (HALFMAPSIZE/zoomclip)*hs; - // offset to minimap center - rv1 += basepos; - rv2 += basepos; - // get the line color - Color col = mm_wallcolor; - if ( (l.flags&Line.ML_MAPPED) || am_cheat ) - { - int secwit = CheckSecret(l); - int lock = SWWMUtility.GetLineLock(l); - if ( secwit == 1 ) col = mm_secretsectorcolor; - else if ( secwit == 2 ) col = mm_unexploredsecretcolor; - else if ( l.flags&Line.ML_SECRET ) + if ( !(l.flags&Line.ML_MAPPED) && !level.allmap && !am_cheat ) continue; + if ( (l.flags&Line.ML_DONTDRAW) && ((am_cheat == 0) || (am_cheat >= 4)) ) + continue; + Vector2 rv1 = l.v1.p-cpos, rv2 = l.v2.p-cpos; + int lgroup; + if ( l.sidedef[0].flags&Side.WALLF_POLYOBJ ) lgroup = level.PointInSector(l.v1.p+l.delta/2.).portalgroup; + else lgroup = l.frontsector.portalgroup; + bool isportal = ((numgroups>0)&&(lgroup!=thisgroup)); + if ( lgroup == p ) { - if ( am_cheat && l.backsector && mm_secretwallcolor ) - col = mm_secretwallcolor; - else col = mm_wallcolor; + // portal displacement + Vector2 pofs = level.GetDisplacement(lgroup,thisgroup); + rv1 += pofs; + rv2 += pofs; } - else if ( mm_interlevelcolor - && ((l.special == Exit_Normal) - || (l.special == Exit_Secret) - || (l.special == Teleport_NewMap) - || (l.special == Teleport_EndGame)) ) - col = mm_interlevelcolor; - else if ( mm_intralevelcolor && - (l.activation&SPAC_PlayerActivate) - && ((l.special == Teleport) - || (l.special == Teleport_NoFog) - || (l.special == Teleport_ZombieChanger) - || (l.special == Teleport_Line)) ) - col = mm_intralevelcolor; - else if ( mm_displaylocks - && (lock > 0) && (lock < 256) ) + else if ( (p != -1) || (lgroup != thisgroup) ) + continue; + Vector2 mid = (rv1+rv2)/2.; + Vector2 siz = (abs(rv1.x-rv2.x),abs(rv1.y-rv2.y))/2.; + if ( (((siz.x+zoomview)-abs(mid.x)) <= 0) || (((siz.y+zoomview)-abs(mid.y)) <= 0) ) + continue; + // flip Y + rv1.y *= -1; + rv2.y *= -1; + // rotate by view + rv1 = Actor.RotateVector(rv1,ViewRot.x-90); + rv2 = Actor.RotateVector(rv2,ViewRot.x-90); + // clip to frame + bool visible; + [visible, rv1, rv2] = SWWMUtility.LiangBarsky((-1,-1)*zoomclip,(1,1)*zoomclip,rv1,rv2); + if ( !visible ) continue; + // scale to minimap frame + rv1 *= (HALFMAPSIZE/zoomclip)*hs; + rv2 *= (HALFMAPSIZE/zoomclip)*hs; + // offset to minimap center + rv1 += basepos; + rv2 += basepos; + // get the line color + Color col = mm_wallcolor; + if ( (l.flags&Line.ML_MAPPED) || am_cheat ) { - let lcol = SWWMUtility.GetLockColor(lock); - if ( lcol ) col = lcol; - else col = mm_lockedcolor; - } - else if ( mm_specialwallcolor && ShowTriggerLine(l) ) - col = mm_specialwallcolor; - else if ( l.frontsector && l.backsector ) - { - if ( !CmpFloorPlanes(l) ) col = mm_fdwallcolor; - else if ( !CmpCeilingPlanes(l) ) col = mm_cdwallcolor; - else if ( CheckFFBoundary(l) ) col = mm_efwallcolor; - else + int secwit = CheckSecret(l); + int lock = SWWMUtility.GetLineLock(l); + if ( secwit == 1 ) col = mm_secretsectorcolor; + else if ( secwit == 2 ) col = mm_unexploredsecretcolor; + else if ( l.flags&Line.ML_SECRET ) { - if ( (am_cheat == 0) || (am_cheat >= 4) ) - continue; - col = mm_tswallcolor; + if ( am_cheat && l.backsector && mm_secretwallcolor ) + col = mm_secretwallcolor; + else col = mm_wallcolor; + } + else if ( mm_interlevelcolor + && ((l.special == Exit_Normal) + || (l.special == Exit_Secret) + || (l.special == Teleport_NewMap) + || (l.special == Teleport_EndGame)) ) + col = mm_interlevelcolor; + else if ( mm_intralevelcolor && + (l.activation&SPAC_PlayerActivate) + && ((l.special == Teleport) + || (l.special == Teleport_NoFog) + || (l.special == Teleport_ZombieChanger) + || (l.special == Teleport_Line)) ) + col = mm_intralevelcolor; + else if ( mm_displaylocks + && (lock > 0) && (lock < 256) ) + { + let lcol = SWWMUtility.GetLockColor(lock); + if ( lcol ) col = lcol; + else col = mm_lockedcolor; + } + else if ( mm_specialwallcolor && ShowTriggerLine(l) ) + col = mm_specialwallcolor; + else if ( l.frontsector && l.backsector ) + { + if ( !CmpFloorPlanes(l) ) col = mm_fdwallcolor; + else if ( !CmpCeilingPlanes(l) ) col = mm_cdwallcolor; + else if ( CheckFFBoundary(l) ) col = mm_efwallcolor; + else + { + if ( (am_cheat == 0) || (am_cheat >= 4) ) + continue; + col = mm_tswallcolor; + } } } + else col = mm_notseencolor; + // draw the line + if ( isportal ) + { + col = Color((col.r+mm_portalcolor.r*7)/8,(col.g+mm_portalcolor.g*7)/8,(col.b+mm_portalcolor.b*7)/8); + Screen.DrawThickLine(int(rv1.x),int(rv1.y),int(rv2.x),int(rv2.y),max(1.,hs*.25),col); + } + else Screen.DrawThickLine(int(rv1.x),int(rv1.y),int(rv2.x),int(rv2.y),max(1.,hs*.5),col); } - else col = mm_notseencolor; - // draw the line - if ( isportal ) - { - col = Color((col.r+mm_portalcolor.r*7)/8,(col.g+mm_portalcolor.g*7)/8,(col.b+mm_portalcolor.b*7)/8); - Screen.DrawThickLine(int(rv1.x),int(rv1.y),int(rv2.x),int(rv2.y),max(1.,hs*.25),col); - } - else Screen.DrawThickLine(int(rv1.x),int(rv1.y),int(rv2.x),int(rv2.y),max(1.,hs*.5),col); } } private void DrawMapMarkers( Vector2 basepos ) @@ -2159,7 +1735,7 @@ Class SWWMStatusBar : BaseStatusBar { isportal = true; // portal displacement - rv -= SWWMUtility.PortalDisplacement(csec,sec); + rv += level.GetDisplacement(sec.portalgroup,csec.portalgroup); } if ( (((radius+zoomview)-abs(rv.x)) <= 0) || (((radius+zoomview)-abs(rv.y)) <= 0) ) continue; @@ -2184,7 +1760,7 @@ Class SWWMStatusBar : BaseStatusBar { isportal = true; // portal displacement - rv -= SWWMUtility.PortalDisplacement(csec,sec); + rv += level.GetDisplacement(sec.portalgroup,csec.portalgroup); } if ( (((radius+zoomview)-abs(rv.x)) <= 0) || (((radius+zoomview)-abs(rv.y)) <= 0) ) continue; @@ -2256,7 +1832,7 @@ Class SWWMStatusBar : BaseStatusBar { isportal = true; // portal displacement - rv -= SWWMUtility.PortalDisplacement(csec,sec); + rv += level.GetDisplacement(sec.portalgroup,csec.portalgroup); // and blend in the color too col = Color((col.r+mm_portalcolor.r*7)/8,(col.g+mm_portalcolor.g*7)/8,(col.b+mm_portalcolor.b*7)/8); } @@ -2509,18 +2085,17 @@ Class SWWMStatusBar : BaseStatusBar klist.Push(k); } int maxcolc = (gameinfo.gametype&GAME_DOOMCHEX)?6:4; - for ( int i=0; i= keyflash[j].flashtime) ) continue; - double alph = max((keyflash[j].flashtime-(gametic+FracTic))/25.,0.)**1.5; + if ( !(k is f.got) ) continue; + if ( !f.flashtime || (gametic >= f.flashtime) ) continue; + double alph = max((f.flashtime-(gametic+FracTic))/25.,0.)**1.5; Screen.DrawTexture(icon,false,keypos.x-siz.x,keypos.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_TopLeft,true,DTA_ColorOverlay,0xFFFFC040,DTA_LegacyRenderStyle,STYLE_Add,DTA_Alpha,alph); break; } @@ -2738,9 +2313,9 @@ Class SWWMStatusBar : BaseStatusBar if ( checkowned ) { bool owned = false; - for ( int j=0; j storemsg; txt.Split(storemsg,"\n"); - for ( int i=0; i > available; // populate ammo production list - for ( int i=0; i)(AllActorClasses[i]); + let a = (Class)(cls); // skip over candy gun spares, they're "special ammo" if ( a == 'CandyGunSpares' ) continue; // only direct descendants of swwmammo with a set price below our max unit price @@ -151,11 +151,11 @@ Class AmmoFabricator : Inventory abstract bool comma = false; int tpertype = pertype; int ttotal = maxunits; - for ( int i=0; i)(AllActorClasses[i]); + let type = (class)(cls); if ( !type || (type.GetParentClass() != 'SWWMAmmo') ) continue; let ammoitem = Ammo(other.FindInventory(type)); int amount = GetDefaultByType(type).BackpackAmount*self.Amount; @@ -362,9 +362,9 @@ Class HammerspaceEmbiggener : Inventory } } // do the same for mag ammo, in a separate loop - for ( int i=0; i)(AllActorClasses[i]); + let type = (class)(cls); if ( !type || (type.GetParentClass() != 'MagAmmo') ) continue; let magitem = MagAmmo(other.FindInventory(type)); int amount = GetDefaultByType(type).BackpackAmount*self.Amount; diff --git a/zscript/items/swwm_baseammo.zsc b/zscript/items/swwm_baseammo.zsc index 3649beb31..24a5f7431 100644 --- a/zscript/items/swwm_baseammo.zsc +++ b/zscript/items/swwm_baseammo.zsc @@ -111,10 +111,10 @@ Class SWWMAmmo : Ammo // enumerate all subclasses Array > ammotypes; ammotypes.Clear(); - for ( int i=0; i)(AllActorClasses[i])); + if ( cls is GetParentAmmo() ) + ammotypes.Push((Class)(cls)); } // sort from largest to smallest qsort_ammotypes(ammotypes,0,ammotypes.Size()-1); @@ -122,12 +122,12 @@ Class SWWMAmmo : Ammo Inventory last = null; while ( amt > 0 ) { - for ( int i=0; i= def.Amount ) { - last = DoDrop(ammotypes[i]); + last = DoDrop(type); amt -= def.Amount; Amount -= def.Amount; break; @@ -149,10 +149,10 @@ Class SWWMAmmo : Ammo // enumerate all subclasses Array > ammotypes; ammotypes.Clear(); - for ( int i=0; i)(AllActorClasses[i])); + if ( cls is GetParentAmmo() ) + ammotypes.Push((Class)(cls)); } // sort from largest to smallest qsort_ammotypes(ammotypes,0,ammotypes.Size()-1); @@ -177,13 +177,13 @@ Class SWWMAmmo : Ammo continue; } } - for ( int i=0; i= def.Amount ) { double ang = FRandom[Junk](0,360); - last = DoDrop(ammotypes[i]); + last = DoDrop(type); last.SetOrigin(item.pos,false); last.vel.xy = AngleToVector(ang,FRandom[Junk](2,5)); excess -= def.Amount; @@ -252,10 +252,10 @@ Class SWWMAmmo : Ammo { Super.ModifyDropAmount(dropamount); int maxdrop = 1; - for ( int i=0; i)(AllActorClasses[i])); + if ( !(cls is GetParentAmmo()) ) continue; + let def = GetDefaultByType((Class)(cls)); maxdrop = max(maxdrop,def.amount); } Amount = Random[ShellDrop](1,clamp(dropamount,1,maxdrop)); @@ -393,10 +393,10 @@ Class MagAmmo : Inventory abstract // enumerate all subclasses Array > ammotypes; ammotypes.Clear(); - for ( int i=0; i)(AllActorClasses[i])); + if ( cls is GetParentMagAmmo() ) + ammotypes.Push((Class)(cls)); } // sort from largest to smallest qsort_ammotypes(ammotypes,0,ammotypes.Size()-1); @@ -415,13 +415,13 @@ Class MagAmmo : Inventory abstract continue; } // drop bullets otherwise - for ( int i=0; i= def.Amount ) { double ang = FRandom[Junk](0,360); - last = DoDrop(ammotypes[i]); + last = DoDrop(type); last.SetOrigin(item.pos,false); last.vel.xy = AngleToVector(ang,FRandom[Junk](2,5)); excess -= def.Amount; @@ -566,10 +566,10 @@ Class MagAmmo : Inventory abstract // enumerate all subclasses Array > ammotypes; ammotypes.Clear(); - for ( int i=0; i)(AllActorClasses[i])); + if ( cls is GetParentMagAmmo() ) + ammotypes.Push((Class)(cls)); } // sort from largest to smallest qsort_ammotypes(ammotypes,0,ammotypes.Size()-1); @@ -587,12 +587,12 @@ Class MagAmmo : Inventory abstract continue; } // drop bullets otherwise - for ( int i=0; i= def.Amount ) { - last = DoDrop(ammotypes[i]); + last = DoDrop(type); amt -= def.Amount; Amount -= def.Amount; break; @@ -606,10 +606,10 @@ Class MagAmmo : Inventory abstract { Super.ModifyDropAmount(dropamount); int maxdrop = 1; - for ( int i=0; i)(AllActorClasses[i])); + if ( !(cls is GetParentMagAmmo()) ) continue; + let def = GetDefaultByType((Class)(cls)); maxdrop = max(maxdrop,def.amount); } Amount = Random[ShellDrop](1,clamp(dropamount,1,maxdrop)); diff --git a/zscript/items/swwm_collectibles.zsc b/zscript/items/swwm_collectibles.zsc index cdf5ca277..9ce5be914 100644 --- a/zscript/items/swwm_collectibles.zsc +++ b/zscript/items/swwm_collectibles.zsc @@ -72,9 +72,9 @@ Class SWWMCollectible : Inventory abstract Super.AttachToOwner(other); // count how many we have, set progress accordingly int nc = 0, cnc = 0; - for ( int i=0; i)(AllActorClasses[i]); + let c = (Class)(cls); if ( !c || (c == 'SWWMCollectible') ) continue; let def = GetDefaultByType(c); // check that we can collect it in this IWAD diff --git a/zscript/items/swwm_collectibles_gesture.zsc b/zscript/items/swwm_collectibles_gesture.zsc index 414eabbf7..8b05ddf52 100644 --- a/zscript/items/swwm_collectibles_gesture.zsc +++ b/zscript/items/swwm_collectibles_gesture.zsc @@ -94,9 +94,9 @@ Class SayaBeanGesture : SWWMItemGesture let realbean = SayaBean(FindInventory("SayaBean")); if ( realbean && !realbean.callout && !Random[Gesture](0,3) ) { - for ( int i=0; i maxradius ) maxradius = v1len; @@ -1122,9 +1119,9 @@ Class Chancebox : Actor { Array > candidates; candidates.Clear(); - for ( int i=0; i)(AllActorClasses[i]); + let c = (Class)(cls); if ( !c || (c == 'SWWMCollectible') ) continue; let def = GetDefaultByType(c); // check that we can collect it in this IWAD @@ -1156,9 +1153,9 @@ Class Chancebox : Actor { // populate reward choices to randomize Array rewards; - for ( int i=0; i)(AllClasses[i]); + let cls = (Class)(cls); if ( !cls || cls.isAbstract() ) continue; let cr = ChanceboxReward(new(cls)); rewards.Push(cr); @@ -1213,9 +1210,9 @@ Class Chancebox : Actor SWWMCollectible c; while ( c = SWWMCollectible(ti.Next()) ) col++; int tcol = 0; - for ( int i=0; i)(AllActorClasses[i]); + let c = (Class)(cls); if ( !c || (c == 'SWWMCollectible') ) continue; let def = GetDefaultByType(c); // check that we can collect it in this IWAD diff --git a/zscript/items/swwm_powerups.zsc b/zscript/items/swwm_powerups.zsc index 282bd577c..73c203efe 100644 --- a/zscript/items/swwm_powerups.zsc +++ b/zscript/items/swwm_powerups.zsc @@ -313,9 +313,8 @@ Class GhostTarget : Actor if ( !master || (LastHeard == master) || !master.FindInventory("GhostPower") ) { let hnd = SWWMHandler(EventHandler.Find("SWWMHandler")); - if ( hnd ) for ( int i=0; i)(AllClasses[i]); + let t = DemolitionistMenuTab(new(deftabs[i])).Init(self); + t.Ticker(); + tabs.Push(t); + } + // custom tabs go before the help and secret tabs + foreach ( cls:AllClasses ) + { + let ct = (Class)(cls); if ( !ct || (ct.GetParentClass() != 'DemolitionistMenuTabCustom') ) continue; - tabs.Push(DemolitionistMenuTab(new(ct)).Init(self)); + let t = DemolitionistMenuTab(new(ct)).Init(self); + t.Ticker(); + tabs.Push(t); } for ( int i=deftabs.Size()-2; i saved = shnd.menustate.At("LastTab"); diff --git a/zscript/kbase/swwm_kbase_list.zsc b/zscript/kbase/swwm_kbase_list.zsc index a13730920..dd3884078 100644 --- a/zscript/kbase/swwm_kbase_list.zsc +++ b/zscript/kbase/swwm_kbase_list.zsc @@ -9,11 +9,11 @@ Class DemolitionistMenuList ui override void OnDestroy() { - for ( int i=0; i mw ) mw = cw; } return mw; @@ -31,8 +31,8 @@ Class DemolitionistMenuList ui // tick all items void Ticker() { - for ( int i=0; i)(AllClasses[i])); + if ( cls.isAbstract() || !(cls is 'MadcatGame') ) continue; + gamelist.Push((Class)(cls)); } bDirectInput = true; return Super.Init(master); @@ -30,9 +30,9 @@ Class DemolitionistGameTab : DemolitionistMenuTab // auto-add lore for kris let lore = SWWMLoreLibrary.Find(players[consoleplayer]); bool found = false; - for ( int i=0; i usesa, usesb; - for ( int i=0; i)(AllActorClasses[i]); + let w = (Class)(cls); if ( !w ) continue; let def = GetDefaultByType(w); if ( w is 'SWWMWeapon' ) @@ -95,9 +95,9 @@ Class DemolitionistInventoryTab : DemolitionistMenuTab pamoa = MagAmmo(a).ParentAmmo; pamob = MagAmmo(b).ParentAmmo; Class usesa, usesb; - for ( int i=0; i)(AllActorClasses[i]); + let w = (Class)(cls); if ( !w ) continue; let def = GetDefaultByType(w); if ( w is 'SWWMWeapon' ) @@ -254,32 +254,32 @@ Class DemolitionistInventoryTab : DemolitionistMenuTab i--; } // check if new entries must be added - for ( Inventory i=players[consoleplayer].mo.inv; i; i=i.inv ) + for ( Inventory inv=players[consoleplayer].mo.inv; inv; inv=inv.inv ) { - if ( FilterInventory(i) ) continue; + if ( FilterInventory(inv) ) continue; // skip if it's already there bool skipme = false; - for ( int j=0; j tag2 ) continue; greater = true; - invlist.items.Insert(j,new("DemolitionistMenuInvItem").Init(master,i)); + invlist.items.Insert(j,new("DemolitionistMenuInvItem").Init(master,inv)); mustsort = true; break; } if ( greater ) continue; - invlist.items.Push(new("DemolitionistMenuInvItem").Init(master,i)); + invlist.items.Push(new("DemolitionistMenuInvItem").Init(master,inv)); mustsort = true; } } @@ -299,11 +299,11 @@ Class DemolitionistInventoryTab : DemolitionistMenuTab int maxw = invlist.GetWidth(); int xx = 0; int yy = 0; - for ( int i=0; i (master.ws.y-62) ) { diff --git a/zscript/kbase/swwm_kbasetab_library.zsc b/zscript/kbase/swwm_kbasetab_library.zsc index a32f4780c..6a838e386 100644 --- a/zscript/kbase/swwm_kbasetab_library.zsc +++ b/zscript/kbase/swwm_kbasetab_library.zsc @@ -57,11 +57,10 @@ Class DemolitionistLibraryTab : DemolitionistMenuTab lists[i].master = master; } loresz = lore.ent.Size(); - for ( int i=0; i 0 ) w -= 8; - for ( int i=0; i 0 ) w -= 8; int len[4], maxlen[4]; for ( int i=0; i<4; i++ ) maxlen[i] = 0; - for ( int i=0; i 0 ) w -= 8; - for ( int i=0; i i ) invlist[bSell].selected = max(0,invlist[bSell].selected-1); i--; } - for ( int i=0; i)(AllActorClasses[i]); + let type = (Class)(cls); if ( !type ) continue; let cur = players[consoleplayer].mo.FindInventory(type); let inv = GetDefaultByType(type); if ( FilterStore(type,cur,inv) ) continue; // skip if it's already there bool skipme = false; - for ( int j=0; j maxw ) maxw = fw; } int xx = 0; int yy = 0; - for ( int i=0; i (master.ws.y-62) ) { @@ -478,9 +478,9 @@ Class DemolitionistMenuStoreItem : DemolitionistMenuListItem if ( bSell ) maxamt = cur.Amount; // we can sell ALL our ammo else maxamt = cur?(cur.MaxAmount-cur.Amount):def.MaxAmount; // get the largest affordable child pickup amount (that we need, or we can sell) - for ( int j=0; j)(AllActorClasses[j]); + let inv2 = (Class)(cls); if ( !inv2 || (inv2.GetParentClass() != inv) ) continue; let def2 = GetDefaultByType(inv2); int cprice = int(abs(def.Stamina)*(1.+.75*(def2.Amount-1))); @@ -496,9 +496,9 @@ Class DemolitionistMenuStoreItem : DemolitionistMenuListItem // never bought, only sold int maxamt = cur.Amount; // get the largest affordable child pickup amount (that we can sell) - for ( int j=0; j)(AllActorClasses[j]); + let inv2 = (Class)(cls); if ( !inv2 || (inv2.GetParentClass() != inv) ) continue; let def2 = GetDefaultByType(inv2); int cprice = int(abs(def.Stamina)*(1.+.75*(def2.Amount-1))); diff --git a/zscript/menu/swwm_achievementmenu.zsc b/zscript/menu/swwm_achievementmenu.zsc index b5edd07f8..0fdda5b7c 100644 --- a/zscript/menu/swwm_achievementmenu.zsc +++ b/zscript/menu/swwm_achievementmenu.zsc @@ -55,10 +55,10 @@ Class SWWMAchievementMenu : GenericMenu // recalculate counters completed = 0; incomplete = 0; - for ( int i=0; i sorted; GetSortedPlayers(sorted,teamplay); - for ( int j=0; j 0) || (a.tics == -1) || !(a.bISMONSTER || a.player) || !a.IsHostile(Owner) ) continue; // check if we can see it if ( !SWWMUtility.InPlayerFOV(Owner.player,a) ) continue; @@ -124,9 +123,9 @@ Class SWWMGesture : SWWMWeapon { // already gesturing // queue if unique - for ( int i=0; i hits; hits.Clear(); int rings = 1; @@ -351,11 +350,11 @@ Class SWWMGesture : SWWMWeapon LineTrace(atan2(dir.y,dir.x),8000.,asin(-dir.z),TRF_ABSPOSITION,origin.z,origin.x,origin.y,d); if ( d.HitType != TRACE_HitActor ) continue; bool addme = true; - for ( int k=0; k 0 ); - for ( int i=0; i 0 ); - for ( int i=0; i 0 ); - for ( int i=0; i)(AllActorClasses[i]); + let type = (class)(cls); if ( !type || type.IsAbstract() || (type.GetParentClass() != 'SWWMAmmo') ) continue; let ammoitem = Ammo(FindInventory(type)); if ( !ammoitem ) @@ -383,9 +383,9 @@ Class Demolitionist : PlayerPawn void CheatGive_Armor() { // only give armors that have spares associated - for ( int i=0; i)(AllActorClasses[i]); + let type = (Class)(cls); if ( !type || type.IsAbstract() || (type == 'SWWMSpareArmor') ) continue; if ( GetReplacement(type) != type ) continue; let def = GetDefaultByType(type); @@ -400,9 +400,9 @@ Class Demolitionist : PlayerPawn } void CheatGive_Keys() { - for ( int i=0; i)(AllActorClasses[i]); + let type = (Class)(cls); if ( !type ) continue; let keyitem = GetDefaultByType(type); if ( !keyitem.special1 ) continue; @@ -424,9 +424,9 @@ Class Demolitionist : PlayerPawn void CheatGive_Weapons() { let savedpending = player.PendingWeapon; - for ( int i=0; i)(AllActorClasses[i]); + let type = (class)(cls); if ( !type || (type == "Weapon") ) continue; // Don't give already owned weapons let owned = FindInventory(type); @@ -446,9 +446,9 @@ Class Demolitionist : PlayerPawn } void CheatGive_Artifacts( int amount = 0 ) { - for ( int i=0; i)(AllActorClasses[i]); + let type = (class)(cls); if ( !type ) continue; let rep = GetReplacement(type); // don't give replaced items @@ -470,9 +470,9 @@ Class Demolitionist : PlayerPawn } void CheatGive_PuzzlePieces( int amount = 0 ) { - for ( int i=0; i)(AllActorClasses[i]); + let type = (class)(cls); if ( !type ) continue; let def = GetDefaultByType(type); if ( !def.Icon.isValid() ) continue; @@ -481,14 +481,14 @@ Class Demolitionist : PlayerPawn } void CheatGive_Collectibles() { - for ( int i=0; i)(AllActorClasses[i]); + let type = (class)(cls); if ( !type || (type == 'SWWMCollectible') ) continue; let def = GetDefaultByType(type); // check that we can collect it in this IWAD if ( !def.ValidGame() ) continue; - let item = Inventory(Spawn(AllActorClasses[i])); + let item = Inventory(Spawn(cls)); SWWMCollectible(item).propagated = true; // no score or anims if ( !item.CallTryPickup(self) ) item.Destroy(); } @@ -731,16 +731,15 @@ Class Demolitionist : PlayerPawn do { found = 0; - for ( int i=0; i 0 ); - for ( int i=0; i 0 ); - for ( int i=0; i 0 ); - for ( int i=0; i= p.Lines.Size() ) continue; + if ( p.Lines.Find(l) >= p.Lines.Size() ) continue; Vector2 diragainst = pos.xy-p.GetPos(); double vsiz = diragainst.length(); if ( vsiz > 0 ) diragainst /= vsiz; @@ -2060,7 +2055,7 @@ Class Demolitionist : PlayerPawn { double fs = TweakSpeed(); Vector3 x, y, z; - [x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll); + [x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll); Vector3 accel; if ( (player.cmd.upmove == -32768) || sendtoground ) { @@ -2107,6 +2102,7 @@ Class Demolitionist : PlayerPawn if ( isdashing ) player.cmd.forwardmove = player.cmd.sidemove = 0; if ( bFly && !bFlyCheat && !(player.cheats&CF_NOCLIP2) ) { + player.cheats &= ~CF_SCALEDNOLERP; // we cannot permit this flag here player.onground = false; if ( player.turnticks ) { @@ -2131,7 +2127,7 @@ Class Demolitionist : PlayerPawn if ( player.cmd.buttons&BT_CROUCH ) jcmove -= 4096.; if ( CanCrouch() && (player.crouchfactor != -1) ) fs *= player.crouchfactor; Vector3 x, y, z; - [x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll); + [x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll); Vector2 nmove = NormalizedMove(); Vector3 accel = x*nmove.x-y*nmove.y+z*jcmove; accel *= fs/320.; @@ -2151,6 +2147,7 @@ Class Demolitionist : PlayerPawn } else { + player.cheats |= CF_SCALEDNOLERP; // smoother turning if ( player.turnticks ) { player.turnticks--; @@ -2256,7 +2253,7 @@ Class Demolitionist : PlayerPawn if ( !(player.cheats & CF_PREDICTING) && !(player.cmd.forwardmove|player.cmd.sidemove) ) PlayIdle(); Vector3 dodge = (0,0,0), x, y, z; - [x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll); + [x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll); int fm = player.cmd.forwardmove; int sm = player.cmd.sidemove; if ( !(fm|sm) ) fm = 1; @@ -3186,7 +3183,7 @@ Class Demolitionist : PlayerPawn } // notify key obtained to flash icon if ( item is 'Key' ) - Console.MidPrint(null,"swwmkeyget."..item.GetClassName()); + EventHandler.SendInterfaceEvent(consoleplayer,"swwmkeyget."..item.GetClassName(),PlayerNumber()); } override bool UseInventory( Inventory item ) { diff --git a/zscript/swwm_statichandler.zsc b/zscript/swwm_statichandler.zsc index 71b75f61a..5167292fa 100644 --- a/zscript/swwm_statichandler.zsc +++ b/zscript/swwm_statichandler.zsc @@ -31,7 +31,7 @@ Class SWWMStaticHandler : StaticEventHandler // for intermissions, to prevent repetition ui Array lasttip, lastart; // stupid dumb thing - ui int aprcheck; + ui bool aprilfools; ui Font aprfnt; override void NewGame() @@ -51,7 +51,11 @@ Class SWWMStaticHandler : StaticEventHandler override void WorldTick() { - if ( mttics > 0 ) mttics--; + if ( mttics > 0 ) + { + mttics--; + if ( mttics == 0 ) EventHandler.SendInterfaceEvent(consoleplayer,"swwmmaptitle"); + } maptime++; // in case we start late? if ( multiplayer && !mpwarned ) @@ -68,7 +72,7 @@ Class SWWMStaticHandler : StaticEventHandler while ( t = sti.Next() ) stinkers.Push(t); if ( stinkers.Size() > 0 ) { - for ( int i=0; i= 1. ) mmz = 1.; else mmz = .5; CVar.FindCVar('swwm_mm_zoom').SetFloat(mmz); + EventHandler.SendInterfaceEvent(consoleplayer,"swwmaprcheck"); if ( !e.IsSaveGame ) return; // save version checker tainted = false; @@ -138,10 +143,10 @@ Class SWWMStaticHandler : StaticEventHandler lst.Clear(); String dat = Wads.ReadLump(lmp); dat.Split(lst,"\n",0); - for ( int i=0; i cvarlist; SWWMUtility.GetCVars(cvarlist); - for ( int i=0; i cvarlist; SWWMUtility.GetCVars(cvarlist); - for ( int i=0; i cvarlist; SWWMUtility.GetCVars(cvarlist); - for ( int i=0; i > sdefs; - for ( int i=0; i)(cls)):StaticEventHandler.Find((Class)(cls)); @@ -354,25 +378,25 @@ Class SWWMStaticHandler : StaticEventHandler bool skipme = true; Console.Printf("[default]"); bool fail = false; - for ( int i=0; i 4 ) + BrokenLines bl = f.BreakLines(line,220); + if ( bl.Count() > 4 ) { - Console.Printf("\cg%s [%d]\c-",lst[i].Left(st-4),l.Count()); + Console.Printf("\cg%s [%d]\c-",l.Left(st-4),bl.Count()); fail = true; } - l.Destroy(); + bl.Destroy(); } if ( !fail ) Console.Printf("ALL OK"); lmp = Wads.FindLumpFullName("language.es_dlg"); @@ -381,25 +405,25 @@ Class SWWMStaticHandler : StaticEventHandler dat.Split(lst,"\n",0); skipme = true; Console.Printf("[es]"); - for ( int i=0; i 4 ) + BrokenLines bl = f.BreakLines(line,220); + if ( bl.Count() > 4 ) { - Console.Printf("\cg%s [%d]\c-",lst[i].Left(st-4),l.Count()); + Console.Printf("\cg%s [%d]\c-",l.Left(st-4),bl.Count()); fail = true; } - l.Destroy(); + bl.Destroy(); } if ( !fail ) Console.Printf("ALL OK"); } @@ -437,13 +461,6 @@ Class SWWMStaticHandler : StaticEventHandler { if ( !uid ) EventHandler.SendNetworkEvent("swwmsessionid",SystemTime.Now()); if ( gamestate != GS_TITLELEVEL ) titlefirst = true; // we skip it - if ( !aprcheck && (gamestate == GS_LEVEL) ) - { - aprfnt = Font.GetFont("TewiFontOutline"); - aprcheck = 1; - if ( SystemTime.Format("%d%m",SystemTime.Now()) == "0104" ) - aprcheck = 2; - } if ( (gametic > 0) && !(gametic%GameTicRate) ) { let pt = CVar.FindCVar('swwm_playtime'); @@ -451,8 +468,6 @@ Class SWWMStaticHandler : StaticEventHandler pt.SetInt(ct+1); } if ( gamestate != GS_LEVEL ) return; - if ( (mttics == 1) && swwm_showmaptitle ) - StatusBar.AttachMessage(new("DSMapTitle").Init(),-7777); CheckAllAchievements(); if ( gametic != checktic ) return; String cver = StringTable.Localize("$SWWM_SHORTVER"); diff --git a/zscript/swwm_thinkers.zsc b/zscript/swwm_thinkers.zsc index 936472b1f..ee681a485 100644 --- a/zscript/swwm_thinkers.zsc +++ b/zscript/swwm_thinkers.zsc @@ -186,9 +186,9 @@ Class SWWMCachedLockInfo : SWWMStaticThinker let ti = ThinkerIterator.Create("SWWMCachedLockInfo",STAT_STATIC); SWWMCachedLockInfo cli = SWWMCachedLockInfo(ti.Next()); if ( !cli ) return false; - for ( int i=0; i which ) { - for ( int i=0; i mvictim = SWWMUtility.MergeMonster(hnd,victim.GetClass()); bool found = false; - for ( int i=0; i)(AllActorClasses[i]); + let c = (Class)(cls); if ( !c || (c == 'SWWMCollectible') ) continue; let def = GetDefaultByType(c); // skip if we match and it's not for this game @@ -548,9 +548,9 @@ Class SWWMLoreLibrary : SWWMStaticThinker text = "SWWM_LORETXT_ZANAVETH32"; // iagb happened } // check if existing - for ( int i=0; i wpn; tt.Split(wpn,","); - for ( int i=0; i= 10) && (l.special <= 13)) || (!part && (l.special >= 20) && (l.special <= 25)) @@ -929,9 +935,8 @@ Class SWWMUtility static play String GetFunTag( SWWMHandler hnd, Actor a, String defstr = "" ) { // look up fun tag services if available - for ( int i=0; i demo.lastbang+30) && (!hnd || (gametic > hnd.lastcombat+10)) && !Random[DemoLines](0,1) ) - demo.lastbang = SWWMHandler.AddOneLiner("blast",2,10); - } - return nhit, nkill; - } int thisgroup = Source.CurSector.portalgroup; - for ( int i=0; i demo.lastbang+30) && (gametic > hnd.lastcombat+10) && !Random[DemoLines](0,1) ) + if ( hnd && (gametic > demo.lastbang+30) && (gametic > hnd.lastcombat+10) && !Random[DemoLines](0,1) ) demo.lastbang = SWWMHandler.AddOneLiner("blast",2,10); } return nhit, nkill; @@ -1536,9 +1531,9 @@ Class SWWMUtility static play Class MergeMonster( SWWMHandler hnd, Class a ) { // see if any services can resolve this first + foreach ( sv:hnd.mergemonstersv ) for ( int i=0; i list; list.Clear(); dat.Split(list,"\n"); - for ( int i=0; i type, int amount ) { AmmoBuffer b; - for ( int i=0; i type, int amount ) { AmmoBuffer b; - for ( int i=0; i type ) { int cnt = 0; - for ( int i=0; i type ) { int cnt = 0; - for ( int i=0; i impactclass ) { Vector3 x, y, z, dir; - [x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll); + [x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll); Vector3 origin = Vec2OffsetZ(0,0,player.viewz); if ( !invoker.mt ) invoker.mt = new("MeleeTracer"); let mt = invoker.mt; // for convenience @@ -408,38 +408,38 @@ extend Class SWWMWeapon int quakin = raging?8:2; double diff = 0.; bool hdoomgal = false; - for ( int i=0; i 0) && !mt.hits[i].a.bNOBLOOD && !mt.hits[i].a.bDORMANT && (raging || !mt.hits[i].a.bINVULNERABLE) ) + if ( hit.a.player ) hit.a.A_QuakeEx(quakin,quakin,quakin,6,0,1,"",QF_RELATIVE|QF_SCALEDOWN|QF_3D,rollIntensity:.125*quakin); + if ( (newdmg > 0) && !hit.a.bNOBLOOD && !hit.a.bDORMANT && (raging || !hit.a.bINVULNERABLE) ) { - mt.hits[i].a.TraceBleed(newdmg,invoker); - mt.hits[i].a.SpawnBlood(mt.hits[i].pos,atan2(mt.hits[i].dir.y,mt.hits[i].dir.x)+180,newdmg); + hit.a.TraceBleed(newdmg,invoker); + hit.a.SpawnBlood(hit.pos,atan2(hit.dir.y,hit.dir.x)+180,newdmg); } else if ( impactclass ) { - let p = Spawn(raging?(Class)("BigPunchImpact"):impactclass,mt.hits[i].pos); - p.angle = atan2(mt.hits[i].dir.y,mt.hits[i].dir.x); + let p = Spawn(raging?(Class)("BigPunchImpact"):impactclass,hit.pos); + p.angle = atan2(hit.dir.y,hit.dir.x); } - if ( (flags&MELEE_HammerHit) && (mt.hits[i].a.Health <= mt.hits[i].a.GetGibHealth()) ) + if ( (flags&MELEE_HammerHit) && (hit.a.Health <= hit.a.GetGibHealth()) ) SWWMUtility.AchievementProgressInc("dab",1,player); } if ( raging ) { - let ps = Spawn("BigPunchSplash",mt.hits[i].pos); + let ps = Spawn("BigPunchSplash",hit.pos); ps.target = self; ps.special1 = dmg; } @@ -496,22 +496,22 @@ extend Class SWWMWeapon ut.uses.Clear(); ut.Trace(origin,level.PointInSector(origin.xy),dir,DEFMELEERANGE*rangemul,0); invoker.wallponch = true; - for ( int i=0; i invoker.preload ) return; - Vector3 x, y, z, x2, y2, z2, dir; - [x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x); + Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*SWWMUtility.Vec3FromAngles(angle,pitch)); // try to catch target in cone of vision - [x2, y2, z2] = swwm_CoordUtil.GetAxes(pitch,angle,roll); + Vector3 x, y, z, dir; + [x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll); Array hits; hits.Clear(); int rings = 1; @@ -228,7 +227,7 @@ Class Hellblazer : SWWMWeapon { for ( int j=0; j<360; j+=(360/rings) ) { - dir = SWWMUtility.ConeSpread(x2,y2,z2,j,i); + dir = SWWMUtility.ConeSpread(x,y,z,j,i); LineTrace(atan2(dir.y,dir.x),8000.,asin(-dir.z),TRF_ABSPOSITION,origin.z,origin.x,origin.y,d); if ( d.HitType != TRACE_HitActor ) continue; if ( (d.HitActor == invoker.seektarget[0]) @@ -241,7 +240,7 @@ Class Hellblazer : SWWMWeapon for ( int k=0; k maxlen) || (spreadtimer < stamina) ) @@ -1491,20 +1488,20 @@ Class YnykronLightningArc : SWWMNonInteractiveActor let t = new("CandyBeamTracer"); t.hitlist.Clear(); Vector3 x, y, z; - [x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll); + [x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll); t.ShootThroughList.Clear(); t.Trace(pos,CurSector,x,speed,TRACE_HitSky); - for ( int i=0; i floorz) && TestMobjZ() ) wnorm *= 2.4; SWWMUtility.DoKnockback(self,wnorm.unit(),wnorm.length()*5000000.); } - for ( int i=0; i 0 ) tics--; if ( !SetState(CurState.NextState) ) @@ -1022,39 +1022,39 @@ Class BiosparkBeam : SWWMNonInteractiveActor let t = new("BiosparkTracer"); t.hitlist.Clear(); t.ignoreme = target; - Vector3 x, y, z; - [x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll); + Vector3 x = SWWMUtility.Vec3FromAngles(angle,pitch); t.ShootThroughList.Clear(); t.Trace(pos,CurSector,x,speed,TRACE_HitSky); - for ( int i=0; i 1) && !Random[Sparkster](0,3) ) { Vector3 x, y, z; - [x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll); + [x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll); for ( int i=0; i WallPenetrateList; Vector3 exitpoint; - transient Array ffloors; // needs to be done like this because HAHA SCOPE override ETraceStatus TraceCallback() { @@ -100,11 +99,12 @@ Class SilverBulletTracer : SpreadgunTracer // double-check if we're piercing through a 3D floor (yes this is a thing that happens, oh boy) Sector s = level.PointInSector(ofs.xy); bool stop3d = false; - for ( int j=0; j maxz) ) continue; stop3d = true; break; @@ -287,72 +287,72 @@ Class SilverBullet : SWWMWeapon action void ProcessTraceHit( SilverBulletTracer t, Vector3 origin, Vector3 dir ) { - for ( int i=0; i 0) && t.HitList[i].HitActor && !t.HitList[i].HitActor.bNOBLOOD && !t.HitList[i].HitActor.bDORMANT ) + if ( (dmg > 0) && hit.HitActor && !hit.HitActor.bNOBLOOD && !hit.HitActor.bDORMANT ) { - t.HitList[i].HitActor.TraceBleed(dmg,self); - t.HitList[i].HitActor.SpawnBlood(t.HitList[i].HitLocation,atan2(t.HitList[i].x.y,t.HitList[i].x.x)+180,dmg); - t.HitList[i].HitActor.A_StartSound("silverbullet/flesh",CHAN_DAMAGE,CHANF_OVERLAP,1.,2.); - let p = Spawn("SilverImpact",t.HitList[i].HitLocation); + hit.HitActor.TraceBleed(dmg,self); + hit.HitActor.SpawnBlood(hit.HitLocation,atan2(hit.x.y,hit.x.x)+180,dmg); + hit.HitActor.A_StartSound("silverbullet/flesh",CHAN_DAMAGE,CHANF_OVERLAP,1.,2.); + let p = Spawn("SilverImpact",hit.HitLocation); p.special1 = 1; p.target = self; p.master = invoker; - p.bAMBUSH = t.HitList[i].pastwall; + p.bAMBUSH = hit.pastwall; } else { - let p = Spawn("SilverImpact",t.HitList[i].HitLocation); - p.angle = atan2(t.HitList[i].x.y,t.HitList[i].x.x)+180; - p.pitch = asin(t.HitList[i].x.z); + let p = Spawn("SilverImpact",hit.HitLocation); + p.angle = atan2(hit.x.y,hit.x.x)+180; + p.pitch = asin(hit.x.z); p.target = self; p.master = invoker; - p.bAMBUSH = t.HitList[i].pastwall; + p.bAMBUSH = hit.pastwall; } } LineTracer faketracer = new("LineTracer"); - for ( int i=0; i 2) && (s.silveregg%2) && player == players[consoleplayer] ) - Console.MidPrint(null,"swwmsilverbulleteasteregg"..((s.silveregg-1)/2)); + if ( (s.silveregg > 2) && (s.silveregg%2) && (player == players[consoleplayer]) ) + EventHandler.SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_WASTE1+(((s.silveregg-1)/2)-1)); } action void A_DropMag() { @@ -627,7 +616,7 @@ Class SilverBullet : SWWMWeapon invoker.ClipCount = 0; if ( swwm_nomagdrop ) return; Vector3 x, y, z; - [x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll); + [x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll); Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),6*x-15*z); let c = Spawn("SilverBulletMag",origin); c.angle = angle; @@ -639,7 +628,7 @@ Class SilverBullet : SWWMWeapon { invoker.specialf1 -= .06; Vector3 x, y, z; - [x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll); + [x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll); vel += x*min(1.,invoker.specialf1)*(600./Mass); A_OverlayAlpha(PSP_WEAPON+1,clamp(invoker.specialf1*3.,0.,1.)); if ( Random[SilverBullet](0,int(invoker.specialf1*2)) )