Morphs now spawn in vents (#27076)

* Morph spawns in vents

* adds to wizard morphs

* makes it work

* Adds another sanity check
This commit is contained in:
BiancaWilkson
2024-10-29 17:25:26 +00:00
committed by GitHub
parent 647df9541f
commit 858e14b275
2 changed files with 22 additions and 5 deletions
@@ -17,12 +17,19 @@
var/datum/mind/player_mind = new /datum/mind(key_of_morph)
player_mind.active = TRUE
if(!GLOB.xeno_spawn)
kill()
return
var/mob/living/simple_animal/hostile/morph/S = new /mob/living/simple_animal/hostile/morph(pick(GLOB.xeno_spawn))
var/list/vents = get_valid_vent_spawns(exclude_mobs_nearby = TRUE)
if(!length(vents))
message_admins("Warning: No suitable vents detected for spawning morphs. Force picking from station vents regardless of state!")
vents = get_valid_vent_spawns(unwelded_only = FALSE, min_network_size = 0)
if(!length(vents))
message_admins("Warning: No vents detected for spawning morphs at all!")
return
var/obj/vent = pick(vents)
var/mob/living/simple_animal/hostile/morph/S = new /mob/living/simple_animal/hostile/morph(vent.loc)
player_mind.transfer_to(S)
S.make_morph_antag()
S.forceMove(vent)
S.add_ventcrawl(vent)
dust_if_respawnable(C)
message_admins("[key_of_morph] has been made into morph by an event.")
log_game("[key_of_morph] was spawned as a morph by an event.")
@@ -305,9 +305,19 @@
to_chat(user, "<span class='notice'>The sludge does not respond to your attempt to awake it. Perhaps you should try again later.</span>")
/obj/item/antag_spawner/morph/spawn_antag(client/C, turf/T, type = "", mob/user)
var/mob/living/simple_animal/hostile/morph/wizard/M = new /mob/living/simple_animal/hostile/morph/wizard(pick(GLOB.xeno_spawn))
var/list/vents = get_valid_vent_spawns(exclude_mobs_nearby = TRUE)
if(!length(vents))
message_admins("Warning: No suitable vents detected for spawning morphs. Force picking from station vents regardless of state!")
vents = get_valid_vent_spawns(unwelded_only = FALSE, min_network_size = 0)
if(!length(vents))
message_admins("Warning: No vents detected for spawning morphs at all!")
return
var/obj/vent = pick(vents)
var/mob/living/simple_animal/hostile/morph/wizard/M = new /mob/living/simple_animal/hostile/morph/wizard(vent)
M.key = C.key
M.make_morph_antag(FALSE)
M.forceMove(vent)
M.add_ventcrawl(vent)
var/list/messages = list()
var/datum/objective/assassinate/KillDaWiz = new /datum/objective/assassinate