From ff9608165544ce37e061265b90a5d9fe0d6bc382 Mon Sep 17 00:00:00 2001 From: Sterling Parker Date: Sun, 6 Sep 2020 12:43:35 -0600 Subject: [PATCH] medical: world spawns for trauma kit --- modules/items/traumakit/spawner.zsc | 17 +++++++++++++++++ modules/items/traumakit/traumakit.zsc | 1 + modules/spawner/spawner.zsc | 1 + 3 files changed, 19 insertions(+) create mode 100644 modules/items/traumakit/spawner.zsc diff --git a/modules/items/traumakit/spawner.zsc b/modules/items/traumakit/spawner.zsc new file mode 100644 index 00000000..7d97c637 --- /dev/null +++ b/modules/items/traumakit/spawner.zsc @@ -0,0 +1,17 @@ +extend class UaS_Spawner { + void TraumakitSpawns(WorldEvent e) { + if(level.maptime > 1) { return; } + if(!e.Thing) { return; } + if(e.Thing is "Inventory" && Inventory(e.Thing).Owner) { return; } + + bool spawnable = ( + e.thing.GetClassName() == "HDAmBox" || + e.Thing.GetClassName() == "PortableStimpack" || + e.Thing.GetClassName() == "PortableMedikit" || + e.Thing.GetClassName() == "HDBackpack"); + + if(spawnable) { + UaS.SpawnStuff('UaS_TraumaKit', randompick[glowstick](0, 0, 0, 0, 1), e.Thing.pos); + } + } +} diff --git a/modules/items/traumakit/traumakit.zsc b/modules/items/traumakit/traumakit.zsc index 4b7825e1..b34cf89c 100644 --- a/modules/items/traumakit/traumakit.zsc +++ b/modules/items/traumakit/traumakit.zsc @@ -6,6 +6,7 @@ #include "modules/items/traumakit/traumakit_saline.zsc" #include "modules/items/traumakit/traumakit_helptext.zsc" #include "modules/items/traumakit/traumakit_pain.zsc" +#include "modules/items/traumakit/spawner.zsc" class UaS_TraumaKit : HDWeapon { string statusMessage; diff --git a/modules/spawner/spawner.zsc b/modules/spawner/spawner.zsc index 0be00dc1..6b8e88ac 100644 --- a/modules/spawner/spawner.zsc +++ b/modules/spawner/spawner.zsc @@ -19,5 +19,6 @@ class UaS_Spawner : EventHandler { GlowstickSpawns(e); FlareSpawns(e); LLMSpawns(e); + TraumakitSpawns(e); } }