Fixes spawning logic of vent-spawned antags (#17844)

* fixes vent spawning antags breaking

* adds exception to xenobio vents

* simplifies the proc

* tidies the logic
This commit is contained in:
S34N
2022-05-24 12:46:24 +01:00
committed by GitHub
parent 787080565a
commit 3d24eeedd8
7 changed files with 28 additions and 35 deletions
+4 -1
View File
@@ -22,7 +22,10 @@
/datum/event/alien_infestation/proc/spawn_xenos()
var/list/candidates = SSghost_spawns.poll_candidates("Do you want to play as an alien?", ROLE_ALIEN, TRUE, source = /mob/living/carbon/alien/larva)
var/list/vents = get_valid_vent_spawns(exclude_mobs_nearby = TRUE, exclude_visible_by_mobs = TRUE)
var/list/vents = get_valid_vent_spawns(exclude_mobs_nearby = TRUE)
if(!length(vents))
message_admins("Warning: No suitable vents detected for spawning xenomorphs. Force picking from station vents regardless of state!")
vents = get_valid_vent_spawns(unwelded_only = FALSE, min_network_size = 0)
while(spawncount && length(vents) && length(candidates))
var/obj/vent = pick_n_take(vents)
var/mob/C = pick_n_take(candidates)
+3 -2
View File
@@ -20,9 +20,10 @@
if(!length(candidates))
return kill()
var/list/vents = get_valid_vent_spawns(exclude_mobs_nearby = TRUE, exclude_visible_by_mobs = TRUE)
var/list/vents = get_valid_vent_spawns(exclude_mobs_nearby = TRUE)
if(!length(vents))
return
message_admins("Warning: No suitable vents detected for spawning blob mouse. Force picking from station vents regardless of state!")
vents = get_valid_vent_spawns(unwelded_only = FALSE, min_network_size = 0)
var/obj/vent = pick(vents)
var/mob/living/simple_animal/mouse/blobinfected/B = new(vent.loc)
var/mob/M = pick(candidates)
+1 -1
View File
@@ -17,7 +17,7 @@ GLOBAL_VAR_INIT(sent_spiders_to_station, 0)
log_and_message_admins("Warning: Could not spawn any mobs for event Spider Infestation")
/datum/event/spider_infestation/start()
var/list/vents = get_valid_vent_spawns(exclude_mobs_nearby = TRUE, exclude_visible_by_mobs = TRUE)
var/list/vents = get_valid_vent_spawns(exclude_mobs_nearby = TRUE)
while(spawncount && length(vents))
var/obj/vent = pick_n_take(vents)
var/obj/structure/spider/spiderling/S = new(vent.loc)
+4 -1
View File
@@ -50,7 +50,10 @@
var/list/candidates = SSghost_spawns.poll_candidates("Do you want to play as a terror spider?", null, TRUE, source = spider_type)
if(length(candidates) < spawncount)
message_admins("Warning: not enough players volunteered to be terrors. Could only spawn [length(candidates)] out of [spawncount]!")
var/list/vents = get_valid_vent_spawns(exclude_mobs_nearby = TRUE, exclude_visible_by_mobs = TRUE)
var/list/vents = get_valid_vent_spawns(exclude_mobs_nearby = TRUE)
if(!length(vents))
message_admins("Warning: No suitable vents detected for spawning terrors. Force picking from station vents regardless of state!")
vents = get_valid_vent_spawns(unwelded_only = FALSE, min_network_size = 0)
while(spawncount && length(vents) && length(candidates))
var/obj/vent = pick_n_take(vents)
var/mob/living/simple_animal/hostile/poison/terror_spider/S = new spider_type(vent.loc)
+2 -2
View File
@@ -732,7 +732,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
if(stat)
to_chat(usr, "<span class='notice'>You have to be conscious to change your flavor text</span>")
return
var/msg = input(usr,"Set the flavor text in your 'examine' verb. The flavor text should be a physical descriptor of your character at a glance.","Flavor Text",html_decode(flavor_text)) as message|null
if(msg != null)
@@ -1156,7 +1156,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
return
//find a viable mouse candidate
var/list/found_vents = get_valid_vent_spawns(min_network_size = 0, station_levels_only = FALSE, z_level = z)
var/list/found_vents = get_valid_vent_spawns(min_network_size = 0)
if(length(found_vents))
var/obj/vent_found = pick(found_vents)
var/mob/living/simple_animal/mouse/host = new(vent_found.loc)