diff --git a/code/__DEFINES/xeno.dm b/code/__DEFINES/xeno.dm index 4b45c660feab..ac783b6f426e 100644 --- a/code/__DEFINES/xeno.dm +++ b/code/__DEFINES/xeno.dm @@ -168,6 +168,8 @@ #define XENO_LEAVE_TIMER_LARVA 80 //80 seconds /// The time against away_timer when an AFK xeno (not larva) can be replaced #define XENO_LEAVE_TIMER 300 //300 seconds +/// The time against away_timer when an AFK facehugger converts to a npc +#define XENO_FACEHUGGER_LEAVE_TIMER 420 //420 seconds /// The time against away_timer when an AFK xeno gets listed in the available list so ghosts can get ready #define XENO_AVAILABLE_TIMER 60 //60 seconds diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index 18b11dde030e..b95052de8824 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -333,23 +333,28 @@ Additional game mode variables. /datum/game_mode/proc/check_xeno_late_join(mob/xeno_candidate) if(jobban_isbanned(xeno_candidate, JOB_XENOMORPH)) // User is jobbanned to_chat(xeno_candidate, SPAN_WARNING("You are banned from playing aliens and cannot spawn as a xenomorph.")) - return - return 1 + return FALSE + return TRUE -/datum/game_mode/proc/attempt_to_join_as_xeno(mob/xeno_candidate, instant_join = 0) +/datum/game_mode/proc/attempt_to_join_as_xeno(mob/xeno_candidate, instant_join = FALSE) var/list/available_xenos = list() var/list/available_xenos_non_ssd = list() - for(var/mob/living/carbon/xenomorph/X in GLOB.living_xeno_list) - var/area/A = get_area(X) - if(is_admin_level(X.z) && (!A || !(A.flags_area & AREA_ALLOW_XENO_JOIN)) || X.aghosted) - continue //xenos on admin z level and aghosted ones don't count - if(istype(X) && ((!islarva(X) && (XENO_LEAVE_TIMER - X.away_timer < XENO_AVAILABLE_TIMER)) || (islarva(X) && (XENO_LEAVE_TIMER_LARVA - X.away_timer < XENO_AVAILABLE_TIMER)))) - if(!X.client) - available_xenos += X - else - available_xenos_non_ssd += X - + for(var/mob/living/carbon/xenomorph/cur_xeno as anything in GLOB.living_xeno_list) + if(cur_xeno.aghosted) + continue //aghosted xenos don't count + var/area/area = get_area(cur_xeno) + if(is_admin_level(cur_xeno.z) && (!area || !(area.flags_area & AREA_ALLOW_XENO_JOIN))) + continue //xenos on admin z level don't count + if(!istype(cur_xeno)) + continue + var/required_time = islarva(cur_xeno) ? XENO_LEAVE_TIMER_LARVA - cur_xeno.away_timer : XENO_LEAVE_TIMER - cur_xeno.away_timer + if(required_time > XENO_AVAILABLE_TIMER) + continue + if(!cur_xeno.client) + available_xenos += cur_xeno + else + available_xenos_non_ssd += cur_xeno var/datum/hive_status/hive for(var/hivenumber in GLOB.hive_datum) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm b/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm index 1ad171ec5c93..08566a6e9af3 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm @@ -67,6 +67,11 @@ PF.flags_can_pass_all = PASS_ALL^PASS_OVER_THROW_ITEM /mob/living/carbon/xenomorph/facehugger/Life(delta_time) + if(!client && !aghosted && away_timer > XENO_FACEHUGGER_LEAVE_TIMER) + // Become a npc once again + new /obj/item/clothing/mask/facehugger(loc, hivenumber) + qdel(src) + return if(stat != DEAD && !lying && !(locate(/obj/effect/alien/weeds) in get_turf(src))) adjustBruteLoss(1) return ..()