MOB SWARM

This commit is contained in:
sood
2016-04-01 23:52:02 -07:00
committed by clusterfack
parent 3ac9246cda
commit c9096aa4cb
4 changed files with 59 additions and 0 deletions

View File

@@ -743,6 +743,7 @@ var/global/floorIsLava = 0
<A href='?src=\ref[src];secretsfun=spacevines'>Spawn Space-Vines</A><BR>
<A href='?src=\ref[src];secretsfun=comms_blackout'>Trigger a communication blackout</A><BR>
<A href='?src=\ref[src];secretsfun=pda_spam'>Trigger a wave of PDA spams</A><BR>
<A href='?src=\ref[src];secretsfun=mobswarm'>Trigger mobs of your choice appearing out of thin air</A><BR>
<BR>
<B>Fun Secrets</B><BR>
<BR>

View File

@@ -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")

View File

@@ -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.")

View File

@@ -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"