From 2c03dd32b8c42fad312c9276111bfd5be93bd14d Mon Sep 17 00:00:00 2001 From: "theastropath@gmail.com" Date: Sun, 10 Mar 2024 20:42:46 -0400 Subject: [PATCH] Add Corpse Explosion Crowd Control effect #407 --- DXRando.cs | 1 + .../Classes/DXRandoCrowdControlEffects.uc | 105 ++++++++++++++++++ .../DeusEx/Classes/DXRandoCrowdControlLink.uc | 3 +- 3 files changed, 108 insertions(+), 1 deletion(-) diff --git a/DXRando.cs b/DXRando.cs index 7c0c895d4..93b56f7e2 100644 --- a/DXRando.cs +++ b/DXRando.cs @@ -65,6 +65,7 @@ public DeusEx(UserRecord player, Func responseHandler, new Effect ("Toggle the Flashlight", "toggle_flashlight"){Price = 1,Description = "Toggle the flashlight!"}, //New for fifth Crowd Control batch, v2.6 new Effect ("Heal all Enemies", "heal_all_enemies"){Price = 10,Description = "Fully heal all enemies in the current level!"}, //New for fifth Crowd Control batch, v2.6 new Effect ("Make Player Radioactive", "radioactive"){Price = 10,Description = "The player becomes radioactive and starts hurting nearby people!",Duration=60}, //New for fifth Crowd Control batch, v2.6 + new Effect ("Corpse Explosion", "corpse_explosion"){Price = 10,Description = "Fill up to 5 nearby corpses with energy, causing them to explode violently!"}, //New for fifth Crowd Control batch, v2.6 //Spawn Enemies/Allies //new Effect("Spawn Enemies/Allies","spawnpawns",ItemKind.Folder), //New for fourth Crowd Control batch diff --git a/DXRando/DeusEx/Classes/DXRandoCrowdControlEffects.uc b/DXRando/DeusEx/Classes/DXRandoCrowdControlEffects.uc index d73703191..ec38e780f 100644 --- a/DXRando/DeusEx/Classes/DXRandoCrowdControlEffects.uc +++ b/DXRando/DeusEx/Classes/DXRandoCrowdControlEffects.uc @@ -1777,6 +1777,102 @@ function bool HealAllEnemies(string viewer) return True; } +function bool CorpseExplosion(string viewer) +{ + local DeusExCarcass carc; + local int num,i; + + num=0; + + for (i=0;i<5;i++){ + carc = FindClosestCarcass(1000); + if (carc==None){ + break; + } + DetonateCarcass(carc); + num++; + } + + if (num==0){ + return False; + } + + PlayerMessage(viewer@"detonated "$num$" corpses!"); + + return True; + +} + +function DeusExCarcass FindClosestCarcass(float radius) +{ + local DeusExCarcass carc,closest; + local float closeDist; + + closest = None; + closeDist = 2 * radius; + foreach player().RadiusActors(class'DeusExCarcass',carc,radius){ + if (VSize(carc.Location-player().Location) < closeDist){ + closest = carc; + closeDist = VSize(carc.Location-player().Location); + } + } + + return closest; +} + +//Duped from MIB +function DetonateCarcass(DeusExCarcass carc) +{ + local SphereEffect sphere; + local ScorchMark s; + local ExplosionLight light; + local int i; + local float explosionDamage; + local float explosionRadius; + + explosionDamage = 100; + explosionRadius = 256; + + // alert NPCs that I'm exploding + AISendEvent('LoudNoise', EAITYPE_Audio, , explosionRadius*16); + PlaySound(Sound'LargeExplosion1', SLOT_None,,, explosionRadius*16); + + // draw a pretty explosion + light = Spawn(class'ExplosionLight',,, carc.Location); + if (light != None) + light.size = 4; + + Spawn(class'ExplosionSmall',,, carc.Location + 2*VRand()*carc.CollisionRadius); + Spawn(class'ExplosionMedium',,, carc.Location + 2*VRand()*carc.CollisionRadius); + Spawn(class'ExplosionMedium',,, carc.Location + 2*VRand()*carc.CollisionRadius); + Spawn(class'ExplosionLarge',,, carc.Location + 2*VRand()*carc.CollisionRadius); + + sphere = Spawn(class'SphereEffect',,, carc.Location); + if (sphere != None) + sphere.size = explosionRadius / 32.0; + + // spawn a mark + s = spawn(class'ScorchMark', carc.Base,, carc.Location-vect(0,0,1)*carc.CollisionHeight, carc.Rotation+rot(16384,0,0)); + if (s != None) + { + s.DrawScale = FClamp(explosionDamage/30, 0.1, 3.0); + s.ReattachDecal(); + } + + // spawn some rocks and flesh fragments + for (i=0; i