From 7eb1321b84cc529e3237a5c69c2d24dde6df0c47 Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Wed, 19 Jul 2023 11:00:46 -0400 Subject: [PATCH 1/4] Add Bypass Time of Death variable --- code/__HELPERS/game.dm | 2 +- code/modules/mob/dead/observer/observer.dm | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index cca3edda464e..c05795c32b10 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -268,7 +268,7 @@ // copied from join as xeno var/deathtime = world.time - cur_obs.timeofdeath - if(deathtime < XENO_JOIN_DEAD_TIME && ( !cur_obs.client.admin_holder || !(cur_obs.client.admin_holder.rights & R_ADMIN)) ) + if(deathtime < XENO_JOIN_DEAD_TIME && ( !cur_obs.client.admin_holder || !(cur_obs.client.admin_holder.rights & R_ADMIN) || !cur_obs.bypass_time_of_death_checks)) continue // AFK players cannot be drafted diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 7e8dfe6cf3fd..62e07951163c 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -56,6 +56,8 @@ var/observer_actions = list(/datum/action/observer_action/join_xeno) var/datum/action/minimap/observer/minimap var/larva_queue_cached_message + ///Used to bypass time of death checks such as when being selected for larva. + var/bypass_time_of_death_checks = FALSE alpha = 127 @@ -368,6 +370,8 @@ Works together with spawning an observer, noted above. // Larva queue: We use the larger of their existing queue time or the new timeofdeath except for facehuggers // We don't change facehugger timeofdeath because they are still on cooldown if they died as a hugger var/new_tod = isfacehugger(src) ? 1 : ghost.timeofdeath + // if they died as facehugger, bypass typical TOD checks + ghost.bypass_time_of_death_checks = isfacehugger(src) ? TRUE : FALSE ghost.client.player_details.larva_queue_time = max(ghost.client.player_details.larva_queue_time, new_tod) ghost.set_huds_from_prefs() From b29960ddfc411fe965e620de486807c86eb7227f Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Wed, 19 Jul 2023 11:01:27 -0400 Subject: [PATCH 2/4] Random variable documentation --- code/modules/mob/dead/observer/observer.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 62e07951163c..f00a5827f1a0 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -49,7 +49,8 @@ var/updatedir = TRUE //Do we have to update our dir as the ghost moves around? var/atom/movable/following = null var/datum/orbit_menu/orbit_menu - var/mob/observetarget = null //The target mob that the ghost is observing. Used as a reference in logout() + /// The target mob that the ghost is observing. Used as a reference in logout() + var/mob/observetarget = null var/datum/health_scan/last_health_display var/ghost_orbit = GHOST_ORBIT_CIRCLE var/own_orbit_size = 0 From 10955c0e13037d104a92533b41ef7484caaba8b7 Mon Sep 17 00:00:00 2001 From: Ben <91219575+Ben10083@users.noreply.github.com> Date: Wed, 19 Jul 2023 16:12:19 -0400 Subject: [PATCH 3/4] oopsie :) Co-authored-by: Drathek <76988376+Drulikar@users.noreply.github.com> --- code/modules/mob/dead/observer/observer.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index f00a5827f1a0..2eb42b091df5 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -372,7 +372,7 @@ Works together with spawning an observer, noted above. // We don't change facehugger timeofdeath because they are still on cooldown if they died as a hugger var/new_tod = isfacehugger(src) ? 1 : ghost.timeofdeath // if they died as facehugger, bypass typical TOD checks - ghost.bypass_time_of_death_checks = isfacehugger(src) ? TRUE : FALSE + ghost.bypass_time_of_death_checks = isfacehugger(src) ghost.client.player_details.larva_queue_time = max(ghost.client.player_details.larva_queue_time, new_tod) ghost.set_huds_from_prefs() From 8d61d47506efc352a263cf0de60afc56b39beb62 Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Wed, 19 Jul 2023 16:14:56 -0400 Subject: [PATCH 4/4] ghost same check --- code/modules/mob/dead/observer/observer.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 2eb42b091df5..ac67471ce30f 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -420,6 +420,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp // Larva queue: We use the larger of their existing queue time or the new timeofdeath except for facehuggers var/new_tod = isfacehugger(src) ? 1 : world.time + ghost.bypass_time_of_death_checks = isfacehugger(src) ghost.client?.player_details.larva_queue_time = max(ghost.client.player_details.larva_queue_time, new_tod) if(is_nested && nest && !QDELETED(nest)) ghost.can_reenter_corpse = FALSE