From 7a4da0c8a704faa94b0a265d551ab25f108ed897 Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Wed, 15 Jul 2020 15:28:43 +0200 Subject: [PATCH] Ynykron adjustments. --- language.version | 2 +- zscript/swwm_deathlydeathcannon.zsc | 126 +++++++++++++++++----------- 2 files changed, 80 insertions(+), 48 deletions(-) diff --git a/language.version b/language.version index 1b3d59fb0..1f01ccb7c 100644 --- a/language.version +++ b/language.version @@ -1,2 +1,2 @@ [default] -SWWM_MODVER="\chSWWM \cwGZ\c- r423 (Wed 15 Jul 15:28:26 CEST 2020)"; +SWWM_MODVER="\chSWWM \cwGZ\c- r424 (Wed 15 Jul 15:28:43 CEST 2020)"; diff --git a/zscript/swwm_deathlydeathcannon.zsc b/zscript/swwm_deathlydeathcannon.zsc index c011af118..63a78517f 100644 --- a/zscript/swwm_deathlydeathcannon.zsc +++ b/zscript/swwm_deathlydeathcannon.zsc @@ -70,6 +70,7 @@ Class IDontFeelSoGood : Thinker static void DeletThis( Actor whomst ) { + if ( !whomst || (whomst.Health > 0) ) return; let ti = ThinkerIterator.Create("IDontFeelSoGood",STAT_USER); IDontFeelSoGood i; while ( i = IDontFeelSoGood(ti.Next()) ) @@ -86,7 +87,13 @@ Class IDontFeelSoGood : Thinker Destroy(); return; } - if ( goner.Health > 0 ) return; + if ( goner.Health > 0 ) + { + goner.bINVISIBLE = goner.default.bINVISIBLE; + goner.A_ChangeLinkFlags(!goner.default.bNOBLOCKMAP); + Destroy(); + return; + } // special handling for some bosses: // - D'Sparil does not spawn, he's already gone // - Korax doesn't leave ghosts @@ -199,6 +206,37 @@ Class YnykronImpactTrail : Actor } } +Class YnykronDelayedImpact : Actor +{ + Vector3 ofs; + + Default + { + +NOBLOCKMAP; + +NOGRAVITY; + +NOTELEPORT; + +NOINTERACTION; + } + override void Tick() + { + special1++; + if ( special1 < 3 ) + { + if ( tracer ) SetOrigin(level.Vec3Offset(tracer.pos,ofs),true); + return; + } + let b = Spawn("YnykronImpact",pos); + b.target = target; + b.master = master; + b.angle = atan2(dirto.y,dirto.x); + b.pitch = asin(-dirto.z); + b.special1 = special2; + if ( YnykronShot(master) ) + YnykronShot(master).blastcount++; + Destroy(); + } +} + Class YnykronImpact : Actor { Default @@ -222,45 +260,9 @@ Class YnykronImpact : Actor override void PostBeginPlay() { Super.PostBeginPlay(); - // no need to call A_AlertMonsters on this, all monsters on the entire map were already alerted by the initial shot + // no need to call A_AlertMonsters if all monsters on the entire map were already alerted by the initial shot + if ( swwm_ynykronimpact && (!special1 || swwm_extraalert) ) A_AlertMonsters(); A_QuakeEx(4,4,4,50,0,1200,"",QF_RELATIVE|QF_SCALEDOWN,falloff:600,rollintensity:.6); - if ( YnykronShot(master) ) - { - if ( YnykronShot(master).lastimpact < gametic ) - { - master.A_StartSound("ynykron/hit",CHAN_VOICE,CHANF_OVERLAP,special2?.2:1.,.0); - YnykronShot(master).lastimpact = gametic+(special2?3:5); - } - } - else A_StartSound("ynykron/hit",CHAN_VOICE,CHANF_OVERLAP,special2?.2:1.,.0); - Scale *= FRandom[ExploS](0.8,1.1); - Scale.x *= RandomPick[ExploS](-1,1); - Scale.y *= RandomPick[ExploS](-1,1); - int numpt = Random[ExploS](3,5); - for ( int i=0; i 3) ) continue; + if ( swwm_capmcrange && (special1 > 3) ) continue; // spawn blast that will propagate - let b = Spawn("YnykronImpact",level.Vec3Offset(pos,dirto*min(300,dist))); + let b = Spawn("YnykronDelayedImpact",pos); + YnykronDelayedImpact(b).ofs = dirto*min(300,dist); + b.tracer = t; b.target = target; b.master = master; b.angle = atan2(dirto.y,dirto.x); b.pitch = asin(-dirto.z); - b.special2 = special2+(Random[Ynykron](0,4)?1:0); - b.special1 = Random[Ynykron](-2,0); - if ( YnykronShot(master) ) - YnykronShot(master).blastcount++; + b.special2 = special1+(Random[Ynykron](0,4)?1:0); + b.special1 = Random[Ynykron](-3,0); + } + if ( YnykronShot(master) ) + { + if ( YnykronShot(master).lastimpact < gametic ) + { + master.A_StartSound("ynykron/hit",CHAN_VOICE,CHANF_OVERLAP,special1?.2:1.,.0); + YnykronShot(master).lastimpact = gametic+(special1?3:5); + } + } + else A_StartSound("ynykron/hit",CHAN_VOICE,CHANF_OVERLAP,special1?.2:1.,.0); + Scale *= FRandom[ExploS](0.8,1.1); + Scale.x *= RandomPick[ExploS](-1,1); + Scale.y *= RandomPick[ExploS](-1,1); + int numpt = Random[ExploS](3,5); + for ( int i=0; i