Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facehuggers now bypass time of death checks when joining as Larva #3940

Merged
merged 4 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/__HELPERS/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion code/modules/mob/dead/observer/observer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,16 @@
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
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

Expand Down Expand Up @@ -368,6 +371,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)
ghost.client.player_details.larva_queue_time = max(ghost.client.player_details.larva_queue_time, new_tod)

ghost.set_huds_from_prefs()
Expand Down Expand Up @@ -415,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
Expand Down
Loading