From f4730f3e27f802498cddc640d648de3d2baa6e18 Mon Sep 17 00:00:00 2001 From: Drulikar Date: Fri, 14 Jul 2023 00:26:58 -0700 Subject: [PATCH 1/3] Facehuggers now revert to npc version after 7 minutes (2 mins more than xeno take over time) --- code/__DEFINES/xeno.dm | 2 ++ .../modules/mob/living/carbon/xenomorph/castes/Facehugger.dm | 5 +++++ 2 files changed, 7 insertions(+) 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/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 ..() From 490f555596a4a04c82871eac45ebc9ebf52cc983 Mon Sep 17 00:00:00 2001 From: Drulikar Date: Fri, 14 Jul 2023 00:28:14 -0700 Subject: [PATCH 2/3] Refactor the start of attempt_to_join_as_xeno I was going to prevent facehuggers from being joinable, but maybe some people like it. --- code/game/gamemodes/cm_initialize.dm | 31 ++++++++++++++++------------ 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index 18b11dde030e..982ad90e39cc 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 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) From c33387f121490efe13d32d9a1a421162f8c0c6e1 Mon Sep 17 00:00:00 2001 From: Drathek <76988376+Drulikar@users.noreply.github.com> Date: Fri, 14 Jul 2023 01:08:49 -0700 Subject: [PATCH 3/3] Update code/game/gamemodes/cm_initialize.dm Co-authored-by: harryob --- code/game/gamemodes/cm_initialize.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index 982ad90e39cc..b95052de8824 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -340,7 +340,7 @@ Additional game mode variables. var/list/available_xenos = list() var/list/available_xenos_non_ssd = list() - for(var/mob/living/carbon/xenomorph/cur_xeno in GLOB.living_xeno_list) + 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)