diff --git a/cvarinfo.txt b/cvarinfo.txt index f6e89a23f..e82cff41f 100644 --- a/cvarinfo.txt +++ b/cvarinfo.txt @@ -147,7 +147,6 @@ server noarchive bool swwm_iseriouslywanttoplaythiswithbd = false; // self-expla nosave int swwm_playtime = 0; // total playtime in seconds // cross-session achievement cvars (0: locked, 1: unlocked, 2: notified) -nosave int swwm_achievement_abort = 0; nosave int swwm_achievement_acid = 0; nosave int swwm_achievement_allcoll = 0; nosave int swwm_achievement_allitems = 0; @@ -163,7 +162,6 @@ nosave int swwm_achievement_brake = 0; nosave int swwm_achievement_bune = 0; nosave int swwm_achievement_bustin = 0; nosave int swwm_achievement_butts = 0; -nosave int swwm_achievement_cheat = 0; nosave int swwm_achievement_cliffyb = 0; nosave int swwm_achievement_clonk = 0; nosave int swwm_achievement_conga = 0; diff --git a/language.version b/language.version index 7b25699bd..0656e642c 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r451 \cu(Fri 23 Apr 23:25:43 CEST 2021)\c-"; -SWWM_SHORTVER="\cw0.9.11b-pre r451 \cu(2021-04-23 23:25:43)\c-"; +SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r452 \cu(Sat 24 Apr 16:00:14 CEST 2021)\c-"; +SWWM_SHORTVER="\cw0.9.11b-pre r452 \cu(2021-04-24 16:00:14)\c-"; diff --git a/zscript/handler/swwm_handler_worldthings.zsc b/zscript/handler/swwm_handler_worldthings.zsc index b5c248e05..43f03087c 100644 --- a/zscript/handler/swwm_handler_worldthings.zsc +++ b/zscript/handler/swwm_handler_worldthings.zsc @@ -8,6 +8,9 @@ extend Class SWWMHandler // attempt to optimize Ynykron singularity suction Array suckableactors; + // for displaying beam-type projectiles + Array beams; + override void WorldThingRevived( WorldEvent e ) { if ( profiling ) curms = MSTime(); @@ -210,19 +213,19 @@ extend Class SWWMHandler override void WorldThingDestroyed( WorldEvent e ) { if ( profiling ) curms = MSTime(); - if ( !e.Thing.default.bSHOOTABLE && !e.Thing.default.bMISSILE && !(e.Thing is 'Inventory') ) + if ( !e.Thing.default.bSHOOTABLE && !e.Thing.default.bMISSILE && !(e.Thing is 'Inventory') && !SWWMUtility.IsBeamProj(e.Thing) ) { if ( profiling ) worldthingdestroyed_ms += MSTime()-curms; return; } // remove from suckables int pos = suckableactors.Find(e.Thing); - if ( pos >= suckableactors.Size() ) - { - if ( profiling ) worldthingdestroyed_ms += MSTime()-curms; - return; - } - suckableactors.Delete(pos); + if ( pos < suckableactors.Size() ) + suckableactors.Delete(pos); + // remove from beams + pos = beams.Find(e.Thing); + if ( pos < beams.Size() ) + beams.Delete(pos); if ( profiling ) worldthingdestroyed_ms += MSTime()-curms; } @@ -370,6 +373,8 @@ extend Class SWWMHandler // Ynykron vortex optimization (faster than a thinker iterator) if ( e.Thing.bSHOOTABLE || SWWMUtility.ValidProjectile(e.Thing) || (e.Thing is 'Inventory') ) SuckableActors.Push(e.Thing); + else if ( SWWMUtility.IsBeamProj(e.Thing) ) + Beams.Push(e.Thing); // vanilla blood color changes if ( (e.Thing.GetClass() == "BaronOfHell") || (e.Thing.GetClass() == "HellKnight") || (e.Thing.GetClass() == "Bishop") || (e.Thing.GetClass() == "Korax") ) { diff --git a/zscript/handler/swwm_handler_worldtick.zsc b/zscript/handler/swwm_handler_worldtick.zsc index 541f4aedf..fcee9f09e 100644 --- a/zscript/handler/swwm_handler_worldtick.zsc +++ b/zscript/handler/swwm_handler_worldtick.zsc @@ -255,6 +255,18 @@ extend Class SWWMHandler continue; SWWMSimpleTracker.Track(a); } + for ( int i=0; i viewdist ) + continue; + if ( !thesight && !(a.target && a.target.IsFriend(players[consoleplayer].mo)) && !players[consoleplayer].Camera.CheckSight(a,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) + continue; + SWWMSimpleTracker.Track(a); + } if ( swwm_mm_portaloverlay && (psectors.Size() > 1) ) { // oh boy here we go @@ -299,6 +311,18 @@ extend Class SWWMHandler continue; SWWMSimpleTracker.Track(a); } + for ( int i=0; i viewdist ) + continue; + if ( !thesight && !(a.target && a.target.IsFriend(players[consoleplayer].mo)) && !players[consoleplayer].Camera.CheckSight(a,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) + continue; + SWWMSimpleTracker.Track(a); + } } } SWWMSimpleTracker trk = strackers; diff --git a/zscript/hud/swwm_hud.zsc b/zscript/hud/swwm_hud.zsc index c80f20867..c903f18cb 100644 --- a/zscript/hud/swwm_hud.zsc +++ b/zscript/hud/swwm_hud.zsc @@ -1362,7 +1362,7 @@ Class SWWMStatusBar : BaseStatusBar { pos = t.target.prev.xy*(1.-FracTic)+t.target.pos.xy*FracTic; angle = t.target.angle; - radius = t.target.radius; + radius = t.isbeam?(t.target.speed*cos(t.target.pitch)):t.target.radius; } else { @@ -1408,7 +1408,14 @@ Class SWWMStatusBar : BaseStatusBar continue; Vector2 tv[4]; int nidx; - if ( isitem ) + if ( t.isbeam ) + { + // oriented line + nidx = 2; + tv[0] = rv; + tv[1] = rv+Actor.RotateVector((radius,0),angle); + } + else if ( isitem ) { // rhombus nidx = 4; @@ -1460,6 +1467,7 @@ Class SWWMStatusBar : BaseStatusBar if ( drawn ) { double alph = clamp(((t.lastupdate+mtime)-level.maptime)/35.,0.,1.); + if ( t.isbeam ) alph *= t.target?(t.target.alpha/t.target.default.alpha):0.; double theta = clamp(5.*FrameTime,0.,1.); t.smoothalpha = t.smoothalpha*(1.-theta)+alph*theta; } diff --git a/zscript/swwm_thinkers_hud.zsc b/zscript/swwm_thinkers_hud.zsc index 338e28e34..2399ce78f 100644 --- a/zscript/swwm_thinkers_hud.zsc +++ b/zscript/swwm_thinkers_hud.zsc @@ -486,6 +486,7 @@ Class SWWMSimpleTracker : Thinker bool vipitem; bool expired; bool ismissile; + bool isbeam; int lastupdate; ui double smoothalpha; // smoothened alpha, for ui SWWMSimpleTracker prev, next; @@ -493,7 +494,8 @@ Class SWWMSimpleTracker : Thinker void Update() { if ( !target ) return; - radius = target.radius; + isbeam = SWWMUtility.IsBeamProj(target); + radius = isbeam?(target.speed*cos(target.pitch)):target.radius; angle = target.angle; pos = target.pos; isplayer = target.player; @@ -502,7 +504,7 @@ Class SWWMSimpleTracker : Thinker friendly = target.IsFriend(players[consoleplayer].mo); countkill = target.bCOUNTKILL; shootable = target.default.bSHOOTABLE; - ismissile = target.default.bMISSILE; + ismissile = isbeam||target.default.bMISSILE; isitem = (target is 'Inventory'); countitem = SWWMUtility.IsScoreItem(target); vipitem = SWWMUtility.IsVipItem(target); @@ -545,7 +547,7 @@ Class SWWMSimpleTracker : Thinker lastupdate += 70; } } - else if ( ismissile ) + else if ( ismissile && !isbeam ) expired = !target.bMISSILE; else if ( target.default.bSHOOTABLE ) expired = (target.Health<=0); diff --git a/zscript/utility/swwm_utility.zsc b/zscript/utility/swwm_utility.zsc index fcced994c..740aca54f 100644 --- a/zscript/utility/swwm_utility.zsc +++ b/zscript/utility/swwm_utility.zsc @@ -1164,6 +1164,20 @@ Class SWWMUtility return false; } + // Is this a beam projectile? (speed = length) + static play bool IsBeamProj( Actor a ) + { + if ( a is 'SaltBeam' ) return true; + if ( a is 'BiosparkBeam' ) return true; + if ( a is 'BiosparkArc' ) return true; + if ( a is 'CandyBeam' ) return true; + if ( a is 'YnykronBeam' ) return true; + if ( a is 'YnykronLightningArc' ) return true; + if ( a is 'YnykronAltBeam' ) return true; + if ( a is 'MykradvoTendril' ) return true; + return false; + } + static clearscope bool IdentifyingDog( Actor a ) { if ( a is 'MBFHelperDog' ) return true; diff --git a/zscript/weapons/swwm_deathlydeathcannon_fx.zsc b/zscript/weapons/swwm_deathlydeathcannon_fx.zsc index 8c6e36032..73c48f23f 100644 --- a/zscript/weapons/swwm_deathlydeathcannon_fx.zsc +++ b/zscript/weapons/swwm_deathlydeathcannon_fx.zsc @@ -653,7 +653,7 @@ Class YnykronBeam : Actor t.ShootThroughList.Clear(); t.WaterHitList.Clear(); t.HitList.Clear(); - t.Trace(pos,cursector,x,128,TRACE_HitSky); + t.Trace(pos,cursector,x,speed,TRACE_HitSky); for ( int i=0; i= 25600 ) { // end of the line, dissipate int numpt = Random[Ynykron](4,8); for ( int i=0; i 20) && !Random[Spreadgun](0,800/args[0]) ) { - let i = Spawn("SaltImpact",level.Vec3Offset(pos,x*32)); + let i = Spawn("SaltImpact",level.Vec3Offset(pos,x*speed)); i.angle = atan2(x.y,x.x); i.pitch = asin(-x.z); i.target = target; @@ -547,8 +548,8 @@ Class SaltBeam : Actor } // next beam if ( !(special2%4) && !Random[Spreadgun](0,Stamina) ) - Spawn("SaltLight",level.Vec3Offset(pos,x*16)); - let next = Spawn("SaltBeam",level.Vec3Offset(pos,x*32)); + Spawn("SaltLight",level.Vec3Offset(pos,x*speed/2)); + let next = Spawn("SaltBeam",level.Vec3Offset(pos,x*speed)); double a = FRandom[Spreadgun](0,360), s = FRandom[Spreadgun](0,.06); Vector3 dir = (x+y*cos(a)*s+z*sin(a)*s).unit(); next.angle = atan2(dir.y,dir.x); @@ -572,7 +573,7 @@ Class SaltBeam : Actor if ( isFrozen() ) return; A_FadeOut(.04); if ( Random[Spreadgun](-2,args[2]/10) == 0 ) - SWWMUtility.DoExplosion(self,5+Accuracy,5000,32,flags:DE_HOWL,ignoreme:target); + SWWMUtility.DoExplosion(self,5+Accuracy,5000,speed,flags:DE_HOWL,ignoreme:target); if ( ((special2%4) || args[2]) && !special1 ) SpreadOut(); args[2]++; if ( !CheckNoDelay() || (tics == -1) ) return; diff --git a/zscript/weapons/swwm_tastytreat_fx.zsc b/zscript/weapons/swwm_tastytreat_fx.zsc index 500fbaf51..45c69460e 100644 --- a/zscript/weapons/swwm_tastytreat_fx.zsc +++ b/zscript/weapons/swwm_tastytreat_fx.zsc @@ -95,14 +95,14 @@ Class CandyBeam : Actor { Vector3 nextpos, nextdir; - action void A_Trace( double dist = 16. ) + action void A_Trace() { let t = new("CandyBeamTracer"); t.hitlist.Clear(); Vector3 x, y, z; [x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll); t.ShootThroughList.Clear(); - t.Trace(pos,CurSector,x,dist,0); + t.Trace(pos,CurSector,x,speed,0); for ( int i=0; i