From 6864722e0432a99726d7a19ab753f684bdfddbd8 Mon Sep 17 00:00:00 2001 From: zzzmike <85382350+zzzmike@users.noreply.github.com> Date: Wed, 19 Jun 2024 16:44:27 -0700 Subject: [PATCH] Show facehugger limit when examining eggs/morphers (#6386) # About the pull request When you examine a hive core, it tells you the lesser drone limit, and the current amount of lesser drones. This adds a similar behavior for eggs and morphers with regards to playable facehuggers. # Explain why it's good for the game Helpful for ghosts to decide whether to play hugger, drone, neither, or just for information. # Testing Photographs and Procedure
Screenshots & Videos Put screenshots and videos here with an empty line between the screenshots and the `
` tags.
# Changelog :cl: qol: examining eggs/morphers tells you current number of huggers and the limit /:cl: --------- Co-authored-by: harryob <55142896+harryob@users.noreply.github.com> Co-authored-by: Drathek <76988376+Drulikar@users.noreply.github.com> --- code/modules/cm_aliens/structures/egg.dm | 4 ++++ code/modules/cm_aliens/structures/special/egg_morpher.dm | 3 +++ code/modules/mob/living/carbon/xenomorph/hive_status.dm | 7 +++++++ 3 files changed, 14 insertions(+) diff --git a/code/modules/cm_aliens/structures/egg.dm b/code/modules/cm_aliens/structures/egg.dm index 889359bb7eef..4e22f1b5e6ba 100644 --- a/code/modules/cm_aliens/structures/egg.dm +++ b/code/modules/cm_aliens/structures/egg.dm @@ -55,6 +55,10 @@ . = ..() if(isxeno(user) && status == EGG_GROWN) . += "Ctrl + Click egg to retrieve child into your empty hand if you can carry it." + if(isobserver(user) && status == EGG_GROWN) + var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] + var/current_hugger_count = hive.get_current_playable_facehugger_count(); + . += "There are currently [SPAN_NOTICE("[current_hugger_count]")] facehuggers in the hive. The hive can support [SPAN_NOTICE("[hive.playable_hugger_limit]")] facehuggers." /obj/effect/alien/egg/attack_alien(mob/living/carbon/xenomorph/M) if(status == EGG_BURST || status == EGG_DESTROYED) diff --git a/code/modules/cm_aliens/structures/special/egg_morpher.dm b/code/modules/cm_aliens/structures/special/egg_morpher.dm index e24ff8d167d8..32cf0ee591b5 100644 --- a/code/modules/cm_aliens/structures/special/egg_morpher.dm +++ b/code/modules/cm_aliens/structures/special/egg_morpher.dm @@ -44,6 +44,9 @@ . = ..() if(isxeno(user) || isobserver(user)) . += "It has [stored_huggers] facehuggers within, with [huggers_to_grow] more to grow (reserved: [huggers_reserved])." + if(isobserver(user)) + var/current_hugger_count = linked_hive.get_current_playable_facehugger_count(); + . += "There are currently [SPAN_NOTICE("[current_hugger_count]")] facehuggers in the hive. The hive can support [SPAN_NOTICE("[linked_hive.playable_hugger_limit]")] facehuggers." /obj/effect/alien/resin/special/eggmorph/attackby(obj/item/I, mob/user) if(istype(I, /obj/item/grab)) diff --git a/code/modules/mob/living/carbon/xenomorph/hive_status.dm b/code/modules/mob/living/carbon/xenomorph/hive_status.dm index e7e1fab0dd45..4782bcd8b288 100644 --- a/code/modules/mob/living/carbon/xenomorph/hive_status.dm +++ b/code/modules/mob/living/carbon/xenomorph/hive_status.dm @@ -874,6 +874,13 @@ return TRUE +/datum/hive_status/proc/get_current_playable_facehugger_count() + var/count = 0 + for(var/mob/mob as anything in totalXenos) + if(isfacehugger(mob)) + count++ + return count + /datum/hive_status/proc/spawn_as_hugger(mob/dead/observer/user, atom/A) var/mob/living/carbon/xenomorph/facehugger/hugger = new /mob/living/carbon/xenomorph/facehugger(A.loc, null, hivenumber) user.mind.transfer_to(hugger, TRUE)