Refactor spawning on vents into one proc

This commit is contained in:
mochi
2020-07-15 12:53:17 +02:00
parent bce3b7755d
commit 9f5e1cdbbc
7 changed files with 69 additions and 67 deletions
+6 -13
View File
@@ -1094,21 +1094,14 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
return
//find a viable mouse candidate
var/mob/living/simple_animal/mouse/host
var/obj/machinery/atmospherics/unary/vent_pump/vent_found
var/list/found_vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/v in SSair.atmos_machinery)
if(!v.welded && v.z == src.z)
found_vents.Add(v)
if(found_vents.len)
vent_found = pick(found_vents)
host = new /mob/living/simple_animal/mouse(vent_found.loc)
else
to_chat(src, "<span class='warning'>Unable to find any unwelded vents to spawn mice at.</span>")
if(host)
var/list/found_vents = get_valid_vent_spawns(min_network_size = 0, station_levels_only = FALSE, z_level = z)
if(length(found_vents))
var/obj/vent_found = pick(found_vents)
var/mob/living/simple_animal/mouse/host = new(vent_found.loc)
host.ckey = src.ckey
to_chat(host, "<span class='info'>You are now a mouse. Try to avoid interaction with players, and do not give hints away that you are more than a simple rodent.</span>")
else
to_chat(src, "<span class='warning'>Unable to find any unwelded vents to spawn mice at.</span>")
/mob/proc/assess_threat() //For sec bot threat assessment
return 5