From 1ddfecbb56bd3ce88d8af4f79618069fd9b37d64 Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Sun, 9 Aug 2020 15:33:47 +0200 Subject: [PATCH] Tweak Ynykron order of operations. Enemies now die when the actual delayed explosion spawns, instead of suddenly vanishing beforehand. Fixed muting level not affecting subtitles. --- language.version | 2 +- zscript/swwm_common.zsc | 10 ++- zscript/swwm_deathlydeathcannon.zsc | 130 ++++++++++++---------------- 3 files changed, 64 insertions(+), 78 deletions(-) diff --git a/language.version b/language.version index 8da69ea41..1a6e54ef7 100644 --- a/language.version +++ b/language.version @@ -1,2 +1,2 @@ [default] -SWWM_MODVER="\chSWWM \cwGZ\c- r470 (Sat 8 Aug 22:05:14 CEST 2020)"; +SWWM_MODVER="\chSWWM \cwGZ\c- r471 (Sun 9 Aug 15:33:47 CEST 2020)"; diff --git a/zscript/swwm_common.zsc b/zscript/swwm_common.zsc index badddccd5..b2cc0841f 100644 --- a/zscript/swwm_common.zsc +++ b/zscript/swwm_common.zsc @@ -3386,8 +3386,14 @@ Class SWWMHandler : EventHandler { if ( (gametic == onelinertic) && (oneliner != "") && (players[consoleplayer].health > 0) ) { - let l = SWWMOneLiner.Make(oneliner,onelinerspan); - StatusBar.AttachMessage(l,-3473); + int mute; + if ( mutevoice ) mute = mutevoice.GetInt(); + else mute = CVar.GetCVar('swwm_mutevoice',players[consoleplayer]).GetInt(); // we can't assign the variable here since it's play scope + if ( onelinerlevel > mute ) + { + let l = SWWMOneLiner.Make(oneliner,onelinerspan); + StatusBar.AttachMessage(l,-3473); + } SendNetworkEvent("swwmremotelinertxt."..oneliner,consoleplayer,onelinerlevel); } for ( int i=0; i candidates; - candidates.Clear(); - while ( bt.Next() ) + if ( tracer ) { - let t = bt.Thing; - if ( !t || !t.bSHOOTABLE || !SWWMUtility.SphereIntersect(t,pos,rad) || (!SWWMUtility.SphereIntersect(t,pos,100) && !CheckSight(t,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY)) ) continue; - if ( YnykronShot(master) && (YnykronShot(master).hitlist.Find(t) < YnykronShot(master).hitlist.Size()) ) - continue; - Vector3 dirto = level.Vec3Diff(pos,t.Vec3Offset(0,0,t.Height/2)); - double dist = dirto.length(); - if ( (dist > rad/2) && (t == target) ) continue; - candidates.Push(t); - } - qsort_candidates(candidates,0,candidates.Size()-1); - candidates.Resize(2); - for ( int i=0; i 2) ) continue; - // spawn blast that will propagate - let b = Spawn("YnykronDelayedImpact",pos); - YnykronDelayedImpact(b).ofs = dirto*min(rad,dist); - b.tracer = t; - b.target = target; - b.master = master; - b.angle = atan2(dirto.y,dirto.x); - b.pitch = asin(-dirto.z); - b.special2 = special1+(Random[Ynykron](0,8)?1:0); - b.special1 = Random[Ynykron](-5,0)-min(special1/2,10); - b.args[0] = trad; } if ( YnykronShot(master) ) { @@ -400,6 +363,47 @@ Class YnykronImpact : Actor let s = Spawn("YnykronImpactArm",pos); s.target = target; } + if ( swwm_capmcrange && (special1 > 2) ) return; + let bt = BlockThingsIterator.Create(self,rad+200); + Array candidates; + candidates.Clear(); + while ( bt.Next() ) + { + let t = bt.Thing; + if ( !t || !t.bSHOOTABLE || !SWWMUtility.SphereIntersect(t,pos,rad) || (!SWWMUtility.SphereIntersect(t,pos,100) && !CheckSight(t,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY)) ) continue; + if ( YnykronShot(master) && (YnykronShot(master).hitlist.Find(t) < YnykronShot(master).hitlist.Size()) ) + continue; + Vector3 dirto = level.Vec3Diff(pos,t.Vec3Offset(0,0,t.Height/2)); + double dist = dirto.length(); + if ( (dist > rad/2) && (t == target) ) continue; + candidates.Push(t); + } + qsort_candidates(candidates,0,candidates.Size()-1); + candidates.Resize(2); + for ( int i=0; i