Skip to content

Commit

Permalink
medical: world spawns for trauma kit
Browse files Browse the repository at this point in the history
  • Loading branch information
caligari87 committed Sep 6, 2020
1 parent 9934296 commit ff96081
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions modules/items/traumakit/spawner.zsc
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
1 change: 1 addition & 0 deletions modules/items/traumakit/traumakit.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions modules/spawner/spawner.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ class UaS_Spawner : EventHandler {
GlowstickSpawns(e);
FlareSpawns(e);
LLMSpawns(e);
TraumakitSpawns(e);
}
}

0 comments on commit ff96081

Please sign in to comment.