From 8b59f0395967659567af107c06ece078bd27c0e7 Mon Sep 17 00:00:00 2001 From: Drulikar Date: Wed, 5 Jul 2023 04:05:36 -0700 Subject: [PATCH] Make late joiners wait --- code/__HELPERS/game.dm | 7 +------ code/game/gamemodes/cm_initialize.dm | 2 +- code/modules/client/player_details.dm | 3 +++ code/modules/mob/dead/observer/observer.dm | 1 - .../mob/living/carbon/xenomorph/castes/Facehugger.dm | 1 - 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index c447bfcecb15..0132a31d0b50 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -290,21 +290,16 @@ * * cache_only - Whether to not actually send a to_chat message and instead only update larva_queue_cached_message */ /proc/message_alien_candidates(list/candidates, dequeued, cache_only = FALSE) - var/new_players = 0 for(var/i in (1 + dequeued) to candidates.len) var/mob/dead/observer/cur_obs = candidates[i] // Generate the messages - var/cached_message = SPAN_XENONOTICE("You are currently [i-dequeued]\th in the larva queue. There are [new_players] ahead of you that have yet to play this round.") + var/cached_message = SPAN_XENONOTICE("You are currently [i-dequeued]\th in the larva queue.") cur_obs.larva_queue_cached_message = cached_message if(!cache_only) var/chat_message = dequeued ? replacetext(cached_message, "currently", "now") : cached_message to_chat(candidates[i], chat_message) - // Count how many are prioritized - if(cur_obs.client.player_details.larva_queue_time < 2) // 0 and 1 because facehuggers/t-domers are slightly deprioritized - new_players++ - /proc/convert_k2c(temp) return ((temp - T0C)) diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index 2f6dc6e38118..18b11dde030e 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -383,7 +383,7 @@ Additional game mode variables. return FALSE // We aren't in queue yet, lets teach them about the queue then - candidate_observer.larva_queue_cached_message = SPAN_XENONOTICE("You are currently still awaiting assignment in the larva queue. Priority is given to players who have yet to play in the round, but otherwise the ordering is based on your time of death. When you have been dead long enough and are not inactive, you will periodically receive messages where you are in the queue relative to other currently valid xeno candidates. Note: Playing as a facehugger or in the thunderdome will not alter your time of death. This means you won't lose your relative place in queue if you step away, disconnect, play as a facehugger, or play in the thunderdome.") + candidate_observer.larva_queue_cached_message = SPAN_XENONOTICE("You are currently awaiting assignment in the larva queue. The ordering is based on your time of death or the time you joined. When you have been dead long enough and are not inactive, you will periodically receive messages where you are in the queue relative to other currently valid xeno candidates. Your current position will shift as others change their preferences or go inactive, but your relative position compared to all observers is the same. Note: Playing as a facehugger or in the thunderdome will not alter your time of death. This means you won't lose your relative place in queue if you step away, disconnect, play as a facehugger, or play in the thunderdome.") to_chat(xeno_candidate, candidate_observer.larva_queue_cached_message) return FALSE diff --git a/code/modules/client/player_details.dm b/code/modules/client/player_details.dm index 2360ea6c4f28..634fd8fb627e 100644 --- a/code/modules/client/player_details.dm +++ b/code/modules/client/player_details.dm @@ -10,6 +10,9 @@ GLOBAL_LIST_EMPTY(player_details) // ckey -> /datum/player_details /// The descriminator for larva queue ordering: Generally set to timeofdeath except for facehuggers/admin z-level play var/larva_queue_time +/datum/player_details/New() + larva_queue_time = world.time + return ..() /proc/log_played_names(ckey, ...) if(!ckey) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index d29b88ac8893..bcf009168fa4 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -367,7 +367,6 @@ 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 - // Facehuggers are atleast 1 because they did get some action compared to those at 0 timeofdeath var/new_tod = isfacehugger(src) ? 1 : ghost.timeofdeath ghost.client.player_details.larva_queue_time = max(ghost.client.player_details.larva_queue_time, new_tod) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm b/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm index 150bc1d9fc96..1ad171ec5c93 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm @@ -156,7 +156,6 @@ for(var/mob/dead/observer/observer as anything in GLOB.observer_list) to_chat(observer, SPAN_DEADSAY("[human] has been facehugged by [src]" + " [OBSERVER_JMP(observer, human)]")) to_chat(src, SPAN_DEADSAY("[human] has been facehugged by [src]")) - timeofdeath = 1 // Ever so slightly deprioritized for larva queue qdel(src) if(hug_area) xeno_message(SPAN_XENOMINORWARNING("You sense that [src] has facehugged a host at \the [hug_area]!"), 1, src.hivenumber)