diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 0132a31d0b50..cca3edda464e 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -241,8 +241,14 @@ else return get_step(start, EAST) -/// Get a list of observers that can be alien candidates, optionally sorted by larva_queue_time -/proc/get_alien_candidates(sorted = TRUE) +/** + * Get a list of observers that can be alien candidates. + * + * Arguments: + * * hive - The hive we're filling a slot for to check if the player is banished + * * sorted - Whether to sort by larva_queue_time (default TRUE) or leave unsorted + */ +/proc/get_alien_candidates(datum/hive_status/hive = null, sorted = TRUE) var/list/candidates = list() for(var/mob/dead/observer/cur_obs as anything in GLOB.observer_list) @@ -273,6 +279,15 @@ if((cur_obs.client.admin_holder && (cur_obs.client.admin_holder.rights & R_MOD)) && !cur_obs.adminlarva) continue + if(hive) + var/banished = FALSE + for(var/mob_name in hive.banished_ckeys) + if(hive.banished_ckeys[mob_name] == cur_obs.ckey) + banished = TRUE + break + if(banished) + continue + candidates += cur_obs // Optionally sort by larva_queue_time diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index b95052de8824..a42ff3f22e59 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -384,6 +384,13 @@ Additional game mode variables. // No cache, lets check now then message_alien_candidates(get_alien_candidates(), dequeued = 0, cache_only = TRUE) if(candidate_observer.larva_queue_cached_message) + var/datum/hive_status/cur_hive + for(var/hive_num in GLOB.hive_datum) + cur_hive = GLOB.hive_datum[hive_num] + for(var/mob_name in cur_hive.banished_ckeys) + if(cur_hive.banished_ckeys[mob_name] == xeno_candidate.ckey) + candidate_observer.larva_queue_cached_message += "\n" + SPAN_WARNING("NOTE: You are banished from the [cur_hive] and you may not rejoin unless the Queen re-admits you or dies. Your queue number won't update until there is a hive you aren't banished from.") + break to_chat(xeno_candidate, candidate_observer.larva_queue_cached_message) return FALSE diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index ed06c0117f33..9c0a227008c3 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -503,23 +503,25 @@ GLOBAL_LIST_INIT(frozen_items, list(SQUAD_MARINE_1 = list(), SQUAD_MARINE_2 = li add_fingerprint(usr) -/obj/structure/machinery/cryopod/proc/go_in_cryopod(mob/M, silent = FALSE) +/obj/structure/machinery/cryopod/proc/go_in_cryopod(mob/mob, silent = FALSE) if(occupant) return - M.forceMove(src) - occupant = M + mob.forceMove(src) + occupant = mob icon_state = "body_scanner_closed" SetLuminosity(2) time_entered = world.time start_processing() if(!silent) - if(M.client) - to_chat(M, SPAN_NOTICE("You feel cool air surround you. You go numb as your senses turn inward.")) - to_chat(M, SPAN_BOLDNOTICE("If you log out or close your client now, your character will permanently removed from the round in 10 minutes. If you ghost, timer will be decreased to 2 minutes.")) + if(mob.client) + to_chat(mob, SPAN_NOTICE("You feel cool air surround you. You go numb as your senses turn inward.")) + to_chat(mob, SPAN_BOLDNOTICE("If you log out or close your client now, your character will permanently removed from the round in 10 minutes. If you ghost, timer will be decreased to 2 minutes.")) + if(!is_admin_level(src.z)) // Set their queue time now because the client has to actually leave to despawn and at that point the client is lost + mob.client.player_details.larva_queue_time = max(mob.client.player_details.larva_queue_time, world.time) var/area/location = get_area(src) - if(M.job != GET_MAPPED_ROLE(JOB_SQUAD_MARINE)) - message_admins("[key_name_admin(M)], [M.job], has entered \a [src] at [location] after playing for [duration2text(world.time - M.life_time_start)].") + if(mob.job != GET_MAPPED_ROLE(JOB_SQUAD_MARINE)) + message_admins("[key_name_admin(mob)], [mob.job], has entered \a [src] at [location] after playing for [duration2text(world.time - mob.life_time_start)].") playsound(src, 'sound/machines/hydraulics_3.ogg', 30) silent_exit = silent diff --git a/code/modules/cm_aliens/structures/special/pylon_core.dm b/code/modules/cm_aliens/structures/special/pylon_core.dm index c38e540efb30..a29b49b7745a 100644 --- a/code/modules/cm_aliens/structures/special/pylon_core.dm +++ b/code/modules/cm_aliens/structures/special/pylon_core.dm @@ -150,7 +150,7 @@ last_larva_time = world.time if(spawning_larva || (last_larva_queue_time + spawn_cooldown * 4) < world.time) last_larva_queue_time = world.time - var/list/players_with_xeno_pref = get_alien_candidates() + var/list/players_with_xeno_pref = get_alien_candidates(linked_hive) if(players_with_xeno_pref && players_with_xeno_pref.len) if(spawning_larva && spawn_burrowed_larva(players_with_xeno_pref[1])) // We were in spawning_larva mode and successfully spawned someone diff --git a/code/modules/mob/living/carbon/xenomorph/Embryo.dm b/code/modules/mob/living/carbon/xenomorph/Embryo.dm index 01f6c1a3c238..3ba42650e49c 100644 --- a/code/modules/mob/living/carbon/xenomorph/Embryo.dm +++ b/code/modules/mob/living/carbon/xenomorph/Embryo.dm @@ -163,7 +163,7 @@ if(!picked) // Get a candidate from observers - var/list/candidates = get_alien_candidates() + var/list/candidates = get_alien_candidates(hive) if(candidates && candidates.len) // If they were facehugged by a player thats still in queue, they get second dibs on the new larva. if(hugger_ckey) diff --git a/code/modules/mob/living/carbon/xenomorph/death.dm b/code/modules/mob/living/carbon/xenomorph/death.dm index e3a69da23262..12c9b3e37c9b 100644 --- a/code/modules/mob/living/carbon/xenomorph/death.dm +++ b/code/modules/mob/living/carbon/xenomorph/death.dm @@ -38,7 +38,7 @@ if(GLOB.hive_datum[hivenumber].stored_larva) GLOB.hive_datum[hivenumber].stored_larva = round(GLOB.hive_datum[hivenumber].stored_larva * 0.5) //Lose half on dead queen - var/list/players_with_xeno_pref = get_alien_candidates() + var/list/players_with_xeno_pref = get_alien_candidates(GLOB.hive_datum[hivenumber]) if(players_with_xeno_pref && istype(GLOB.hive_datum[hivenumber].hive_location, /obj/effect/alien/resin/special/pylon/core)) var/turf/larva_spawn = get_turf(GLOB.hive_datum[hivenumber].hive_location) var/count = 0 diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index 6d3465ee8747..983fffeb2634 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -635,7 +635,7 @@ var/mob/dead/observer/obs = mob.ghostize(FALSE) if(obs) obs.timeofdeath = world.time - obs.client?.player_details.larva_queue_time = world.time + obs.client?.player_details.larva_queue_time = max(obs.client.player_details.larva_queue_time, world.time) mob.moveToNullspace() // Now that mobs are stowed, delete the shuttle