From c9096aa4cb1226f2dd16bd8308c9777cb0d49578 Mon Sep 17 00:00:00 2001 From: sood Date: Fri, 1 Apr 2016 23:52:02 -0700 Subject: [PATCH] MOB SWARM --- code/modules/admin/admin.dm | 1 + code/modules/admin/topic.dm | 9 ++++++ code/modules/events/mob_swarm.dm | 48 ++++++++++++++++++++++++++++++++ vgstation13.dme | 1 + 4 files changed, 59 insertions(+) create mode 100644 code/modules/events/mob_swarm.dm diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 4734ec374d1..ec7dfd83f83 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -743,6 +743,7 @@ var/global/floorIsLava = 0 Spawn Space-Vines
Trigger a communication blackout
Trigger a wave of PDA spams
+ Trigger mobs of your choice appearing out of thin air

Fun Secrets

diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index db578d103b1..da87bc4ed21 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -2877,6 +2877,15 @@ new /turf/unsimulated/wall/supermatter(get_turf(usr)) SetUniversalState(/datum/universal_state/supermatter_cascade) message_admins("[key_name_admin(usr)] has managed to destroy the universe with a supermatter cascade. Good job, [key_name_admin(usr)]") + if("mobswarm") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","CS") + var/choice = input("Are you sure you want to fill the station with a bunch of unnecessary mobs?") in list("Of course!", "No, I hate timespace anomalies involving fun") + if(choice == "Of course!") + var/amt = input("How many would you like to spawn?", 10) as num + var/mobtype = input("What mob would you like?", /mob/living/simple_animal/corgi) in list(typesof(/mob/living)) + message_admins("[key_name_admin(usr)] triggered a mob swarm.") + new /datum/event/mob_swarm(mobtype, amt) if("spawnadminbus") feedback_inc("admin_secrets_fun_used",1) feedback_add_details("admin_secrets_fun_used","AB") diff --git a/code/modules/events/mob_swarm.dm b/code/modules/events/mob_swarm.dm new file mode 100644 index 00000000000..b04005e10c3 --- /dev/null +++ b/code/modules/events/mob_swarm.dm @@ -0,0 +1,48 @@ +/datum/event/mob_swarm + announceWhen = 2 + endWhen = 10 + var/mob_to_spawn = /mob/living/simple_animal/corgi + var/area/target_area = /area/shuttle/arrival/station + var/mobs_to_spawn = 10 + var/list/area/possible_locations = list(/area/science/xenobiology, + /area/crew_quarters/bar, + /area/bridge, + /area/supply/storage, + /area/crew_quarters/hop, + /area/chapel/main, + /area/medical/cmo, + /area/crew_quarters/theatre) + +/datum/event/mob_swarm/New(var/mob = /mob/living/simple_animal/corgi, var/amount = 10) + mob_to_spawn = mob + mobs_to_spawn = round(amount) + . = ..() + +/datum/event/mob_swarm/setup() + while(possible_locations.len) + var/area/possible_spawn_area = pick(possible_locations) + if(possible_spawn_area.x) // If we're on the map + target_area = possible_spawn_area + break + else + possible_locations.Remove(possible_spawn_area) + +/datum/event/mob_swarm/start() + var/list/turfs = list() + for(var/turf/T in target_area) + if(T.density) + continue + turfs.Add(T) + + for(var/n = 0, n < mobs_to_spawn, n++) + var/turf/targetTurf = pick(turfs) + if(!targetTurf) // If all else goes wrong for SOME REASON + targetTurf = get_turf(pick(target_area.contents)) // Areas contain more than turfs + var/mob/mobber = new mob_to_spawn(targetTurf) + var/datum/effect/effect/system/spark_spread/sparks = new /datum/effect/effect/system/spark_spread() + sparks.set_up(3,0,targetTurf) + sparks.start() + + +/datum/event/mob_swarm/announce() + command_alert("Due to timespace anomalies of unknown origin, the statio is now host to several [mob_to_spawn]\s more than there were a moment ago.") diff --git a/vgstation13.dme b/vgstation13.dme index e9d3d2f81c9..3319d5ad22b 100644 --- a/vgstation13.dme +++ b/vgstation13.dme @@ -1054,6 +1054,7 @@ #include "code\modules\events\carp_migration.dm" #include "code\modules\events\comms_blackout.dm" #include "code\modules\events\communications_blackout.dm" +#include "code\modules\events\mob_swarm.dm" #include "code\modules\events\disease_outbreak.dm" #include "code\modules\events\electrical_storm.dm" #include "code\modules\events\event.dm"